Bladeren bron

Merge branch 'wq1' of SH-Arbitrate/Mediation-Backend into dev

wangqiong123 2 jaren geleden
bovenliggende
commit
f1a5037af3

+ 5
- 3
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java Bestand weergeven

57
      * @param affiliate
57
      * @param affiliate
58
      * @param groupOrder 组别
58
      * @param groupOrder 组别
59
      * @param operatorCount 操作人数量
59
      * @param operatorCount 操作人数量
60
+     * @param updateFlag 是否修改案件
60
      */
61
      */
61
-    public int setCaseAfflicate(MsCaseApplicationVO caseApplication, MsCaseAffiliate affiliate,int groupOrder,int operatorCount);
62
+    public int setCaseAfflicate(MsCaseApplicationVO caseApplication, MsCaseAffiliate affiliate,int groupOrder,int operatorCount,boolean updateFlag);
62
     /**
63
     /**
63
      * 新增案件相关人员信息
64
      * 新增案件相关人员信息
64
      * @param affiliate 相关人员信息
65
      * @param affiliate 相关人员信息
65
-     * @param roleId 角色id
66
+     * @param roleIdList 角色id
67
+     * @param updateFlag 是否修改案件
66
 
68
 
67
      */
69
      */
68
-    public void insertAfficateUser(MsCaseAffiliate affiliate,  List<Long> roleIdList);
70
+    public void insertAfficateUser(MsCaseAffiliate affiliate,  List<Long> roleIdList,boolean updateFlag);
69
 
71
 
70
     /**
72
     /**
71
      * 新增案件
73
      * 新增案件

+ 40
- 18
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java Bestand weergeven

701
                     if(CollectionUtil.isNotEmpty(applicant)){
701
                     if(CollectionUtil.isNotEmpty(applicant)){
702
                         for (int i = 0; i < applicant.size(); i++) {
702
                         for (int i = 0; i < applicant.size(); i++) {
703
                             // 申请人
703
                             // 申请人
704
-                            appOperatorCount= setCaseAfflicate(caseApplication, applicant.get(i).getApplicant(),i,appOperatorCount);
704
+                            appOperatorCount= setCaseAfflicate(caseApplication, applicant.get(i).getApplicant(),i,appOperatorCount,false);
705
                             // 申请人代理人
705
                             // 申请人代理人
706
-                            appOperatorCount=setCaseAfflicate(caseApplication, applicant.get(i).getApplicantAgent(),i,appOperatorCount);
706
+                            appOperatorCount=setCaseAfflicate(caseApplication, applicant.get(i).getApplicantAgent(),i,appOperatorCount,false);
707
                         }
707
                         }
708
                     }
708
                     }
709
                     if(CollectionUtil.isNotEmpty(res)){
709
                     if(CollectionUtil.isNotEmpty(res)){
710
                         for (int i = 0; i < res.size(); i++) {
710
                         for (int i = 0; i < res.size(); i++) {
711
                             // 申请人
711
                             // 申请人
712
-                            resOperatorCount=   setCaseAfflicate(caseApplication, res.get(i).getRes(),i,resOperatorCount);
712
+                            resOperatorCount=   setCaseAfflicate(caseApplication, res.get(i).getRes(),i,resOperatorCount,false);
713
                             // 申请人代理人
713
                             // 申请人代理人
714
-                            resOperatorCount= setCaseAfflicate(caseApplication, res.get(i).getResAgent(),i,resOperatorCount);
714
+                            resOperatorCount= setCaseAfflicate(caseApplication, res.get(i).getResAgent(),i,resOperatorCount,false);
715
                         }
715
                         }
716
                     }
716
                     }
717
             if (appOperatorCount < 1 && resOperatorCount < 1) {
717
             if (appOperatorCount < 1 && resOperatorCount < 1) {
769
      * 设置案件相关信息
769
      * 设置案件相关信息
770
      * @param caseApplication
770
      * @param caseApplication
771
      * @param affiliate
771
      * @param affiliate
772
+     * @param groupOrder 组别
773
+     * @param operatorCount 操作人数量
774
+     * @param updateFlag 是否修改案件
772
      */
