Przeglądaj źródła

Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev

wangqiong123 2 lat temu
rodzic
commit
7182106bab

+ 4
- 3
ruoyi-common/src/main/java/com/ruoyi/common/enums/UpdateSubmitStatus.java Wyświetl plik

9
 {
9
 {
10
     UNCOMMITTED(0, "未提交"),
10
     UNCOMMITTED(0, "未提交"),
11
     COMMITTED(1, "已提交"),
11
     COMMITTED(1, "已提交"),
12
-    AGREE(2, "同意已修改的案件"),
13
-    REFUSE(3, "拒绝已修改的案件"),
14
-    REVOKE(4, "撤销"),
12
+    REVOKE(2, "撤销"),
13
+    AGREE(3, "同意已修改的案件"),
14
+    REFUSE(4, "拒绝已修改的案件"),
15
+
15
     AGREE_REVOKE(5, "同意撤销修改"),
16
     AGREE_REVOKE(5, "同意撤销修改"),
16
     REFUSE_REVOKE(6, "拒绝撤销修改"),
17
     REFUSE_REVOKE(6, "拒绝撤销修改"),
17
     ;
18
     ;

+ 5
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/UpdateSubmitVO.java Wyświetl plik

22
      */
22
      */
23
     private Integer version;
23
     private Integer version;
24
     /**
24
     /**
25
-     * 修改案件的提交状态,0-未提交,1-已提交,2-同意已修改的案件,3-拒绝已修改的案件,4-撤销,5-同意撤销,6-拒绝撤销
25
+     * 修改案件的提交状态,0-未提交,1-已提交,2-撤销,3-同意已修改的案件,4-拒绝已修改的案件,5-同意撤销,6-拒绝撤销
26
      */
26
      */
27
     private Integer updateSubmitStatus;
27
     private Integer updateSubmitStatus;
28
     /**
28
     /**
29
      * 是否同意,0-否,1-是
29
      * 是否同意,0-否,1-是
30
      */
30
      */
31
     private Integer isAgree;
31
     private Integer isAgree;
32
+    /**
33
+     * 拒絕原因
34
+     */
35
+    private String reason;
32
 
36
 
33
 
37
 
34
 }
38
 }

+ 57
- 38
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationLogServiceImpl.java Wyświetl plik

61
         caseApplicationLogMapper.updateStatus(vo);
61
         caseApplicationLogMapper.updateStatus(vo);
62
         return AjaxResult.success();
62
         return AjaxResult.success();
63
     }
63
     }
64
-
64
+    @Transactional
65
     @Override
65
     @Override
66
     public AjaxResult revoke(UpdateSubmitVO vo) {
66
     public AjaxResult revoke(UpdateSubmitVO vo) {
67
-        vo.setUpdateSubmitStatus(UpdateSubmitStatus.REVOKE.getCode());
67
+        // 根据案件id和版本号查询改案件
68
+        CaseApplication caseApplication = caseApplicationLogMapper.selectByCaseIdAndVersion(vo.getCaseId(), vo.getVersion());
69
+        if(caseApplication == null){
70
+            return AjaxResult.error("案件不存在");
71
+        }
72
+        // 如果秘书没有审核,将撤销状态改为同意撤销,否则改为撤销
73
+        if(caseApplication.getUpdateSubmitStatus()!=null && caseApplication.getUpdateSubmitStatus()>UpdateSubmitStatus.REVOKE.getCode()){
74
+            agreeRevoke(vo);
75
+
76
+        }else {
77
+            vo.setUpdateSubmitStatus(UpdateSubmitStatus.REVOKE.getCode());
78
+        }
68
         // 修改日志表提交状态
79
         // 修改日志表提交状态
69
         caseApplicationLogMapper.updateStatus(vo);
80
         caseApplicationLogMapper.updateStatus(vo);
70
         return AjaxResult.success();
81
         return AjaxResult.success();
108
                 // 拒绝,将日志表改版本的状态改为拒绝
119
                 // 拒绝,将日志表改版本的状态改为拒绝
109
                 vo.setUpdateSubmitStatus(UpdateSubmitStatus.REFUSE.getCode());
120
                 vo.setUpdateSubmitStatus(UpdateSubmitStatus.REFUSE.getCode());
110
                 caseApplicationLogMapper.updateStatus(vo);
121
                 caseApplicationLogMapper.updateStatus(vo);
122
+                // todo 给申请人发送短信
111
                 // 修改案件表的版本号
123
                 // 修改案件表的版本号
112
                  //  caseApplicationMapper.updateVersionById(vo.getCaseId(),vo.getVersion());
124
                  //  caseApplicationMapper.updateVersionById(vo.getCaseId(),vo.getVersion());
113
 
125
 
114
             }
126
             }
