lyh
2025-01-16 1d84a3c62eeee429f7d7d6339bcf9b504a9d7277
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
package org.jeecg.modules.activiti.controller;
 
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.modules.activiti.entity.ActivitiDefinition;
import org.jeecg.modules.activiti.request.ActivitiDefinitionRequest;
import org.jeecg.modules.activiti.service.IActivitiDefinitionService;
import org.jeecg.modules.dnc.response.CommonCode;
import org.jeecg.modules.dnc.response.QueryPageResponseResult;
import org.jeecg.modules.dnc.response.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
@Slf4j
@Api(tags = "DNC流程配置")
@RestController
@RequestMapping("/nc/definition")
public class ActivitiDefinitionController {
    @Autowired
    private IActivitiDefinitionService definitionService;
 
    @AutoLog(value = "DNC流程配置-添加配置")
    @ApiOperation(value = "DNC流程配置-添加配置", notes = "DNC流程配置-添加配置")
    @PostMapping("/add")
    public ResponseResult addDefinition(@RequestBody ActivitiDefinition definition) {
        boolean b = definitionService.addDefinition(definition);
        if(b)
            return new ResponseResult(CommonCode.SUCCESS);
        return new ResponseResult(CommonCode.FAIL);
    }
 
    @AutoLog(value = "DNC流程配置-修改配置")
    @ApiOperation(value = "DNC流程配置-修改配置", notes = "DNC流程配置-修改配置")
    @PutMapping("/edit")
    public ResponseResult editDefinition( @RequestBody ActivitiDefinition definition) {
        boolean b = definitionService.updateById(definition);
        if(b)
            return new ResponseResult(CommonCode.SUCCESS);
        return new ResponseResult(CommonCode.FAIL);
    }
 
    @AutoLog(value = "DNC流程配置-删除配置")
    @ApiOperation(value = "DNC流程配置-删除配置", notes = "DNC流程配置-删除配置")
    @DeleteMapping("/delete")
    public ResponseResult deleteDefinition(@RequestParam("id") String id) {
        boolean b = definitionService.deleteDefinition(id);
        if(b)
            return new ResponseResult(CommonCode.SUCCESS);
        return new ResponseResult(CommonCode.FAIL);
    }
 
    @AutoLog(value = "DNC流程配置-分页查询配置列表")
    @ApiOperation(value = "DNC流程配置-分页查询配置列表", notes = "DNC流程配置-分页查询配置列表")
    @GetMapping("/find/page")
    public Result<?> findPageList(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                  @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                  ActivitiDefinitionRequest request) {
        return definitionService.findPageList(pageNo, pageSize, request);
    }
}