diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/message/BpmMessageConvert.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/message/BpmMessageConvert.java index 8648c1a7..75ab751d 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/message/BpmMessageConvert.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/convert/message/BpmMessageConvert.java @@ -68,13 +68,17 @@ public interface BpmMessageConvert { if (reason != null) { MsgData approvalReason = new MsgData(); + if (reason.length() > 10) { + reason = reason.substring(0,10) + ". . . . "; + } + approvalReason.setName("thing12"); approvalReason.setValue(reason); message.addData(approvalReason); } message.setMiniprogramState(miniProgramState); - message.setPage("pages/home/index?id=" + processInstanceId); + message.setPage("pages/bpm/task/todo/examineApprove?id=" + processInstanceId + "&isDetail=1"); return message; } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/message/BpmMessageServiceImpl.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/message/BpmMessageServiceImpl.java index c842d30f..fd5a7ea3 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/message/BpmMessageServiceImpl.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/message/BpmMessageServiceImpl.java @@ -60,45 +60,48 @@ public class BpmMessageServiceImpl implements BpmMessageService { // smsSendApi.sendSingleSmsToAdmin(BpmMessageConvert.INSTANCE.convert(reqDTO.getStartUserId(), // BpmMessageEnum.PROCESS_INSTANCE_APPROVE.getSmsTemplateCode(), templateParams)); + //发送站内信息 + notifyMessageSendApi.sendSingleMessageToAdmin(BpmMessageConvert.INSTANCE.convert1(reqDTO.getStartUserId(), + BpmMessageEnum.PROCESS_INSTANCE_APPROVE.getSmsTemplateCode(), templateParams)); + + //发送审批结果通知至微信 + String openId = getUserOpenId(reqDTO.getStartUserId()); + if (openId != null) { + subscribeMessageSendApi.sendApprovalResultNotification( + BpmMessageConvert.INSTANCE.convertApprovalResultNotification( + openId, reqDTO.getProcessInstanceName(), reqDTO.getCreateTime(), "通过", reqDTO.getReason(), + reqDTO.getProcessInstanceId(), + /** + * 跳转小程序类型:developer为开发版;trial为体验版;formal为正式版;默认为正式版 + */ + "formal")); + } + //当流程全部审批通过 BpmProcessInstanceExtDO processInstance = bpmProcessInstanceService.getProcessInstanceDO(reqDTO.getProcessInstanceId()); if (processInstance.getResult().equals(BpmProcessInstanceResultEnum.APPROVE.getResult())) { - //发送站内信息 - notifyMessageSendApi.sendSingleMessageToAdmin(BpmMessageConvert.INSTANCE.convert1(reqDTO.getStartUserId(), - BpmMessageEnum.PROCESS_INSTANCE_APPROVE.getSmsTemplateCode(), templateParams)); - - //发送审批结果通知至微信 - String openId = getUserOpenId(reqDTO.getStartUserId()); - if (openId != null) { - subscribeMessageSendApi.sendApprovalResultNotification( - BpmMessageConvert.INSTANCE.convertApprovalResultNotification( - openId, reqDTO.getProcessInstanceName(), reqDTO.getCreateTime(), "通过", reqDTO.getReason(), - reqDTO.getProcessInstanceId(), - /** - * 跳转小程序类型:developer为开发版;trial为体验版;formal为正式版;默认为正式版 - */ - "formal")); - } - //获取抄送用户ID String ccIDs = processInstance.getCcids(); - Pattern pattern = Pattern.compile("\\[(\\d+)]"); - Matcher matcher = pattern.matcher(ccIDs); - while (matcher.find()) { - String ccID = matcher.group(1); - String ccOpenId = getUserOpenId(Long.valueOf(ccID)); + if (ccIDs != null && !ccIDs.isEmpty()) { - //发送抄送信息至微信 - if (ccOpenId != null) { - subscribeMessageSendApi.sendApprovalResultNotification( - BpmMessageConvert.INSTANCE.convertApprovalResultNotification( - ccOpenId, reqDTO.getProcessInstanceName(), reqDTO.getCreateTime(), "抄送", reqDTO.getReason(), - reqDTO.getProcessInstanceId(), - /** - * 跳转小程序类型:developer为开发版;trial为体验版;formal为正式版;默认为正式版 - */ - "formal")); + Pattern pattern = Pattern.compile("\\[(\\d+)]"); + Matcher matcher = pattern.matcher(ccIDs); + while (matcher.find()) { + String ccID = matcher.group(1); + String ccOpenId = getUserOpenId(Long.valueOf(ccID)); + + //发送抄送信息至微信 + if (ccOpenId != null) { + subscribeMessageSendApi.sendApprovalResultNotification( + BpmMessageConvert.INSTANCE.convertApprovalResultNotification( + ccOpenId, reqDTO.getProcessInstanceName(), reqDTO.getCreateTime(), "抄送", reqDTO.getReason(), + reqDTO.getProcessInstanceId(), + /** + * 跳转小程序类型:developer为开发版;trial为体验版;formal为正式版;默认为正式版 + */ + "formal")); + } } } }