From c39cd5babd3dca9180254676f1a9391415629d9d Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Fri, 24 Nov 2023 19:22:32 +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 --- .../wisdomarbitrate/domain/CaseAttach.java | 4 ++ .../domain/ReservedConference.java | 4 ++ .../mapper/CaseAttachMapper.java | 4 +- .../impl/CaseApplicationLogServiceImpl.java | 34 +++++++--- .../impl/CaseApplicationServiceImpl.java | 64 +++++++++++++++---- .../service/impl/CaseEvidenceServiceImpl.java | 10 ++- .../service/impl/VideoServiceImpl.java | 3 + .../wisdomarbitrate/CaseApplicationMapper.xml | 16 ++--- .../wisdomarbitrate/CaseAttachLogMapper.xml | 8 +-- .../wisdomarbitrate/CaseAttachMapper.xml | 7 +- 10 files changed, 116 insertions(+), 38 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java index 9911399..e39680a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java @@ -50,5 +50,9 @@ public class CaseAttach { * 印章状态(0未启用,1已启用) */ private Integer sealStatus; + /** + * 是否是证据上传,0-否,1-是 + */ + private Integer isBatchUpload; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ReservedConference.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ReservedConference.java index a759582..2e43d86 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ReservedConference.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ReservedConference.java @@ -39,6 +39,10 @@ public class ReservedConference { */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date scheduleEndTime; + /** + * 是否超过5分钟 + */ + private Boolean isBeforeFiveMinutes; public ReservedConference() { diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java index 872f6db..1b939b8 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java @@ -27,9 +27,9 @@ public interface CaseAttachMapper { CaseAttach queryAnnexById(Integer annexId); /** - * 根据案件id和附件类型删除 + * 根据案件id和附件类型删除和上传类型 * @param caseAppliId * @param annexType */ - void deleteByCasedIdAndType(@Param("caseAppliId")Long caseAppliId,@Param("annexType") int annexType); + void deleteByCasedIdAndType(@Param("caseAppliId")Long caseAppliId,@Param("annexType") int annexType,@Param("isBatchUpload") int isBatchUpload); } 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 e6ca056..c121b54 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 @@ -146,10 +146,10 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService List attachLogList = caseAttachLogMapper.queryCaseAttachList(caseApplication); // 更新记录附件表 if(CollectionUtil.isNotEmpty(attachLogList)){ - caseAttachMapper.deleteByCasedIdAndType(vo.getCaseId(), 2); + // caseAttachMapper.deleteByCasedIdAndType(vo.getCaseId(), 2,0); for (CaseAttach caseAttach : attachLogList) { caseAttach.setCaseAppliId(vo.getCaseId()); - caseAttachMapper.save(caseAttach); + caseAttachMapper.updateCaseAttach(caseAttach); } } // caseAffiliateMapper.updateCaseAffiliateByCaseId(caseApplicationLog.getCaseAppliId(), affiliateLogList); @@ -202,7 +202,6 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService return AjaxResult.success(); } - // todo 给申请人发送短信 SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); request.setTemplateId("1996949"); request.setPhone(caseAffiliate.getContactTelphone()); @@ -337,12 +336,12 @@ 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()); + boolean notEmptyFlag = CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList()) && CollectionUtil.isEmpty(afterCase.getCaseAttachList()); + boolean emptyFlag = CollectionUtil.isEmpty(beforeCase.getCaseAttachList()) && CollectionUtil.isNotEmpty(afterCase.getCaseAttachList()); // 对比附件 if(notEmptyFlag || emptyFlag){ changeColumn.append("fileColumn"); - }else if(CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList()) && CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList())){ + }else if(CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList()) && CollectionUtil.isNotEmpty(afterCase.getCaseAttachList())){ if(beforeCase.getCaseAttachList().size()!=afterCase.getCaseAttachList().size()){ changeColumn.append("fileColumn"); }else { @@ -360,6 +359,25 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService } compareCaseVO.setChangeColumn(changeColumn.toString()); + if(CollectionUtil.isNotEmpty(afterCase.getCaseAttachList())){ + List caseAttachList = afterCase.getCaseAttachList(); + for (CaseAttach attach : caseAttachList) { + String annexName = attach.getAnnexName(); + String prefix = "/profile"; + int startIndex = annexName.indexOf(prefix); + startIndex += prefix.length(); + String annexPath = "/uploadPath" + annexName.substring(startIndex); + attach.setAnnexPath(annexPath); + int startIndexnew = annexName.lastIndexOf("/"); + if (startIndexnew != -1) { + String annexNamenew = annexName.substring(startIndexnew + 1); + attach.setAnnexName(annexNamenew); + } + + + } + afterCase.setCaseAttachList(caseAttachList); + } return AjaxResult.success(compareCaseVO); } @@ -406,10 +424,10 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService List attachLogList = caseAttachLogMapper.queryCaseAttachList(caseApplication); // 更新记录附件表 if(CollectionUtil.isNotEmpty(attachLogList)){ - caseAttachMapper.deleteByCasedIdAndType(vo.getCaseId(), 2); + // caseAttachMapper.deleteByCasedIdAndType(vo.getCaseId(), 2,0); for (CaseAttach caseAttach : attachLogList) { caseAttach.setCaseAppliId(vo.getCaseId()); - caseAttachMapper.save(caseAttach); + caseAttachMapper.updateCaseAttach(caseAttach); } } // caseAffiliateMapper.updateCaseAffiliateByCaseId(caseApplicationLog.getCaseAppliId(), affiliateLogList); 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 f557086..8512ffd 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 @@ -969,7 +969,19 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { if (insertRow != 0 && CollectionUtil.isNotEmpty(caseAffiliates)) { caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getId())); // 插入案件日志人员相关表 - caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates); + if(CollectionUtil.isNotEmpty(caseAttachList)) { + List filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList()); + // 插入日志附件表 + if(CollectionUtil.isNotEmpty(filterList)) { + for (CaseAttach caseAttach : filterList) { + // 查询附件表 + CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId()); + attach.setCaseAppliLogId(caseApplication.getId()); + caseAttachLogMapper.save(attach); + } + } + + } caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates); } }); @@ -1077,11 +1089,22 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 立案申请状态直接修改主表信息 if (caseAttachList != null && caseAttachList.size() > 0 && caseApplication.getCaseStatus()!=null && caseApplication.getCaseStatus().equals(CaseApplicationConstants.CASE_APPLICATION)) { - for (CaseAttach caseAttach : caseAttachList) { - caseAttach.setCaseAppliId(caseApplication.getId()); - caseAttachMapper.updateCaseAttach(caseAttach); + List filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList()); + if(CollectionUtil.isNotEmpty(filterList)){ + // 先删除2的附件在新增 +// caseAttachMapper.deleteByCasedIdAndType(caseApplication.getId(),2,0); +// for (CaseAttach caseAttach : filterList) { +// caseAttach.setCaseAppliId(caseApplication.getId()); +// caseAttachMapper.save(caseAttach); +// } + + for (CaseAttach caseAttach : caseAttachList) { + caseAttach.setCaseAppliId(caseApplication.getId()); + caseAttachMapper.updateCaseAttach(caseAttach); + } } + } // 根据案件id查询最新版本号 Integer maxVersion = caseApplicationLogMapper.selectMaxVersionByCaseId(caseApplication.getId()); @@ -1106,13 +1129,16 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates); } if(CollectionUtil.isNotEmpty(caseAttachList)) { + List filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList()); // 插入日志附件表 - for (CaseAttach caseAttach : caseAttachList) { - // 查询附件表 - CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId()); - attach.setCaseAppliLogId(caseApplication.getId()); - caseAttachLogMapper.save(attach); - } + if(CollectionUtil.isNotEmpty(filterList)) { + for (CaseAttach caseAttach : filterList) { + // 查询附件表 + CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId()); + attach.setCaseAppliLogId(caseApplication.getId()); + caseAttachLogMapper.save(attach); + } + } } } @@ -2731,8 +2757,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { public long createRoomId(Long caseId) { long roomId = generateRoomId(); // 新增预约会议表 -// ReservedConference conference = new ReservedConference(caseId, roomId, -// null, null,0); +// ReservedConference conference = new ReservedConference(caseId, SecurityUtils.getUserId(),roomId, +// null, null); // reservedConferenceMapper.insert(conference); // 绑定案件与房间号 caseApplicationMapper.bindCaseId(caseId, String.valueOf(roomId)); @@ -2766,6 +2792,19 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Transactional public List reserveConferenceList(Long caseId) { List reservedConferences = reservedConferenceMapper.selectListByCaseId(caseId); + if(CollectionUtil.isNotEmpty(reservedConferences)){ + for (ReservedConference reservedConference : reservedConferences) { + Date startTime = reservedConference.getScheduleStartTime(); + if(null != startTime){ + long beforeMinutes = startTime.getTime() - 1000 * 60 * 5; + if(System.currentTimeMillis() 0 && annexType != null && annexType != 8) { diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java index 8d2ca25..c0485f7 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java @@ -365,7 +365,9 @@ public class VideoServiceImpl implements VideoService { staticAndMksDir = Paths.get(absPath).toFile().toString(); long downloadFile = HttpUtil.downloadFile(fileUrl, staticAndMksDir); if(downloadFile>0) { + log.info("下载成功roomId"+roomId); Long caseId = caseApplicationMapper.selectCaseIdByRoomId(roomId); + log.info("下载成功caseId"+caseId); String annexName = getPathFileName(RuoYiConfig.getVideoUploadPath(), fileName); // 存入数据库 CaseAttach caseAttach = CaseAttach.builder().caseAppliId(caseId) @@ -374,6 +376,7 @@ public class VideoServiceImpl implements VideoService { .annexType(9) .build(); caseAttachMapper.save(caseAttach); + log.info("保存附件号成功"); return annexName; } } diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index f9123fd..e09a148 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -162,7 +162,7 @@ - select c.id ,l.id AS caseLogId,c.case_num ,l.case_subject_amount ,c.register_date ,c.arbitrat_method , + select c.id ,l.id AS caseLogId,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method , CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理' ELSE '无审理方式' END arbitratMethodName, @@ -176,10 +176,10 @@ when 31 then '待修改开庭时间' ELSE '无案件状态' END caseStatusName, - c.hear_date ,l.arbitrat_claims , - l.loan_start_date ,l.loan_end_date ,l.claim_princi_owed ,l.claim_interest_owed ,l.claim_liquid_damag - ,l.fee_payable , - c.begin_video_date ,c.online_video_person ,l.contract_number ,c.create_by ,c.create_time , + c.hear_date ,c.arbitrat_claims , + c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag + ,c.fee_payable , + c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time , c.update_by ,c.update_time , c.arbitrator_name,ca.name,ca.application_organ_id,ca.application_organ_name as applicantName, @@ -1468,9 +1468,9 @@ update case_application set lock_status=#{lockStatus} where id = #{id} - + update case_application set room_id=#{roomId} where id = #{caseId} - update case_application set room_id= CONCAT(room_id,',',#{roomId}) where id =#{caseId} + update case_application set version = #{version} where id = #{id} @@ -1585,7 +1585,7 @@ order by c.create_time desc limit 1 - select annex_id,case_appli_log_id,annex_name,annex_path,annex_type,note,use_id,use_account + select * from case_attach_log where case_appli_log_id =#{id} @@ -65,7 +65,7 @@ -- 2.54.0