bug修复 #152

Merged
wangqiong123 merged 1 commits from wq1 into dev 2024-04-25 10:16:28 +00:00
8 changed files with 177 additions and 54 deletions
@@ -41,8 +41,7 @@ public class IdentityAuthenticationController extends BaseController {
@Anonymous @Anonymous
@GetMapping("/selectPCEIDtokenStatus") @GetMapping("/selectPCEIDtokenStatus")
public AjaxResult selectPCEIDtokenStatus(@RequestParam String eidToken) { public AjaxResult selectPCEIDtokenStatus(@RequestParam String eidToken) {
JSONObject tokenResult = identityAuthenticationService.selectPCEIDtokenStatus(eidToken); return identityAuthenticationService.selectPCEIDtokenStatus(eidToken);
return success(tokenResult);
} }
/** /**
@@ -250,7 +250,7 @@ public class MsCaseApplicationController extends BaseController {
* @return * @return
*/ */
@GetMapping("/listMediator") @GetMapping("/listMediator")
public AjaxResult listMediator( @RequestParam(value = "caseAppliId",required = false) Long caseAppliId) { public AjaxResult listMediator( @RequestParam(value = "caseAppliId",required = true) Long caseAppliId) {
return caseApplicationService.listMediator(caseAppliId); return caseApplicationService.listMediator(caseAppliId);
} }
/** /**
@@ -310,7 +310,7 @@ public class MsCaseApplicationController extends BaseController {
*/ */
@PostMapping("/mediation") @PostMapping("/mediation")
public AjaxResult mediation(@RequestBody MsCaseApplicationReq req) throws EsignDemoException, InterruptedException { public AjaxResult mediation(@RequestBody MsCaseApplicationReq req) throws EsignDemoException, InterruptedException {
if (req.getCaseFlowId() == null || req.getId() == null || req.getMediaResult()==null) { if (req.getCaseFlowId() == null || req.getId() == null ) {
return error("参数校验失败"); return error("参数校验失败");
} }
@@ -175,7 +175,7 @@ identityAuthentication:
# 小程序端人脸核身商户id # 小程序端人脸核身商户id
merchantId: 0NSJ2309281116194321 merchantId: 0NSJ2309281116194321
# pc端人脸核身商户id # pc端人脸核身商户id
pcMerchantId: 0NSJ2309281116194321 pcMerchantId: 0NSJ2404231626029804
privateKeyHexDecodeinfo: 4c3b311bf7b98969994e85928e069574a1e95777f24d1c510679cc3c2f460faf privateKeyHexDecodeinfo: 4c3b311bf7b98969994e85928e069574a1e95777f24d1c510679cc3c2f460faf
# 腾讯云即时通信相关配置 # 腾讯云即时通信相关配置
imConfig: imConfig:
@@ -84,11 +84,11 @@ public class MsCaseApplicationVO extends MsCaseApplication {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
private Date endTime; private Date endTime;
/** /**
* 是否申请操作人,0-否,1-是 * 是否申请操作人签名按钮权限,0-否,1-是
*/ */
private Integer appOperatorFlag; private Integer appOperatorFlag;
/** /**
* 是否被申请操作人,0-否,1-是 * 是否被申请操作人签名按钮权限,0-否,1-是
*/ */
private Integer resOperatorFlag; private Integer resOperatorFlag;
/** /**
@@ -99,5 +99,9 @@ public class MsCaseApplicationVO extends MsCaseApplication {
* 调解书上传下载按钮权限,调解员,顾问在调节之后,送达之前显示,0-否,1-是 * 调解书上传下载按钮权限,调解员,顾问在调节之后,送达之前显示,0-否,1-是
*/ */
private Integer mediationFileFlag=0; private Integer mediationFileFlag=0;
/**
* 是否申请人被申请人签收按钮权限,0-否,1-是
*/
private Integer signFlag=0;
} }
@@ -36,5 +36,5 @@ public interface IdentityAuthenticationService {
* H5轮询获取EIDtoken状态 * H5轮询获取EIDtoken状态
* @return * @return
*/ */
JSONObject selectPCEIDtokenStatus(String eidToken); AjaxResult selectPCEIDtokenStatus(String eidToken);
} }
@@ -231,10 +231,12 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthentication
} }
@Override @Override
public JSONObject selectPCEIDtokenStatus(String eidToken) { public AjaxResult selectPCEIDtokenStatus(String eidToken) {
// todo 送达时需要判断是否有pdf版的调解书,没有则不送达,签名完后下载pdf时不删除之前的doc调解书,上传调解书时,pdf的需要将类型设为13,异步发送短信邮件时将登录用户传参过来 // todo 送达时需要判断是否有pdf版的调解书,没有则不送达,签名完后下载pdf时不删除之前的doc调解书,上传调解书时,pdf的需要将类型设为13,异步发送短信邮件时将登录用户传参过来
// todo E证通审核过后将PC端的机器id在YML文件中改掉 // todo E证通审核过后将PC端的机器id在YML文件中改掉
JSONObject objJSON = null; JSONObject objJSON = null;
IdentityAuthentication authentication = new IdentityAuthentication();
try { try {
Credential cred = new Credential(credentialSecretId, credentialSecretKey); Credential cred = new Credential(credentialSecretId, credentialSecretKey);
// 实例化一个http选项,可选的,没有特殊需求可以跳过 // 实例化一个http选项,可选的,没有特殊需求可以跳过
@@ -254,11 +256,62 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthentication
String s = GetEidResultResponse.toJsonString(resp); String s = GetEidResultResponse.toJsonString(resp);
if(StrUtil.isNotEmpty(s)) { if(StrUtil.isNotEmpty(s)) {
objJSON = JSON.parseObject(s); objJSON = JSON.parseObject(s);
JSONObject text = objJSON.getJSONObject("Text");
if (text != null) {
Integer comparestatus = text.getInteger("Comparestatus");
if (comparestatus != null && comparestatus == 0) {
JSONObject eidInfo = objJSON.getJSONObject("EidInfo");
if (eidInfo != null) {
String desKey = eidInfo.getString("DesKey");
String userInfo = eidInfo.getString("UserInfo");
//1.解密用户的信息
JSONObject info = DecodeUserInfo(desKey, userInfo);
if (info != null) {
String idcardno = info.getString("idnum");
String name = info.getString("name");
//2.在用户认证表中插入用户认证记录
// LoginUser loginUser = SecurityUtils.getLoginUser();
/**
* 用户名
* 用户名id
* 姓名
* 身份证号
* 认证时间
* 认证状态0表示成功
* 请求id
*/
// authentication.setUserName(loginUser.getUsername());
// authentication.setUserId(loginUser.getUserId());
authentication.setIdentityNo(idcardno);
// 查询认证表是否已存在该身份证信息的认证,不存在则新增,存在不处理
IdentityAuthentication identityAuthentication = identityAuthenticationMapper.selectIdentityAuthentication(authentication);
if(identityAuthentication!=null) {
return AjaxResult.success(identityAuthentication);
}
authentication.setName(name);
authentication.setCertificationTime(new Date());
authentication.setCertificationStatus(0);
authentication.setCreateBy(name);
// authentication.setCreateBy(loginUser.getUsername());
try {
identityAuthenticationMapper.insertIdentityAuthentication(authentication);
authentication.setId(authentication.getId());
} catch (Exception e) {
System.out.println("认证记录新增失败");
}
}
}
}
}
return AjaxResult.success(authentication);
} }
} catch (TencentCloudSDKException e) { } catch (TencentCloudSDKException e) {
throw new ServiceException("获取E证通Token状态失败"); return AjaxResult.error(e.getMessage());
} }
return objJSON; return AjaxResult.error("认证失败");
} }
@@ -316,10 +316,14 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
vo.setAppOperatorFlag(0); vo.setAppOperatorFlag(0);
} }
} }
// 签收按钮权限
if(affiliate.getUserId().equals(loginUserId) &&vo.getCaseStatusName().contains("签收")){
vo.setSignFlag(1);
}
} }
if (vo.getResOperatorFlag() == null && (affiliate.getRoleType() == 3 || affiliate.getRoleType() == 4)) { if (vo.getResOperatorFlag() == null && (affiliate.getRoleType() == 3 || affiliate.getRoleType() == 4)) {
// 申请人操作人 // 被申请人操作人
if(Objects.equals(affiliate.getUserId(), loginUserId) &&!vo.getCaseStatusName().equals("待签名")){ if(Objects.equals(affiliate.getUserId(), loginUserId) &&!vo.getCaseStatusName().equals("待签名")){
vo.setResOperatorFlag(1); vo.setResOperatorFlag(1);
}else if(vo.getCaseStatusName().equals("待签名")) { }else if(vo.getCaseStatusName().equals("待签名")) {
@@ -329,7 +333,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
vo.setResOperatorFlag(0); vo.setResOperatorFlag(0);
} }
} }
// 签收按钮权限
if(affiliate.getUserId().equals(loginUserId) &&vo.getCaseStatusName().contains("签收")){
vo.setSignFlag(1);
}
} }
} }
if(affiliate.getOrganizeFlag()==null || affiliate.getOrganizeFlag()!=1) { if(affiliate.getOrganizeFlag()==null || affiliate.getOrganizeFlag()!=1) {
@@ -387,7 +394,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
){ ){
vo.setOtherFlag(1); vo.setOtherFlag(1);
} }
if(role.getRoleName().equals("法律顾问")){ if(role.getRoleName().equals("法律顾问") && mediatorSort!=null && sendSort!=null
&& null!=flowNameMap.get(vo.getCaseStatusName())
&& flowNameMap.get(vo.getCaseStatusName())>mediatorSort
&& flowNameMap.get(vo.getCaseStatusName())<=sendSort){
// 顾问可以上传下载调解书 // 顾问可以上传下载调解书
vo.setMediationFileFlag(1); vo.setMediationFileFlag(1);
} }
@@ -1363,7 +1373,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
} }
} }
if(StrUtil.isNotEmpty(applicant.getIdCard())){
setBirthByIdentityNum(applicant);
}
affiliateVO.setApplicant(applicantList); affiliateVO.setApplicant(applicantList);
// 如果身份证不为空,设置生日和性别 // 如果身份证不为空,设置生日和性别
@@ -1727,6 +1739,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
@Override @Override
@Transactional @Transactional
public void sendEmail(MsCaseApplication application, MsCaseAffiliate affiliate, String subject, String sendContent) { public void sendEmail(MsCaseApplication application, MsCaseAffiliate affiliate, String subject, String sendContent) {
if(StrUtil.isEmpty(affiliate.getEmail())){
return;
}
boolean emailFlag = emailOutUtil.sendMessage(affiliate.getEmail(), subject, sendContent, null, null); boolean emailFlag = emailOutUtil.sendMessage(affiliate.getEmail(), subject, sendContent, null, null);
SendMailRecord sendMailRecord = new SendMailRecord(); SendMailRecord sendMailRecord = new SendMailRecord();
@@ -1897,18 +1912,22 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
if (CollectionUtil.isNotEmpty(caseApplicationList)) { if (CollectionUtil.isNotEmpty(caseApplicationList)) {
caseMap = caseApplicationList.stream().collect(Collectors.groupingBy(MsCaseApplication::getMediatorId, Collectors.toList())); caseMap = caseApplicationList.stream().collect(Collectors.groupingBy(MsCaseApplication::getMediatorId, Collectors.toList()));
} }
if(caseAppliId!=null) {
// 查询该用户是否是操作人,是申请操作人还是被申请操作人 // 查询该用户是否是操作人,是申请操作人还是被申请操作人
List<MsCaseAffiliate> affiliates = msCaseAffiliateMapper.selectByCaseId(caseAppliId); List<MsCaseAffiliate> affiliates = msCaseAffiliateMapper.selectByCaseId(caseAppliId);
if(CollectionUtil.isEmpty(affiliates)){ if(CollectionUtil.isEmpty(affiliates)){
return AjaxResult.error("未找到案件相关人员"); return AjaxResult.error("未找到案件相关人员");
} }
List<Long> affiliateUserIds=new ArrayList<>();
// 根据案件id和用户id查询已选择的调解员进行回显 // 根据案件id和用户id查询已选择的调解员进行回显
Example example = new Example(MsCaseMediator.class); Example example = new Example(MsCaseMediator.class);
Example.Criteria criteria = example.createCriteria(); Example.Criteria criteria = example.createCriteria();
LoginUser loginUser = SecurityUtils.getLoginUser(); LoginUser loginUser = SecurityUtils.getLoginUser();
for (MsCaseAffiliate affiliate : affiliates) { for (MsCaseAffiliate affiliate : affiliates) {
if(affiliate.getUserId()!=null && affiliate.getUserId().equals(loginUser.getUser().getUserId())){ if(affiliate.getUserId()==null ){
continue;
}
affiliateUserIds.add(affiliate.getUserId());
if(affiliate.getUserId().equals(loginUser.getUser().getUserId())){
if( affiliate.getRoleType()==null){ if( affiliate.getRoleType()==null){
continue; continue;
} }
@@ -1917,7 +1936,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
criteria.andEqualTo("type", YesOrNoEnum.NO.getCode()); criteria.andEqualTo("type", YesOrNoEnum.NO.getCode());
} }
if(affiliate.getRoleType()==3|| affiliate.getRoleType()==4){ if(affiliate.getRoleType()==3|| affiliate.getRoleType()==4){
// 申请人 // 被申请人
criteria.andEqualTo("type", YesOrNoEnum.YES.getCode()); criteria.andEqualTo("type", YesOrNoEnum.YES.getCode());
} }
} }
@@ -1926,9 +1945,12 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
// 已选择的调解员 // 已选择的调解员
List<MsCaseMediator> selectedMediators = msCaseMediatorMapper.selectByExample(example); List<MsCaseMediator> selectedMediators = msCaseMediatorMapper.selectByExample(example);
selectedMediatorIds = selectedMediators.stream().map(MsCaseMediator::getMediatorId).collect(Collectors.toList()); selectedMediatorIds = selectedMediators.stream().map(MsCaseMediator::getMediatorId).collect(Collectors.toList());
}
for (SysUser user : users) { for (SysUser user : users) {
if(affiliateUserIds.contains(user.getUserId())){
continue;
}
MediatorVO mediatorVO = new MediatorVO(); MediatorVO mediatorVO = new MediatorVO();
mediatorVO.setMediatorId(user.getUserId()); mediatorVO.setMediatorId(user.getUserId());
mediatorVO.setMediatorName(user.getNickName()); mediatorVO.setMediatorName(user.getNickName());
@@ -2079,7 +2101,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
if (caseMap.containsKey(userId)) { if (caseMap.containsKey(userId)) {
List<MsCaseApplication> applications = caseMap.get(userId); List<MsCaseApplication> applications = caseMap.get(userId);
// 已办案件 // 已办案件
long count = applications.stream().filter(caseApplication -> !caseApplication.getCaseStatusName().equals("结束")).count(); long count = applications.stream().filter(caseApplication -> caseApplication.getCaseStatusName().equals("结束")).count();
if(count>=maxCount){ if(count>=maxCount){
maxCount=count; maxCount=count;
application.setMediatorId(userId); application.setMediatorId(userId);
@@ -2135,6 +2157,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
*/ */
@Transactional @Transactional
public void verifyMediator(MsCaseApplication application,BookingVO vo) { public void verifyMediator(MsCaseApplication application,BookingVO vo) {
Long userId = SecurityUtils.getUserId();
final List<MsCaseAffiliate>[] affiliates = new List[]{new ArrayList<>()};
ExecutorService executor = ThreadUtil.createThreadPool();
CompletableFuture<MsCaseApplication> cf1 = CompletableFuture.supplyAsync(() -> {
MsCaseFlow currentFlow = caseFlowMapper.selectByPrimaryKey(vo.getCaseFlowId()); MsCaseFlow currentFlow = caseFlowMapper.selectByPrimaryKey(vo.getCaseFlowId());
if (currentFlow == null) { if (currentFlow == null) {
throw new ServiceException("未找到当前流程节点"); throw new ServiceException("未找到当前流程节点");
@@ -2145,7 +2171,6 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
} }
if(vo.getMediatorId()!=null) { if(vo.getMediatorId()!=null) {
// setMediatorAndDate(application,vo);
application.setMediatorId(vo.getMediatorId()); application.setMediatorId(vo.getMediatorId());
application.setMediatorName(vo.getMediatorName()); application.setMediatorName(vo.getMediatorName());
} }
@@ -2160,23 +2185,34 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
if (caseApplication == null) { if (caseApplication == null) {
throw new ServiceException("未找到案件"); throw new ServiceException("未找到案件");
} }
caseApplication.setHearDate(application.getHearDate());
ExecutorService executor = ThreadUtil.createThreadPool();
CompletableFuture.runAsync(() -> {
// 发送开庭短信
if (CollectionUtil.isNotEmpty(vo.getHerDates())) {
List<MsCaseAffiliate> affiliates = selectAffliatesByCaseId(caseApplication.getId());
// 申请人发送开庭日期短信
sendHearDateSms(caseApplication, affiliates);
// 调解员发送开庭短信
sendMeditorHearDateSms(caseApplication,vo);
}
}, executor);
affiliates[0] = selectAffliatesByCaseId(caseApplication.getId());
if(CollectionUtil.isEmpty(affiliates[0])){
throw new ServiceException("未找到案件相关人员");
}
// 新增日志 // 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), ""); CaseLogUtils.insertCaseLog(caseApplication.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "",userId);
caseApplication.setHearDate(application.getHearDate());
return caseApplication;
});
if (CollectionUtil.isNotEmpty(vo.getHerDates())) {
cf1.thenAcceptAsync((result) -> {
// 申请人发送开庭日期短信
sendHearDateSms(result, affiliates[0]);
}, executor);
cf1.thenAcceptAsync((result) -> {
// 发送开庭短信
if (CollectionUtil.isNotEmpty(vo.getHerDates())) {
// 调解员发送开庭短信
sendMeditorHearDateSms(result, vo);
}
}, executor);
}
} }
@@ -2241,9 +2277,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
List<String> resPhones=new ArrayList<>(); List<String> resPhones=new ArrayList<>();
List<String> appEmails=new ArrayList<>(); List<String> appEmails=new ArrayList<>();
List<String> resEmails=new ArrayList<>(); List<String> resEmails=new ArrayList<>();
ExecutorService executor = ThreadUtil.createThreadPool();
for (MsCaseAffiliate affiliate : affiliates) { for (MsCaseAffiliate affiliate : affiliates) {
CompletableFuture.runAsync(() -> {
// 申请人 // 申请人
if (affiliate.getOperatorFlag() == 1 && (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2))) { if (affiliate.getOperatorFlag() == 1 && (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2))) {
// 获取短信链接uuid // 获取短信链接uuid
@@ -2256,13 +2293,12 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
SmsUtils.sendSms(application,"2130103", affiliate.getPhone(), SmsUtils.sendSms(application,"2130103", affiliate.getPhone(),
new String[]{application.getCaseNum(),application.getHearDate(),"authId="+roomUuid}); new String[]{application.getCaseNum(),application.getHearDate(),"authId="+roomUuid});
} else if(StrUtil.isNotEmpty(affiliate.getEmail())&&!appEmails.contains(affiliate.getEmail())) { } else if(StrUtil.isEmpty(affiliate.getPhone()) && StrUtil.isNotEmpty(affiliate.getEmail())&&!appEmails.contains(affiliate.getEmail())) {
appEmails.add(affiliate.getEmail()); appEmails.add(affiliate.getEmail());
// 发送邮件 // 发送邮件
caseApplicationService.sendEmail(application, affiliate, "开庭日期通知", content); caseApplicationService.sendEmail(application, affiliate, "开庭日期通知", content);
} }
continue;
} }
// 被申请人 // 被申请人
if (affiliate.getOperatorFlag() == 1 && (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4))) { if (affiliate.getOperatorFlag() == 1 && (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4))) {
@@ -2276,14 +2312,14 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
SmsUtils.sendSms(application,"2130103", affiliate.getPhone(), SmsUtils.sendSms(application,"2130103", affiliate.getPhone(),
new String[]{application.getCaseNum(),application.getHearDate(),"authId="+roomUuid}); new String[]{application.getCaseNum(),application.getHearDate(),"authId="+roomUuid});
} else if(StrUtil.isNotEmpty(affiliate.getEmail())&&!resEmails.contains(affiliate.getEmail())){ } else if(StrUtil.isEmpty(affiliate.getPhone()) && StrUtil.isNotEmpty(affiliate.getEmail())&&!resEmails.contains(affiliate.getEmail())){
resEmails.add(affiliate.getEmail()); resEmails.add(affiliate.getEmail());
// 发送邮件 // 发送邮件
caseApplicationService.sendEmail(application, affiliate, "开庭日期通知", content); caseApplicationService.sendEmail(application, affiliate, "开庭日期通知", content);
} }
} }}, executor);
} }
}else { }else {
// 申请人/被申通知, 线下调解 2077966 尊敬的用户,您的{1}案件,线下调解日期已确定为{2},请知晓,如非本人操作,请忽略本短信。 // 申请人/被申通知, 线下调解 2077966 尊敬的用户,您的{1}案件,线下调解日期已确定为{2},请知晓,如非本人操作,请忽略本短信。
@@ -2322,7 +2358,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
SmsUtils.sendSms(application, applicantNotice.getTemplateId(), affiliate.getPhone(), SmsUtils.sendSms(application, applicantNotice.getTemplateId(), affiliate.getPhone(),
applicantNotice.getTemplateParamSet()); applicantNotice.getTemplateParamSet());
} else if(StrUtil.isNotEmpty(affiliate.getEmail())&&!appEmails.contains(affiliate.getEmail())) { } else if(StrUtil.isEmpty(affiliate.getPhone()) && StrUtil.isNotEmpty(affiliate.getEmail())&&!appEmails.contains(affiliate.getEmail())) {
appEmails.add(affiliate.getEmail()); appEmails.add(affiliate.getEmail());
// 发送邮件 // 发送邮件
caseApplicationService.sendEmail(application, affiliate, applicantNotice.getSubject(), applicantNotice.getContent()); caseApplicationService.sendEmail(application, affiliate, applicantNotice.getSubject(), applicantNotice.getContent());
@@ -2340,7 +2376,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
SmsUtils.sendSms(application, resNotice.getTemplateId(), affiliate.getPhone(), SmsUtils.sendSms(application, resNotice.getTemplateId(), affiliate.getPhone(),
resNotice.getTemplateParamSet()); resNotice.getTemplateParamSet());
} else if(StrUtil.isNotEmpty(affiliate.getEmail())&&!resEmails.contains(affiliate.getEmail())){ } else if(StrUtil.isEmpty(affiliate.getPhone()) && StrUtil.isNotEmpty(affiliate.getEmail())&&!resEmails.contains(affiliate.getEmail())){
resEmails.add(affiliate.getEmail()); resEmails.add(affiliate.getEmail());
// 发送邮件 // 发送邮件
caseApplicationService.sendEmail(application, affiliate, resNotice.getSubject(), resNotice.getContent()); caseApplicationService.sendEmail(application, affiliate, resNotice.getSubject(), resNotice.getContent());
@@ -2485,9 +2521,11 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
return AjaxResult.error("未找到案件"); return AjaxResult.error("未找到案件");
} }
req.setSealFlag(application.getSealFlag()); req.setSealFlag(application.getSealFlag());
if (StrUtil.isEmpty(application.getMediationMethod())) { if (StrUtil.isEmpty(application.getMediationMethod())) {
return AjaxResult.error("未选择调解方式"); return AjaxResult.error("未选择调解方式");
} }
// 查询当前流程节点 // 查询当前流程节点
MsCaseFlow currentFlow = caseFlowMapper.selectByPrimaryKey(req.getCaseFlowId()); MsCaseFlow currentFlow = caseFlowMapper.selectByPrimaryKey(req.getCaseFlowId());
if (currentFlow == null) { if (currentFlow == null) {
@@ -2505,12 +2543,12 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
if (!applicantAffiliateOpt.isPresent() || !resAffiliateOpt.isPresent()) { if (!applicantAffiliateOpt.isPresent() || !resAffiliateOpt.isPresent()) {
throw new ServiceException("未找到案件操作人员"); throw new ServiceException("未找到案件操作人员");
} }
// 调解结果
Integer mediaResult = req.getMediaResult();
if (mediaResult == null) {
return AjaxResult.error("请选择调解结果");
}
if (application.getMediationMethod().equals("1")) { if (application.getMediationMethod().equals("1")) {
Integer mediaResult = application.getMediaResult();
if (mediaResult == null) {
return AjaxResult.error("请选择调解结果");
}
// 线上调解 // 线上调解
List<MsCaseAttach> attachList = req.getAttachList(); List<MsCaseAttach> attachList = req.getAttachList();
if (CollectionUtil.isNotEmpty(attachList)) { if (CollectionUtil.isNotEmpty(attachList)) {
@@ -3037,6 +3075,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
} }
} }
} else { } else {
Integer mediaResult=req.getMediaResult();
if(mediaResult==null){
return AjaxResult.error("请选择调解结果");
}
// 线下调解 // 线下调解
List<MsCaseAttach> attachList = req.getAttachList(); List<MsCaseAttach> attachList = req.getAttachList();
if (CollectionUtil.isEmpty(attachList)) { if (CollectionUtil.isEmpty(attachList)) {
@@ -3168,6 +3210,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
AjaxResult result = caseApplicationService.generateApplication(req); AjaxResult result = caseApplicationService.generateApplication(req);
// 修改案件结果 // 修改案件结果
application.setMediaResult(req.getMediaResult()); application.setMediaResult(req.getMediaResult());
application.setSealFlag(req.getSealFlag());
msCaseApplicationMapper.updateByPrimaryKeySelective(application); msCaseApplicationMapper.updateByPrimaryKeySelective(application);
return AjaxResult.success(); return AjaxResult.success();
} }
@@ -3501,10 +3544,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
caseAttach.setOtherSysFileId(caseFileInfo.getFileId()); caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
} }
} }
caseAttach.setSuffix(getFileExtension(caseAttach.getAnnexPath()));
msCaseAttachMapper.save(caseAttach);
}
}
caseAttach.setSuffix(getFileExtension(caseAttach.getAnnexPath()));
msCaseAttachMapper.save(caseAttach);
} }
@@ -28,10 +28,14 @@ public class CaseLogUtils
* @param caseNode 案件节点,不能为空 * @param caseNode 案件节点,不能为空
* @param notes 备注 * @param notes 备注
*/ */
public static void insertCaseLog(@NotNull Long caseAppliId, @NotEmpty Integer caseNode,String caseStatusName, String notes ){ public static void insertCaseLog(@NotNull Long caseAppliId, @NotEmpty Integer caseNode,String caseStatusName, String notes ){
MsCaseLogRecord operLog = new MsCaseLogRecord(); MsCaseLogRecord operLog = new MsCaseLogRecord();
// 获取当前的用户 LoginUser loginUser=null;
LoginUser loginUser = SecurityUtils.getLoginUser(); try {
loginUser = SecurityUtils.getLoginUser();
} catch (Exception e) {
loginUser=null;
}
if(loginUser!=null) { if(loginUser!=null) {
SysUser sysUser = userMapper.selectUserById(loginUser.getUserId()); SysUser sysUser = userMapper.selectUserById(loginUser.getUserId());
operLog.setCreateBy(sysUser.getUserName()); operLog.setCreateBy(sysUser.getUserName());
@@ -49,4 +53,24 @@ public class CaseLogUtils
operLog.setCreateTime(new Date()); operLog.setCreateTime(new Date());
caseLogRecordMapper.insert(operLog); caseLogRecordMapper.insert(operLog);
} }
/**
* 新增案件日志
* @param caseAppliId 案件id,不能为空
* @param caseNode 案件节点,不能为空
* @param notes 备注
*/
public static void insertCaseLog(@NotNull Long caseAppliId, @NotEmpty Integer caseNode,String caseStatusName, String notes,Long userId ){
if(userId==null)
return;
MsCaseLogRecord operLog = new MsCaseLogRecord();
SysUser sysUser = userMapper.selectUserById(userId);
operLog.setCreateBy(sysUser.getUserName());
operLog.setCreateNickName(sysUser.getNickName());
operLog.setCaseStatusName(caseStatusName);
operLog.setCaseAppliId(caseAppliId);
operLog.setCaseNode(caseNode);
operLog.setNotes(notes);
operLog.setCreateTime(new Date());
caseLogRecordMapper.insert(operLog);
}
} }