|
@@ -7,7 +7,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.qmth.sop.business.bean.dto.FlowRejectSequenceDto;
|
|
import com.qmth.sop.business.bean.dto.FlowRejectSequenceDto;
|
|
import com.qmth.sop.business.bean.result.*;
|
|
import com.qmth.sop.business.bean.result.*;
|
|
import com.qmth.sop.business.entity.*;
|
|
import com.qmth.sop.business.entity.*;
|
|
-import com.qmth.sop.business.service.*;
|
|
|
|
|
|
+import com.qmth.sop.business.service.SysMessageService;
|
|
|
|
+import com.qmth.sop.business.service.TFCustomFlowEntityService;
|
|
|
|
+import com.qmth.sop.business.service.TFCustomFlowService;
|
|
|
|
+import com.qmth.sop.business.service.TSJobRemindService;
|
|
import com.qmth.sop.business.util.SmsSendUtil;
|
|
import com.qmth.sop.business.util.SmsSendUtil;
|
|
import com.qmth.sop.common.contant.SpringContextHolder;
|
|
import com.qmth.sop.common.contant.SpringContextHolder;
|
|
import com.qmth.sop.common.contant.SystemConstant;
|
|
import com.qmth.sop.common.contant.SystemConstant;
|
|
@@ -113,13 +116,13 @@ public class ProcessEventListener implements ActivitiEventListener, Serializable
|
|
List<TSJobRemind> tsJobRemindArrayList = new ArrayList<>();
|
|
List<TSJobRemind> tsJobRemindArrayList = new ArrayList<>();
|
|
if (Objects.nonNull(task.getAssignee())) {
|
|
if (Objects.nonNull(task.getAssignee())) {
|
|
tsJobRemindArrayList.add(new TSJobRemind(JobQuartzTypeEnum.FLOW, tfCustomFlowEntity.getCode(), Long.parseLong(task.getId()), tfCustomFlow.getType().getTitle() + ";" + task.getName(), JobTypeEnum.AFTER, Long.parseLong(task.getAssignee()), tfFlowLog.getApproveOperation(), sysUser.getId()));
|
|
tsJobRemindArrayList.add(new TSJobRemind(JobQuartzTypeEnum.FLOW, tfCustomFlowEntity.getCode(), Long.parseLong(task.getId()), tfCustomFlow.getType().getTitle() + ";" + task.getName(), JobTypeEnum.AFTER, Long.parseLong(task.getAssignee()), tfFlowLog.getApproveOperation(), sysUser.getId()));
|
|
- this.sendSopFlowDoneSms(tfCustomFlow.getType(), Long.parseLong(task.getAssignee()));
|
|
|
|
|
|
+ this.sendSopFlowDoneSms(tfCustomFlow.getType(), tfCustomFlowEntity, task.getName(), Long.parseLong(task.getAssignee()));
|
|
} else {
|
|
} else {
|
|
List<IdentityLink> identityLinkList = taskService.getIdentityLinksForTask(task.getId());
|
|
List<IdentityLink> identityLinkList = taskService.getIdentityLinksForTask(task.getId());
|
|
if (!CollectionUtils.isEmpty(identityLinkList)) {
|
|
if (!CollectionUtils.isEmpty(identityLinkList)) {
|
|
for (IdentityLink i : identityLinkList) {
|
|
for (IdentityLink i : identityLinkList) {
|
|
tsJobRemindArrayList.add(new TSJobRemind(JobQuartzTypeEnum.FLOW, tfCustomFlowEntity.getCode(), Long.parseLong(i.getTaskId()), tfCustomFlow.getType().getTitle() + ";" + task.getName(), JobTypeEnum.AFTER, Long.parseLong(i.getUserId()), tfFlowLog.getApproveOperation(), sysUser.getId()));
|
|
tsJobRemindArrayList.add(new TSJobRemind(JobQuartzTypeEnum.FLOW, tfCustomFlowEntity.getCode(), Long.parseLong(i.getTaskId()), tfCustomFlow.getType().getTitle() + ";" + task.getName(), JobTypeEnum.AFTER, Long.parseLong(i.getUserId()), tfFlowLog.getApproveOperation(), sysUser.getId()));
|
|
- this.sendSopFlowDoneSms(tfCustomFlow.getType(), Long.parseLong(i.getUserId()));
|
|
|
|
|
|
+ this.sendSopFlowDoneSms(tfCustomFlow.getType(), tfCustomFlowEntity, task.getName(), Long.parseLong(i.getUserId()));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -319,17 +322,21 @@ public class ProcessEventListener implements ActivitiEventListener, Serializable
|
|
* 发送流程待办短信
|
|
* 发送流程待办短信
|
|
*
|
|
*
|
|
* @param type
|
|
* @param type
|
|
|
|
+ * @param tfCustomFlowEntity
|
|
|
|
+ * @param taskName
|
|
* @param userId
|
|
* @param userId
|
|
*/
|
|
*/
|
|
- protected void sendSopFlowDoneSms(TFCustomTypeEnum type, Long userId) {
|
|
|
|
- SysUserService sysUserService = SpringContextHolder.getBean(SysUserService.class);
|
|
|
|
|
|
+ protected void sendSopFlowDoneSms(TFCustomTypeEnum type, TFCustomFlowEntity tfCustomFlowEntity, String taskName, Long userId) {
|
|
SmsSendUtil smsSendUtil = SpringContextHolder.getBean(SmsSendUtil.class);
|
|
SmsSendUtil smsSendUtil = SpringContextHolder.getBean(SmsSendUtil.class);
|
|
|
|
+ TFCustomFlowEntityService tfCustomFlowEntityService = SpringContextHolder.getBean(TFCustomFlowEntityService.class);
|
|
if (type == TFCustomTypeEnum.OFFICE_SOP_FLOW || type == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW) {//发送待审批短信
|
|
if (type == TFCustomTypeEnum.OFFICE_SOP_FLOW || type == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW) {//发送待审批短信
|
|
|
|
+ FlowTaskSmsResult flowTaskSmsResult = tfCustomFlowEntityService.getFlowTaskRemindSmsInfo(tfCustomFlowEntity.getId(), userId);
|
|
|
|
+ Optional.ofNullable(flowTaskSmsResult).orElseThrow(() -> ExceptionResultEnum.USER_NO_EXISTS.exception());
|
|
Map<String, Object> templateParam = new HashMap<>();
|
|
Map<String, Object> templateParam = new HashMap<>();
|
|
- templateParam.put("code", "test");
|
|
|
|
- SysUser sysUser = sysUserService.getById(userId);
|
|
|
|
- Optional.ofNullable(sysUser).orElseThrow(() -> ExceptionResultEnum.USER_NO_EXISTS.exception());
|
|
|
|
- smsSendUtil.sendSms(sysUser.getMobileNumber(), SystemConstant.SMS_TPL_CODE, templateParam);
|
|
|
|
|
|
+ templateParam.put("userName", flowTaskSmsResult.getRealName());
|
|
|
|
+ templateParam.put("customName", flowTaskSmsResult.getCustomName());
|
|
|
|
+ templateParam.put("flowName", type.getTitle() + "【" + taskName + "】");
|
|
|
|
+ smsSendUtil.sendSms(flowTaskSmsResult.getMobileNumber(), SystemConstant.SMS_SOP_DONE_CODE, templateParam);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -362,14 +369,12 @@ public class ProcessEventListener implements ActivitiEventListener, Serializable
|
|
content = content.replaceAll("\\$\\{dingDate\\}", DateUtil.format(new Date(flowTaskMsgResult.getApplyTime()), SystemConstant.DEFAULT_DATE_PATTERN));
|
|
content = content.replaceAll("\\$\\{dingDate\\}", DateUtil.format(new Date(flowTaskMsgResult.getApplyTime()), SystemConstant.DEFAULT_DATE_PATTERN));
|
|
content = content.replaceAll("\\$\\{approveRemark\\}", tfFlowLog.getApproveRemark());
|
|
content = content.replaceAll("\\$\\{approveRemark\\}", tfFlowLog.getApproveRemark());
|
|
|
|
|
|
- configKey = SystemConstant.SMS_TPL_CODE;
|
|
|
|
|
|
+ configKey = SystemConstant.SMS_FLOW_DING_EXCEPTION_FINISH_CODE;
|
|
templateParam.put("dingDate", DateUtil.format(new Date(flowTaskMsgResult.getApplyTime()), SystemConstant.DEFAULT_DATE_PATTERN));
|
|
templateParam.put("dingDate", DateUtil.format(new Date(flowTaskMsgResult.getApplyTime()), SystemConstant.DEFAULT_DATE_PATTERN));
|
|
templateParam.put("approveRemark", tfFlowLog.getApproveRemark());
|
|
templateParam.put("approveRemark", tfFlowLog.getApproveRemark());
|
|
|
|
|
|
sysMessage = new SysMessage(tfCustomFlowEntity.getCrmNo(), tfCustomFlowEntity.getCode(),
|
|
sysMessage = new SysMessage(tfCustomFlowEntity.getCrmNo(), tfCustomFlowEntity.getCode(),
|
|
MessageTypeEnum.EXCEPTION_APPROVE, type.name(), flowTaskMsgResult.getServiceId(), tfCustomFlowEntity.getCreateId(), content);
|
|
MessageTypeEnum.EXCEPTION_APPROVE, type.name(), flowTaskMsgResult.getServiceId(), tfCustomFlowEntity.getCreateId(), content);
|
|
-
|
|
|
|
- configKey = SystemConstant.SMS_TPL_CODE;
|
|
|
|
} else if (type == TFCustomTypeEnum.PROJECT_EXCHANGE_FLOW) {//项目计划变更
|
|
} else if (type == TFCustomTypeEnum.PROJECT_EXCHANGE_FLOW) {//项目计划变更
|
|
content = MessageEnum.NOTICE_OF_PROJECT_EXCHANGE.getTemplate();
|
|
content = MessageEnum.NOTICE_OF_PROJECT_EXCHANGE.getTemplate();
|
|
content = content.replaceAll("\\$\\{userName\\}", flowTaskMsgResult.getRealName());
|
|
content = content.replaceAll("\\$\\{userName\\}", flowTaskMsgResult.getRealName());
|
|
@@ -377,7 +382,7 @@ public class ProcessEventListener implements ActivitiEventListener, Serializable
|
|
content = content.replaceAll("\\$\\{customName\\}", flowTaskMsgResult.getCustomName());
|
|
content = content.replaceAll("\\$\\{customName\\}", flowTaskMsgResult.getCustomName());
|
|
content = content.replaceAll("\\$\\{exchangeType\\}", flowTaskMsgResult.getExchangeType().getTitle());
|
|
content = content.replaceAll("\\$\\{exchangeType\\}", flowTaskMsgResult.getExchangeType().getTitle());
|
|
|
|
|
|
- configKey = SystemConstant.SMS_TPL_CODE;
|
|
|
|
|
|
+ configKey = SystemConstant.SMS_FLOW_PROJECT_EXCHANGE_FINISH_CODE;
|
|
templateParam.put("serviceName", flowTaskMsgResult.getServiceName());
|
|
templateParam.put("serviceName", flowTaskMsgResult.getServiceName());
|
|
templateParam.put("customName", flowTaskMsgResult.getCustomName());
|
|
templateParam.put("customName", flowTaskMsgResult.getCustomName());
|
|
templateParam.put("exchangeType", flowTaskMsgResult.getExchangeType().getTitle());
|
|
templateParam.put("exchangeType", flowTaskMsgResult.getExchangeType().getTitle());
|