|
@@ -1,12 +1,13 @@
|
|
|
package com.zjugis.business.controller;
|
|
|
|
|
|
+import com.zjugis.business.bean.entity.Project;
|
|
|
import com.zjugis.business.bean.entity.ProjectMaterial;
|
|
|
-import com.zjugis.business.bean.request.ProjectMaterialCategoryRequest;
|
|
|
import com.zjugis.business.bean.request.ProjectMaterialRequest;
|
|
|
-import com.zjugis.business.bean.response.MaterialTreeNode;
|
|
|
import com.zjugis.business.service.ProjectMaterialService;
|
|
|
+import com.zjugis.business.service.ProjectService;
|
|
|
import com.zjugis.framework.common.pojo.CommonResult;
|
|
|
import com.zjugis.framework.workflow.rpc.remote.WorkflowClient;
|
|
|
+import com.zjugis.framework.workflow.utils.zTree;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
@@ -28,6 +29,9 @@ public class ProjectMaterialController {
|
|
|
@Resource
|
|
|
private ProjectMaterialService projectMaterialService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ProjectService projectService;
|
|
|
+
|
|
|
@Autowired
|
|
|
WorkflowClient workflowClient;
|
|
|
|
|
@@ -55,14 +59,15 @@ public class ProjectMaterialController {
|
|
|
}
|
|
|
|
|
|
|
|
|
- @PostMapping("/project-material/category")
|
|
|
- public CommonResult<Long> category(@Valid @RequestBody ProjectMaterialCategoryRequest category) throws Exception {
|
|
|
- return CommonResult.success(projectMaterialService.category(category));
|
|
|
- }
|
|
|
+// @PostMapping("/project-material/category")
|
|
|
+// public CommonResult<Long> category(@Valid @RequestBody ProjectMaterialCategoryRequest category) throws Exception {
|
|
|
+// return CommonResult.success(projectMaterialService.category(category));
|
|
|
+// }
|
|
|
|
|
|
@PostMapping("/project-material/tree")
|
|
|
- public CommonResult<List<MaterialTreeNode>> tree(@Valid @RequestBody ProjectMaterialRequest p) throws Exception {
|
|
|
- return CommonResult.success(projectMaterialService.tree(p));
|
|
|
+ public CommonResult<List<zTree>> tree(@Valid @RequestBody ProjectMaterialRequest p) throws Exception {
|
|
|
+ Project project = projectService.selectDOById(p.getProjectId());
|
|
|
+ return workflowClient.getMaterialTree(project.getInstanceId(),null);
|
|
|
}
|
|
|
|
|
|
/**
|