|
@@ -348,6 +348,18 @@ public class BpmMessageServiceImpl implements BpmMessageService {
|
|
|
NotieBusinessTypeEnum.BPM.getValue(), NotifyTypeEnum.NOTIFY_TODO.getValue(),
|
|
NotieBusinessTypeEnum.BPM.getValue(), NotifyTypeEnum.NOTIFY_TODO.getValue(),
|
|
|
NotifyPriorityEnum.MEDIUM.getValue(), 0, assigneeUser.getTenantId());
|
|
NotifyPriorityEnum.MEDIUM.getValue(), 0, assigneeUser.getTenantId());
|
|
|
break;
|
|
break;
|
|
|
|
|
+ case FEE_ITEM_CHANGE:
|
|
|
|
|
+ elderlyInfo = bpmElderlyChangeApi.getElderlyInfoByChangeId(businessFormDO.getBusinessId());
|
|
|
|
|
+ templateParams.put("nickname", user.getNickname());
|
|
|
|
|
+ templateParams.put("elderName", elderlyInfo.getElderName());
|
|
|
|
|
+ detailUrl = getProcessInstanceDetailUrl(reqDTO.getProcessInstanceId()) + "&businessId=" + businessFormDO.getBusinessId();
|
|
|
|
|
+ templateParams.put("detailUrl", detailUrl);
|
|
|
|
|
+ notifySendSingleToUserReqDTO = BpmMessageConvert.INSTANCE.messageConvert(reqDTO.getStartUserId(),
|
|
|
|
|
+ reqDTO.getProcessInstanceId(), "", detailUrl,
|
|
|
|
|
+ BpmMessageEnum.FEE_ITEM_CHANGE_PROCESS_INSTANCE_APPROVE.getTemplateCode(), templateParams,
|
|
|
|
|
+ NotieBusinessTypeEnum.BPM.getValue(), NotifyTypeEnum.NOTIFY_TODO.getValue(),
|
|
|
|
|
+ NotifyPriorityEnum.MEDIUM.getValue(), 0, assigneeUser.getTenantId());
|
|
|
|
|
+ break;
|
|
|
case PRICE_CHANGE:
|
|
case PRICE_CHANGE:
|
|
|
elderlyInfo = bpmElderlyChangeApi.getElderlyInfoByChangeId(businessFormDO.getBusinessId());
|
|
elderlyInfo = bpmElderlyChangeApi.getElderlyInfoByChangeId(businessFormDO.getBusinessId());
|
|
|
templateParams.put("nickname", user.getNickname());
|
|
templateParams.put("nickname", user.getNickname());
|
|
@@ -478,13 +490,17 @@ public class BpmMessageServiceImpl implements BpmMessageService {
|
|
|
copyList.add(copyDO);
|
|
copyList.add(copyDO);
|
|
|
CorpSendMessage corpSendMessage = new CorpSendMessage();
|
|
CorpSendMessage corpSendMessage = new CorpSendMessage();
|
|
|
WechatMessageSaveReq wechatMessageSaveReq = new WechatMessageSaveReq();
|
|
WechatMessageSaveReq wechatMessageSaveReq = new WechatMessageSaveReq();
|
|
|
- AdminUserRespDTO promoter = adminUserApi.getUser(taskCopyUserDO.getId());
|
|
|
|
|
- String corpUserId = promoter.getCorpUserId() == null ? "" : promoter.getCorpUserId().toString();
|
|
|
|
|
|
|
+ // 抄送人可能属于其他租户,必须忽略租户过滤查询:
|
|
|
|
|
+ // 若用 getUser,跨租户时查不到会返回 null,触发 NPE 中断整个抄送循环,
|
|
|
|
|
+ // 导致只有排在异常之前的抄送人(消息已异步投出)能收到,其余人全部丢失
|
|
|
|
|
+ AdminUserRespDTO promoter = adminUserApi.getUserTenantIgnore(taskCopyUserDO.getId());
|
|
|
|
|
+ String corpUserId = promoter == null || promoter.getCorpUserId() == null
|
|
|
|
|
+ ? "" : promoter.getCorpUserId().toString();
|
|
|
CorpWechatMiniProgramNotice corpNotice = new CorpWechatMiniProgramNotice();
|
|
CorpWechatMiniProgramNotice corpNotice = new CorpWechatMiniProgramNotice();
|
|
|
corpNotice.setTitle(CorpMsgUtil.TITLE_COPY);
|
|
corpNotice.setTitle(CorpMsgUtil.TITLE_COPY);
|
|
|
corpNotice.setPage(String.format(MINI_PROGRAM_DETAIL_PAGE, reqDTO.getProcessInstanceId(), 4,
|
|
corpNotice.setPage(String.format(MINI_PROGRAM_DETAIL_PAGE, reqDTO.getProcessInstanceId(), 4,
|
|
|
businessFormDO.getStatus() == null ? "" : String.valueOf(businessFormDO.getStatus()),
|
|
businessFormDO.getStatus() == null ? "" : String.valueOf(businessFormDO.getStatus()),
|
|
|
- promoter.getId() == null ? "" : String.valueOf(promoter.getId())));
|
|
|
|
|
|
|
+ taskCopyUserDO.getId() == null ? "" : String.valueOf(taskCopyUserDO.getId())));
|
|
|
corpSendMessage.setTouser(corpUserId);
|
|
corpSendMessage.setTouser(corpUserId);
|
|
|
corpSendMessage.setMiniProgramNotice(corpNotice);
|
|
corpSendMessage.setMiniProgramNotice(corpNotice);
|
|
|
wechatMessageSaveReq.setTitle(CorpMsgUtil.TITLE_COPY);
|
|
wechatMessageSaveReq.setTitle(CorpMsgUtil.TITLE_COPY);
|
|
@@ -590,6 +606,18 @@ public class BpmMessageServiceImpl implements BpmMessageService {
|
|
|
NotieBusinessTypeEnum.BPM.getValue(), notifyType,
|
|
NotieBusinessTypeEnum.BPM.getValue(), notifyType,
|
|
|
NotifyPriorityEnum.MEDIUM.getValue(), 0, assigneeUser.getTenantId());
|
|
NotifyPriorityEnum.MEDIUM.getValue(), 0, assigneeUser.getTenantId());
|
|
|
break;
|
|
break;
|
|
|
|
|
+ case FEE_ITEM_CHANGE:
|
|
|
|
|
+ detailUrl = getInstanceDetailUrl(reqDTO.getProcessInstanceId()) + "&businessId=" + businessFormDO.getBusinessId();
|
|
|
|
|
+ elderlyInfo = bpmElderlyChangeApi.getElderlyInfoByChangeId(businessFormDO.getBusinessId());
|
|
|
|
|
+ templateParams.put("nickname", user.getNickname());
|
|
|
|
|
+ templateParams.put("elderName", elderlyInfo.getElderName());
|
|
|
|
|
+ templateParams.put("detailUrl", detailUrl);
|
|
|
|
|
+ notifySendSingleToUserReqDTO = BpmMessageConvert.INSTANCE.messageConvert(reqDTO.getStartUserId(),
|
|
|
|
|
+ reqDTO.getProcessInstanceId(), "", detailUrl,
|
|
|
|
|
+ BpmMessageEnum.FEE_ITEM_CHANGE_PROCESS_INSTANCE_REJECT.getTemplateCode(), templateParams,
|
|
|
|
|
+ NotieBusinessTypeEnum.BPM.getValue(), notifyType,
|
|
|
|
|
+ NotifyPriorityEnum.MEDIUM.getValue(), 0, assigneeUser.getTenantId());
|
|
|
|
|
+ break;
|
|
|
case PRICE_CHANGE:
|
|
case PRICE_CHANGE:
|
|
|
detailUrl = getInstanceDetailUrl(reqDTO.getProcessInstanceId()) + "&businessId=" + businessFormDO.getBusinessId();
|
|
detailUrl = getInstanceDetailUrl(reqDTO.getProcessInstanceId()) + "&businessId=" + businessFormDO.getBusinessId();
|
|
|
elderlyInfo = bpmElderlyChangeApi.getElderlyInfoByChangeId(businessFormDO.getBusinessId());
|
|
elderlyInfo = bpmElderlyChangeApi.getElderlyInfoByChangeId(businessFormDO.getBusinessId());
|
|
@@ -783,6 +811,26 @@ public class BpmMessageServiceImpl implements BpmMessageService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if (BpmBusinessTypeEnum.FEE_ITEM_CHANGE.getValue().equals(businessFormDO.getType())) {
|
|
|
|
|
+ elderlyInfo = bpmElderlyChangeApi.getElderlyInfoByChangeId(businessFormDO.getBusinessId());
|
|
|
|
|
+ templateParams.put("nickname", user.getNickname());
|
|
|
|
|
+ templateParams.put("elderName", elderlyInfo.getElderName());
|
|
|
|
|
+ detailUrl = getInstanceDetailUrl(reqDTO.getProcessInstanceId()) + "&businessId=" + businessFormDO.getBusinessId();
|
|
|
|
|
+ templateParams.put("detailUrl", detailUrl);
|
|
|
|
|
+ notifySendSingleToUserReqDTO = BpmMessageConvert.INSTANCE.messageConvert(reqDTO.getAssigneeUserId(),
|
|
|
|
|
+ reqDTO.getProcessInstanceId(), reqDTO.getTaskId(), detailUrl,
|
|
|
|
|
+ BpmMessageEnum.FEE_ITEM_CHANGE_PROCESS_TASK_ASSIGNED.getTemplateCode(), templateParams,
|
|
|
|
|
+ NotieBusinessTypeEnum.BPM.getValue(), NotifyTypeEnum.NOTIFY_TODO.getValue(),
|
|
|
|
|
+ NotifyPriorityEnum.MEDIUM.getValue(), 0, assigneeUser.getTenantId());
|
|
|
|
|
+ if (reqDTO.getStartUserId().equals(loginUserId)) {
|
|
|
|
|
+ notifyMessageSendApi.sendSingleMessageToAdminByDTO(BpmMessageConvert.INSTANCE.messageConvert(loginUserId,
|
|
|
|
|
+ reqDTO.getProcessInstanceId(), reqDTO.getTaskId(), detailUrl,
|
|
|
|
|
+ BpmMessageEnum.FEE_ITEM_CHANGE_PROCESS_TASK_ASSIGNED.getTemplateCode(), templateParams,
|
|
|
|
|
+ NotieBusinessTypeEnum.BPM.getValue(), NotifyTypeEnum.NOTIFY_TODO.getValue(),
|
|
|
|
|
+ NotifyPriorityEnum.MEDIUM.getValue(), 1, assigneeUser.getTenantId()));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (BpmBusinessTypeEnum.PRICE_CHANGE.getValue().equals(businessFormDO.getType())) {
|
|
if (BpmBusinessTypeEnum.PRICE_CHANGE.getValue().equals(businessFormDO.getType())) {
|
|
|
elderlyInfo = bpmElderlyChangeApi.getElderlyInfoByChangeId(businessFormDO.getBusinessId());
|
|
elderlyInfo = bpmElderlyChangeApi.getElderlyInfoByChangeId(businessFormDO.getBusinessId());
|
|
|
templateParams.put("nickname", user.getNickname());
|
|
templateParams.put("nickname", user.getNickname());
|