|
@@ -3,10 +3,14 @@ package cn.cslg.pas.service.business.invalidReport;
|
|
|
import cn.cslg.pas.common.dto.invalidDTO.AlterPatentClaimDTO;
|
|
|
import cn.cslg.pas.common.dto.invalidDTO.EditPatentClaimHistoryDTO;
|
|
|
import cn.cslg.pas.common.dto.invalidDTO.PatentClaimDTO;
|
|
|
+import cn.cslg.pas.common.model.cronModel.PersonnelVO;
|
|
|
+import cn.cslg.pas.common.utils.CacheUtils;
|
|
|
+import cn.cslg.pas.common.utils.LoginUtils;
|
|
|
import cn.cslg.pas.common.vo.invalidVO.PatentClaimHistoryVO;
|
|
|
import cn.cslg.pas.common.vo.invalidVO.QueryPatentClaimHistoryVO;
|
|
|
import cn.cslg.pas.domain.business.PatentClaim;
|
|
|
import cn.cslg.pas.domain.business.PatentClaimHistory;
|
|
|
+import cn.cslg.pas.exception.UnLoginException;
|
|
|
import cn.cslg.pas.exception.XiaoShiException;
|
|
|
import cn.cslg.pas.mapper.InvalidReport.PatentClaimHistoryMapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
@@ -30,6 +34,10 @@ import java.util.stream.Collectors;
|
|
|
public class PatentClaimHistoryService extends ServiceImpl<PatentClaimHistoryMapper, PatentClaimHistory> {
|
|
|
@Autowired
|
|
|
private PatentClaimService patentClaimService;
|
|
|
+ @Autowired
|
|
|
+ private CacheUtils cacheUtils;
|
|
|
+ @Autowired
|
|
|
+ private LoginUtils loginUtils;
|
|
|
|
|
|
/**
|
|
|
* 修改权利要求
|
|
@@ -44,11 +52,29 @@ public class PatentClaimHistoryService extends ServiceImpl<PatentClaimHistoryMap
|
|
|
if (claimId == null) {
|
|
|
throw new XiaoShiException("claimId为空");
|
|
|
}
|
|
|
- PatentClaimHistory patentClaimHistory = new PatentClaimHistory();
|
|
|
- BeanUtils.copyProperties(alterPatentClaimDTO, patentClaimHistory);
|
|
|
- patentClaimHistory.setOperateType(0);
|
|
|
- patentClaimHistory.setCreateId("328");
|
|
|
- patentClaimHistory.insert();
|
|
|
+ PersonnelVO personnelVO = new PersonnelVO();
|
|
|
+ try {
|
|
|
+ personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new UnLoginException("未登录");
|
|
|
+ }
|
|
|
+ LambdaQueryWrapper<PatentClaimHistory> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(PatentClaimHistory::getIfFirst, alterPatentClaimDTO.getIfFirst())
|
|
|
+ .eq(PatentClaimHistory::getClaimId, claimId)
|
|
|
+ .eq(PatentClaimHistory::getOperateType, 0);
|
|
|
+ PatentClaimHistory patentClaimHistory = this.getOne(queryWrapper, false);
|
|
|
+ if (patentClaimHistory != null) {
|
|
|
+ patentClaimHistory.setContent(alterPatentClaimDTO.getContent());
|
|
|
+ patentClaimHistory.setDescription(alterPatentClaimDTO.getDescription());
|
|
|
+ patentClaimHistory.updateById();
|
|
|
+ } else {
|
|
|
+ PatentClaimHistory patentClaimHistory1 = new PatentClaimHistory();
|
|
|
+ BeanUtils.copyProperties(alterPatentClaimDTO, patentClaimHistory1);
|
|
|
+ patentClaimHistory1.setOperateType(0);
|
|
|
+ patentClaimHistory1.setCreateId(personnelVO.getId());
|
|
|
+ patentClaimHistory1.insert();
|
|
|
+ }
|
|
|
+
|
|
|
return patentClaimHistory.getId();
|
|
|
}
|
|
|
|