lxw
2023-08-15 160e150009b51a39fa95d9462c3798ba28d51a09
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package com.whyc.controller;
 
import com.whyc.dto.Response;
import com.whyc.pojo.UserInf;
import com.whyc.pojo.WorkflowAction;
import com.whyc.service.WorkflowActionService;
import com.whyc.util.ActionUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
 
@RestController
@RequestMapping("workflowAction")
@Api(tags = "工作流动作")
public class WorkflowActionController {
 
    @Autowired
    private WorkflowActionService service;
 
    //@PostMapping
    //@ApiOperation(value = "创建动作规则")
    //public Response add(@RequestBody WorkflowAction workflowAction){
    //    service.add(workflowAction);
    //    return new Response().setII(1,"创建成功");
    //}
 
    @PutMapping
    @ApiOperation(value = "更新动作规则")
    public Response update(@RequestBody List<WorkflowAction> workflowActionList){
        service.update(workflowActionList);
        return new Response().setII(1,"更新成功");
    }
 
    @GetMapping("actionTypeList4Link")
    @ApiOperation(value = "查询节点的动作类型列表")
    public Response<List<WorkflowAction>> getActionTypeList4Link(@RequestParam Integer type,@RequestParam Integer linkType){
        List<WorkflowAction> actionTypeList = service.getActionTypeList4Link(type,linkType);
        return new Response<List<WorkflowAction>>().set(1,actionTypeList);
    }
 
    /**
     * @see com.whyc.constant.RoleEnum 用户角色说明
     */
    @GetMapping("actionTypeList4Role")
    @ApiOperation(value = "查询动作列表")
    public Response getActionTypeList(@RequestParam Integer type,@RequestParam Integer status){
        int userRole = ActionUtil.getUser().getURole();
        List<WorkflowAction> actionTypeList = service.getActionTypeList(type,status,userRole);
        return new Response<List<WorkflowAction>>().set(1,actionTypeList);
    }
}