|
@@ -65,10 +65,11 @@ public class PatentService {
|
|
|
|
|
|
|
|
public Patent get(Long id) {
|
|
public Patent get(Long id) {
|
|
|
Patent patent = patentRepo.findById(id).orElseThrow(new BusinessException("无记录"));
|
|
Patent patent = patentRepo.findById(id).orElseThrow(new BusinessException("无记录"));
|
|
|
- patent.setIndustryName(settingRepo.findById(patent.getIndustryClass())
|
|
|
|
|
- .orElseThrow(new BusinessException("无记录"))
|
|
|
|
|
- .getName());
|
|
|
|
|
-
|
|
|
|
|
|
|
+ if(patent.getIndustryClass() != null) {
|
|
|
|
|
+ patent.setIndustryName(settingRepo.findById(patent.getIndustryClass())
|
|
|
|
|
+ .orElseThrow(new BusinessException("无记录"))
|
|
|
|
|
+ .getName());
|
|
|
|
|
+ }
|
|
|
if (patent.getPatentTypeId() != null) {
|
|
if (patent.getPatentTypeId() != null) {
|
|
|
patent.setPatentType(settingRepo.findById(patent.getPatentTypeId())
|
|
patent.setPatentType(settingRepo.findById(patent.getPatentTypeId())
|
|
|
.orElseThrow(new BusinessException("无记录"))
|
|
.orElseThrow(new BusinessException("无记录"))
|