18792927508 2 anni fa
parent
commit
f5817926ca

+ 4
- 3
ruoyi-common/src/main/java/com/ruoyi/common/enums/UpdateSubmitStatus.java Vedi File

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

+ 5
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/UpdateSubmitVO.java Vedi File

@@ -22,13 +22,17 @@ public class UpdateSubmitVO {
22 22
      */
23 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 27
     private Integer updateSubmitStatus;
28 28
     /**
29 29
      * 是否同意,0-否,1-是
30 30
      */
31 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 Vedi File

@@ -61,10 +61,21 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
61 61
         caseApplicationLogMapper.updateStatus(vo);
62 62
         return AjaxResult.success();
63 63
     }
64
-
64
+    @Transactional
65 65
     @Override
66 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 80
         caseApplicationLogMapper.updateStatus(vo);
70 81
         return AjaxResult.success();
@@ -108,48 +119,56 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
108 119
                 // 拒绝,将日志表改版本的状态改为拒绝
109 120
                 vo.setUpdateSubmitStatus(UpdateSubmitStatus.REFUSE.getCode());
110 121
                 caseApplicationLogMapper.updateStatus(vo);
122
+                // todo 给申请人发送短信
111 123
                 // 修改案件表的版本号
112 124
                  //  caseApplicationMapper.updateVersionById(vo.getCaseId(),vo.getVersion());
113 125
 
114 126
             }
115 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 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 Vedi File

@@ -1007,7 +1007,16 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1007 1007
         BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, RoundingMode.HALF_UP);
1008 1008
         caseApplication.setFeePayable(feePayable);
1009 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 1020
 //        if(rows==0){
1012 1021
 //            return rows;
1013 1022
 //        }
@@ -1052,8 +1061,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
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,7 +1265,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1253 1265
         }
1254 1266
         caseApplicationselect.setCaseAttachList(caseAttachList);
1255 1267
         CaseAffiliate caseAffiliateLog = new CaseAffiliate();
1256
-        caseAffiliateLog.setCaseAppliLogId(caseApplication.getCaseLogId());
1268
+        caseAffiliateLog.setCaseAppliLogId(caseApplicationselect.getCaseLogId());
1257 1269
         List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateLogMapper.selectCaseAffiliate(caseAffiliateLog);
1258 1270
         if (caseAffiliatListeselect != null) {
1259 1271
             // 查询组织机构
@@ -2749,6 +2761,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2749 2761
     /**
2750 2762
      * 生成房间号
2751 2763
      */
2764
+    @Transactional
2752 2765
     @Override
2753 2766
     public String createRoomId(Long caseId) {
2754 2767
         String roomId = generateRoomId();
@@ -2756,6 +2769,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2756 2769
         ReservedConference conference = new ReservedConference(caseId, roomId,
2757 2770
                 null, null,0);
2758 2771
         reservedConferenceMapper.insert(conference);
2772
+        // 绑定案件与房间号
2773
+        caseApplicationMapper.bindCaseId(caseId, roomId);
2759 2774
         return roomId;
2760 2775
     }
2761 2776
 

+ 15
- 13
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml Vedi File

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