|
|
@@ -27,18 +27,18 @@ public class PatentService {
|
|
|
private final InformationRepo informationRepo;
|
|
|
|
|
|
public Page<Patent> all(PageQuery pageQuery) {
|
|
|
- Map<Long, String> settingMap = settingRepo.findAllByFlagIn(CollUtil.list(false, 1, 13,24,25,26)).stream()
|
|
|
+ Map<Long, String> settingMap = settingRepo.findAllByFlagIn(CollUtil.list(false, 1, 13, 24, 25, 26)).stream()
|
|
|
.collect(Collectors.toMap(Setting::getId, Setting::getName));
|
|
|
return patentRepo.findAll(JpaUtils.toSpecification(pageQuery, Patent.class), JpaUtils.toPageRequest(pageQuery))
|
|
|
.map(cd -> {
|
|
|
cd.setIndustryName(settingMap.get(cd.getIndustryClass()));
|
|
|
- if(cd.getPatentTypeId()!=null){
|
|
|
+ if (cd.getPatentTypeId() != null) {
|
|
|
cd.setPatentType(settingMap.get(cd.getPatentTypeId()));
|
|
|
}
|
|
|
- if(cd.getLawStatusId()!=null){
|
|
|
+ if (cd.getLawStatusId() != null) {
|
|
|
cd.setLawStatus(settingMap.get(cd.getLawStatusId()));
|
|
|
}
|
|
|
- if(cd.getTradingMethodId()!=null){
|
|
|
+ if (cd.getTradingMethodId() != null) {
|
|
|
cd.setTradingMethod(settingMap.get(cd.getTradingMethodId()));
|
|
|
}
|
|
|
return cd;
|
|
|
@@ -51,17 +51,17 @@ public class PatentService {
|
|
|
.orElseThrow(new BusinessException("无记录"))
|
|
|
.getName());
|
|
|
|
|
|
- if(patent.getPatentTypeId()!=null){
|
|
|
+ if (patent.getPatentTypeId() != null) {
|
|
|
patent.setPatentType(settingRepo.findById(patent.getPatentTypeId())
|
|
|
.orElseThrow(new BusinessException("无记录"))
|
|
|
.getName());
|
|
|
}
|
|
|
- if(patent.getLawStatusId()!=null){
|
|
|
+ if (patent.getLawStatusId() != null) {
|
|
|
patent.setLawStatus(settingRepo.findById(patent.getLawStatusId())
|
|
|
.orElseThrow(new BusinessException("无记录"))
|
|
|
.getName());
|
|
|
}
|
|
|
- if(patent.getTradingMethodId()!=null){
|
|
|
+ if (patent.getTradingMethodId() != null) {
|
|
|
patent.setTradingMethod(settingRepo.findById(patent.getTradingMethodId())
|
|
|
.orElseThrow(new BusinessException("无记录"))
|
|
|
.getName());
|
|
|
@@ -81,14 +81,14 @@ public class PatentService {
|
|
|
record.setStatus(ApplyStatus.PASS);
|
|
|
patentRepo.save(record);
|
|
|
|
|
|
- information.setContent("您发布的供给侧:"+record.getName()+"已通过审核!");
|
|
|
+ information.setContent("您发布的供给侧:" + record.getName() + "已通过审核!");
|
|
|
informationRepo.save(information);
|
|
|
return;
|
|
|
}
|
|
|
record.setStatus(ApplyStatus.DENY);
|
|
|
patentRepo.save(record);
|
|
|
|
|
|
- information.setContent("您发布的的供给侧:"+record.getName()+"未通过审核,原因为:" + remark);
|
|
|
+ information.setContent("您发布的的供给侧:" + record.getName() + "未通过审核,原因为:" + remark);
|
|
|
informationRepo.save(information);
|
|
|
}
|
|
|
}
|