diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java index 924418c..1b1f923 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java @@ -166,6 +166,10 @@ public class CaseApplication extends BaseEntity { /** 是否仲裁反请求 */ private Integer adjudicaCounter; + /** + * 仲裁反请求原因 + */ + private String adjudicaCounterReason; /** 被申请人是否缺席 */ private Integer isAbsence; @@ -178,6 +182,14 @@ public class CaseApplication extends BaseEntity { /** 申请人是否缺席 */ private Integer appliIsAbsen; + public String getAdjudicaCounterReason() { + return adjudicaCounterReason; + } + + public void setAdjudicaCounterReason(String adjudicaCounterReason) { + this.adjudicaCounterReason = adjudicaCounterReason; + } + public Integer getAppliIsAbsen() { return appliIsAbsen; } 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 c7d7541..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 @@ -18,6 +18,10 @@ public class CaseAttach { * 案件申请id */ private Long caseAppliId; + /** + * 案件记录id + */ + private Long caseAppliLogId; /** * 附件名称 */ @@ -46,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..fad99e3 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 @@ -21,6 +21,10 @@ public class ReservedConference { * 用户id */ private Long userId; + /** + * 用户名 + */ + private String userName; /** * 案件id */ @@ -39,6 +43,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/domain/dto/CaseEvidenceDTO.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CaseEvidenceDTO.java index bd65a9a..2a9caa3 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CaseEvidenceDTO.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CaseEvidenceDTO.java @@ -31,6 +31,10 @@ public class CaseEvidenceDTO { private Integer pendingAppointArbotrar; /** 是否仲裁反请求 */ private Integer adjudicaCounter; + /** + * 仲裁反请求原因 + */ + private String adjudicaCounterReason; /** 是否管辖异议申请 */ private Integer objectiJuris; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateMapper.java index 28b9fd8..d934a3c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateMapper.java @@ -35,4 +35,10 @@ public interface CaseAffiliateMapper { * @param affiliateLogList */ void updateCaseAffiliateByCaseId(@Param("caseAppliId")Long caseAppliId,@Param("list") List affiliateLogList); + + /** + * 根据案件id删除 + * @param caseId + */ + void deleteByCaseId(@Param("caseAppliId") Long caseId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationLogMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationLogMapper.java index d6b1c52..98310f2 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationLogMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationLogMapper.java @@ -43,4 +43,5 @@ public interface CaseApplicationLogMapper { */ void batchDeleteLog(@Param("ids") List ids); + CaseApplication selectBeforeCase(@Param("caseId") Long caseId, @Param("version")Integer version); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachLogMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachLogMapper.java new file mode 100644 index 0000000..9ea2b54 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachLogMapper.java @@ -0,0 +1,30 @@ +package com.ruoyi.wisdomarbitrate.mapper; + +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.CaseAttach; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface CaseAttachLogMapper { + int save(CaseAttach caseAttach); + + List queryAnnexPathByCaseId(Long id); + + List queryCaseAttachList(CaseApplication caseApplication); + + + int updateCaseAttach(CaseAttach caseAttach); + + int updateCaseAttachBycaseid(CaseAttach caseAttach); + + int deleteByFileIds(@Param("ids") List fileIds); + + List getCaseAttachByCaseIdAndType(CaseAttach caseAttach); + + CaseAttach queryAnnexById(Integer annexId); + + +} 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 f15d694..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 @@ -25,4 +25,11 @@ public interface CaseAttachMapper { List getCaseAttachByCaseIdAndType(CaseAttach caseAttach); CaseAttach queryAnnexById(Integer annexId); + + /** + * 根据案件id和附件类型删除和上传类型 + * @param caseAppliId + * @param 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 e94045b..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 @@ -3,12 +3,14 @@ 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; import com.ruoyi.common.utils.SmsUtils; import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.CaseAttach; import com.ruoyi.wisdomarbitrate.domain.SmsSendRecord; import com.ruoyi.wisdomarbitrate.domain.vo.CompareCaseVO; import com.ruoyi.wisdomarbitrate.domain.vo.UpdateSubmitVO; @@ -22,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; @@ -42,6 +45,10 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService @Autowired private CaseAffiliateMapper caseAffiliateMapper; @Autowired + private CaseAttachMapper caseAttachMapper; + @Autowired + private CaseAttachLogMapper caseAttachLogMapper; + @Autowired private SmsRecordMapper smsRecordMapper; @Override public int insert(CaseApplication caseApplicationLog) { @@ -105,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(); } // 同意,查询日志记录表本版本数据,将数据更新到主表,并将日志表改版本的状态改为同意 @@ -123,8 +132,24 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService // 更新相关人员主表 if(CollectionUtil.isNotEmpty(affiliateLogList)){ + caseAffiliateMapper.deleteByCaseId(vo.getCaseId()); for (CaseAffiliate caseAffiliate : affiliateLogList) { - caseAffiliateMapper.updataCaseAffiliate(caseAffiliate); + caseAffiliate.setCaseAppliId(vo.getCaseId()); + + } + caseAffiliateMapper.batchCaseAffiliate(affiliateLogList); + } + // // 根据caseLogId查询案件记录附件表 + CaseApplication caseApplication = new CaseApplication(); + caseApplication.setCaseLogId(caseApplicationLog.getCaseLogId()); + caseApplication.setAnnexType(2); + List attachLogList = caseAttachLogMapper.queryCaseAttachList(caseApplication); + // 更新记录附件表 + if(CollectionUtil.isNotEmpty(attachLogList)){ + // caseAttachMapper.deleteByCasedIdAndType(vo.getCaseId(), 2,0); + for (CaseAttach caseAttach : attachLogList) { + caseAttach.setCaseAppliId(vo.getCaseId()); + caseAttachMapper.updateCaseAttach(caseAttach); } } // caseAffiliateMapper.updateCaseAffiliateByCaseId(caseApplicationLog.getCaseAppliId(), affiliateLogList); @@ -177,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()); @@ -209,20 +233,29 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService public AjaxResult selectCompareCase(UpdateSubmitVO vo) { // 查询当前版本号和上一个版本号的案件 CaseApplication afterCase = caseApplicationLogMapper.selectByCaseIdAndVersion(vo.getCaseId(), vo.getVersion()); - CaseApplication beforeCase = caseApplicationLogMapper.selectByCaseIdAndVersion(vo.getCaseId(), vo.getVersion() - 1); + CaseApplication beforeCase = caseApplicationLogMapper.selectBeforeCase(vo.getCaseId(), vo.getVersion()); // 查询案件关联人员 beforeCase.setCaseAffiliates(caseAffiliateLogMapper.selectCaseAffiliate(beforeCase.getCaseLogId())); afterCase.setCaseAffiliates(caseAffiliateLogMapper.selectCaseAffiliate(afterCase.getCaseLogId())); + // 查询附件 + 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)); CompareCaseVO compareCaseVO = new CompareCaseVO(); compareCaseVO.setBeforeCase(beforeCase); compareCaseVO.setAfterCase(afterCase); // 对比两个版本修改的字段 String[] columns = {"caseSubjectAmount","loanStartDate", "loanEndDate","contractNumber","claimInterestOwed","claimLiquidDamag", "claimPrinciOwed","arbitratClaims","properPreser","requestRule"}; - String[] affiliateColumns = {"name", "identityNum","contactTelphone","contactAdress","workTelphone","workAddress", + String[] affiliateColumns = {"name", "identityNum","contactTelphone","contactAddress","workTelphone","workAddress", "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); @@ -241,6 +274,7 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService } } + // 对比人员字段 List beforeCaseCaseAffiliates = beforeCase.getCaseAffiliates(); List afterCaseCaseAffiliates = afterCase.getCaseAffiliates(); Map beforeCaseCaseAffiliateMap = null; @@ -257,8 +291,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) { @@ -302,8 +335,49 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService } + } + 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(afterCase.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()); + 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); } @@ -319,7 +393,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; @@ -330,13 +404,30 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService // 根据caseLogId查询相关人员表 List affiliateLogList = caseAffiliateLogMapper.selectCaseAffiliate(caseApplicationLog.getCaseLogId()); + // 更新案件主表 caseApplicationMapper.updataCaseApplication(caseApplicationLog); // 更新相关人员主表 if(CollectionUtil.isNotEmpty(affiliateLogList)){ + caseAffiliateMapper.deleteByCaseId(vo.getCaseId()); for (CaseAffiliate caseAffiliate : affiliateLogList) { - caseAffiliateMapper.updataCaseAffiliate(caseAffiliate); + caseAffiliate.setCaseAppliId(vo.getCaseId()); + + } + caseAffiliateMapper.batchCaseAffiliate(affiliateLogList); + } + // // 根据caseLogId查询案件记录附件表 + CaseApplication caseApplication = new CaseApplication(); + caseApplication.setCaseLogId(caseApplicationLog.getCaseLogId()); + caseApplication.setAnnexType(2); + List attachLogList = caseAttachLogMapper.queryCaseAttachList(caseApplication); + // 更新记录附件表 + if(CollectionUtil.isNotEmpty(attachLogList)){ + // caseAttachMapper.deleteByCasedIdAndType(vo.getCaseId(), 2,0); + for (CaseAttach caseAttach : attachLogList) { + caseAttach.setCaseAppliId(vo.getCaseId()); + 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 c44bb55..a649ba8 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 @@ -127,6 +127,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { private CaseApplicationLogMapper caseApplicationLogMapper; @Autowired private CaseAffiliateLogMapper caseAffiliateLogMapper; + @Autowired + private CaseAttachLogMapper caseAttachLogMapper; // 手机号正则 private static final Pattern TELEPHONE_REGX = Pattern.compile("^1(3\\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$"); @@ -978,7 +980,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); } }); @@ -1083,12 +1097,25 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } List caseAttachList = caseApplication.getCaseAttachList(); - if (caseAttachList != null && caseAttachList.size() > 0) { - for (CaseAttach caseAttach : caseAttachList) { - caseAttach.setCaseAppliId(caseApplication.getId()); - caseAttachMapper.updateCaseAttach(caseAttach); + // 立案申请状态直接修改主表信息 + if (caseAttachList != null && caseAttachList.size() > 0 + && caseApplication.getCaseStatus()!=null && caseApplication.getCaseStatus().equals(CaseApplicationConstants.CASE_APPLICATION)) { + 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()); @@ -1103,12 +1130,31 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 异步新增案件日志 ThreadPoolUtil.execute(() -> { - caseApplication.setCaseAppliId(caseApplication.getId()); - int insertRow = caseApplicationLogMapper.insert(caseApplication); - if (insertRow != 0 && CollectionUtil.isNotEmpty(caseAffiliates)) { - caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getId())); - // 插入案件日志人员相关表 - caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates); + 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)) { + 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); + } + } + + } + } + } catch (Exception e) { + throw new RuntimeException(e); } }); @@ -2722,8 +2768,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)); @@ -2757,25 +2803,36 @@ 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); + if (CollectionUtil.isEmpty(reservedConferences)) { + return reservedConferences; + } + Map userIdMap = null; + List userIds = reservedConferences.stream().map(ReservedConference::getUserId).collect(Collectors.toList()); + if(CollectionUtil.isNotEmpty(userIds)){ + // 根据userids查询用户名 + List userList = sysUserMapper.selectUserListByIds(userIds); + if(CollectionUtil.isNotEmpty(userList)){ + userIdMap = userList.stream().collect(Collectors.toMap(SysUser::getUserId,SysUser::getUserName)); } } - return result; + for (ReservedConference reservedConference : reservedConferences) { + if(null!=reservedConference.getUserId() && null!=userIdMap){ + reservedConference.setUserName(userIdMap.get(reservedConference.getUserId())); + } + Date startTime = reservedConference.getScheduleStartTime(); + if (null == startTime) { + continue; + } + long beforeMinutes = startTime.getTime() - 1000 * 60 * 5; + if (System.currentTimeMillis() < beforeMinutes) { + reservedConference.setIsBeforeFiveMinutes(true); + } else { + reservedConference.setIsBeforeFiveMinutes(false); + } + } + + + return reservedConferences; } /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java index 546eb05..09ea6f9 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java @@ -125,7 +125,14 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { } CaseAttach caseAttachselect = new CaseAttach(); caseAttachselect.setAnnexId(caseAttach.getAnnexId()); - caseAttachselect.setAnnexName(caseAttach.getAnnexName()); + String annexName = caseAttach.getAnnexName(); + if(StrUtil.isNotEmpty(annexName)) { + int startIndexnew = annexName.lastIndexOf("/"); + if (startIndexnew != -1) { + String annexNamenew = annexName.substring(startIndexnew + 1); + caseAttach.setAnnexName(annexNamenew); + } + } caseAttachselect.setAnnexType(caseAttach.getAnnexType()); return AjaxResult.success("上传成功", caseAttachselect); } catch (IOException e) { @@ -193,6 +200,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { caseApplication.setId(caseEvidenceDTO.getCaseId()); CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); if (caseApplication1 != null) { + caseApplication1.setAdjudicaCounterReason(caseEvidenceDTO.getAdjudicaCounterReason()); int caseStatus = caseApplication1.getCaseStatus(); caseApplication1.setObjectionAddEviden(caseEvidenceDTO.getObjectionAddEviden()); //默认书面审理 @@ -246,6 +254,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { .annexType(annexType) .userId(userId) .userName(userName) + .isBatchUpload(1) .build(); int count = caseAttachMapper.save(caseAttach); if (count > 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/CaseAffiliateMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml index 13e463a..6bed4f0 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml @@ -150,6 +150,9 @@ #{item} + + delete from case_affiliate where case_appli_id = #{caseAppliId} + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationLogMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationLogMapper.xml index 737823b..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 @@ @@ -153,6 +156,13 @@ FROM case_application_log WHERE case_appli_id = #{caseAppliId} and update_submit_status IN ( 1, 4 ) + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index d8fdb7a..f55c4ec 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, @@ -335,8 +335,8 @@ SELECT l.case_appli_id id, l.id AS caseLogId, - l.case_num, - l.case_subject_amount, + c.case_num, + c.case_subject_amount, c.register_date, c.arbitrat_method, CASE @@ -389,20 +389,20 @@ '待修改开庭时间' 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.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, - l.contract_number, - l.create_by, + c.contract_number, + c.create_by, c.create_time, - l.update_by, - l.update_time, + c.update_by, + c.update_time, c.arbitrator_name, ca.name, ca.application_organ_id , @@ -1455,6 +1455,7 @@ open_court_hear = #{openCourtHear}, hear_date = #{hearDate}, filearbitra_url = #{filearbitraUrl}, + adjudica_counter_reason = #{adjudicaCounterReason}, where id = #{id} @@ -1468,9 +1469,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 +1586,7 @@ order by c.create_time desc limit 1 + select * + from case_attach_log + where case_appli_log_id =#{id} + + + + + + + + + update case_attach_log + set + case_appli_log_id= #{caseAppliLogId} + where annex_id = #{annexId} + + + + update case_attach_log + + annex_name = #{annexName}, + annex_path = #{annexPath} + + + + AND case_appli_log_id = #{caseAppliLogId} + + + AND annex_type = #{annexType} + + + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml index 6901b84..78ae972 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml @@ -15,8 +15,8 @@ - INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status) - VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note},#{userId},#{userName},#{sealStatus}) + INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,is_batch_upload) + VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note},#{userId},#{userName},#{sealStatus},#{isBatchUpload}) delete from case_attach @@ -25,6 +25,14 @@ #{id} + + delete from case_attach + where case_appli_id = #{caseAppliId} + and annex_type = #{annexType} + + AND is_batch_upload = #{isBatchUpload} + +