From 080e77a79d9a3f5916ab6d2b543f1ced433d2b07 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Fri, 24 Nov 2023 14:34:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A1=88=E4=BB=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/CaseApplicationLogServiceImpl.java | 34 +++++++++++- .../impl/CaseApplicationServiceImpl.java | 55 +++++++------------ .../CaseApplicationLogMapper.xml | 9 ++- 3 files changed, 58 insertions(+), 40 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationLogServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationLogServiceImpl.java index 019970a..e6ca056 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationLogServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationLogServiceImpl.java @@ -3,6 +3,7 @@ package com.ruoyi.wisdomarbitrate.service.impl; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.SysDept; import com.ruoyi.common.enums.UpdateSubmitStatus; import com.ruoyi.common.enums.YesOrNoEnum; import com.ruoyi.common.utils.ObjectFieldUtils; @@ -23,6 +24,7 @@ import java.util.Date; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.function.Function; import java.util.stream.Collectors; import static com.ruoyi.common.utils.SecurityUtils.getUsername; @@ -110,6 +112,8 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService if (Objects.equals(vo.getIsAgree(), YesOrNoEnum.YES.getCode())) { // 如果版本号为1,则直接返回 if(vo.getVersion() <= 1){ + vo.setUpdateSubmitStatus(UpdateSubmitStatus.AGREE.getCode()); + caseApplicationLogMapper.updateStatus(vo); return AjaxResult.success(); } // 同意,查询日志记录表本版本数据,将数据更新到主表,并将日志表改版本的状态改为同意 @@ -238,6 +242,7 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService CaseAttach caseAttach = new CaseAttach(); caseAttach.setCaseAppliLogId(beforeCase.getCaseLogId()); caseAttach.setAnnexType(2); + caseAttachLogMapper.getCaseAttachByCaseIdAndType(caseAttach); beforeCase.setCaseAttachList(caseAttachLogMapper.getCaseAttachByCaseIdAndType(caseAttach)); caseAttach.setCaseAppliLogId(afterCase.getCaseLogId()); afterCase.setCaseAttachList(caseAttachLogMapper.getCaseAttachByCaseIdAndType(caseAttach)); @@ -251,6 +256,7 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService "nameAgent", "identityNumAgent","contactTelphoneAgent","contactAddressAgent","residenAffili","compLegalPerson", "compLegalperPost","responSex","responBirth"}; StringBuilder changeColumn = new StringBuilder(); + // 对比基本字段 for (String column : columns) { String beforeValue = ObjectFieldUtils.getValue(beforeCase, column); String afterValue = ObjectFieldUtils.getValue(afterCase, column); @@ -269,6 +275,7 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService } } + // 对比人员字段 List beforeCaseCaseAffiliates = beforeCase.getCaseAffiliates(); List afterCaseCaseAffiliates = afterCase.getCaseAffiliates(); Map beforeCaseCaseAffiliateMap = null; @@ -285,8 +292,7 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService affiliateChangeColumn.append(column).append(","); } - } - else if (beforeCaseCaseAffiliates == null && afterCaseCaseAffiliates != null) { + } else if (beforeCaseCaseAffiliates == null && afterCaseCaseAffiliates != null) { affiliateChangeColumn = new StringBuilder(); for (String column : affiliateColumns) { @@ -330,6 +336,28 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService } + } + boolean notEmptyFlag = CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList()) && CollectionUtil.isEmpty(beforeCase.getCaseAttachList()); + boolean emptyFlag = CollectionUtil.isEmpty(beforeCase.getCaseAttachList()) && CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList()); + // 对比附件 + if(notEmptyFlag || emptyFlag){ + changeColumn.append("fileColumn"); + }else if(CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList()) && CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList())){ + if(beforeCase.getCaseAttachList().size()!=afterCase.getCaseAttachList().size()){ + changeColumn.append("fileColumn"); + }else { + Map afterAttachMap = afterCase.getCaseAttachList().stream().collect(Collectors.toMap(CaseAttach::getAnnexPath, Function.identity(), (n1, n2) -> n2)); + + + for (CaseAttach beforeCaseAttach : beforeCase.getCaseAttachList()) { + if(!afterAttachMap.containsKey(beforeCaseAttach.getAnnexPath())) { + changeColumn.append("fileColumn"); + break; + } + } + } + + } compareCaseVO.setChangeColumn(changeColumn.toString()); @@ -347,7 +375,7 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService caseApplicationLog = caseApplicationLogMapper.selectByCaseIdAndVersion(vo.getCaseId(), vo.getVersion() ); }else { - caseApplicationLog = caseApplicationLogMapper.selectByCaseIdAndVersion(vo.getCaseId(), vo.getVersion() - 1); + caseApplicationLog = caseApplicationLogMapper.selectBeforeCase(vo.getCaseId(), vo.getVersion() ); } if (caseApplicationLog == null) { return; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index d9cc883..f557086 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -1096,24 +1096,28 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 异步新增案件日志 ThreadPoolUtil.execute(() -> { - caseApplication.setCaseAppliId(caseApplication.getId()); - int insertRow = caseApplicationLogMapper.insert(caseApplication); - if (insertRow != 0 ) { - if( CollectionUtil.isNotEmpty(caseAffiliates)) { - caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getId())); - // 插入案件日志人员相关表 - caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates); - } - if(CollectionUtil.isNotEmpty(caseAttachList)) { - // 插入日志附件表 - for (CaseAttach caseAttach : caseAttachList) { - // 查询附件表 - CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId()); - attach.setCaseAppliLogId(caseApplication.getId()); - caseAttachLogMapper.save(attach); + try { + caseApplication.setCaseAppliId(caseApplication.getId()); + int insertRow = caseApplicationLogMapper.insert(caseApplication); + if (insertRow != 0 ) { + if( CollectionUtil.isNotEmpty(caseAffiliates)) { + caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getId())); + // 插入案件日志人员相关表 + caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates); } + if(CollectionUtil.isNotEmpty(caseAttachList)) { + // 插入日志附件表 + for (CaseAttach caseAttach : caseAttachList) { + // 查询附件表 + CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId()); + attach.setCaseAppliLogId(caseApplication.getId()); + caseAttachLogMapper.save(attach); + } + } } + } catch (Exception e) { + throw new RuntimeException(e); } }); @@ -2762,25 +2766,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Transactional public List reserveConferenceList(Long caseId) { List reservedConferences = reservedConferenceMapper.selectListByCaseId(caseId); - List result = new ArrayList<>(); - // 判断当前时间是否大于结束时间,如果大于,则把该房间删掉 - if (CollectionUtil.isNotEmpty(reservedConferences)) { - List ids = new ArrayList<>(); - for (ReservedConference reservedConference : reservedConferences) { - Date endTime = reservedConference.getScheduleEndTime(); - Date now = new Date(); - if (now.after(endTime)) { - ids.add(reservedConference.getId()); - } else { - result.add(reservedConference); - } - } - if (CollectionUtil.isNotEmpty(ids)) { - // 根据id批量删除 - reservedConferenceMapper.batchDeleteByIds(ids); - } - } - return result; + + return reservedConferences; } /** diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationLogMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationLogMapper.xml index 96fed76..a86f3db 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationLogMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationLogMapper.xml @@ -48,6 +48,7 @@ + insert into case_application_log( @@ -69,6 +70,7 @@ create_by, version, update_submit_status, + proper_preser, create_time )values( #{caseAppliId}, @@ -89,6 +91,7 @@ #{createBy}, #{version}, #{updateSubmitStatus}, + #{properPreser}, sysdate() ) @@ -130,7 +133,7 @@ @@ -138,7 +141,7 @@ @@ -156,7 +159,7 @@ -- 2.54.0