Przeglądaj źródła

调解bug修复

18792927508 2 lat temu
rodzic
commit
8f9f16254a

+ 5
- 3
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java Wyświetl plik

@@ -57,15 +57,17 @@ public interface MsCaseApplicationService {
57 57
      * @param affiliate
58 58
      * @param groupOrder 组别
59 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 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 Wyświetl plik

@@ -701,17 +701,17 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
701 701
                     if(CollectionUtil.isNotEmpty(applicant)){
702 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 709
                     if(CollectionUtil.isNotEmpty(res)){
710 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 717
             if (appOperatorCount < 1 && resOperatorCount < 1) {
@@ -769,9 +769,12 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
769 769
      * 设置案件相关信息
770 770
      * @param caseApplication
771 771
      * @param affiliate
772
+     * @param groupOrder 组别
773
+     * @param operatorCount 操作人数量
774
+     * @param updateFlag 是否修改案件
772 775
      */
773 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 778
         if(affiliate==null){
776 779
             return operatorCount;
777 780
         }
@@ -793,8 +796,6 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
793 796
         }
794 797
         affiliate.setCaseAppliId(caseApplication.getId());
795 798
         List<Long> roleIdList = new ArrayList<>();
796
-     //   Long roleId = null;
797
-
798 799
             switch (affiliate.getRoleType()) {
799 800
                 case 1:
800 801
                     roleIdList.add((Long) applicantObj);
@@ -827,19 +828,28 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
827 828
                     }
828 829
                     break;
829 830
                 default:
830
-
831 831
                     break;
832 832
             }
833 833
         // 如果是申请人,则和用户表关联
834 834
         if (affiliate.getOrganizeFlag() == 0) {
835
-            caseApplicationService.insertAfficateUser(affiliate, roleIdList);
835
+            caseApplicationService.insertAfficateUser(affiliate, roleIdList, updateFlag);
836 836
         } else {
837 837
             // 申请机构
838 838
             if (affiliate.getRoleType() == 1 || affiliate.getRoleType()==3) {
839 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 853
                 if (dept==null) {
844 854
                     // 不存在该部门,新增
845 855
                     dept = new SysDept();
@@ -872,7 +882,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
872 882
                 }
873 883
                 affiliate.setApplicantDeptId(dept.getDeptId());
874 884
             } else {
875
-                caseApplicationService.insertAfficateUser(affiliate, roleIdList);
885
+                caseApplicationService.insertAfficateUser(affiliate, roleIdList, updateFlag);
876 886
             }
877 887
         }
878 888
         // 保存人员
@@ -887,15 +897,27 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
887 897
      * 新增案件相关人员信息
888 898
      * @param affiliate 相关人员信息
889 899
      * @param roleIdList 角色id
900
+     * @param updateFlag 是否修改案件
890 901
 
891 902
      */
892 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 906
         if(StrUtil.isEmpty(affiliate.getEmail())){
896 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 922
         if(user==null){
901 923
             // 不存在,则新增
@@ -1079,17 +1101,17 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
1079 1101
             if(CollectionUtil.isNotEmpty(applicant)){
1080 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 1109
             if(CollectionUtil.isNotEmpty(res)){
1088 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 1117
         if (appOperatorCount < 1 && resOperatorCount < 1) {

+ 21
- 14
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java Wyświetl plik

@@ -317,23 +317,30 @@ public class MsSignSealServiceImpl implements MsSignSealService {
317 317
                 if (record.getCreateTime() != null) {
318 318
                     caseNodeTime = DateUtil.format(record.getCreateTime(), DatePattern.NORM_DATETIME_FORMATTER);
319 319
                 }
320
+
320 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 Wyświetl plik

@@ -40,7 +40,7 @@
40 40
   </select>
41 41
     <select id="selectByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate">
42 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 44
                (case when a.user_id is null then d.dept_name else u.nick_name end)  name,
45 45
                (case when a.user_id is null then d.home else u.home end) home,
46 46
                (case when a.user_id is null then d.address else u.address end) address,