18792927508 пре 2 година
родитељ
комит
080e77a79d

+ 31
- 3
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationLogServiceImpl.java Прегледај датотеку

3
 import cn.hutool.core.collection.CollectionUtil;
3
 import cn.hutool.core.collection.CollectionUtil;
4
 import cn.hutool.core.util.StrUtil;
4
 import cn.hutool.core.util.StrUtil;
5
 import com.ruoyi.common.core.domain.AjaxResult;
5
 import com.ruoyi.common.core.domain.AjaxResult;
6
+import com.ruoyi.common.core.domain.entity.SysDept;
6
 import com.ruoyi.common.enums.UpdateSubmitStatus;
7
 import com.ruoyi.common.enums.UpdateSubmitStatus;
7
 import com.ruoyi.common.enums.YesOrNoEnum;
8
 import com.ruoyi.common.enums.YesOrNoEnum;
8
 import com.ruoyi.common.utils.ObjectFieldUtils;
9
 import com.ruoyi.common.utils.ObjectFieldUtils;
23
 import java.util.List;
24
 import java.util.List;
24
 import java.util.Map;
25
 import java.util.Map;
25
 import java.util.Objects;
26
 import java.util.Objects;
27
+import java.util.function.Function;
26
 import java.util.stream.Collectors;
28
 import java.util.stream.Collectors;
27
 
29
 
28
 import static com.ruoyi.common.utils.SecurityUtils.getUsername;
30
 import static com.ruoyi.common.utils.SecurityUtils.getUsername;
110
             if (Objects.equals(vo.getIsAgree(), YesOrNoEnum.YES.getCode())) {
112
             if (Objects.equals(vo.getIsAgree(), YesOrNoEnum.YES.getCode())) {
111
                 // 如果版本号为1,则直接返回
113
                 // 如果版本号为1,则直接返回
112
                 if(vo.getVersion() <= 1){
114
                 if(vo.getVersion() <= 1){
115
+                    vo.setUpdateSubmitStatus(UpdateSubmitStatus.AGREE.getCode());
116
+                    caseApplicationLogMapper.updateStatus(vo);
113
                     return AjaxResult.success();
117
                     return AjaxResult.success();
114
                 }
118
                 }
115
                 // 同意,查询日志记录表本版本数据,将数据更新到主表,并将日志表改版本的状态改为同意
119
                 // 同意,查询日志记录表本版本数据,将数据更新到主表,并将日志表改版本的状态改为同意
238
         CaseAttach caseAttach = new CaseAttach();
242
         CaseAttach caseAttach = new CaseAttach();
239
         caseAttach.setCaseAppliLogId(beforeCase.getCaseLogId());
243
         caseAttach.setCaseAppliLogId(beforeCase.getCaseLogId());
240
         caseAttach.setAnnexType(2);
244
         caseAttach.setAnnexType(2);
245
+        caseAttachLogMapper.getCaseAttachByCaseIdAndType(caseAttach);
241
         beforeCase.setCaseAttachList(caseAttachLogMapper.getCaseAttachByCaseIdAndType(caseAttach));
246
         beforeCase.setCaseAttachList(caseAttachLogMapper.getCaseAttachByCaseIdAndType(caseAttach));
242
         caseAttach.setCaseAppliLogId(afterCase.getCaseLogId());
247
         caseAttach.setCaseAppliLogId(afterCase.getCaseLogId());
243
         afterCase.setCaseAttachList(caseAttachLogMapper.getCaseAttachByCaseIdAndType(caseAttach));
248
         afterCase.setCaseAttachList(caseAttachLogMapper.getCaseAttachByCaseIdAndType(caseAttach));
251
                 "nameAgent", "identityNumAgent","contactTelphoneAgent","contactAddressAgent","residenAffili","compLegalPerson",
256
                 "nameAgent", "identityNumAgent","contactTelphoneAgent","contactAddressAgent","residenAffili","compLegalPerson",
252
         "compLegalperPost","responSex","responBirth"};
257
         "compLegalperPost","responSex","responBirth"};
253
         StringBuilder changeColumn = new StringBuilder();
258
         StringBuilder changeColumn = new StringBuilder();
259
+        // 对比基本字段
254
         for (String column : columns) {
260
         for (String column : columns) {
255
             String beforeValue = ObjectFieldUtils.getValue(beforeCase, column);
261
             String beforeValue = ObjectFieldUtils.getValue(beforeCase, column);
256
             String afterValue = ObjectFieldUtils.getValue(afterCase, column);
262
             String afterValue = ObjectFieldUtils.getValue(afterCase, column);
269
             }
275
             }
270
 
276
 
271
         }
277
         }
278
+        // 对比人员字段
272
         List<CaseAffiliate> beforeCaseCaseAffiliates = beforeCase.getCaseAffiliates();
279
         List<CaseAffiliate> beforeCaseCaseAffiliates = beforeCase.getCaseAffiliates();
273
         List<CaseAffiliate> afterCaseCaseAffiliates = afterCase.getCaseAffiliates();
280
         List<CaseAffiliate> afterCaseCaseAffiliates = afterCase.getCaseAffiliates();
274
         Map<Integer, CaseAffiliate> beforeCaseCaseAffiliateMap = null;
281
         Map<Integer, CaseAffiliate> beforeCaseCaseAffiliateMap = null;
285
                 affiliateChangeColumn.append(column).append(",");
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
             affiliateChangeColumn = new StringBuilder();
296
             affiliateChangeColumn = new StringBuilder();
