|
@@ -44,8 +44,8 @@ public class MatchCasePersonService extends ServiceImpl<MatchCasePersonMapper, M
|
|
|
@Autowired
|
|
|
@Lazy
|
|
|
private IprPersonService iprPersonService;
|
|
|
- private AssoProjectPersonService assoProjectPersonService;
|
|
|
- private ReportProjectService reportProjectService;
|
|
|
+ private final AssoProjectPersonService assoProjectPersonService;
|
|
|
+ private final ReportProjectService reportProjectService;
|
|
|
private final PermissionService permissionService;
|
|
|
|
|
|
public Integer updateMatchCasePerson(UpdateMatchCasePersonDTO updateMatchCasePersonDTO) {
|
|
@@ -71,9 +71,13 @@ public class MatchCasePersonService extends ServiceImpl<MatchCasePersonMapper, M
|
|
|
queryWrapper.eq(IprPerson::getEmail, email);
|
|
|
IprPerson iprPerson = iprPersonService.getOne(queryWrapper, false);
|
|
|
if (iprPerson != null) {
|
|
|
+ if (!name.trim().equals(iprPerson.getName().trim()) || assoAccountId != iprPerson.getAssoAccountId()) {
|
|
|
+ throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "禁止修改已存在邮箱的相关信息!");
|
|
|
+ }
|
|
|
//邮箱存在
|
|
|
iprPersonId = iprPerson.getId();
|
|
|
assoId = iprPerson.getAssoAccountId();
|
|
|
+
|
|
|
} else {
|
|
|
PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
|
|
|
String personId = personnelVO.getId();
|
|
@@ -125,20 +129,21 @@ public class MatchCasePersonService extends ServiceImpl<MatchCasePersonMapper, M
|
|
|
|
|
|
LambdaQueryWrapper<ReportProject> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.eq(ReportProject::getProjectId, projectId);
|
|
|
- ReportProject reportProject = reportProjectService.getById(projectId);
|
|
|
-
|
|
|
- if (type.equals(2)) { // 代理所
|
|
|
- Integer actType = reportProject.getActType();
|
|
|
- //主动类型 请求人代理所
|
|
|
- if (actType != null && actType.equals(1)) {
|
|
|
- reportProject.setApplicantAgency(resultName);
|
|
|
- } else {//被动类型 专利权人代理所
|
|
|
- reportProject.setRightHolderAgency(resultName);
|
|
|
+ ReportProject reportProject = reportProjectService.getOne(queryWrapper,false);
|
|
|
+ if (reportProject != null) {
|
|
|
+ if (type.equals(2)) { // 代理所
|
|
|
+ Integer actType = reportProject.getActType();
|
|
|
+ //主动类型 请求人代理所
|
|
|
+ if (actType != null && actType.equals(1)) {
|
|
|
+ reportProject.setApplicantAgency(resultName);
|
|
|
+ } else {//被动类型 专利权人代理所
|
|
|
+ reportProject.setRightHolderAgency(resultName);
|
|
|
+ }
|
|
|
+ } else if (type.equals(1)) { // 内部ipr
|
|
|
+ reportProject.setActualPerson(resultName);
|
|
|
}
|
|
|
- } else if (type.equals(1)) { // 内部ipr
|
|
|
- reportProject.setActualPerson(resultName);
|
|
|
+ reportProject.updateById();
|
|
|
}
|
|
|
- reportProject.updateById();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -149,6 +154,17 @@ public class MatchCasePersonService extends ServiceImpl<MatchCasePersonMapper, M
|
|
|
Integer tenantId = personnelVO.getTenantId();
|
|
|
Integer id = updateMatchCasePersonDTO.getId();
|
|
|
Integer assoAccountId = updateMatchCasePersonDTO.getAssoAccountId();
|
|
|
+ Integer type = updateMatchCasePersonDTO.getType();
|
|
|
+ Integer iprPerson = updateMatchCasePersonDTO.getIprPersonId();
|
|
|
+ LambdaQueryWrapper<MatchCasePerson> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(MatchCasePerson::getIprPersonId, iprPerson);
|
|
|
+ queryWrapper.eq(MatchCasePerson::getProjectId, updateMatchCasePersonDTO.getReportId());
|
|
|
+ queryWrapper.eq(MatchCasePerson::getType, type);
|
|
|
+ List<MatchCasePerson> matchCasePeople = this.list(queryWrapper);
|
|
|
+ if (matchCasePeople != null && !matchCasePeople.isEmpty()) {
|
|
|
+ String entityType = type.equals(2) ? "代理所" : "IPR";
|
|
|
+ throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "该" + entityType + "已配案");
|
|
|
+ }
|
|
|
if (id != null) {
|
|
|
matchCasePerson = this.getById(id);
|
|
|
if (matchCasePerson != null) {
|
|
@@ -167,6 +183,7 @@ public class MatchCasePersonService extends ServiceImpl<MatchCasePersonMapper, M
|
|
|
matchCasePerson.setIprPersonId(updateMatchCasePersonDTO.getIprPersonId());
|
|
|
matchCasePerson.setCreateId(personId);
|
|
|
matchCasePerson.setTenantId(tenantId);
|
|
|
+ matchCasePerson.setType(updateMatchCasePersonDTO.getType());
|
|
|
matchCasePerson.setId(null);
|
|
|
matchCasePerson.insert();
|
|
|
}
|
|
@@ -227,9 +244,9 @@ public class MatchCasePersonService extends ServiceImpl<MatchCasePersonMapper, M
|
|
|
.map(String::valueOf)//转换为String
|
|
|
.collect(Collectors.toList());
|
|
|
personIds.addAll(assoAccountStrIds);
|
|
|
- if (!CollectionUtils.isEmpty(createIds)) {
|
|
|
+ if (!CollectionUtils.isEmpty(personIds)) {
|
|
|
try {
|
|
|
- String res = permissionService.getPersonnelByIdsFromPCS(createIds);
|
|
|
+ String res = permissionService.getPersonnelByIdsFromPCS(personIds);
|
|
|
JSONObject jsonObject = JSON.parseObject(res);
|
|
|
personnels = JSONObject.parseArray(jsonObject.getString("data"), Personnel.class);
|
|
|
} catch (Exception e) {
|
|
@@ -257,7 +274,6 @@ public class MatchCasePersonService extends ServiceImpl<MatchCasePersonMapper, M
|
|
|
queryMatchCasePersonVO.setAccountName(personnel.getPersonnelName());
|
|
|
queryMatchCasePersonVO.setAccountUserName(personnel.getPersonnelUserName());
|
|
|
}
|
|
|
- queryMatchCasePersonVOS.add(queryMatchCasePersonVO);
|
|
|
}
|
|
|
}
|
|
|
|