lxw
2023-09-04 cbc09e1b6ce4c6674d75a96982848af6572f32b9
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
package com.whyc.controller;
 
import com.whyc.dto.Response;
import com.whyc.dto.WorkflowLinkDTO;
import com.whyc.pojo.UserInf;
import com.whyc.pojo.WorkflowLink;
import com.whyc.service.WorkflowLinkService;
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 java.util.List;
 
@RestController
@RequestMapping("workflowLink")
@Api(tags = "单据审批")
public class WorkflowLinkController {
    
    @Autowired
    private WorkflowLinkService service;
 
    @GetMapping("workflowInfo")
    @ApiOperation(value = "工单节点列表")
    public Response<List<WorkflowLink>> getWorkflowInfo(@RequestParam Integer mainId){
        return new Response<List<WorkflowLink>>().set(1, service.getWorkflowInfo(mainId));
    }
 
    @PutMapping("linkOfDischargePlanTemp")
    @ApiOperation(value = "更新节点-放电计划", notes = "传参link对象内,传入id,mainId,processLevel,status,dealReason或者dealRejectReason;" +
            "字段status:5-通过,8-驳回")
    public Response updateLinkOfDischargePlanTemp(@RequestBody WorkflowLinkDTO linkDTO) {
        return service.updateLinkOfDischargePlanTemp(linkDTO);
    }
 
    @PutMapping("link")
    @ApiOperation(value = "更新节点", notes = "传参link对象内,传入id,mainId,processLevel,status,dealReason或者dealRejectReason;type传3" +
            "字段status:5-通过,8-驳回")
    public Response updateLink(@RequestBody WorkflowLinkDTO linkDTO) {
        return service.updateLink(linkDTO);
    }
 
    @PostMapping("linkOfTemp")
    @ApiOperation(value = "更新节点(除放电计划之外的)", notes = "传参link对象内,传入id,mainId,status,dealReason或者dealRejectReason;" +
            "字段status:5-通过,8-驳回")
    public Response linkOfTemp(@RequestBody WorkflowLink link) {
        return service.linkOfTemp(link);
    }
 
    @GetMapping("searchTmp")
    @ApiOperation(value = "查询节点(除放电计划之外的)", notes = "status:0全部,1审批中,2审批通过,3驳回;type:0全部,2二次放电,3告警隐患")
    public Response searchTmp(@RequestParam int type, @RequestParam int status, @RequestParam int pageNum, @RequestParam int pageSize) {
        UserInf uinf = ActionUtil.getUser();
        return service.searchTmp(uinf.getUId().intValue(), uinf.getURole(), type, status, pageNum, pageSize);
    }
 
    @GetMapping("searchLastHrById")
    @ApiOperation(value = "节点为二次放电时查询二次放电参数和本年上一次有效核容数据")
    public Response searchLastHrById(@RequestParam int mid) {
        return service.searchLastHrById(mid);
    }
 
    @GetMapping("searcFaultById")
    @ApiOperation(value = "节点为故障隐患")
    public Response searcFaultById(@RequestParam int mid) {
        return service.searcFaultById(mid);
    }
 
    @GetMapping("getFlowMainByUid")
    @ApiOperation(value = "查询自己申请的工单(去除放电计划)", notes = "status:0全部,1审批中,2审批通过,3驳回;type:0全部,2二次放电,3告警隐患")
    public Response getFlowMainByUid(@RequestParam int type, @RequestParam int status, @RequestParam int pageNum, @RequestParam int pageSize) {
        UserInf uinf = ActionUtil.getUser();
        return service.getFlowMainByUid(uinf.getUId().intValue(), type, status, pageNum, pageSize);
    }
}