291
             for (String column : affiliateColumns) {
297
             for (String column : affiliateColumns) {
292
 
298
 
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
         compareCaseVO.setChangeColumn(changeColumn.toString());
362
         compareCaseVO.setChangeColumn(changeColumn.toString());
335
 
363
 
347
             caseApplicationLog = caseApplicationLogMapper.selectByCaseIdAndVersion(vo.getCaseId(), vo.getVersion() );
375
             caseApplicationLog = caseApplicationLogMapper.selectByCaseIdAndVersion(vo.getCaseId(), vo.getVersion() );
348
 
376
 
349
         }else {
377
         }else {
350
-            caseApplicationLog = caseApplicationLogMapper.selectByCaseIdAndVersion(vo.getCaseId(), vo.getVersion() - 1);
378
+            caseApplicationLog = caseApplicationLogMapper.selectBeforeCase(vo.getCaseId(), vo.getVersion() );
351
         }
379
         }
352
          if (caseApplicationLog == null) {
380
          if (caseApplicationLog == null) {
353
             return;
381
             return;

+ 21
- 34
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java Прегледај датотеку

1096
 
1096
 
1097
         // 异步新增案件日志
1097
         // 异步新增案件日志
1098
         ThreadPoolUtil.execute(() -> {
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
     @Transactional
2766
     @Transactional
2763
     public List<ReservedConference> reserveConferenceList(Long caseId) {
2767
     public List<ReservedConference> reserveConferenceList(Long caseId) {
2764
         List<ReservedConference> reservedConferences = reservedConferenceMapper.selectListByCaseId(caseId);
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
         <result property="lockStatus"   column="lock_status"  />
48
         <result property="lockStatus"   column="lock_status"  />
49
         <result property="version"   column="version"  />
49
         <result property="version"   column="version"  />
50
         <result property="updateSubmitStatus"   column="update_submit_status"  />
50
         <result property="updateSubmitStatus"   column="update_submit_status"  />
51
+        <result property="properPreser"   column="proper_preser"  />
51
     </resultMap>
52
     </resultMap>
52
     <insert id="insert" parameterType="com.ruoyi.wisdomarbitrate.domain.CaseApplication" useGeneratedKeys="true" keyProperty="id">
53
     <insert id="insert" parameterType="com.ruoyi.wisdomarbitrate.domain.CaseApplication" useGeneratedKeys="true" keyProperty="id">
53
         insert into case_application_log(
54
         insert into case_application_log(
69
         <if test="createBy != null  and createBy != ''">create_by,</if>
70
         <if test="createBy != null  and createBy != ''">create_by,</if>
70
         <if test="version != null ">version,</if>
71
         <if test="version != null ">version,</if>
71
         <if test="updateSubmitStatus != null ">update_submit_status,</if>
72
         <if test="updateSubmitStatus != null ">update_submit_status,</if>
73
+        <if test="properPreser != null ">proper_preser,</if>
72
         create_time
74
         create_time
73
         )values(
75
         )values(
74
         <if test="caseAppliId != null">#{caseAppliId},</if>
76
         <if test="caseAppliId != null">#{caseAppliId},</if>
89
         <if test="createBy != null  and createBy != ''">#{createBy},</if>
91
         <if test="createBy != null  and createBy != ''">#{createBy},</if>
90
         <if test="version != null ">#{version},</if>
92
         <if test="version != null ">#{version},</if>
91
         <if test="updateSubmitStatus != null ">#{updateSubmitStatus},</if>
93
         <if test="updateSubmitStatus != null ">#{updateSubmitStatus},</if>
94
+        <if test="properPreser != null ">#{properPreser},</if>
92
         sysdate()
95
         sysdate()
93
         )
96
         )
94
     </insert>
97
     </insert>
130
     <select id="selectByCaseIdAndVersion" resultMap="CaseApplicationResult">
133
     <select id="selectByCaseIdAndVersion" resultMap="CaseApplicationResult">
131
         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,
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
                loan_end_date,claim_princi_owed,claim_interest_owed,claim_liquid_damag,fee_payable,contract_number,
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
         FROM case_application_log
137
         FROM case_application_log
135
         WHERE case_appli_id = #{caseAppliId} and version=#{version}
138
         WHERE case_appli_id = #{caseAppliId} and version=#{version}
136
     </select>
139
     </select>
138
     <select id="selectLatestCase" resultMap="CaseApplicationResult">
141
     <select id="selectLatestCase" resultMap="CaseApplicationResult">
139
         SELECT id caseLogId,case_appli_id caseAppliId ,case_name,case_num,case_subject_amount,arbitrat_claims,request_rule,loan_start_date,
142
         SELECT id caseLogId,case_appli_id caseAppliId ,case_name,case_num,case_subject_amount,arbitrat_claims,request_rule,loan_start_date,
140
                loan_end_date,claim_princi_owed,claim_interest_owed,claim_liquid_damag,fee_payable,contract_number,
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
         FROM case_application_log
145
         FROM case_application_log
143
         WHERE case_appli_id = #{caseAppliId} ORDER BY version DESC limit 1
146
         WHERE case_appli_id = #{caseAppliId} ORDER BY version DESC limit 1
144
     </select>
147
     </select>
156
     <select id="selectBeforeCase" resultMap="CaseApplicationResult">
159
     <select id="selectBeforeCase" resultMap="CaseApplicationResult">
157
         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,
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
                loan_end_date,claim_princi_owed,claim_interest_owed,claim_liquid_damag,fee_payable,contract_number,
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
         FROM case_application_log
163
         FROM case_application_log
161
         WHERE case_appli_id = #{caseId} and version &lt; #{version} and update_submit_status not in ( 4, 5 ) order by version desc limit 1
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
     </select>
165
     </select>