Merge branch 'wq1' of SH-Arbitrate/Mediation-Backend into dev

This commit was merged in pull request #144.
This commit is contained in:
2024-04-18 13:57:14 +08:00
committed by Gitea
2 changed files with 79 additions and 58 deletions
@@ -74,6 +74,8 @@ import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import java.util.function.Function;
import java.util.stream.Collectors;
@@ -1609,6 +1611,11 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
application.setUpdateBy(SecurityUtils.getUsername());
application.setUpdateTime(new Date());
application.setBatchNumber(null);
msCaseApplicationMapper.updateByPrimaryKeySelective(application);
caseApplicationService.nextFlow(application.getId(), req.getCaseFlowId(),req.getLockStatus());
ExecutorService executor = ThreadUtil.createThreadPool();
CompletableFuture.runAsync(() -> {
// 给被申请人发送短信
if (affiliateMap.containsKey(application.getId())) {
List<MsCaseAffiliate> affiliates = affiliateMap.get(application.getId());
@@ -1620,9 +1627,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
);
SMSNotice notice = new SMSNotice(null,resNotice);
caseApplicationService.sendNotice(application,affiliates,false,notice);
}
msCaseApplicationMapper.updateByPrimaryKeySelective(application);
caseApplicationService.nextFlow(application.getId(), req.getCaseFlowId(),req.getLockStatus());
}}, executor);
}
/**
@@ -1639,6 +1644,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
if(selectApplication==null){
return;
}
ExecutorService executor = ThreadUtil.createThreadPool();
CompletableFuture.runAsync(() -> {
List<String> appPhones=new ArrayList<>();
List<String> resPhones=new ArrayList<>();
List<String> appEmails=new ArrayList<>();
@@ -1682,7 +1689,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
}
}
}
}
}}, executor);
}
/**
@@ -2125,6 +2132,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
msCaseApplicationMapper.updateByPrimaryKeySelective(application);
// 根据案件id查询案件
MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(application.getId());
long l = System.currentTimeMillis();
ExecutorService executor = ThreadUtil.createThreadPool();
CompletableFuture.runAsync(() -> {
// 发送开庭短信
if (CollectionUtil.isNotEmpty(vo.getHerDates())) {
List<MsCaseAffiliate> affiliates = selectAffliatesByCaseId(application.getId());
@@ -2132,8 +2142,11 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
// 申请人发送开庭日期短信
sendHearDateSms(caseApplication, affiliates);
}
}, executor);
// 调解员发送短信,根据调解员id查询用户
if (caseApplication.getMediatorId() != null) {
CompletableFuture.runAsync(() -> { if (caseApplication.getMediatorId() != null) {
// 线下调解 2077966 尊敬的用户,您的{1}案件,线下调解日期已确定为{2},请知晓,如非本人操作,请忽略本短信。
SysUser sysUser = sysUserMapper.selectUserById(caseApplication.getMediatorId());
String content = "尊敬的用户,您的" + caseApplication.getCaseNum() + "的案件,线下调解日期已确定为" + application.getHearDate() + ",请知晓,如非本人操作,请忽略本短信。";
@@ -2169,10 +2182,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
caseApplicationService.sendEmail(caseApplication, meditorAffliate, subject, content);
}
}
}
} }, executor);
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "");
}
@@ -2327,7 +2338,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
application.setRejectReason(reason);
if(application.getCaseFlowId()!=null && application.getCaseFlowId()==4){
// todo 超过五日还没有受理,给申请操作人发送不受理通知,有手机号发短信,没有手机号发邮箱
// 申请人不受理分配通知
// 申请人不受理分配通知 // todo 短信异步
ExecutorService executor = ThreadUtil.createThreadPool();
CompletableFuture.runAsync(() -> {
String rejectReason = application.getRejectReason() == null ? "" : application.getRejectReason();
SMSNoticeDO applicantNotice = new SMSNoticeDO("案件不受理通知",
"尊敬的用户,您编号为" + application.getCaseNum() + "的案件由于" + rejectReason + "所以不予受理,请知晓,如非本人操作,请忽略本短信。",
@@ -2337,6 +2350,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
SMSNotice notice = new SMSNotice(applicantNotice,null);
caseApplicationService.sendNotice(application,affiliates,true,notice);
}, executor);
// 修改案件状态为17,结束
MsCaseApplication caseApplication = new MsCaseApplication();
caseApplication.setId(id);
@@ -14,6 +14,7 @@ import com.ruoyi.common.enums.PaymentStatusEnum;
import com.ruoyi.common.enums.YesOrNoEnum;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.ThreadUtil;
import com.ruoyi.common.utils.spring.SpringUtils;
import com.ruoyi.dto.PayRequest;
import com.ruoyi.dto.PayResponse;
@@ -41,6 +42,8 @@ import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@@ -339,7 +342,8 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
}
casePaymentRecord.setCaseId(application.getId());
Example example = new Example(MsCasePaymentRecord.class);
example.createCriteria().andEqualTo("caseId", casePaymentRecord.getCaseId());casePaymentRecordMapper.updateByExampleSelective(casePaymentRecord, example);
example.createCriteria().andEqualTo("caseId", casePaymentRecord.getCaseId());
casePaymentRecordMapper.updateByExampleSelective(casePaymentRecord, example);
// 更改案件流程id和案件状态
application.setCaseFlowId(flow.getId());
application.setCaseStatusName(flow.getCaseStatusName());
@@ -379,6 +383,9 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
if(CollectionUtil.isEmpty(operatorList)){
throw new ServiceException("未找到案件操作人员");
}
// 异步发送短信
ExecutorService executor = ThreadUtil.createThreadPool();
CompletableFuture.runAsync(() -> {
if(dto.getApplicantConfirm()) {
List<String> appPhones=new ArrayList<>();
@@ -427,7 +434,7 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
}
}
}
}}, executor);
}