|
@@ -1,17 +1,17 @@
|
|
|
package cn.cslg.pas.service.business.invalidReport;
|
|
|
|
|
|
|
|
|
-import cn.cslg.pas.common.dto.invalidDTO.AddClaimDTO;
|
|
|
-import cn.cslg.pas.common.dto.invalidDTO.AddClaimsDTO;
|
|
|
-import cn.cslg.pas.common.dto.invalidDTO.QueryClaimDTO;
|
|
|
-import cn.cslg.pas.common.dto.invalidDTO.SplitClaimDTO;
|
|
|
+import cn.cslg.pas.common.dto.DomainFieldDTO;
|
|
|
+import cn.cslg.pas.common.dto.invalidDTO.*;
|
|
|
import cn.cslg.pas.common.model.cronModel.PersonnelVO;
|
|
|
import cn.cslg.pas.common.utils.CacheUtils;
|
|
|
+import cn.cslg.pas.common.utils.GenerateObjectUtil;
|
|
|
import cn.cslg.pas.common.utils.LoginUtils;
|
|
|
import cn.cslg.pas.common.vo.RePatentClaim;
|
|
|
import cn.cslg.pas.common.vo.invalidReport.PatentClaimVO;
|
|
|
import cn.cslg.pas.domain.business.AssoEventFile;
|
|
|
import cn.cslg.pas.domain.business.PatentClaim;
|
|
|
+import cn.cslg.pas.domain.business.PatentClaimHistory;
|
|
|
import cn.cslg.pas.domain.business.ReportProject;
|
|
|
import cn.cslg.pas.exception.XiaoShiException;
|
|
|
import cn.cslg.pas.mapper.AssoEventFileMapper;
|
|
@@ -25,6 +25,7 @@ import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
@@ -41,6 +42,9 @@ public class PatentClaimService extends ServiceImpl<PatentClaimMapper, PatentCla
|
|
|
private CacheUtils cacheUtils;
|
|
|
@Autowired
|
|
|
private LoginUtils loginUtils;
|
|
|
+ @Autowired
|
|
|
+ @Lazy
|
|
|
+ private PatentClaimHistoryService patentClaimHistoryService;
|
|
|
|
|
|
public List<PatentClaimVO> splitClaim(SplitClaimDTO splitClaimDTO) {
|
|
|
Integer projectId = splitClaimDTO.getProjectId();
|
|
@@ -124,7 +128,13 @@ public class PatentClaimService extends ServiceImpl<PatentClaimMapper, PatentCla
|
|
|
throw new XiaoShiException("请输入报告id");
|
|
|
}
|
|
|
List<PatentClaimVO> patentClaimVOS = this.ifHaveSplit(projectId);
|
|
|
-
|
|
|
+ //装载历史
|
|
|
+ patentClaimVOS.forEach(item -> {
|
|
|
+ LambdaQueryWrapper<PatentClaimHistory> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(PatentClaimHistory::getClaimId, item.getId());
|
|
|
+ List<PatentClaimHistory> histories = patentClaimHistoryService.list(queryWrapper);
|
|
|
+ item.setPatentClaimHistoryList(histories);
|
|
|
+ });
|
|
|
return patentClaimVOS;
|
|
|
|
|
|
}
|
|
@@ -151,7 +161,7 @@ public class PatentClaimService extends ServiceImpl<PatentClaimMapper, PatentCla
|
|
|
List<AddClaimDTO> addClaimDTOS1 = addClaimDTOS.stream()
|
|
|
.filter(item -> item.getOptionType() != null && item.getOptionType().equals(2))
|
|
|
.collect(Collectors.toList());
|
|
|
- this.saveByAddDTOs(addClaimDTOS1);
|
|
|
+ this.saveByAddDTOs(addClaimDTOS1);
|
|
|
//需要删除的
|
|
|
List<Integer> saveIds = addClaimDTOS.stream().map(AddClaimDTO::getId).collect(Collectors.toList());
|
|
|
orgIds.removeAll(saveIds);
|
|
@@ -162,7 +172,7 @@ public class PatentClaimService extends ServiceImpl<PatentClaimMapper, PatentCla
|
|
|
List<AddClaimDTO> updateDTOs = addClaimDTOS.stream()
|
|
|
.filter(item -> item.getOptionType() != null && item.getOptionType().equals(1))
|
|
|
.collect(Collectors.toList());
|
|
|
- this.updateByAddVOS(updateDTOs);
|
|
|
+ this.updateByAddVOS(updateDTOs);
|
|
|
|
|
|
return true;
|
|
|
|
|
@@ -184,7 +194,7 @@ public class PatentClaimService extends ServiceImpl<PatentClaimMapper, PatentCla
|
|
|
patentClaims.add(patentClaim);
|
|
|
});
|
|
|
|
|
|
- if(patentClaims!=null&&patentClaims.size()>0) {
|
|
|
+ if (patentClaims != null && patentClaims.size() > 0) {
|
|
|
this.saveBatch(patentClaims);
|
|
|
}
|
|
|
}
|
|
@@ -203,9 +213,39 @@ public class PatentClaimService extends ServiceImpl<PatentClaimMapper, PatentCla
|
|
|
patentClaims.add(patentClaim);
|
|
|
});
|
|
|
|
|
|
- if(patentClaims!=null&&patentClaims.size()>0) {
|
|
|
+ if (patentClaims != null && patentClaims.size() > 0) {
|
|
|
this.updateBatchById(patentClaims);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public Boolean updateClaimMessage(List<UpdateClaimMessageDTO> updateClaimMessageDTOs) {
|
|
|
+ for (UpdateClaimMessageDTO updateClaimMessageDTO : updateClaimMessageDTOs) {
|
|
|
+
|
|
|
+ Integer claimId = updateClaimMessageDTO.getClaimId();
|
|
|
+
|
|
|
+ List<DomainFieldDTO> domainFieldDTOS = updateClaimMessageDTO.getDomainFieldDTOs();
|
|
|
+
|
|
|
+ //根据id 查询权要
|
|
|
+ PatentClaim patentClaim = this.getById(claimId);
|
|
|
+
|
|
|
+ if (patentClaim == null) {
|
|
|
+ throw new XiaoShiException("权要不存在");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (domainFieldDTOS != null && domainFieldDTOS.size() != 0) {
|
|
|
+ domainFieldDTOS.forEach(item -> {
|
|
|
+ try {
|
|
|
+ if (item.getValue() != null) {
|
|
|
+ GenerateObjectUtil.setObjectProperty(patentClaim, item.getField(), item.getValue());
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new XiaoShiException("装载失败");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ patentClaim.updateById();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|