115
             return AjaxResult.success();
127
             return AjaxResult.success();
128
+        } else if (Objects.equals(vo.getUpdateSubmitStatus(), UpdateSubmitStatus.REVOKE.getCode())) {
129
+            // 如果版本号为1,则直接返回
130
+            if(vo.getVersion() <= 1){
131
+                return AjaxResult.success();
132
+            }
133
+            // 审核修改撤销状态
134
+            if (Objects.equals(vo.getIsAgree(), YesOrNoEnum.YES.getCode())) {
135
+                agreeRevoke(vo);
136
+                // 同意撤销,查询日志记录表上个版本数据,将数据更新到主表,并将日志表改版本的状态改为同意撤销
137
+
138
+            } else {
139
+                // 拒绝撤销,将日志表改版本的状态改为拒绝撤销
140
+                vo.setUpdateSubmitStatus(UpdateSubmitStatus.REFUSE_REVOKE.getCode());
141
+                caseApplicationLogMapper.updateStatus(vo);
142
+                // 修改案件表的版本号
143
+             //   caseApplicationMapper.updateVersionById(vo.getCaseId(),vo.getVersion());
144
+            }
145
+            return AjaxResult.success();
116
         }
146
         }
117
-        // todo 需确定
118
-//        else if (Objects.equals(vo.getUpdateSubmitStatus(), UpdateSubmitStatus.REVOKE.getCode())) {
119
-//            // 如果版本号为1,则直接返回
120
-//            if(vo.getVersion() <= 1){
121
-//                return AjaxResult.success();
122
-//            }
123
-//            // 审核修改撤销状态
124
-//            if (Objects.equals(vo.getIsAgree(), YesOrNoEnum.YES.getCode())) {
125
-//                // 同意撤销,查询日志记录表上个版本数据,将数据更新到主表,并将日志表改版本的状态改为同意撤销
126
-//                // 查询日志记录表上个版本未被拒绝数据
127
-//                CaseApplication caseApplicationLog = caseApplicationLogMapper.selectByCaseIdAndVersion(vo.getCaseId(), vo.getVersion()-1);
128
-//                if (caseApplicationLog == null) {
129
-//                    return AjaxResult.error("未找到该案件");
130
-//                }
131
-//                // 将日志表改版本的状态改为拒绝
132
-//                vo.setUpdateSubmitStatus(UpdateSubmitStatus.AGREE_REVOKE.getCode());
133
-//                caseApplicationLogMapper.updateStatus(vo);
134
-//                // 根据caseLogId查询相关人员表
135
-//                CaseAffiliate caseAffiliate = new CaseAffiliate();
136
-//                caseAffiliate.setCaseAppliLogId(caseApplicationLog.getCaseLogId());
137
-//                List<CaseAffiliate> affiliateLogList = caseAffiliateLogMapper.selectCaseAffiliate(caseAffiliate);
138
-//                caseApplicationLog.setId(caseApplicationLog.getCaseAppliId());
139
-//                // 更新案件主表
140
-//                caseApplicationMapper.updataCaseApplication(caseApplicationLog);
141
-//
142
-//                // 更新相关人员主表
143
-//                caseAffiliateMapper.updataCaseAffiliateByCaseId(caseApplicationLog.getCaseAppliId(), affiliateLogList);
144
-//            } else {
145
-//                // 拒绝撤销,将日志表改版本的状态改为拒绝撤销
146
-//                vo.setUpdateSubmitStatus(UpdateSubmitStatus.REFUSE_REVOKE.getCode());
147
-//                caseApplicationLogMapper.updateStatus(vo);
148
-//                // 修改案件表的版本号
149
-//             //   caseApplicationMapper.updateVersionById(vo.getCaseId(),vo.getVersion());
150
-//            }
151
-//            return AjaxResult.success();
152
-//        }
153
        return AjaxResult.success();
147
        return AjaxResult.success();
154
     }
148
     }