775
      */
773
     @Transactional
776
     @Transactional
774
-    public int setCaseAfflicate(MsCaseApplicationVO caseApplication, MsCaseAffiliate affiliate,int groupOrder,int operatorCount) {
777
+    public int setCaseAfflicate(MsCaseApplicationVO caseApplication, MsCaseAffiliate affiliate,int groupOrder,int operatorCount,boolean updateFlag) {
775
         if(affiliate==null){
778
         if(affiliate==null){
776
             return operatorCount;
779
             return operatorCount;
777
         }
780
         }
793
         }
796
         }
794
         affiliate.setCaseAppliId(caseApplication.getId());
797
         affiliate.setCaseAppliId(caseApplication.getId());
795
         List<Long> roleIdList = new ArrayList<>();
798
         List<Long> roleIdList = new ArrayList<>();
796
-     //   Long roleId = null;
797
-
798
             switch (affiliate.getRoleType()) {
799
             switch (affiliate.getRoleType()) {
799
                 case 1:
800
                 case 1:
800
                     roleIdList.add((Long) applicantObj);
801
                     roleIdList.add((Long) applicantObj);
827
                     }
828
                     }
828
                     break;
829
                     break;
829
                 default:
830
                 default:
830
-
831
                     break;
831
                     break;
832
             }
832
             }
833
         // 如果是申请人,则和用户表关联
833
         // 如果是申请人,则和用户表关联
834
         if (affiliate.getOrganizeFlag() == 0) {
834
         if (affiliate.getOrganizeFlag() == 0) {
835
-            caseApplicationService.insertAfficateUser(affiliate, roleIdList);
835
+            caseApplicationService.insertAfficateUser(affiliate, roleIdList, updateFlag);
836
         } else {
836
         } else {
837
             // 申请机构
837
             // 申请机构
838
             if (affiliate.getRoleType() == 1 || affiliate.getRoleType()==3) {
838
             if (affiliate.getRoleType() == 1 || affiliate.getRoleType()==3) {
839
                 affiliate.setOperatorFlag(0);
839
                 affiliate.setOperatorFlag(0);
840
                 // 申请人,从缓存中判断部门是否存在
840
                 // 申请人,从缓存中判断部门是否存在
841
-//                Object deptCache = redisCache.getCacheObject(CacheConstants.DEPT_KEY + affiliate.getName());
842
-                SysDept dept = sysDeptMapper.selectDeptByName(affiliate.getName());
841
+                SysDept dept = null;
842
+                if(!updateFlag) {
843
+                    // 新增则根据部门名称查
844
+                    dept = sysDeptMapper.selectDeptByName(affiliate.getName());
845
+                }else {
846
+                    if(affiliate.getApplicantDeptId()!=null){
847
+                        // 修改根据部门id查
848
+                        dept = sysDeptMapper.selectDeptById(affiliate.getApplicantDeptId());
849
+                    }else {
850
+                        dept = sysDeptMapper.selectDeptByName(affiliate.getName());
851
+                    }
852
+                }
843
                 if (dept==null) {
853
                 if (dept==null) {
844
                     // 不存在该部门,新增
854
                     // 不存在该部门,新增
845
                     dept = new SysDept();
855
                     dept = new SysDept();
872
                 }
882
                 }
873
                 affiliate.setApplicantDeptId(dept.getDeptId());
883
                 affiliate.setApplicantDeptId(dept.getDeptId());
874
             } else {
884
             } else {
875
-                caseApplicationService.insertAfficateUser(affiliate, roleIdList);
885
+                caseApplicationService.insertAfficateUser(affiliate, roleIdList, updateFlag);
876
             }
886
             }
877
         }
887
         }
878
         // 保存人员
888
         // 保存人员
887
      * 新增案件相关人员信息
897
      * 新增案件相关人员信息
