浏览代码

案件修改

18792927508 2 年前
父节点
当前提交
080e77a79d

+ 31
- 3
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationLogServiceImpl.java 查看文件

@@ -3,6 +3,7 @@ package com.ruoyi.wisdomarbitrate.service.impl;
3 3
 import cn.hutool.core.collection.CollectionUtil;
4 4
 import cn.hutool.core.util.StrUtil;
5 5
 import com.ruoyi.common.core.domain.AjaxResult;
6
+import com.ruoyi.common.core.domain.entity.SysDept;
6 7
 import com.ruoyi.common.enums.UpdateSubmitStatus;
7 8
 import com.ruoyi.common.enums.YesOrNoEnum;
8 9
 import com.ruoyi.common.utils.ObjectFieldUtils;
@@ -23,6 +24,7 @@ import java.util.Date;
23 24
 import java.util.List;
24 25
 import java.util.Map;
25 26
 import java.util.Objects;
27
+import java.util.function.Function;
26 28
 import java.util.stream.Collectors;
27 29
 
28 30
 import static com.ruoyi.common.utils.SecurityUtils.getUsername;
@@ -110,6 +112,8 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
110 112
             if (Objects.equals(vo.getIsAgree(), YesOrNoEnum.YES.getCode())) {
111 113
                 // 如果版本号为1,则直接返回
112 114
                 if(vo.getVersion() <= 1){
115
+                    vo.setUpdateSubmitStatus(UpdateSubmitStatus.AGREE.getCode());
116
+                    caseApplicationLogMapper.updateStatus(vo);
113 117
                     return AjaxResult.success();
114 118
                 }
115 119
                 // 同意,查询日志记录表本版本数据,将数据更新到主表,并将日志表改版本的状态改为同意
@@ -238,6 +242,7 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
238 242
         CaseAttach caseAttach = new CaseAttach();
239 243
         caseAttach.setCaseAppliLogId(beforeCase.getCaseLogId());
240 244
         caseAttach.setAnnexType(2);
245
+        caseAttachLogMapper.getCaseAttachByCaseIdAndType(caseAttach);
241 246
         beforeCase.setCaseAttachList(caseAttachLogMapper.getCaseAttachByCaseIdAndType(caseAttach));
242 247
         caseAttach.setCaseAppliLogId(afterCase.getCaseLogId());
243 248
         afterCase.setCaseAttachList(caseAttachLogMapper.getCaseAttachByCaseIdAndType(caseAttach));
@@ -251,6 +256,7 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
251 256
                 "nameAgent", "identityNumAgent","contactTelphoneAgent","contactAddressAgent","residenAffili","compLegalPerson",
252 257
         "compLegalperPost","responSex","responBirth"};
253 258
         StringBuilder changeColumn = new StringBuilder();
259
+        // 对比基本字段
254 260
         for (String column : columns) {
255 261
             String beforeValue = ObjectFieldUtils.getValue(beforeCase, column);
256 262
             String afterValue = ObjectFieldUtils.getValue(afterCase, column);
@@ -269,6 +275,7 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
269 275
             }
270 276
 
271 277
         }
278
+        // 对比人员字段
272 279
         List<CaseAffiliate> beforeCaseCaseAffiliates = beforeCase.getCaseAffiliates();
273 280
         List<CaseAffiliate> afterCaseCaseAffiliates = afterCase.getCaseAffiliates();
274 281
         Map<Integer, CaseAffiliate> beforeCaseCaseAffiliateMap = null;
@@ -285,8 +292,7 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
285 292
                 affiliateChangeColumn.append(column).append(",");
286 293
             }
287 294
 