149
+
150
+    /**
151
+     * 同意撤销
152
+     * @param vo
153
+     */
154
+    private void agreeRevoke(UpdateSubmitVO vo) {
155
+        // 查询日志记录表上个版本未被拒绝数据
156
+        CaseApplication caseApplicationLog = caseApplicationLogMapper.selectByCaseIdAndVersion(vo.getCaseId(), vo.getVersion()-1);
157
+        if (caseApplicationLog == null) {
158
+            return;
159
+        }
160
+        // 将日志表改版本的状态改为拒绝
161
+        vo.setUpdateSubmitStatus(UpdateSubmitStatus.AGREE_REVOKE.getCode());
162
+        caseApplicationLogMapper.updateStatus(vo);
163
+        // 根据caseLogId查询相关人员表
164
+        CaseAffiliate caseAffiliate = new CaseAffiliate();
165
+        caseAffiliate.setCaseAppliLogId(caseApplicationLog.getCaseLogId());
166
+        List<CaseAffiliate> affiliateLogList = caseAffiliateLogMapper.selectCaseAffiliate(caseAffiliate);
167
+        caseApplicationLog.setId(caseApplicationLog.getCaseAppliId());
168
+        // 更新案件主表
169
+        caseApplicationMapper.updataCaseApplication(caseApplicationLog);
170
+
171
+        // 更新相关人员主表
172
+        caseAffiliateMapper.updataCaseAffiliateByCaseId(caseApplicationLog.getCaseAppliId(), affiliateLogList);
173
+    }
155
 }
174
 }

+ 18
- 3
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java Wyświetl plik

1007
         BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, RoundingMode.HALF_UP);
1007
         BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, RoundingMode.HALF_UP);
1008
         caseApplication.setFeePayable(feePayable);
1008
         caseApplication.setFeePayable(feePayable);
1009
         caseApplication.setUpdateBy(getUsername());
1009
         caseApplication.setUpdateBy(getUsername());
1010
-    //    int rows = caseApplicationMapper.updataCaseApplication(caseApplication);
1010
+        // 立案申请状态直接修改主表信息
1011
+        if(caseApplication.getCaseStatus()!=null && caseApplication.getCaseStatus().equals(CaseApplicationConstants.CASE_APPLICATION)) {
1012
+
1013
+            caseApplicationMapper.updataCaseApplication(caseApplication);
1014
+            // 修改记录表状态为同意提交修改的内容
1015
+            caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.AGREE.getCode());
1016
+        }else {
1017
+            // 修改记录表状态为已提交修改的内容
1018
+            caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.COMMITTED.getCode());
1019
+        }
1011
 //        if(rows==0){
1020
 //        if(rows==0){
1012
 //            return rows;
1021
 //            return rows;
1013
 //        }
1022
 //        }
1052
                     }
1061
                     }
1053
 
1062
 
1054
                 }
1063
                 }
1064
+                // 立案申请状态直接修改主表信息
1065
+                if(caseApplication.getCaseStatus()!=null && caseApplication.getCaseStatus().equals(CaseApplicationConstants.CASE_APPLICATION)) {
1055
 
1066
 
1056
-          //      caseAffiliateMapper.updataCaseAffiliate(caseAffiliate);
1067
+                    caseAffiliateMapper.updataCaseAffiliate(caseAffiliate);
1068
+                }
1057
             }
1069
             }
1058
 
1070
 
1059
         }
1071
         }
1253
         }
1265
         }
1254
         caseApplicationselect.setCaseAttachList(caseAttachList);
1266
         caseApplicationselect.setCaseAttachList(caseAttachList);
1255
         CaseAffiliate caseAffiliateLog = new CaseAffiliate();
1267
         CaseAffiliate caseAffiliateLog = new CaseAffiliate();
1256
-        caseAffiliateLog.setCaseAppliLogId(caseApplication.getCaseLogId());
1268
+        caseAffiliateLog.setCaseAppliLogId(caseApplicationselect.getCaseLogId());
1257
         List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateLogMapper.selectCaseAffiliate(caseAffiliateLog);
1269
         List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateLogMapper.selectCaseAffiliate(caseAffiliateLog);
