From 86b8305dc20c6cc5cef5bfedacb0c1b6634ba6d4 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Mon, 26 Feb 2024 13:58:05 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/template/TemplateManageMapper.java | 8 ++ .../dept/impl/DeptIdentifyServiceImpl.java | 15 +++- .../impl/MsCaseApplicationServiceImpl.java | 87 +++++++++++-------- .../template/TemplateManageMapper.xml | 21 ++++- 4 files changed, 93 insertions(+), 38 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/template/TemplateManageMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/template/TemplateManageMapper.java index 392cf0b..1a9d113 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/template/TemplateManageMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/template/TemplateManageMapper.java @@ -9,6 +9,7 @@ import java.util.List; @Mapper public interface TemplateManageMapper { List selectTemplateList(TemplateManage templateManage); + List selectTemplateListByIds(@Param("fileIds") List fileIds); int insertTemplateManage(TemplateManage templateManage); @@ -56,6 +57,13 @@ public interface TemplateManageMapper { */ void deleteTemplateManageFileById(@Param("id")Long id, @Param("fileIds")List annexIds); + /** + * 根据id和附件类型删除 + * @param id + * @param types + */ + void deleteTemplateManageFileByIdAndType(@Param("id")Long id, @Param("types")List types); + /** * 根据模板id和类型查询 * @param templateId diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/dept/impl/DeptIdentifyServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/dept/impl/DeptIdentifyServiceImpl.java index 0dbc074..a1a44fb 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/dept/impl/DeptIdentifyServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/dept/impl/DeptIdentifyServiceImpl.java @@ -427,11 +427,20 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService { Long id = templateManage.getId(); templateManage.setUpdateBy(getUsername()); int i = templateManageMapper.updateTemplateManage(templateManage); + // 先删除附件 if (CollectionUtil.isNotEmpty(templateManage.getAnnexIds())) { - templateManageMapper.deleteTemplateManageFileById(id, templateManage.getAnnexIds()); - // 修改附件表 - templateManageMapper.updateFileByIds(templateManage); + // 根据附件id查询附件类型 + List templateManages = templateManageMapper.selectTemplateListByIds(templateManage.getAnnexIds()); + if(CollectionUtil.isNotEmpty(templateManages)) { + List types = templateManages.stream().map(TemplateManage::getTemType).collect(Collectors.toList()); + if(CollectionUtil.isNotEmpty(types)) { + // 根据模板id和类型删除附件 + templateManageMapper.deleteTemplateManageFileByIdAndType(id, types); + // 修改附件表 + templateManageMapper.updateFileByIds(templateManage); + } + } } if (i > 0) { diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java index f34c0f1..46f5fef 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java @@ -1050,10 +1050,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { mediatorVO.setCompleteAmount(0L); } else if(caseMap.containsKey(user.getUserId())) { List applications = caseMap.get(user.getUserId()); - // 已办案件 + // 待办案件 long count = applications.stream().filter(caseApplication -> !caseApplication.getCaseStatusName().equals("结束")).count(); - mediatorVO.setTodoAmount(applications.size()-count); - mediatorVO.setCompleteAmount(count); + mediatorVO.setCompleteAmount(applications.size()-count); + mediatorVO.setTodoAmount(count); } mediatorVOS.add(mediatorVO); } @@ -1240,6 +1240,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { */ @Transactional public void verifyMediator(MsCaseApplication application,BookingVO vo) { + MsCaseFlow currentFlow = caseFlowMapper.selectByPrimaryKey(vo.getCaseFlowId()); + if (currentFlow == null) { + throw new ServiceException("未找到当前流程节点"); + } MsCaseFlow nextFlow = caseFlowMapper.nextFlow(vo.getCaseFlowId()); if (nextFlow == null) { throw new ServiceException("未找到下一个流程节点"); @@ -1257,36 +1261,41 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { msCaseApplicationMapper.updateByPrimaryKeySelective(application); // 根据案件id查询案件 MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(application.getId()); - MsCaseAffiliate affiliate = msCaseAffiliateMapper.selectByPrimaryKey(application.getId()); - if(caseApplication==null || affiliate==null){ - throw new ServiceException("未找到该案件"); - } - // 申请人电话 - String phone=""; - if(affiliate.getOrganizeFlag().equals(0)){ - // 自然人 - if(StrUtil.isNotEmpty(affiliate.getContactTelphoneAgent())){ - phone=affiliate.getContactTelphoneAgent(); - }else { - phone=affiliate.getApplicationPhone(); - } + // 发送开庭短信 + if(CollectionUtil.isNotEmpty(vo.getHerDates())) { - }else { - phone=affiliate.getContactTelphoneAgent(); - } - caseApplication.setHearDate(application.getHearDate()); - // 申请人发送开庭日期短信 - sendHearDateSms(caseApplication,phone); - // 被申发送开庭日期短信 - sendHearDateSms(caseApplication,affiliate.getRespondentPhone()); - // 调解员发送短信 - // 根据调解员id查询用户 - if(caseApplication.getMediatorId()!=null) { - SysUser sysUser = sysUserMapper.selectUserById(caseApplication.getMediatorId()); - sendHearDateSms(caseApplication, sysUser.getPhonenumber()); + MsCaseAffiliate affiliate = msCaseAffiliateMapper.selectByPrimaryKey(application.getId()); + if (caseApplication == null || affiliate == null) { + throw new ServiceException("未找到该案件"); + } + // 申请人电话 + String phone = ""; + if (affiliate.getOrganizeFlag().equals(0)) { + // 自然人 + if (StrUtil.isNotEmpty(affiliate.getContactTelphoneAgent())) { + phone = affiliate.getContactTelphoneAgent(); + } else { + phone = affiliate.getApplicationPhone(); + } + + } else { + phone = affiliate.getContactTelphoneAgent(); + } + caseApplication.setHearDate(application.getHearDate()); + // 申请人发送开庭日期短信 + sendHearDateSms(caseApplication, phone); + // 被申发送开庭日期短信 + sendHearDateSms(caseApplication, affiliate.getRespondentPhone()); + // 调解员发送短信 + // 根据调解员id查询用户 + if (caseApplication.getMediatorId() != null) { + SysUser sysUser = sysUserMapper.selectUserById(caseApplication.getMediatorId()); + sendHearDateSms(caseApplication, sysUser.getPhonenumber()); + } } // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(), ""); + + CaseLogUtils.insertCaseLog(caseApplication.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), ""); } @@ -1299,10 +1308,20 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { if(StrUtil.isEmpty(phone)){ return; } - // 2075447 尊敬的用户,您的{1}案件,线上调解日期已确定为{2},请知晓,如非本人操作,请忽略本短信。 - Boolean smsFlag = SmsUtils.sendSms(application.getId(), "2075447", phone, new String[]{application.getCaseNum(),application.getHearDate()}); - String sendContent = "尊敬的用户,您的" + application.getCaseNum() + "的案件,线上调解日期已确定为"+application.getHearDate()+",请知晓,如非本人操作,请忽略本短信。"; - // 新增短信记录 + Boolean smsFlag =true; + String sendContent=""; + if(StrUtil.isNotEmpty(application.getMediationMethod()) && application.getMediationMethod().equals("1")){ + + // 线上调解 2075447 尊敬的用户,您的{1}案件,线上调解日期已确定为{2},请知晓,如非本人操作,请忽略本短信。 + smsFlag = SmsUtils.sendSms(application.getId(), "2075447", phone, new String[]{application.getCaseNum(),application.getHearDate()}); + sendContent = "尊敬的用户,您的" + application.getCaseNum() + "的案件,线上调解日期已确定为"+application.getHearDate()+",请知晓,如非本人操作,请忽略本短信。"; + }else { + // 线下调解 2077966 尊敬的用户,您的{1}案件,线下调解日期已确定为{2},请知晓,如非本人操作,请忽略本短信。 + smsFlag = SmsUtils.sendSms(application.getId(), "2075447", phone, new String[]{application.getCaseNum(),application.getHearDate()}); + sendContent = "尊敬的用户,您的" + application.getCaseNum() + "的案件,线下调解日期已确定为"+application.getHearDate()+",请知晓,如非本人操作,请忽略本短信。"; + + } + // 新增短信记录 SmsSendRecord smsSendRecord = new SmsSendRecord(application.getId(), application.getCaseNum(), phone, new Date(), sendContent); if(smsFlag){ smsSendRecord.setSendStatus(YesOrNoEnum.YES.getCode()); diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/template/TemplateManageMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/template/TemplateManageMapper.xml index 52575d2..8675bc3 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/template/TemplateManageMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/template/TemplateManageMapper.xml @@ -64,7 +64,18 @@ ORDER BY create_time DESC - + @@ -135,6 +146,14 @@ ; + + delete from ms_template_manage_file where template_manage_id = #{id} and tem_type in + + #{it} + + + ; +