|
@@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
@@ -82,18 +83,18 @@ public class MatchCasePersonService extends ServiceImpl<MatchCasePersonMapper, M
|
|
|
|
|
|
public MatchCasePerson addMatchCasePersonDB(UpdateMatchCasePersonDTO updateMatchCasePersonDTO) {
|
|
|
MatchCasePerson matchCasePerson = new MatchCasePerson();
|
|
|
+ Integer id = updateMatchCasePersonDTO.getId();
|
|
|
|
|
|
LambdaQueryWrapper<MatchCasePerson> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.eq(MatchCasePerson::getProjectId, updateMatchCasePersonDTO.getReportId());
|
|
|
- if (this.count(queryWrapper) > 1) {
|
|
|
- throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "该报告已有多个配案人员,错误!");
|
|
|
- } else if (this.count(queryWrapper) == 1) {
|
|
|
- matchCasePerson = this.getOne(queryWrapper, false);
|
|
|
+
|
|
|
+ if (id != null) {
|
|
|
+ matchCasePerson = this.getById(id);
|
|
|
if (matchCasePerson != null) {
|
|
|
matchCasePerson.setIprPersonId(updateMatchCasePersonDTO.getIprPersonId());
|
|
|
matchCasePerson.updateById();
|
|
|
}
|
|
|
- } else if (this.count(queryWrapper) == 0) {
|
|
|
+ } else {
|
|
|
PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
|
|
|
String personId = personnelVO.getId();
|
|
|
Integer tenantId = personnelVO.getTenantId();
|
|
@@ -107,16 +108,21 @@ public class MatchCasePersonService extends ServiceImpl<MatchCasePersonMapper, M
|
|
|
return matchCasePerson;
|
|
|
}
|
|
|
|
|
|
- public QueryMatchCasePersonVO getReportMatchCasePerson(Integer reportId) {
|
|
|
- QueryMatchCasePersonVO queryMatchCasePersonVO = new QueryMatchCasePersonVO();
|
|
|
+ public List<QueryMatchCasePersonVO> getReportMatchCasePerson(Integer reportId) {
|
|
|
+ List<QueryMatchCasePersonVO> queryMatchCasePersonVOS = new ArrayList<>();
|
|
|
+
|
|
|
LambdaQueryWrapper<MatchCasePerson> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.eq(MatchCasePerson::getProjectId, reportId);
|
|
|
- MatchCasePerson matchCasePerson = this.getOne(queryWrapper, false);
|
|
|
- if (matchCasePerson != null) {
|
|
|
- BeanUtils.copyProperties(matchCasePerson, queryMatchCasePersonVO);
|
|
|
- this.loadQueryMatchCasePersonVO(queryMatchCasePersonVO);
|
|
|
+ List<MatchCasePerson> matchCasePersons = this.list(queryWrapper);
|
|
|
+ if (matchCasePersons != null && !matchCasePersons.isEmpty()) {
|
|
|
+ for (MatchCasePerson matchCasePerson : matchCasePersons) {
|
|
|
+ QueryMatchCasePersonVO queryMatchCasePersonVO = new QueryMatchCasePersonVO();
|
|
|
+ BeanUtils.copyProperties(matchCasePerson, queryMatchCasePersonVO);
|
|
|
+ this.loadQueryMatchCasePersonVO(queryMatchCasePersonVO);
|
|
|
+ queryMatchCasePersonVOS.add(queryMatchCasePersonVO);
|
|
|
+ }
|
|
|
}
|
|
|
- return queryMatchCasePersonVO;
|
|
|
+ return queryMatchCasePersonVOS;
|
|
|
}
|
|
|
|
|
|
public void loadQueryMatchCasePersonVO(QueryMatchCasePersonVO queryMatchCasePersonVO) {
|
|
@@ -127,7 +133,6 @@ public class MatchCasePersonService extends ServiceImpl<MatchCasePersonMapper, M
|
|
|
queryMatchCasePersonVO.setEmail(iprPerson.getEmail());
|
|
|
}
|
|
|
// 人员信息装载
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|