发送微信推送信息, 处理审批建议太长报错
This commit is contained in:
parent
1693bb20d0
commit
bca27f9fcd
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user