288
-        }
289
-        else if (beforeCaseCaseAffiliates == null && afterCaseCaseAffiliates != null) {
295
+        } else if (beforeCaseCaseAffiliates == null && afterCaseCaseAffiliates != null) {
290 296
             affiliateChangeColumn = new StringBuilder();
291 297
             for (String column : affiliateColumns) {
292 298
 
@@ -330,6 +336,28 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
330 336
             }
331 337
 
332 338
 
339
+        }
340
+        boolean notEmptyFlag = CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList()) && CollectionUtil.isEmpty(beforeCase.getCaseAttachList());
341
+        boolean emptyFlag = CollectionUtil.isEmpty(beforeCase.getCaseAttachList()) && CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList());
342
+        // 对比附件
343
+        if(notEmptyFlag || emptyFlag){
344
+            changeColumn.append("fileColumn");
345
+        }else if(CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList()) && CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList())){
346
+            if(beforeCase.getCaseAttachList().size()!=afterCase.getCaseAttachList().size()){
347
+                changeColumn.append("fileColumn");
348
+            }else {
349
+                Map<String, CaseAttach> afterAttachMap = afterCase.getCaseAttachList().stream().collect(Collectors.toMap(CaseAttach::getAnnexPath, Function.identity(), (n1, n2) -> n2));
350
+
351
+
352
+                for (CaseAttach beforeCaseAttach : beforeCase.getCaseAttachList()) {
353
+                    if(!afterAttachMap.containsKey(beforeCaseAttach.getAnnexPath())) {
354
+                        changeColumn.append("fileColumn");
355
+                        break;
356
+                    }
357
+                }
358
+            }
359
+
360
+
333 361
         }
334 362
         compareCaseVO.setChangeColumn(changeColumn.toString());
335 363
 
@@ -347,7 +375,7 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
347 375
             caseApplicationLog = caseApplicationLogMapper.selectByCaseIdAndVersion(vo.getCaseId(), vo.getVersion() );
348 376
 
349 377
         }else {
350
-            caseApplicationLog = caseApplicationLogMapper.selectByCaseIdAndVersion(vo.getCaseId(), vo.getVersion() - 1);
378
+            caseApplicationLog = caseApplicationLogMapper.selectBeforeCase(vo.getCaseId(), vo.getVersion() );
351 379
         }
352 380
          if (caseApplicationLog == null) {
353 381
             return;

+ 21
- 34
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java 查看文件

@@ -1096,24 +1096,28 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1096 1096
 
1097 1097
         // 异步新增案件日志
1098 1098
         ThreadPoolUtil.execute(() -> {
1099
-            caseApplication.setCaseAppliId(caseApplication.getId());
1100
-            int insertRow = caseApplicationLogMapper.insert(caseApplication);
1101
-            if (insertRow != 0 ) {
1102
-                if( CollectionUtil.isNotEmpty(caseAffiliates)) {
1103
-                    caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getId()));
1104
-                    // 插入案件日志人员相关表
1105
-                    caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates);
1106
-                }
1107
-                if(CollectionUtil.isNotEmpty(caseAttachList)) {
1108
-                    // 插入日志附件表
1109
-                    for (CaseAttach caseAttach : caseAttachList) {
1110
-                        // 查询附件表
1111
-                        CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId());
1112
-                        attach.setCaseAppliLogId(caseApplication.getId());
1113
-                        caseAttachLogMapper.save(attach);
1099
+            try {
1100
+                caseApplication.setCaseAppliId(caseApplication.getId());
1101
+                int insertRow = caseApplicationLogMapper.insert(caseApplication);
1102
+                if (insertRow != 0 ) {
1103
+                    if( CollectionUtil.isNotEmpty(caseAffiliates)) {
1104
+                        caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getId()));
1105
+                        // 插入案件日志人员相关表
1106
+                        caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates);
1114 1107
                     }
1108
+                    if(CollectionUtil.isNotEmpty(caseAttachList)) {
1109
+                        // 插入日志附件表
1110
+                        for (CaseAttach caseAttach : caseAttachList) {
1111
+                            // 查询附件表
1112
+                            CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId());
1113
+                            attach.setCaseAppliLogId(caseApplication.getId());
1114
+                            caseAttachLogMapper.save(attach);
1115
+                        }
1115 1116
 
1117
+                    }
1116 1118
                 }
1119
+            } catch (Exception e) {
1120
+                throw new RuntimeException(e);
1117 1121
             }
1118 1122
         });
1119 1123
 
@@ -2762,25 +2766,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2762 2766
     @Transactional
