Explorar o código

增加流程进度

zhou-hao %!s(int64=6) %!d(string=hai) anos
pai
achega
4ed1db9455

+ 2 - 2
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/src/main/java/org/hswebframework/web/workflow/web/diagram/BaseProcessDefinitionDiagramLayoutResource.java

@@ -249,8 +249,8 @@ public class BaseProcessDefinitionDiagramLayoutResource {
         return highLightedFlows;
     }
 
-    private void getActivity(String processInstanceId, ActivityImpl activity, List activityArray,
-                             List sequenceFlowArray, ProcessInstance processInstance, List<String> highLightedFlows,
+    private void getActivity(String processInstanceId, ActivityImpl activity, List<Object> activityArray,
+                             List<Object> sequenceFlowArray, ProcessInstance processInstance, List<String> highLightedFlows,
                              Map<String, Object> subProcessInstanceMap) {
 
         JSONObject activityJSON = new JSONObject();

+ 2 - 2
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/src/main/java/org/hswebframework/web/workflow/web/diagram/ProcessDefinitionDiagramLayoutResource.java

@@ -1,6 +1,6 @@
 package org.hswebframework.web.workflow.web.diagram;
 
-import com.fasterxml.jackson.databind.node.ObjectNode;
+import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.*;
 
 /**
@@ -14,7 +14,7 @@ public class ProcessDefinitionDiagramLayoutResource
 
     @GetMapping(
             value = {"/process-definition/{processDefinitionId}/diagram-layout"},
-            produces = {"application/json"}
+            produces = MediaType.APPLICATION_JSON_UTF8_VALUE
     )
     public Object getDiagram(@PathVariable String processDefinitionId) {
         return this.getDiagramNode(null, processDefinitionId);

+ 5 - 8
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/src/main/java/org/hswebframework/web/workflow/web/diagram/ProcessInstanceDiagramLayoutResource.java

@@ -1,9 +1,7 @@
 package org.hswebframework.web.workflow.web.diagram;
 
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.*;
 
 /**
  * @author zhouhao
@@ -16,12 +14,11 @@ public class ProcessInstanceDiagramLayoutResource
 {
 
 
-    @RequestMapping(
+    @GetMapping(
             value = {"/process-instance/{processInstanceId}/diagram-layout"},
-            method = {RequestMethod.GET},
-            produces = {"application/json"}
+            produces = MediaType.APPLICATION_JSON_UTF8_VALUE
     )
     public Object getDiagram(@PathVariable String processInstanceId) {
-        return this.getDiagramNode(processInstanceId, (String)null);
+        return this.getDiagramNode(processInstanceId, null);
     }
 }

+ 2 - 2
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/src/main/java/org/hswebframework/web/workflow/web/diagram/ProcessInstanceHighlightsResource.java

@@ -30,9 +30,9 @@ import org.activiti.engine.impl.pvm.PvmTransition;
 import org.activiti.engine.impl.pvm.process.ActivityImpl;
 import org.activiti.engine.runtime.ProcessInstance;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.*;
 
-import com.alibaba.fastjson.JSONArray;
 
 @RestController
 @RequestMapping("/workflow/service")
@@ -48,7 +48,7 @@ public class ProcessInstanceHighlightsResource {
     private HistoryService historyService;
 
 
-    @GetMapping(value = "/process-instance/{processInstanceId}/highlights", produces = "application/json")
+    @GetMapping(value = "/process-instance/{processInstanceId}/highlights", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
     public Object getHighlighted(@PathVariable String processInstanceId) {
 
         JSONObject responseJSON = new JSONObject();