xiangpei
2025-02-11 d0b275ac9b4b071359356edf238e7d0c9114dbd1
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package com.ycl.controller;
 
 
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ycl.common.base.Result;
import com.ycl.common.constant.UserConstants;
import com.ycl.common.core.controller.BaseController;
import com.ycl.common.core.domain.AjaxResult;
import com.ycl.common.core.domain.entity.SysMenu;
import com.ycl.common.group.Add;
import com.ycl.common.group.Update;
import com.ycl.domain.entity.FlowableType;
import com.ycl.domain.form.PlanForm;
import com.ycl.domain.query.PlanQuery;
import com.ycl.domain.vo.PlanVO;
import com.ycl.framework.utils.PageUtil;
import com.ycl.service.FlowableTypeService;
import com.ycl.service.PlanService;
import com.ycl.system.domain.base.AbsQuery;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
 
import javax.validation.constraints.NotEmpty;
import java.util.Date;
import java.util.List;
 
/**
 * 工作流分类 前端控制器
 */
@Validated
@RequiredArgsConstructor
@Api(value = "工作流分类", tags = "工作流分类管理")
@RestController
@RequestMapping("/flowable_type")
public class FlowableTypeController extends BaseController {
 
    private final FlowableTypeService flowableTypeService;
 
    @PostMapping
    @ApiOperation(value = "添加", notes = "添加")
//    @PreAuthorize("hasAuthority('flowableType:add')")
    public Result add(@RequestBody @Validated(Add.class) FlowableType form) {
        form.setCreateBy(getUsername());
        form.setCreateTime(new Date());
        form.setUpdateBy(getUsername());
        form.setUpdateTime(new Date());
        flowableTypeService.save(form);
        return Result.ok();
    }
 
    @PutMapping
    @ApiOperation(value = "修改", notes = "修改")
//    @PreAuthorize("hasAuthority('flowableType:edit')")
    public Result update(@RequestBody @Validated(Update.class) FlowableType form) {
        flowableTypeService.updateById(form);
        return Result.ok();
    }
 
    @DeleteMapping("/{id}")
    @ApiOperation(value = "ID删除", notes = "ID删除")
//    @PreAuthorize("hasAuthority('flowableType:del')")
    public Result removeById(@PathVariable("id") String id) {
        flowableTypeService.removeById(id);
        return Result.ok();
    }
 
 
    @GetMapping("/list")
//    @PreAuthorize("hasAuthority('flowableType:page')")
    public Result list(FlowableType flowableType) {
        List<FlowableType> list = flowableTypeService.selectTypeList(flowableType);
        return Result.ok().data(list);
    }
    @GetMapping("/tree_select")
    public AjaxResult treeSelect(FlowableType flowableType) {
        List<FlowableType> list = flowableTypeService.selectTypeList(flowableType);
        return success(flowableTypeService.buildTreeSelect(list));
    }
}