bug修复

This commit is contained in:
18792927508
2024-02-26 13:58:05 +08:00
parent da4a49956c
commit 86b8305dc2
4 changed files with 93 additions and 38 deletions
@@ -9,6 +9,7 @@ import java.util.List;
@Mapper @Mapper
public interface TemplateManageMapper { public interface TemplateManageMapper {
List<TemplateManage> selectTemplateList(TemplateManage templateManage); List<TemplateManage> selectTemplateList(TemplateManage templateManage);
List<TemplateManage> selectTemplateListByIds(@Param("fileIds") List<Long> fileIds);
int insertTemplateManage(TemplateManage templateManage); int insertTemplateManage(TemplateManage templateManage);
@@ -56,6 +57,13 @@ public interface TemplateManageMapper {
*/ */
void deleteTemplateManageFileById(@Param("id")Long id, @Param("fileIds")List<Long> annexIds); void deleteTemplateManageFileById(@Param("id")Long id, @Param("fileIds")List<Long> annexIds);
/**
* 根据id和附件类型删除
* @param id
* @param types
*/
void deleteTemplateManageFileByIdAndType(@Param("id")Long id, @Param("types")List<Integer> types);
/** /**
* 根据模板id和类型查询 * 根据模板id和类型查询
* @param templateId * @param templateId
@@ -427,11 +427,20 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
Long id = templateManage.getId(); Long id = templateManage.getId();
templateManage.setUpdateBy(getUsername()); templateManage.setUpdateBy(getUsername());
int i = templateManageMapper.updateTemplateManage(templateManage); int i = templateManageMapper.updateTemplateManage(templateManage);
// 先删除附件 // 先删除附件
if (CollectionUtil.isNotEmpty(templateManage.getAnnexIds())) { if (CollectionUtil.isNotEmpty(templateManage.getAnnexIds())) {
templateManageMapper.deleteTemplateManageFileById(id, templateManage.getAnnexIds()); // 根据附件id查询附件类型
// 修改附件表 List<TemplateManage> templateManages = templateManageMapper.selectTemplateListByIds(templateManage.getAnnexIds());
templateManageMapper.updateFileByIds(templateManage); if(CollectionUtil.isNotEmpty(templateManages)) {
List<Integer> types = templateManages.stream().map(TemplateManage::getTemType).collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(types)) {
// 根据模板id和类型删除附件
templateManageMapper.deleteTemplateManageFileByIdAndType(id, types);
// 修改附件表
templateManageMapper.updateFileByIds(templateManage);
}
}
} }
if (i > 0) { if (i > 0) {
@@ -1050,10 +1050,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
mediatorVO.setCompleteAmount(0L); mediatorVO.setCompleteAmount(0L);
} else if(caseMap.containsKey(user.getUserId())) { } else if(caseMap.containsKey(user.getUserId())) {
List<MsCaseApplication> applications = caseMap.get(user.getUserId()); List<MsCaseApplication> applications = caseMap.get(user.getUserId());
// 已办案件 // 待办案件
long count = applications.stream().filter(caseApplication -> !caseApplication.getCaseStatusName().equals("结束")).count(); long count = applications.stream().filter(caseApplication -> !caseApplication.getCaseStatusName().equals("结束")).count();
mediatorVO.setTodoAmount(applications.size()-count); mediatorVO.setCompleteAmount(applications.size()-count);
mediatorVO.setCompleteAmount(count); mediatorVO.setTodoAmount(count);
} }
mediatorVOS.add(mediatorVO); mediatorVOS.add(mediatorVO);
} }
@@ -1240,6 +1240,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
*/ */
@Transactional @Transactional
public void verifyMediator(MsCaseApplication application,BookingVO vo) { 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()); MsCaseFlow nextFlow = caseFlowMapper.nextFlow(vo.getCaseFlowId());
if (nextFlow == null) { if (nextFlow == null) {
throw new ServiceException("未找到下一个流程节点"); throw new ServiceException("未找到下一个流程节点");
@@ -1257,36 +1261,41 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
msCaseApplicationMapper.updateByPrimaryKeySelective(application); msCaseApplicationMapper.updateByPrimaryKeySelective(application);
// 根据案件id查询案件 // 根据案件id查询案件
MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(application.getId()); MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(application.getId());
MsCaseAffiliate affiliate = msCaseAffiliateMapper.selectByPrimaryKey(application.getId()); // 发送开庭短信
if(caseApplication==null || affiliate==null){ if(CollectionUtil.isNotEmpty(vo.getHerDates())) {
throw new ServiceException("未找到该案件");
}
// 申请人电话
String phone="";
if(affiliate.getOrganizeFlag().equals(0)){
// 自然人
if(StrUtil.isNotEmpty(affiliate.getContactTelphoneAgent())){
phone=affiliate.getContactTelphoneAgent();
}else {
phone=affiliate.getApplicationPhone();
}
}else { MsCaseAffiliate affiliate = msCaseAffiliateMapper.selectByPrimaryKey(application.getId());
phone=affiliate.getContactTelphoneAgent(); if (caseApplication == null || affiliate == null) {
} throw new ServiceException("未找到该案件");
caseApplication.setHearDate(application.getHearDate()); }
// 申请人发送开庭日期短信 // 申请人电话
sendHearDateSms(caseApplication,phone); String phone = "";
// 被申发送开庭日期短信 if (affiliate.getOrganizeFlag().equals(0)) {
sendHearDateSms(caseApplication,affiliate.getRespondentPhone()); // 自然人
// 调解员发送短信 if (StrUtil.isNotEmpty(affiliate.getContactTelphoneAgent())) {
// 根据调解员id查询用户 phone = affiliate.getContactTelphoneAgent();
if(caseApplication.getMediatorId()!=null) { } else {
SysUser sysUser = sysUserMapper.selectUserById(caseApplication.getMediatorId()); phone = affiliate.getApplicationPhone();
sendHearDateSms(caseApplication, sysUser.getPhonenumber()); }
} 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)){ if(StrUtil.isEmpty(phone)){
return; return;
} }
// 2075447 尊敬的用户,您的{1}案件,线上调解日期已确定为{2},请知晓,如非本人操作,请忽略本短信。 Boolean smsFlag =true;
Boolean smsFlag = SmsUtils.sendSms(application.getId(), "2075447", phone, new String[]{application.getCaseNum(),application.getHearDate()}); String sendContent="";
String sendContent = "尊敬的用户,您的" + application.getCaseNum() + "的案件,线上调解日期已确定为"+application.getHearDate()+",请知晓,如非本人操作,请忽略本短信。"; 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); SmsSendRecord smsSendRecord = new SmsSendRecord(application.getId(), application.getCaseNum(), phone, new Date(), sendContent);
if(smsFlag){ if(smsFlag){
smsSendRecord.setSendStatus(YesOrNoEnum.YES.getCode()); smsSendRecord.setSendStatus(YesOrNoEnum.YES.getCode());
@@ -64,7 +64,18 @@
</where> </where>
ORDER BY create_time DESC ORDER BY create_time DESC
</select> </select>
<select id="selectTemplateListByIds" resultMap="TemplateManageResult">
SELECT *
FROM ms_template_manage_file
<where>
<if test="fileIds != null">
and file_id in
<foreach collection="fileIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</where>
</select>
<select id="selectById" resultMap="TemplateManageResult"> <select id="selectById" resultMap="TemplateManageResult">
select * from ms_template_manage where id=#{id} select * from ms_template_manage where id=#{id}
</select> </select>
@@ -135,6 +146,14 @@
; ;
</delete> </delete>
<delete id="deleteTemplateManageFileByIdAndType">
delete from ms_template_manage_file where template_manage_id = #{id} and tem_type in
<foreach collection="types" item="it" open="(" separator="," close=")">
#{it}
</foreach>
;
</delete>
<select id="selectByIdAndType" resultMap="TemplateManageResult"> <select id="selectByIdAndType" resultMap="TemplateManageResult">
select f.* from ms_template_manage m join ms_template_manage_file f on m.id=f.template_manage_id select f.* from ms_template_manage m join ms_template_manage_file f on m.id=f.template_manage_id