郑永安
2023-09-19 69185134fcfaf913ea45f1255677225a2cc311a4
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
package com.gk.hotwork.specialWork.controller;
 
 
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.gk.hotwork.Config.Oauth2.RedisKeyEnum;
import com.gk.hotwork.Controller.Base.BaseController;
import com.gk.hotwork.Domain.Enum.ResultCodes;
import com.gk.hotwork.Domain.UserInfo;
import com.gk.hotwork.Domain.Utils.CommonUtil;
import com.gk.hotwork.Domain.Utils.PageUtils;
import com.gk.hotwork.Domain.Vo.PageQuery;
import com.gk.hotwork.Domain.Vo.ResultVO;
import com.gk.hotwork.Domain.co.ContextCacheUser;
import com.gk.hotwork.doublePrevention.utils.CacheUserTransfer;
import com.gk.hotwork.specialWork.model.dto.req.WorkProcessDetectionReqDTO;
import com.gk.hotwork.specialWork.model.dto.resp.WorkApplyReportableRespDTO;
import com.gk.hotwork.specialWork.model.dto.resp.WorkProcessDetectionInfoRespDTO;
import com.gk.hotwork.specialWork.model.query.WorkProcessDetectionPageQuery;
import com.gk.hotwork.specialWork.model.query.WorkProcessWorkApplyQuery;
import com.gk.hotwork.specialWork.service.WorkProcessService;
import org.apache.tomcat.util.net.openssl.ciphers.Authentication;
import org.springframework.beans.factory.annotation.Autowired;
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;
 
@RestController
@RequestMapping("work/process")
public class WorkProcessController extends BaseController {
 
    @Autowired
    private WorkProcessService workProcessService;
 
 
 
    /**
    * @Description: 查询可上传的作业信息
    */
    @RequestMapping(value = "/workApply/list", method = RequestMethod.POST)
    public ResultVO<List<WorkApplyReportableRespDTO>> workApplyList(Authentication authentication, @RequestBody WorkProcessWorkApplyQuery query) {
        ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser());
        List<WorkApplyReportableRespDTO> result = workProcessService.listReportableWorkApply(currentUser, query);
        return new ResultVO<>(ResultCodes.OK, result);
    }
 
 
    /**
     * @Description: 检测上报
     */
    @RequestMapping(value = "/detection/report", method = RequestMethod.POST)
    public ResultVO detectionReport(Authentication authentication, @RequestBody WorkProcessDetectionReqDTO reqDTO) {
        ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser());
        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 = CacheUserTransfer.transfer(getUser());
        PageUtils.checkCheck(pageQuery);
        return workProcessService.listDetectionByPage(currentUser, pageQuery);
    }
 
 
 
}