diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java index 3d5bea1..b8e0322 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java @@ -57,15 +57,17 @@ public interface MsCaseApplicationService { * @param affiliate * @param groupOrder 组别 * @param operatorCount 操作人数量 + * @param updateFlag 是否修改案件 */ - public int setCaseAfflicate(MsCaseApplicationVO caseApplication, MsCaseAffiliate affiliate,int groupOrder,int operatorCount); + public int setCaseAfflicate(MsCaseApplicationVO caseApplication, MsCaseAffiliate affiliate,int groupOrder,int operatorCount,boolean updateFlag); /** * 新增案件相关人员信息 * @param affiliate 相关人员信息 - * @param roleId 角色id + * @param roleIdList 角色id + * @param updateFlag 是否修改案件 */ - public void insertAfficateUser(MsCaseAffiliate affiliate, List roleIdList); + public void insertAfficateUser(MsCaseAffiliate affiliate, List roleIdList,boolean updateFlag); /** * 新增案件 diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java index 6414647..26be72e 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java @@ -701,17 +701,17 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { if(CollectionUtil.isNotEmpty(applicant)){ for (int i = 0; i < applicant.size(); i++) { // 申请人 - appOperatorCount= setCaseAfflicate(caseApplication, applicant.get(i).getApplicant(),i,appOperatorCount); + appOperatorCount= setCaseAfflicate(caseApplication, applicant.get(i).getApplicant(),i,appOperatorCount,false); // 申请人代理人 - appOperatorCount=setCaseAfflicate(caseApplication, applicant.get(i).getApplicantAgent(),i,appOperatorCount); + appOperatorCount=setCaseAfflicate(caseApplication, applicant.get(i).getApplicantAgent(),i,appOperatorCount,false); } } if(CollectionUtil.isNotEmpty(res)){ for (int i = 0; i < res.size(); i++) { // 申请人 - resOperatorCount= setCaseAfflicate(caseApplication, res.get(i).getRes(),i,resOperatorCount); + resOperatorCount= setCaseAfflicate(caseApplication, res.get(i).getRes(),i,resOperatorCount,false); // 申请人代理人 - resOperatorCount= setCaseAfflicate(caseApplication, res.get(i).getResAgent(),i,resOperatorCount); + resOperatorCount= setCaseAfflicate(caseApplication, res.get(i).getResAgent(),i,resOperatorCount,false); } } if (appOperatorCount < 1 && resOperatorCount < 1) { @@ -769,9 +769,12 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { * 设置案件相关信息 * @param caseApplication * @param affiliate + * @param groupOrder 组别 + * @param operatorCount 操作人数量 + * @param updateFlag 是否修改案件 */ @Transactional - public int setCaseAfflicate(MsCaseApplicationVO caseApplication, MsCaseAffiliate affiliate,int groupOrder,int operatorCount) { + public int setCaseAfflicate(MsCaseApplicationVO caseApplication, MsCaseAffiliate affiliate,int groupOrder,int operatorCount,boolean updateFlag) { if(affiliate==null){ return operatorCount; } @@ -793,8 +796,6 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { } affiliate.setCaseAppliId(caseApplication.getId()); List roleIdList = new ArrayList<>(); - // Long roleId = null; - switch (affiliate.getRoleType()) { case 1: roleIdList.add((Long) applicantObj); @@ -827,19 +828,28 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { } break; default: - break; } // 如果是申请人,则和用户表关联 if (affiliate.getOrganizeFlag() == 0) { - caseApplicationService.insertAfficateUser(affiliate, roleIdList); + caseApplicationService.insertAfficateUser(affiliate, roleIdList, updateFlag); } else { // 申请机构 if (affiliate.getRoleType() == 1 || affiliate.getRoleType()==3) { affiliate.setOperatorFlag(0); // 申请人,从缓存中判断部门是否存在 -// Object deptCache = redisCache.getCacheObject(CacheConstants.DEPT_KEY + affiliate.getName()); - SysDept dept = sysDeptMapper.selectDeptByName(affiliate.getName()); + SysDept dept = null; + if(!updateFlag) { + // 新增则根据部门名称查 + dept = sysDeptMapper.selectDeptByName(affiliate.getName()); + }else { + if(affiliate.getApplicantDeptId()!=null){ + // 修改根据部门id查 + dept = sysDeptMapper.selectDeptById(affiliate.getApplicantDeptId()); + }else { + dept = sysDeptMapper.selectDeptByName(affiliate.getName()); + } + } if (dept==null) { // 不存在该部门,新增 dept = new SysDept(); @@ -872,7 +882,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { } affiliate.setApplicantDeptId(dept.getDeptId()); } else { - caseApplicationService.insertAfficateUser(affiliate, roleIdList); + caseApplicationService.insertAfficateUser(affiliate, roleIdList, updateFlag); } } // 保存人员 @@ -887,15 +897,27 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { * 新增案件相关人员信息 * @param affiliate 相关人员信息 * @param roleIdList 角色id + * @param updateFlag 是否修改案件 */ @Transactional - public void insertAfficateUser(MsCaseAffiliate affiliate, List roleIdList) { + public void insertAfficateUser(MsCaseAffiliate affiliate, List roleIdList,boolean updateFlag) { if(StrUtil.isEmpty(affiliate.getEmail())){ return; } - SysUser user = sysUserMapper.selectUserByEmail(affiliate.getEmail()); + SysUser user=null; + if(!updateFlag) { + // 新增案件则根据邮箱查用户 + user = sysUserMapper.selectUserByEmail(affiliate.getEmail()); + }else { + // 修改案件则根据userId查用户 + if(affiliate.getUserId()!=null) { + user = sysUserMapper.selectUserById(affiliate.getUserId()); + }else { + user = sysUserMapper.selectUserByEmail(affiliate.getEmail()); + } + } // 判断该用户是否存在 if(user==null){ // 不存在,则新增 @@ -1079,17 +1101,17 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { if(CollectionUtil.isNotEmpty(applicant)){ for (int i = 0; i < applicant.size(); i++) { // 申请人 - appOperatorCount=setCaseAfflicate(caseApplication, applicant.get(i).getApplicant(),i,appOperatorCount); + appOperatorCount=setCaseAfflicate(caseApplication, applicant.get(i).getApplicant(),i,appOperatorCount,true); // 申请人代理人 - appOperatorCount= setCaseAfflicate(caseApplication, applicant.get(i).getApplicantAgent(),i,appOperatorCount); + appOperatorCount= setCaseAfflicate(caseApplication, applicant.get(i).getApplicantAgent(),i,appOperatorCount,true); } } if(CollectionUtil.isNotEmpty(res)){ for (int i = 0; i < res.size(); i++) { // 申请人 - resOperatorCount=setCaseAfflicate(caseApplication, res.get(i).getRes(),i,resOperatorCount); + resOperatorCount=setCaseAfflicate(caseApplication, res.get(i).getRes(),i,resOperatorCount,true); // 申请人代理人 - resOperatorCount=setCaseAfflicate(caseApplication, res.get(i).getResAgent(),i,resOperatorCount); + resOperatorCount=setCaseAfflicate(caseApplication, res.get(i).getResAgent(),i,resOperatorCount,true); } } if (appOperatorCount < 1 && resOperatorCount < 1) { diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java index 6097745..58737bb 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java @@ -317,23 +317,30 @@ public class MsSignSealServiceImpl implements MsSignSealService { if (record.getCreateTime() != null) { caseNodeTime = DateUtil.format(record.getCreateTime(), DatePattern.NORM_DATETIME_FORMATTER); } - Integer caseNode = record.getCaseNode(); - String createBy = record.getCreateBy(); - if (StrUtil.isNotEmpty(createBy)) { - contentBuilder.append(Optional.ofNullable(record.getCreateNickName()).orElse("")).append("(").append(record.getCreateBy()).append(")").append("于").append(caseNodeTime); - } else { - contentBuilder.append(Optional.ofNullable(record.getCreateNickName()).orElse("")).append("于").append(caseNodeTime); - } - if (StrUtil.isNotEmpty(record.getContent())) { - contentBuilder.append(record.getContent()); - } else if (caseNode.intValue() == 0) { - contentBuilder.append(record.getCaseStatusName()); + Integer caseNode = record.getCaseNode(); + if(caseNode!=null) { + if(caseNode.equals(17)){ + contentBuilder.append("调解案件于").append(caseNodeTime).append("结束"); + }else { + String createBy = record.getCreateBy(); + if (StrUtil.isNotEmpty(createBy)) { + contentBuilder.append(Optional.ofNullable(record.getCreateNickName()).orElse("")).append("(").append(record.getCreateBy()).append(")").append("于").append(caseNodeTime); + } else { + contentBuilder.append(Optional.ofNullable(record.getCreateNickName()).orElse("")).append("于").append(caseNodeTime); + } + + if (StrUtil.isNotEmpty(record.getContent())) { + contentBuilder.append(record.getContent()); + } else if (caseNode.intValue() == 0) { + contentBuilder.append(record.getCaseStatusName()); + } + if (StrUtil.isNotEmpty(record.getNotes())) { + contentBuilder.append(",").append(record.getNotes()); + } + } + record.setContent(contentBuilder.toString()); } - if (StrUtil.isNotEmpty(record.getNotes())) { - contentBuilder.append(",").append(record.getNotes()); - } - record.setContent(contentBuilder.toString()); }); } diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAffiliateMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAffiliateMapper.xml index 53d3d2e..ee8ae75 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAffiliateMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAffiliateMapper.xml @@ -40,7 +40,7 @@