1258
         if (caseAffiliatListeselect != null) {
1270
         if (caseAffiliatListeselect != null) {
1259
             // 查询组织机构
1271
             // 查询组织机构
2749
     /**
2761
     /**
2750
      * 生成房间号
2762
      * 生成房间号
2751
      */
2763
      */
2764
+    @Transactional
2752
     @Override
2765
     @Override
2753
     public String createRoomId(Long caseId) {
2766
     public String createRoomId(Long caseId) {
2754
         String roomId = generateRoomId();
2767
         String roomId = generateRoomId();
2756
         ReservedConference conference = new ReservedConference(caseId, roomId,
2769
         ReservedConference conference = new ReservedConference(caseId, roomId,
2757
                 null, null,0);
2770
                 null, null,0);
2758
         reservedConferenceMapper.insert(conference);
2771
         reservedConferenceMapper.insert(conference);
2772
+        // 绑定案件与房间号
2773
+        caseApplicationMapper.bindCaseId(caseId, roomId);
2759
         return roomId;
2774
         return roomId;
2760
     }
2775
     }
2761
 
2776
 

+ 15
- 13
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml Wyświetl plik

187
                     and l.version=(SELECT
187
                     and l.version=(SELECT
188
                     max( version ) version
188
                     max( version ) version
189
                     FROM
189
                     FROM
190
-                    case_application_log where case_appli_id = c.id)
190
+                    case_application_log where case_appli_id = c.id and update_submit_status not in(4,5))
191
                     <if test="applicationOrganId != null and applicationOrganId != ''">
191
                     <if test="applicationOrganId != null and applicationOrganId != ''">
192
                         AND ca.application_organ_id = #{applicationOrganId}
192
                         AND ca.application_organ_id = #{applicationOrganId}
193
                     </if>
193
                     </if>
293
                 FROM
293
                 FROM
294
                 case_application c
294
                 case_application c
295
                 JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type = 1
295
                 JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type = 1
296
-                JOIN case_application_log l on l.case_appli_id=c.id and l.update_submit_status not in(1,4) and l.version
296
+                JOIN case_application_log l on l.case_appli_id=c.id and l.update_submit_status not in(1, 2) and l.version
297
                 = (
297
                 = (
298
                 SELECT
298
                 SELECT
299
                 max( version ) version
299
                 max( version ) version
300
                 FROM
300
                 FROM
301
                 case_application_log
301
                 case_application_log
302
                 WHERE case_appli_id = c.id
302
                 WHERE case_appli_id = c.id
303
-                and update_submit_status not IN ( 1, 4 ))
303
+                and update_submit_status not IN ( 1, 2 ))
304
                 WHERE
304
                 WHERE
305
                 ca.identity_type=1 and c.case_status in (1,5,11,15,16,17,31)
305
                 ca.identity_type=1 and c.case_status in (1,5,11,15,16,17,31)
306
                 <if test="deptIds != null and deptIds.size() > 0">
306
                 <if test="deptIds != null and deptIds.size() > 0">
406
                 JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id
406
                 JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id
407
                 AND ca.identity_type = 1
407
                 AND ca.identity_type = 1
408
                 WHERE
408
                 WHERE
409
-                l.update_submit_status IN ( 1, 4 ) and ca.identity_type=1
409
+                l.update_submit_status IN ( 1, 2 ) and ca.identity_type=1
410
                 <if test="deptIds != null and deptIds.size() > 0">
410
                 <if test="deptIds != null and deptIds.size() > 0">
411
                     and ca.application_organ_id in
411
                     and ca.application_organ_id in
412
                     <foreach item="item" collection="deptIds" open="(" separator="," close=")">
412
                     <foreach item="item" collection="deptIds" open="(" separator="," close=")">
435
                 FROM
435
                 FROM
436
                 case_application_log
436
                 case_application_log
437
                 WHERE
437
                 WHERE
438
-                update_submit_status IN ( 1, 4 ) and c.id = l.case_appli_id)
438
+                update_submit_status IN ( 1, 2 ) and c.id = l.case_appli_id)
439
             </if>
439
             </if>
440
         </trim>
440
         </trim>
441
         ) t1
441
         ) t1
713
                     and l.version=(SELECT
713
                     and l.version=(SELECT
714
                     max( version ) version
714
                     max( version ) version
715
                     FROM
715
                     FROM
716
-                    case_application_log where case_appli_id = c.id)
716
+                    case_application_log where case_appli_id = c.id and update_submit_status not in(4,5))
717
                     <if test="applicationOrganId != null and applicationOrganId != ''">
717
                     <if test="applicationOrganId != null and applicationOrganId != ''">
718
                         AND ca.application_organ_id = #{applicationOrganId}
718
                         AND ca.application_organ_id = #{applicationOrganId}
719
                     </if>
719
                     </if>
1032
         FROM
1032
         FROM
