浏览代码

增加配置和权限

zhouhao 6 年之前
父节点
当前提交
92b8f9def7

+ 35 - 0
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/src/main/java/org/hswebframework/web/workflow/web/ProcessActivityConfigController.java

@@ -0,0 +1,35 @@
+package org.hswebframework.web.workflow.web;
+
+import io.swagger.annotations.Api;
+import org.hswebframework.web.authorization.annotation.Authorize;
+import org.hswebframework.web.commons.entity.param.QueryParamEntity;
+import org.hswebframework.web.controller.SimpleGenericEntityController;
+import org.hswebframework.web.service.CrudService;
+import org.hswebframework.web.workflow.dao.entity.ActivityConfigEntity;
+import org.hswebframework.web.workflow.dao.entity.ProcessDefineConfigEntity;
+import org.hswebframework.web.workflow.service.ActivityConfigService;
+import org.hswebframework.web.workflow.service.ProcessDefineConfigService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author zhouhao
+ * @since 3.0.0-RC
+ */
+@RestController
+@RequestMapping("/workflow/process/configuration/activity")
+@Authorize(permission = "workflow-definition", description = "工作流-流程定义管理")
+@Api(tags = "工作流-流程定义-环节配置")
+public class ProcessActivityConfigController
+        implements SimpleGenericEntityController<ActivityConfigEntity, String, QueryParamEntity> {
+    @Autowired
+    private ActivityConfigService service;
+
+    @Override
+    public CrudService<ActivityConfigEntity, String> getService() {
+        return service;
+    }
+
+
+}

+ 33 - 0
hsweb-system/hsweb-system-workflow/hsweb-system-workflow-local/src/main/java/org/hswebframework/web/workflow/web/ProcessDefineConfigController.java

@@ -0,0 +1,33 @@
+package org.hswebframework.web.workflow.web;
+
+import io.swagger.annotations.Api;
+import org.hswebframework.web.authorization.annotation.Authorize;
+import org.hswebframework.web.commons.entity.param.QueryParamEntity;
+import org.hswebframework.web.controller.SimpleGenericEntityController;
+import org.hswebframework.web.service.CrudService;
+import org.hswebframework.web.workflow.dao.entity.ProcessDefineConfigEntity;
+import org.hswebframework.web.workflow.service.ProcessDefineConfigService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author zhouhao
+ * @since 3.0.0-RC
+ */
+@RestController
+@RequestMapping("/workflow/process/configuration/definition")
+@Authorize(permission = "workflow-definition", description = "工作流-流程定义管理")
+@Api(tags = "工作流-流程定义-流程配置")
+public class ProcessDefineConfigController
+        implements SimpleGenericEntityController<ProcessDefineConfigEntity, String, QueryParamEntity> {
+    @Autowired
+    private ProcessDefineConfigService service;
+
+    @Override
+    public CrudService<ProcessDefineConfigEntity, String> getService() {
+        return service;
+    }
+
+
+}

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

@@ -326,11 +326,11 @@ public class BaseProcessDefinitionDiagramLayoutResource {
         for (String key : properties.keySet()) {
             Object prop = properties.get(key);
             if (prop instanceof String)
-                propertiesJSON.put(key, (String) properties.get(key));
+                propertiesJSON.put(key,  properties.get(key));
             else if (prop instanceof Integer)
-                propertiesJSON.put(key, (Integer) properties.get(key));
+                propertiesJSON.put(key,  properties.get(key));
             else if (prop instanceof Boolean)
-                propertiesJSON.put(key, (Boolean) properties.get(key));
+                propertiesJSON.put(key,  properties.get(key));
             else if ("initial".equals(key)) {
                 ActivityImpl act = (ActivityImpl) properties.get(key);
                 propertiesJSON.put(key, act.getId());

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

@@ -1,5 +1,6 @@
 package org.hswebframework.web.workflow.web.diagram;
 
+import org.hswebframework.web.authorization.annotation.Authorize;
 import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.*;
 
@@ -9,6 +10,7 @@ import org.springframework.web.bind.annotation.*;
  */
 @RestController
 @RequestMapping("/workflow/service/")
+@Authorize(permission = "workflow-definition", description = "工作流-流程定义管理")
 public class ProcessDefinitionDiagramLayoutResource
         extends BaseProcessDefinitionDiagramLayoutResource {
 

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

@@ -1,5 +1,6 @@
 package org.hswebframework.web.workflow.web.diagram;
 
+import org.hswebframework.web.authorization.annotation.Authorize;
 import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.*;
 
@@ -9,6 +10,7 @@ import org.springframework.web.bind.annotation.*;
  */
 @RestController
 @RequestMapping("/workflow/service/")
+@Authorize(permission = "workflow-definition", description = "工作流-流程定义管理")
 public class ProcessInstanceDiagramLayoutResource
         extends BaseProcessDefinitionDiagramLayoutResource
 {

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

@@ -29,6 +29,7 @@ import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity;
 import org.activiti.engine.impl.pvm.PvmTransition;
 import org.activiti.engine.impl.pvm.process.ActivityImpl;
 import org.activiti.engine.runtime.ProcessInstance;
+import org.hswebframework.web.authorization.annotation.Authorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.*;
@@ -36,6 +37,7 @@ import org.springframework.web.bind.annotation.*;
 
 @RestController
 @RequestMapping("/workflow/service")
+@Authorize(permission = "workflow-definition", description = "工作流-流程定义管理")
 public class ProcessInstanceHighlightsResource {
 
     @Autowired