|
@@ -33,9 +33,10 @@ public class PatentClaimHistoryService extends ServiceImpl<PatentClaimHistoryMap
|
|
|
|
|
|
/**
|
|
/**
|
|
* 修改权利要求
|
|
* 修改权利要求
|
|
|
|
+ *
|
|
* @param alterPatentClaimDTO
|
|
* @param alterPatentClaimDTO
|
|
*/
|
|
*/
|
|
- public Integer alterPatentClaim(AlterPatentClaimDTO alterPatentClaimDTO){
|
|
|
|
|
|
+ public Integer alterPatentClaim(AlterPatentClaimDTO alterPatentClaimDTO) {
|
|
if (alterPatentClaimDTO == null) {
|
|
if (alterPatentClaimDTO == null) {
|
|
throw new XiaoShiException("入参为空");
|
|
throw new XiaoShiException("入参为空");
|
|
}
|
|
}
|
|
@@ -53,10 +54,11 @@ public class PatentClaimHistoryService extends ServiceImpl<PatentClaimHistoryMap
|
|
|
|
|
|
/**
|
|
/**
|
|
* 编辑权利要求历史
|
|
* 编辑权利要求历史
|
|
|
|
+ *
|
|
* @param editPatentClaimHistoryDTO
|
|
* @param editPatentClaimHistoryDTO
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public Integer editPatentClaimHistory(EditPatentClaimHistoryDTO editPatentClaimHistoryDTO){
|
|
|
|
|
|
+ public Integer editPatentClaimHistory(EditPatentClaimHistoryDTO editPatentClaimHistoryDTO) {
|
|
if (editPatentClaimHistoryDTO == null) {
|
|
if (editPatentClaimHistoryDTO == null) {
|
|
throw new XiaoShiException("入参为空");
|
|
throw new XiaoShiException("入参为空");
|
|
}
|
|
}
|
|
@@ -72,10 +74,11 @@ public class PatentClaimHistoryService extends ServiceImpl<PatentClaimHistoryMap
|
|
|
|
|
|
/**
|
|
/**
|
|
* 查询权利要求修改历史
|
|
* 查询权利要求修改历史
|
|
|
|
+ *
|
|
* @param patentClaimDTO
|
|
* @param patentClaimDTO
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public PatentClaimHistoryVO queryPatentClaimHistory(PatentClaimDTO patentClaimDTO){
|
|
|
|
|
|
+ public PatentClaimHistoryVO queryPatentClaimHistory(PatentClaimDTO patentClaimDTO) {
|
|
PatentClaimHistoryVO patentClaimHistoryVO = new PatentClaimHistoryVO();
|
|
PatentClaimHistoryVO patentClaimHistoryVO = new PatentClaimHistoryVO();
|
|
|
|
|
|
if (patentClaimDTO == null) {
|
|
if (patentClaimDTO == null) {
|
|
@@ -99,10 +102,11 @@ public class PatentClaimHistoryService extends ServiceImpl<PatentClaimHistoryMap
|
|
|
|
|
|
/**
|
|
/**
|
|
* 装载原始权要
|
|
* 装载原始权要
|
|
|
|
+ *
|
|
* @param claimId
|
|
* @param claimId
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public QueryPatentClaimHistoryVO loadOriginalVO(Integer claimId){
|
|
|
|
|
|
+ public QueryPatentClaimHistoryVO loadOriginalVO(Integer claimId) {
|
|
QueryPatentClaimHistoryVO originalClaimVO = new QueryPatentClaimHistoryVO();
|
|
QueryPatentClaimHistoryVO originalClaimVO = new QueryPatentClaimHistoryVO();
|
|
LambdaQueryWrapper<PatentClaim> getOriginalWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<PatentClaim> getOriginalWrapper = new LambdaQueryWrapper<>();
|
|
getOriginalWrapper.eq(PatentClaim::getId, claimId);
|
|
getOriginalWrapper.eq(PatentClaim::getId, claimId);
|
|
@@ -114,45 +118,33 @@ public class PatentClaimHistoryService extends ServiceImpl<PatentClaimHistoryMap
|
|
return originalClaimVO;
|
|
return originalClaimVO;
|
|
}
|
|
}
|
|
|
|
|
|
- public Map<Integer, QueryPatentClaimHistoryVO> loadHistoryVO(Integer claimId){
|
|
|
|
|
|
+ public Map<Integer, QueryPatentClaimHistoryVO> loadHistoryVO(Integer claimId) {
|
|
Map<Integer, QueryPatentClaimHistoryVO> historyVOMap = new HashMap<>();
|
|
Map<Integer, QueryPatentClaimHistoryVO> historyVOMap = new HashMap<>();
|
|
|
|
|
|
LambdaQueryWrapper<PatentClaimHistory> queryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<PatentClaimHistory> queryWrapper = new LambdaQueryWrapper<>();
|
|
queryWrapper.eq(PatentClaimHistory::getClaimId, claimId);
|
|
queryWrapper.eq(PatentClaimHistory::getClaimId, claimId);
|
|
List<PatentClaimHistory> patentClaimHistoryList = this.list(queryWrapper);
|
|
List<PatentClaimHistory> patentClaimHistoryList = this.list(queryWrapper);
|
|
if (!patentClaimHistoryList.isEmpty()) {
|
|
if (!patentClaimHistoryList.isEmpty()) {
|
|
- if (patentClaimHistoryList.size() == 1 || patentClaimHistoryList.size() == 2) {
|
|
|
|
- //只有一次修改
|
|
|
|
|
|
+ PatentClaimHistory patentClaimHistory1 = patentClaimHistoryList.stream().filter(item -> item.getIfFirst().equals(true)).findFirst().orElse(null);
|
|
|
|
+ PatentClaimHistory patentClaimHistory2 = patentClaimHistoryList.stream().filter(item -> item.getIfFirst().equals(false)).findFirst().orElse(null);
|
|
|
|
+ if (patentClaimHistory1 != null) {
|
|
QueryPatentClaimHistoryVO firstClaimVO = new QueryPatentClaimHistoryVO();
|
|
QueryPatentClaimHistoryVO firstClaimVO = new QueryPatentClaimHistoryVO();
|
|
- PatentClaimHistory patentClaimHistory = patentClaimHistoryList.get(0);
|
|
|
|
- if (patentClaimHistory.getIfFirst() == false) {
|
|
|
|
- throw new XiaoShiException("历史错误");
|
|
|
|
- }
|
|
|
|
- //历史id
|
|
|
|
- firstClaimVO.setClaimHistoryId(patentClaimHistory.getId());
|
|
|
|
- BeanUtils.copyProperties(patentClaimHistory, firstClaimVO);
|
|
|
|
|
|
+ firstClaimVO.setClaimHistoryId(patentClaimHistory1.getId());
|
|
|
|
+ BeanUtils.copyProperties(patentClaimHistory1, firstClaimVO);
|
|
historyVOMap.put(1, firstClaimVO);
|
|
historyVOMap.put(1, firstClaimVO);
|
|
}
|
|
}
|
|
- if (patentClaimHistoryList.size() == 2) {
|
|
|
|
- //修改了两次
|
|
|
|
|
|
+ if (patentClaimHistory2 != null) {
|
|
QueryPatentClaimHistoryVO secondClaimVO = new QueryPatentClaimHistoryVO();
|
|
QueryPatentClaimHistoryVO secondClaimVO = new QueryPatentClaimHistoryVO();
|
|
- PatentClaimHistory patentClaimHistory = patentClaimHistoryList.get(1);
|
|
|
|
- if (patentClaimHistory.getIfFirst() == true) {
|
|
|
|
- throw new XiaoShiException("历史错误");
|
|
|
|
- }
|
|
|
|
- //历史id
|
|
|
|
- secondClaimVO.setClaimHistoryId(patentClaimHistory.getId());
|
|
|
|
- BeanUtils.copyProperties(patentClaimHistory, secondClaimVO);
|
|
|
|
|
|
+ secondClaimVO.setClaimHistoryId(patentClaimHistory2.getId());
|
|
|
|
+ BeanUtils.copyProperties(patentClaimHistory2, secondClaimVO);
|
|
historyVOMap.put(2, secondClaimVO);
|
|
historyVOMap.put(2, secondClaimVO);
|
|
- } else {
|
|
|
|
- throw new XiaoShiException("查询错误");
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return historyVOMap;
|
|
return historyVOMap;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- public void deletePatentClaim(PatentClaimDTO patentClaimDTO){
|
|
|
|
|
|
+ public void deletePatentClaim(PatentClaimDTO patentClaimDTO) {
|
|
Integer claimId = patentClaimDTO.getClaimId();
|
|
Integer claimId = patentClaimDTO.getClaimId();
|
|
//判空
|
|
//判空
|
|
Boolean ifFirst = patentClaimDTO.getIfFirst();
|
|
Boolean ifFirst = patentClaimDTO.getIfFirst();
|
|
@@ -303,7 +295,7 @@ public class PatentClaimHistoryService extends ServiceImpl<PatentClaimHistoryMap
|
|
List<PatentClaimHistory> ifExist = this.list(queryWrapper1);
|
|
List<PatentClaimHistory> ifExist = this.list(queryWrapper1);
|
|
if (!ifExist.isEmpty()) {
|
|
if (!ifExist.isEmpty()) {
|
|
List<PatentClaimHistory> secondHistories = new ArrayList<>();
|
|
List<PatentClaimHistory> secondHistories = new ArrayList<>();
|
|
- sortLaterIds.forEach(item -> {
|
|
|
|
|
|
+ sortLaterIds.forEach(item -> {
|
|
LambdaQueryWrapper<PatentClaimHistory> queryWrapper2 = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<PatentClaimHistory> queryWrapper2 = new LambdaQueryWrapper<>();
|
|
queryWrapper2.eq(PatentClaimHistory::getIfFirst, ifFirst)
|
|
queryWrapper2.eq(PatentClaimHistory::getIfFirst, ifFirst)
|
|
.eq(PatentClaimHistory::getClaimId, item)
|
|
.eq(PatentClaimHistory::getClaimId, item)
|
|
@@ -337,9 +329,9 @@ public class PatentClaimHistoryService extends ServiceImpl<PatentClaimHistoryMap
|
|
patentClaimHistories.add(patentClaimHistory1);
|
|
patentClaimHistories.add(patentClaimHistory1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- });
|
|
|
|
- this.saveBatch(patentClaimHistories);
|
|
|
|
- this.updateBatchById(secondHistories);
|
|
|
|
|
|
+ });
|
|
|
|
+ this.saveBatch(patentClaimHistories);
|
|
|
|
+ this.updateBatchById(secondHistories);
|
|
} else {
|
|
} else {
|
|
// 待新增的权利要求
|
|
// 待新增的权利要求
|
|
secondFilter.forEach(item -> {
|
|
secondFilter.forEach(item -> {
|
|
@@ -359,7 +351,7 @@ public class PatentClaimHistoryService extends ServiceImpl<PatentClaimHistoryMap
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- public List<PatentClaim> getAllPatentClaims(Integer claimId){
|
|
|
|
|
|
+ public List<PatentClaim> getAllPatentClaims(Integer claimId) {
|
|
LambdaQueryWrapper<PatentClaim> queryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<PatentClaim> queryWrapper = new LambdaQueryWrapper<>();
|
|
queryWrapper.eq(PatentClaim::getId, claimId);
|
|
queryWrapper.eq(PatentClaim::getId, claimId);
|
|
PatentClaim patentClaim = patentClaimService.getOne(queryWrapper, false);
|
|
PatentClaim patentClaim = patentClaimService.getOne(queryWrapper, false);
|