瀏覽代碼

执行活动删除描述

caixiaofeng 7 月之前
父節點
當前提交
65f625ab7c

+ 11 - 2
flow-workflow/flow-workflow-biz/src/main/java/com/flow/service/impl/FlowActivityServiceImpl.java

@@ -1,5 +1,6 @@
 package com.flow.service.impl;
 
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.flow.entity.Activity;
 import com.flow.entity.FlowDefine;
 import com.flow.entity.FlowTask;
@@ -74,7 +75,11 @@ public class FlowActivityServiceImpl implements FlowActivityService {
                         JumpNode jumpNode = flowDefine.findFlowNodeOfType(JumpNode.class, e.getActivityId());
                         Node target = flowDefine.findFlowNodeOfType(Node.class, jumpNode.getTargetNode());
                         activity.setAssignee("admin");
-                        activity.setDescription(String.format("<span>跳转至 <span class='color-primary'>%s</span></span>", target.getName()));
+                        if (StringUtils.isNotBlank(activity.getDeleteReason())) {
+                            activity.setDeleteReason(String.format("<span>跳转至 <span class='color-primary'>%s</span></span>", target.getName()));
+                        } else {
+                            activity.setDeleteReason("<span>跳转失败 <span class='color-warning'>不满足跳转条件</span></span>");
+                        }
                     }
                     return activity;
                 })
@@ -119,7 +124,11 @@ public class FlowActivityServiceImpl implements FlowActivityService {
                         JumpNode jumpNode = flowDefine.findFlowNodeOfType(JumpNode.class, e.getActivityId());
                         Node target = flowDefine.findFlowNodeOfType(Node.class, jumpNode.getTargetNode());
                         activity.setAssignee("admin");
-                        activity.setDescription(String.format("<span>跳转至 <span class='color-primary'>%s</span></span>", target.getName()));
+                        if (StringUtils.isNotBlank(activity.getDeleteReason())) {
+                            activity.setDeleteReason(String.format("<span>跳转至 <span class='color-primary'>%s</span></span>", target.getName()));
+                        } else {
+                            activity.setDeleteReason("<span>跳转失败 <span class='color-warning'>不满足跳转条件</span></span>");
+                        }
                     }
                     return activity;
                 })

+ 3 - 1
flow-workflow/flow-workflow-entity/src/main/java/com/flow/entity/Activity.java

@@ -24,7 +24,7 @@ public class Activity {
     private Date startTime;
     private Date endTime;
     private Long duration;
-    private String description;
+    private String deleteReason;
     private ProcessStatus status;
 
     public Activity(ActivityInstance activityInstance) {
@@ -40,6 +40,7 @@ public class Activity {
         this.instanceId = activityInstance.getProcessInstanceId();
         this.taskId = activityInstance.getTaskId();
         this.defineId = activityInstance.getProcessDefinitionId();
+        this.deleteReason = activityInstance.getDeleteReason();
         if (Objects.isNull(this.endTime)) {
             this.status = ProcessStatus.RUNNING;
         } else {
@@ -60,6 +61,7 @@ public class Activity {
         this.taskId = historicActivityInstance.getTaskId();
         this.activityName = historicActivityInstance.getActivityName();
         this.activityType = historicActivityInstance.getActivityType();
+        this.deleteReason = historicActivityInstance.getDeleteReason();
         if (Objects.isNull(this.endTime)) {
             this.status = ProcessStatus.RUNNING;
         } else {