Browse Source

工作流完善

wangwei 7 years ago
parent
commit
27cca04bcc

+ 10 - 0
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable/src/main/java/org/hswebframework/web/workflow/Application.java

@@ -2,9 +2,19 @@ package org.hswebframework.web.workflow;
 
 import org.hswebframework.web.dao.Dao;
 import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.beans.factory.ObjectProvider;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration;
+import org.springframework.boot.autoconfigure.web.HttpMessageConverters;
+import org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration;
+import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.ComponentScan;
+import org.springframework.http.converter.HttpMessageConverter;
+
+import java.util.Collections;
+import java.util.List;
 
 /**
  * @author zhouhao

+ 32 - 0
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable/src/main/java/org/hswebframework/web/workflow/flowable/controller/FlowableUtilsController.java

@@ -0,0 +1,32 @@
+package org.hswebframework.web.workflow.flowable.controller;
+
+import org.activiti.engine.impl.pvm.process.ActivityImpl;
+import org.activiti.engine.repository.ProcessDefinition;
+import org.hswebframework.web.commons.entity.PagerResult;
+import org.hswebframework.web.controller.message.ResponseMessage;
+import org.hswebframework.web.workflow.flowable.service.BpmActivityService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * @Author wangwei
+ * @Date 2017/9/4.
+ */
+@RestController
+@RequestMapping("workflow/utils/")
+public class FlowableUtilsController {
+
+    @Autowired
+    BpmActivityService bpmActivityService;
+
+    @GetMapping("{procDefId}/acts")
+    public ResponseMessage<List<ActivityImpl>> acts(@PathVariable String procDefId){
+        List<ActivityImpl> activities = bpmActivityService.getActivitiesById(procDefId,null);
+        return ResponseMessage.ok(activities);
+    }
+}

+ 3 - 0
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-flowable/src/main/resources/application.yml

@@ -1,4 +1,7 @@
 spring:
+    http:
+      converters:
+        preferred-json-mapper: fastjson
     aop:
         auto: true
         proxy-target-class: true