1033
         case_application_log
1033
         case_application_log
1034
         WHERE case_appli_id = t.id
1034
         WHERE case_appli_id = t.id
1035
-        update_submit_status IN ( 1, 4 ))
1035
+        update_submit_status IN ( 1, 2 ))
1036
         order by c.create_time desc,c.case_num desc
1036
         order by c.create_time desc,c.case_num desc
1037
     </select>
1037
     </select>
1038
     <select id="selectSecretaryCase" parameterType="CaseApplication" resultMap="CaseApplicationResult">
1038
     <select id="selectSecretaryCase" parameterType="CaseApplication" resultMap="CaseApplicationResult">
1149
                 FROM
1149
                 FROM
1150
                     case_application c
1150
                     case_application c
1151
                         JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type = 1
1151
                         JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type = 1
1152
-                        JOIN case_application_log l on l.case_appli_id=c.id and l.update_submit_status not in(1,4) and    l.version = (
1152
+                        JOIN case_application_log l on l.case_appli_id=c.id and l.update_submit_status not in(1, 2) and    l.version = (
1153
         SELECT
1153
         SELECT
1154
         max( version ) version
1154
         max( version ) version
1155
         FROM
1155
         FROM
1156
         case_application_log
1156
         case_application_log
1157
         WHERE case_appli_id = c.id
1157
         WHERE case_appli_id = c.id
1158
-        update_submit_status IN ( 1, 4 ))
1158
+        update_submit_status IN ( 1, 2 ))
1159
                 WHERE
1159
                 WHERE
1160
         ca.identity_type=1 and c.case_status in (1,5)
1160
         ca.identity_type=1 and c.case_status in (1,5)
1161
         <if test="deptIds != null and deptIds.size() > 0">
1161
         <if test="deptIds != null and deptIds.size() > 0">
1262
                         JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id
1262
                         JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id
1263
                         AND ca.identity_type = 1
1263
                         AND ca.identity_type = 1
1264
                 WHERE
1264
                 WHERE
1265
-                    l.update_submit_status IN ( 1, 4 ) and  ca.identity_type=1
1265
+                    l.update_submit_status IN ( 1, 2 ) and  ca.identity_type=1
1266
                     <if test="deptIds != null and deptIds.size() > 0">
1266
                     <if test="deptIds != null and deptIds.size() > 0">
1267
                         and ca.application_organ_id in
1267
                         and ca.application_organ_id in
1268
                         <foreach item="item" collection="deptIds" open="(" separator="," close=")">
1268
                         <foreach item="item" collection="deptIds" open="(" separator="," close=")">
1291
                     FROM
1291
                     FROM
1292
                         case_application_log
1292
                         case_application_log
1293
                     WHERE
1293
                     WHERE
1294
-                        update_submit_status IN ( 1, 4 ))
1294
+                        update_submit_status IN ( 1, 2 ))
1295
             ) t
1295
             ) t
1296
         GROUP BY
1296
         GROUP BY
1297
             t.id,
1297
             t.id,
1459
         update case_application set lock_status=#{lockStatus} where id = #{id}
1459
         update case_application set lock_status=#{lockStatus} where id = #{id}
1460
     </update>
1460
     </update>
1461
     <update id="bindCaseId">
1461
     <update id="bindCaseId">
1462
-        update case_application set room_id=#{roomId} where id = #{caseId}
1462
+       <!-- update case_application set room_id=#{roomId} where id = #{caseId} -->
1463
+
1464
+        update case_application set room_id= CONCAT(room_id,',',#{roomId}) where id =#{caseId}
1463
     </update>
1465
     </update>
1464
     <update id="updateVersionById">
1466
     <update id="updateVersionById">
1465
         update case_application set version = #{version} where id = #{id}
1467
         update case_application set version = #{version} where id = #{id}
1574
     </select>
1576
     </select>
1575
     <select id="selectCaseIdByRoomId" resultType="java.lang.Long">
1577
     <select id="selectCaseIdByRoomId" resultType="java.lang.Long">
1576
         select id
1578
         select id
1577
-        from case_application where room_id=#{roomId} limit 1
1579
+        from case_application where room_id like concat('%', #{roomId}, '%')  limit 1
1578
     </select>
1580
     </select>
1579
 
1581
 
1580
     <select id="selectMaxRoomId" resultType="java.lang.Integer">
1582
     <select id="selectMaxRoomId" resultType="java.lang.Integer">