DELL
3 天以前 d8475b8670b6b4cbcd1bc9e57d30a6f433d206ab
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
package com.whyc.controller;
 
import com.github.pagehelper.PageInfo;
import com.whyc.dto.Response;
import com.whyc.pojo.db_user.User;
import com.whyc.pojo.web_site.WorkflowMain;
import com.whyc.service.WorkflowLinkService;
import com.whyc.service.WorkflowMainService;
import com.whyc.util.ActionUtil;
import com.whyc.util.CommonUtil;
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.Map;
 
@RestController
@RequestMapping("workflowMain")
@Api(tags = "单据审批")
public class WorkflowMainController {
 
    @Autowired
    private WorkflowMainService service;
 
    @PostMapping("submit")
    @ApiOperation(value = "提交单据", notes = "传参:taskDesc,mainType,mainTypeCN,mainTypeEn,dealRoleId,processLevel")
    public Response<Integer> submit(@RequestBody WorkflowMain  main){
        return service.submit(main);
    }
 
 
    @GetMapping("basicInfo")
    @ApiOperation(value = "工单基本状态")
    public Response<WorkflowMain> getBasicInfo(@RequestParam Integer mainId){
        return new Response<WorkflowMain>().set(1,service.getBaseInfo(mainId));
    }
 
    //本人的单据: 已审批,审批中,已撤销,已驳回
    //接收到的单据: 待审核,(待接单审核?),已审核
 
    /**
     * 本人的单据:
     *  已审批,审批中,已撤销,已驳回
     * */
    @GetMapping("ownStatistics")
    @ApiOperation(value = "本人的单据统计",notes = "status含义:1-审批中,2-审批完成且通过,3-审批完成且驳回")
    public Response<Map<Integer,Integer>> getOwnStatistics(int type){
        int userId = CommonUtil.getUser().getId().intValue();
        return service.getOwnStatistics(userId,type);
    }
 
    /**
     * 本人的单据:
     *  已审批,审批中,已撤销,已驳回
     * */
    @GetMapping("ownListPage")
    @ApiOperation(value = "本人的单据列表分页",notes = "status传参:0:全部,1-审批中,2-审批完成且通过,3-审批完成且驳回")
    public Response<PageInfo<WorkflowMain>> ownListPage(int type,int status,int pageNum,int pageSize){
        int userId = CommonUtil.getUser().getId().intValue();
        return service.ownListPage(userId,type,status,pageNum,pageSize);
    }
 
    /**
     * 接收到的单据:
     *  放电计划临时表中存在: 待审核,待接单审核,已审核
     * */
    @GetMapping("receivedStatistics")
    @ApiOperation(value = "接收到的单据统计",notes = "status含义:1-待接单,6-待审核,58-已审核")
    public Response<Map<Integer,Integer>> getReceivedStatistics(int type){
        User user = CommonUtil.getUser();
        return service.getReceivedStatistics(type,user);
    }
 
    /**
     * 接收到的单据:
     * 放电计划临时表中存在: 待审核,待接单审核,已审核
     */
    @GetMapping("receivedListPage")
    @ApiOperation(value = "接收到的单据列表分页", notes = "status传参:0-全部,1-待接单,6-待审核,5|8-已审核(通过|驳回)")
    public Response<PageInfo<WorkflowMain>> getReceivedListPage(int type, int status, int pageNum, int pageSize) {
        User user = CommonUtil.getUser();
        return service.getReceivedListPage(type, status, user, pageNum, pageSize);
    }
 
}