|
|
@@ -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;
|