郑永安
2023-06-19 7a6abd05683528032687c75e80e0bd2030a3e46c
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
115
116
117
118
119
120
121
package com.gkhy.safePlatform.specialWork.controller;
 
import com.alibaba.fastjson.JSONObject;
import com.gkhy.safePlatform.commons.co.ContextCacheUser;
import com.gkhy.safePlatform.commons.enums.Module;
import com.gkhy.safePlatform.commons.enums.ResultCodes;
import com.gkhy.safePlatform.commons.query.PageQuery;
import com.gkhy.safePlatform.commons.utils.PageUtils;
import com.gkhy.safePlatform.commons.vo.ResultVO;
import com.gkhy.safePlatform.equipment.rpc.api.model.dto.resp.SafeRfidMaterialDetailRPCRespDto;
import com.gkhy.safePlatform.specialWork.entity.WorkProcessCheckInfo;
import com.gkhy.safePlatform.specialWork.model.annotation.CommonLogEnable;
import com.gkhy.safePlatform.specialWork.model.dto.req.WorkProcessCheckReqDTO;
import com.gkhy.safePlatform.specialWork.model.dto.req.WorkProcessDetectionReqDTO;
import com.gkhy.safePlatform.specialWork.model.dto.resp.*;
import com.gkhy.safePlatform.specialWork.model.query.WorkProcessCheckPageQuery;
import com.gkhy.safePlatform.specialWork.model.query.WorkProcessDetectionPageQuery;
import com.gkhy.safePlatform.specialWork.model.query.WorkProcessWarningPageQuery;
import com.gkhy.safePlatform.specialWork.model.query.WorkProcessWorkApplyQuery;
import com.gkhy.safePlatform.specialWork.service.WorkProcessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.List;
import java.util.Map;
 
@RestController
@RequestMapping("work/process")
public class WorkProcessController {
 
    @Autowired
    private WorkProcessService workProcessService;
 
 
 
    /**
    * @Description: 查询可上传的作业信息
    */
    @RequestMapping(value = "/workApply/list", method = RequestMethod.POST)
    public ResultVO<List<WorkApplyReportableRespDTO>> workApplyList(Authentication authentication,@RequestBody WorkProcessWorkApplyQuery query) {
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        List<WorkApplyReportableRespDTO> result = workProcessService.listReportableWorkApply(currentUser, query);
        return new ResultVO<>(ResultCodes.OK, result);
    }
 
 
    /**
     * @Description: 检测上报
     */
    @RequestMapping(value = "/detection/report", method = RequestMethod.POST)
    @CommonLogEnable(module = Module.SPECIAL_WORK,content = "检测上报")
    public ResultVO detectionReport(Authentication authentication, @RequestBody WorkProcessDetectionReqDTO reqDTO) {
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        workProcessService.detectionReport(currentUser, reqDTO);
        return new ResultVO(ResultCodes.OK);
    }
 
 
    /**
     * @Description: 检测分页
     */
    @RequestMapping(value = "/detection/page/list", method = RequestMethod.POST)
    public ResultVO<List<WorkProcessDetectionInfoRespDTO>> detectionPageList(Authentication authentication, @RequestBody PageQuery<WorkProcessDetectionPageQuery> pageQuery) {
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        PageUtils.checkCheck(pageQuery);
        return workProcessService.listDetectionByPage(currentUser, pageQuery);
    }
 
 
    /**
     * @Description: 检查上报
     */
    @RequestMapping(value = "/check/report", method = RequestMethod.POST)
    @CommonLogEnable(module = Module.SPECIAL_WORK,content = "检查上报")
    public ResultVO checkReport(Authentication authentication, @RequestBody WorkProcessCheckReqDTO reqDTO) {
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        workProcessService.checkReport(currentUser, reqDTO);
        return new ResultVO(ResultCodes.OK);
    }
 
 
    /**
     * @Description: 检查分页
     */
    @RequestMapping(value = "/check/page/list", method = RequestMethod.POST)
    public ResultVO<List<WorkProcessCheckInfoRespDTO>> checkPageList(Authentication authentication, @RequestBody PageQuery<WorkProcessCheckPageQuery> pageQuery) {
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        PageUtils.checkCheck(pageQuery);
        return workProcessService.listCheckByPage(currentUser, pageQuery);
    }
 
 
    /**
     * @Description: 预警分页
     */
    @RequestMapping(value = "/warning/page/list", method = RequestMethod.POST)
    public ResultVO<List<WorkProcessWarningInfoRespDTO>> warningPageList(Authentication authentication, @RequestBody PageQuery<WorkProcessWarningPageQuery> pageQuery) {
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        PageUtils.checkCheck(pageQuery);
        return workProcessService.listWarningByPage(currentUser, pageQuery);
    }
    /**
     * 获取物资配置自动检查结果
     */
   /* @RequestMapping(value = "/check/material/list", method = RequestMethod.POST)
    public ResultVO<List<ConfigurationLevelCheckRespDTO>> chekMaterialList(Authentication authentication, @RequestBody JSONObject jsonObject) {
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        String workPermitNo = jsonObject.getString("workPermitNo");
        return workProcessService.chekMaterialList(currentUser, workPermitNo);
    }*/
    @RequestMapping(value = "/check/material", method = RequestMethod.POST)
    public ResultVO<List<WorkMaterialRecordsRespDTO>> chekMaterialList(Authentication authentication, @RequestBody List<String> rfids) {
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        return new ResultVO<>(ResultCodes.OK,workProcessService.getListByRfids(rfids));
    }
 
}