|
@@ -1,17 +1,19 @@
|
|
package org.hswebframework.web.workflow.flowable.controller;
|
|
package org.hswebframework.web.workflow.flowable.controller;
|
|
|
|
|
|
import org.activiti.engine.impl.pvm.process.ActivityImpl;
|
|
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.commons.entity.DataStatus;
|
|
import org.hswebframework.web.controller.message.ResponseMessage;
|
|
import org.hswebframework.web.controller.message.ResponseMessage;
|
|
|
|
+import org.hswebframework.web.entity.organizational.RelationDefineEntity;
|
|
|
|
+import org.hswebframework.web.entity.organizational.SimpleRelationDefineEntity;
|
|
|
|
+import org.hswebframework.web.service.organizational.RelationDefineService;
|
|
|
|
+import org.hswebframework.web.service.organizational.RelationInfoService;
|
|
import org.hswebframework.web.workflow.flowable.service.BpmActivityService;
|
|
import org.hswebframework.web.workflow.flowable.service.BpmActivityService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
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 org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
+import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @Author wangwei
|
|
* @Author wangwei
|
|
@@ -23,10 +25,30 @@ public class FlowableUtilsController {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
BpmActivityService bpmActivityService;
|
|
BpmActivityService bpmActivityService;
|
|
|
|
+ @Autowired
|
|
|
|
+ RelationDefineService relationDefineService;
|
|
|
|
+ @Autowired
|
|
|
|
+ RelationInfoService relationInfoService;
|
|
|
|
|
|
@GetMapping("{procDefId}/acts")
|
|
@GetMapping("{procDefId}/acts")
|
|
- public ResponseMessage<List<ActivityImpl>> acts(@PathVariable String procDefId){
|
|
|
|
|
|
+ public ResponseMessage<Map<String, Object>> acts(@PathVariable String procDefId){
|
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
List<ActivityImpl> activities = bpmActivityService.getActivitiesById(procDefId,null);
|
|
List<ActivityImpl> activities = bpmActivityService.getActivitiesById(procDefId,null);
|
|
- return ResponseMessage.ok(activities);
|
|
|
|
|
|
+ for (ActivityImpl activity: activities) {
|
|
|
|
+ if(activity.getProperty("type").equals("userTask")) map.put(activity.getId(), activity.getProperty("name"));
|
|
|
|
+ }
|
|
|
|
+ return ResponseMessage.ok(map);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @GetMapping("relation-define")
|
|
|
|
+ public ResponseMessage<List<RelationDefineEntity>> getRelationDefines(){
|
|
|
|
+ SimpleRelationDefineEntity entity = new SimpleRelationDefineEntity();
|
|
|
|
+ entity.setStatus(DataStatus.STATUS_ENABLED);
|
|
|
|
+ List<RelationDefineEntity> list = relationDefineService.select(entity);
|
|
|
|
+
|
|
|
|
+ return ResponseMessage.ok(list);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+// @PostMapping("act/{actId}-{defineId}")
|
|
|
|
+// public ResponseMessage
|
|
}
|
|
}
|