2763 2767
     public List<ReservedConference> reserveConferenceList(Long caseId) {
2764 2768
         List<ReservedConference> reservedConferences = reservedConferenceMapper.selectListByCaseId(caseId);
2765
-        List<ReservedConference> result = new ArrayList<>();
2766
-        // 判断当前时间是否大于结束时间,如果大于,则把该房间删掉
2767
-        if (CollectionUtil.isNotEmpty(reservedConferences)) {
2768
-            List<Long> ids = new ArrayList<>();
2769
-            for (ReservedConference reservedConference : reservedConferences) {
2770
-                Date endTime = reservedConference.getScheduleEndTime();
2771
-                Date now = new Date();
2772
-                if (now.after(endTime)) {
2773
-                    ids.add(reservedConference.getId());
2774
-                } else {
2775
-                    result.add(reservedConference);
2776
-                }
2777
-            }
2778
-            if (CollectionUtil.isNotEmpty(ids)) {
2779
-                // 根据id批量删除
2780
-                reservedConferenceMapper.batchDeleteByIds(ids);
2781
-            }
2782
-        }
2783
-        return result;
2769
+
2770
+        return reservedConferences;
2784 2771
     }
2785 2772
 
2786 2773
     /**

+ 6
- 3
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationLogMapper.xml 查看文件

@@ -48,6 +48,7 @@
48 48
         <result property="lockStatus"   column="lock_status"  />
49 49
         <result property="version"   column="version"  />
50 50
         <result property="updateSubmitStatus"   column="update_submit_status"  />
51
+        <result property="properPreser"   column="proper_preser"  />
51 52
     </resultMap>
52 53
     <insert id="insert" parameterType="com.ruoyi.wisdomarbitrate.domain.CaseApplication" useGeneratedKeys="true" keyProperty="id">
53 54
         insert into case_application_log(
@@ -69,6 +70,7 @@
69 70
         <if test="createBy != null  and createBy != ''">create_by,</if>
70 71
         <if test="version != null ">version,</if>
71 72
         <if test="updateSubmitStatus != null ">update_submit_status,</if>
73
+        <if test="properPreser != null ">proper_preser,</if>
72 74
         create_time
73 75
         )values(
74 76
         <if test="caseAppliId != null">#{caseAppliId},</if>
@@ -89,6 +91,7 @@
89 91
         <if test="createBy != null  and createBy != ''">#{createBy},</if>
90 92
         <if test="version != null ">#{version},</if>
91 93
         <if test="updateSubmitStatus != null ">#{updateSubmitStatus},</if>
94
+        <if test="properPreser != null ">#{properPreser},</if>
92 95
         sysdate()
93 96
         )
94 97
     </insert>
@@ -130,7 +133,7 @@
130 133
     <select id="selectByCaseIdAndVersion" resultMap="CaseApplicationResult">
131 134
         SELECT case_appli_id id,id caseLogId,case_appli_id caseAppliId ,case_name,case_num,case_subject_amount,arbitrat_claims,request_rule,loan_start_date,
132 135
                loan_end_date,claim_princi_owed,claim_interest_owed,claim_liquid_damag,fee_payable,contract_number,
133
-               create_by,version,update_submit_status,create_time
136
+               create_by,version,update_submit_status,create_time,proper_preser
134 137
         FROM case_application_log
135 138
         WHERE case_appli_id = #{caseAppliId} and version=#{version}
136 139
     </select>
@@ -138,7 +141,7 @@
138 141
     <select id="selectLatestCase" resultMap="CaseApplicationResult">
139 142
         SELECT id caseLogId,case_appli_id caseAppliId ,case_name,case_num,case_subject_amount,arbitrat_claims,request_rule,loan_start_date,
140 143
                loan_end_date,claim_princi_owed,claim_interest_owed,claim_liquid_damag,fee_payable,contract_number,
141
-               create_by,version,update_submit_status,create_time
144
+               create_by,version,update_submit_status,create_time,proper_preser
142 145
         FROM case_application_log
143 146
         WHERE case_appli_id = #{caseAppliId} ORDER BY version DESC limit 1
144 147
     </select>
@@ -156,7 +159,7 @@
156 159
     <select id="selectBeforeCase" resultMap="CaseApplicationResult">
157 160
         SELECT case_appli_id id,id caseLogId,case_appli_id caseAppliId ,case_name,case_num,case_subject_amount,arbitrat_claims,request_rule,loan_start_date,
158 161
                loan_end_date,claim_princi_owed,claim_interest_owed,claim_liquid_damag,fee_payable,contract_number,
159
-               create_by,version,update_submit_status,create_time
162
+               create_by,version,update_submit_status,create_time,proper_preser
160 163
         FROM case_application_log
161 164
         WHERE case_appli_id = #{caseId} and version &lt; #{version} and update_submit_status not in ( 4, 5 ) order by version desc limit 1
162 165
     </select>