888
      * @param affiliate 相关人员信息
898
      * @param affiliate 相关人员信息
889
      * @param roleIdList 角色id
899
      * @param roleIdList 角色id
900
+     * @param updateFlag 是否修改案件
890
 
901
 
891
      */
902
      */
892
     @Transactional
903
     @Transactional
893
-    public void insertAfficateUser(MsCaseAffiliate affiliate,  List<Long> roleIdList) {
904
+    public void insertAfficateUser(MsCaseAffiliate affiliate,  List<Long> roleIdList,boolean updateFlag) {
894
 
905
 
895
         if(StrUtil.isEmpty(affiliate.getEmail())){
906
         if(StrUtil.isEmpty(affiliate.getEmail())){
896
             return;
907
             return;
897
         }
908
         }
898
-        SysUser user = sysUserMapper.selectUserByEmail(affiliate.getEmail());
909
+        SysUser user=null;
910
+        if(!updateFlag) {
911
+            // 新增案件则根据邮箱查用户
912
+             user = sysUserMapper.selectUserByEmail(affiliate.getEmail());
913
+        }else {
914
+            // 修改案件则根据userId查用户
915
+            if(affiliate.getUserId()!=null) {
916
+                user = sysUserMapper.selectUserById(affiliate.getUserId());
917
+            }else {
918
+                user = sysUserMapper.selectUserByEmail(affiliate.getEmail());
919
+            }
920
+        }
899
         // 判断该用户是否存在
921
         // 判断该用户是否存在
900
         if(user==null){
922
         if(user==null){
901
             // 不存在,则新增
923
             // 不存在,则新增
1079
             if(CollectionUtil.isNotEmpty(applicant)){
1101
             if(CollectionUtil.isNotEmpty(applicant)){
1080
                 for (int i = 0; i < applicant.size(); i++) {
1102
                 for (int i = 0; i < applicant.size(); i++) {
1081
                     // 申请人
1103
                     // 申请人
1082
-                    appOperatorCount=setCaseAfflicate(caseApplication, applicant.get(i).getApplicant(),i,appOperatorCount);
1104
+                    appOperatorCount=setCaseAfflicate(caseApplication, applicant.get(i).getApplicant(),i,appOperatorCount,true);
1083
                     // 申请人代理人
1105
                     // 申请人代理人
1084
-                    appOperatorCount= setCaseAfflicate(caseApplication, applicant.get(i).getApplicantAgent(),i,appOperatorCount);
1106
+                    appOperatorCount= setCaseAfflicate(caseApplication, applicant.get(i).getApplicantAgent(),i,appOperatorCount,true);
1085
                 }
1107
                 }
1086
             }
1108
             }
1087
             if(CollectionUtil.isNotEmpty(res)){
1109
             if(CollectionUtil.isNotEmpty(res)){
1088
                 for (int i = 0; i < res.size(); i++) {
1110
                 for (int i = 0; i < res.size(); i++) {
1089
                     // 申请人
1111
                     // 申请人
1090
-                    resOperatorCount=setCaseAfflicate(caseApplication, res.get(i).getRes(),i,resOperatorCount);
1112
+                    resOperatorCount=setCaseAfflicate(caseApplication, res.get(i).getRes(),i,resOperatorCount,true);
1091
                     // 申请人代理人
1113
                     // 申请人代理人
1092
-                    resOperatorCount=setCaseAfflicate(caseApplication, res.get(i).getResAgent(),i,resOperatorCount);
1114
+                    resOperatorCount=setCaseAfflicate(caseApplication, res.get(i).getResAgent(),i,resOperatorCount,true);
1093
                 }
1115
                 }
1094
             }
1116
             }
1095
         if (appOperatorCount < 1 && resOperatorCount < 1) {
1117
         if (appOperatorCount < 1 && resOperatorCount < 1) {

+ 21
- 14
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java Bestand weergeven

317
                 if (record.getCreateTime() != null) {
317
                 if (record.getCreateTime() != null) {
318
                     caseNodeTime = DateUtil.format(record.getCreateTime(), DatePattern.NORM_DATETIME_FORMATTER);
318
                     caseNodeTime = DateUtil.format(record.getCreateTime(), DatePattern.NORM_DATETIME_FORMATTER);
319
                 }
319
                 }
320
+
320
                 Integer caseNode = record.getCaseNode();
321
                 Integer caseNode = record.getCaseNode();
321
-                String createBy = record.getCreateBy();
322
-                if (StrUtil.isNotEmpty(createBy)) {
323
-                    contentBuilder.append(Optional.ofNullable(record.getCreateNickName()).orElse("")).append("(").append(record.getCreateBy()).append(")").append("于").append(caseNodeTime);
324
-                } else {
325
-                    contentBuilder.append(Optional.ofNullable(record.getCreateNickName()).orElse("")).append("于").append(caseNodeTime);
326
-                }
322
+                if(caseNode!=null) {
323
+                    if(caseNode.equals(17)){
324
+                        contentBuilder.append("调解案件于").append(caseNodeTime).append("结束");
325
+                    }else {
326
+                        String createBy = record.getCreateBy();
327
+                        if (StrUtil.isNotEmpty(createBy)) {
328
+                            contentBuilder.append(Optional.ofNullable(record.getCreateNickName()).orElse("")).append("(").append(record.getCreateBy()).append(")").append("于").append(caseNodeTime);
329
+                        } else {
330
+                            contentBuilder.append(Optional.ofNullable(record.getCreateNickName()).orElse("")).append("于").append(caseNodeTime);
331
+                        }
327
 
332
 
328
-                if (StrUtil.isNotEmpty(record.getContent())) {
329
-                    contentBuilder.append(record.getContent());
330
-                } else if (caseNode.intValue() == 0) {
331
-                    contentBuilder.append(record.getCaseStatusName());
332
-                }
333
-                if (StrUtil.isNotEmpty(record.getNotes())) {
334
-                    contentBuilder.append(",").append(record.getNotes());
333
+                        if (StrUtil.isNotEmpty(record.getContent())) {
334
+                            contentBuilder.append(record.getContent());
335
+                        } else if (caseNode.intValue() == 0) {
336
+                            contentBuilder.append(record.getCaseStatusName());
337
+                        }
338
+                        if (StrUtil.isNotEmpty(record.getNotes())) {
339
+                            contentBuilder.append(",").append(record.getNotes());
340
+                        }
341
+                    }
342
+                    record.setContent(contentBuilder.toString());
335
                 }
343
                 }
336
-                record.setContent(contentBuilder.toString());
337
 
344
 
338
             });
345
             });
339
         }
346
         }

+ 1
- 1
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAffiliateMapper.xml Bestand weergeven

40
   </select>
40
   </select>
41
     <select id="selectByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate">
41
     <select id="selectByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate">
42
         select c.id caseAppliId,r.role_id roleId,a.id,a.role_type roleType,a.group_order groupOrder,a.operator_flag operatorFlag,d.code,d.comp_legal_person compLegalPerson,u.id_card idCard,u.phonenumber phone,
42
         select c.id caseAppliId,r.role_id roleId,a.id,a.role_type roleType,a.group_order groupOrder,a.operator_flag operatorFlag,d.code,d.comp_legal_person compLegalPerson,u.id_card idCard,u.phonenumber phone,
43
-            u.email,u.user_name userName,
43
+            u.email,u.user_name userName,a.applicant_dept_id applicantDeptId,
44
                (case when a.user_id is null then d.dept_name else u.nick_name end)  name,
44
                (case when a.user_id is null then d.dept_name else u.nick_name end)  name,
45
                (case when a.user_id is null then d.home else u.home end) home,
45
                (case when a.user_id is null then d.home else u.home end) home,
46
                (case when a.user_id is null then d.address else u.address end) address,
46
                (case when a.user_id is null then d.address else u.address end) address,