|
@@ -15,6 +15,7 @@ import com.flow.flowable.cmd.RecordActivityDeleteReasonCmd;
|
|
|
import com.flow.flowable.event.CustomFlowableEngineEvent;
|
|
|
import com.flow.flowable.model.JumpServiceTask;
|
|
|
import com.flow.flowable.utils.ProcessElementUtil;
|
|
|
+import com.flow.model.FormInfo;
|
|
|
import com.flow.service.*;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.flowable.bpmn.model.FlowElement;
|
|
@@ -132,7 +133,13 @@ public class GlobalActivityEventListener extends AbstractFlowableEngineEventList
|
|
|
public void afterCommit() {
|
|
|
Notify notify = new Notify();
|
|
|
notify.setSubject("新的审批任务");
|
|
|
- notify.setContent(String.format("您有一条待处理的审批任务【%s】,请及时处理。", entity.getName()));
|
|
|
+ //notify.setContent(String.format("您有一条待处理的审批任务【%s】,请及时处理。", entity.getName()));
|
|
|
+ String instanceId = entity.getProcessInstanceId();
|
|
|
+
|
|
|
+ FormInfo form = flowInstanceService.getForm(instanceId);
|
|
|
+ String fromName = form.getFlowDefine().getName();
|
|
|
+
|
|
|
+ notify.setContent(fromName);
|
|
|
notify.setSender(SecurityContextUtil.getUserId());
|
|
|
notify.setType(NotifyEnum.TODO);
|
|
|
notify.setReceiver(entity.getAssignee());
|
|
@@ -181,7 +188,13 @@ public class GlobalActivityEventListener extends AbstractFlowableEngineEventList
|
|
|
public void afterCommit() {
|
|
|
Notify notify = new Notify();
|
|
|
notify.setSubject("申请已通过");
|
|
|
- notify.setContent(String.format("您申请的流程《%s》已通过", entity.getName()));
|
|
|
+
|
|
|
+ //notify.setContent(String.format("您申请的流程《%s》已通过", entity.getName()));
|
|
|
+ String instanceId = entity.getProcessInstanceId();
|
|
|
+ FormInfo form = flowInstanceService.getForm(instanceId);
|
|
|
+ String fromName = form.getFlowDefine().getName();
|
|
|
+
|
|
|
+ notify.setContent(fromName);
|
|
|
notify.setSender(entity.getStartUserId());
|
|
|
notify.setType(NotifyEnum.SYSTEM);
|
|
|
notify.setReceiver(entity.getStartUserId());
|