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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
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.AssignFileStream;
import org.jeecg.modules.activiti.ext.ActTaskExt;
import org.jeecg.modules.activiti.ext.AssignFileStreamExt;
import org.jeecg.modules.activiti.request.ApproveBatchRequest;
import org.jeecg.modules.activiti.request.AssignFileRequest;
import org.jeecg.modules.activiti.request.AssignFileStreamQueryRequest;
import org.jeecg.modules.activiti.service.IAssignFileStreamService;
import org.jeecg.modules.dnc.response.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.Collections;
import java.util.List;
 
@Slf4j
@Api(tags = "DNC流程操作")
@RestController
@RequestMapping("/nc/activit")
public class AssignFileStreamController  {
    @Autowired
    private IAssignFileStreamService assignFileStreamService;
 
    @AutoLog(value = "DNC流程操作-启动流程 保存相应的数据 绑定businessKey")
    @ApiOperation(value = "DNC流程操作-启动流程 保存相应的数据 绑定businessKey", notes = "DNC流程操作-启动流程 保存相应的数据 绑定businessKey")
    @PostMapping("/assign/file/apply")
    public ResponseResult applyAssignFile(@RequestBody AssignFileStream stream) {
        ResponseResult b = assignFileStreamService.applyAssignFile(stream);
        if(b.isSuccess()) {
            return new ResponseResult(CommonCode.SUCCESS);
        }
        return b;
    }
 
    @AutoLog(value = "DNC流程操作-审批服务")
    @ApiOperation(value = "DNC流程操作-审批服务", notes = "DNC流程操作-审批服务")
    @PostMapping("/assign/file/approve/{taskId}/{streamId}")
    public ResponseResult approveAssignFile(@PathVariable("taskId") String taskId, @PathVariable("streamId") String streamId,
                                            @RequestBody AssignFileStream stream) {
        boolean b = assignFileStreamService.approveAssignFile(taskId, streamId, stream);
        if(b)
            return new ResponseResult(CommonCode.SUCCESS);
        return new ResponseResult(CommonCode.FAIL);
    }
 
    @AutoLog(value = "DNC流程操作-获取当前用户的待办及可拾取的任务")
    @ApiOperation(value = "DNC流程操作-获取当前用户的待办及可拾取的任务", notes = "DNC流程操作-获取当前用户的待办及可拾取的任务")
    @GetMapping("/find/task/list")
    public QueryListResponseResult<ActTaskExt> getUndoTaskList() {
        List<ActTaskExt> list = assignFileStreamService.getUndoTaskList();
        if(list == null)
            list = Collections.emptyList();
        return new QueryListResponseResult<>(CommonCode.SUCCESS, list);
    }
 
    @AutoLog(value = "DNC流程操作-批量指派到设备")
    @ApiOperation(value = "DNC流程操作-批量指派到设备", notes = "DNC流程操作-批量指派到设备")
    @PostMapping("/assign/file/batch/apply")
    public ResponseResult applyBatchAssignFile(@RequestBody AssignFileRequest assignFileRequest) {
        boolean b = assignFileStreamService.applyBatchAssignFile(assignFileRequest);
        if(b)
            return new ResponseResult(CommonCode.SUCCESS);
        return new ResponseResult(CommonCode.FAIL);
    }
 
    @AutoLog(value = "DNC流程操作-批量审批")
    @ApiOperation(value = "DNC流程操作-批量审批", notes = "DNC流程操作-批量审批")
    @PostMapping("/assign/file/batch/approve")
    public ResponseResult approveBatchAssignFile(@RequestBody ApproveBatchRequest approveBatchRequest) {
        boolean b = assignFileStreamService.approveBatchAssignFile(approveBatchRequest);
        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, AssignFileStreamQueryRequest request) {
        return assignFileStreamService.findPageList(pageNo, pageSize, request);
    }
 
    @AutoLog(value = "DNC流程操作-查询文档的审批记录")
    @ApiOperation(value = "DNC流程操作-查询文档的审批记录", notes = "DNC流程操作-查询文档的审批记录")
    @GetMapping("/find/page/{page}/{size}/{docId}")
    public QueryPageResponseResult<AssignFileStreamExt> findPageListByDocId(@PathVariable("page") int page, @PathVariable("size") int size, @PathVariable("docId") String docId) {
        return assignFileStreamService.findPageListByDocId(page, size, docId);
    }
 
    @AutoLog(value = "DNC流程操作-获取启用流程的标记")
    @ApiOperation(value = "DNC流程操作-获取启用流程的标记", notes = "DNC流程操作-获取启用流程的标记")
    @GetMapping("/get/enable/flag")
    public DataResponseResult<Boolean> getActiveEnable() {
        Boolean b = assignFileStreamService.getActiveEnable();
        return new DataResponseResult<>(CommonCode.SUCCESS, b);
    }
 
    @AutoLog(value = "DNC流程操作-扫码传输程序 不经过审批 文件存在采用覆盖")
    @ApiOperation(value = "DNC流程操作-扫码传输程序 不经过审批 文件存在采用覆盖", notes = "DNC流程操作-扫码传输程序 不经过审批 文件存在采用覆盖")
    @PostMapping("/transfer/doc")
    public ResponseResult transferDocFile(String pnCode, String deviceNo) {
        boolean b = assignFileStreamService.transferDocFile(pnCode, deviceNo);
        if(b)
            return new ResponseResult(CommonCode.SUCCESS);
        return new ResponseResult(CommonCode.FAIL);
    }
}