郑永安
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
package com.gkhy.safePlatform.doublePrevention.controller;
 
import com.gkhy.safePlatform.commons.co.ContextCacheUser;
import com.gkhy.safePlatform.commons.vo.ResultVO;
import com.gkhy.safePlatform.doublePrevention.entity.PreventDangerCheckWork;
import com.gkhy.safePlatform.doublePrevention.entity.PreventRiskAnaUnit;
import com.gkhy.safePlatform.doublePrevention.entity.dto.req.*;
import com.gkhy.safePlatform.doublePrevention.service.DangerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.security.Principal;
 
@RestController
@RequestMapping("prevent/checkWork")
public class PreventDangerCheckWorkController {
 
    @Autowired
    private DangerService dangerService;
 
    /**
     * 隐患排查作业-分页查询
     */
    @PostMapping("/select/getCheckWorkPage")
    public ResultVO<PreventDangerCheckWork> getCheckWorkPage(Authentication authentication, @RequestBody PreventDangerCheckWorkQueryReqDTO workQueryReqDTO) {
        //获取用户信息
        ContextCacheUser currentUser = (ContextCacheUser)authentication.getPrincipal();
        return dangerService.getCheckWorkPage(currentUser.getUid(), workQueryReqDTO);
    }
 
    /**
     * 隐患排查作业-任务列表
     */
    @PostMapping("/select/listCheckWork")
    public ResultVO<PreventDangerCheckWork> listCheckWork(Authentication authentication) {
        //获取用户信息
        ContextCacheUser currentUser = (ContextCacheUser)authentication.getPrincipal();
        return dangerService.listCheckWork(currentUser.getUid());
    }
 
    /**
     * 隐患排查作业-查看检查内容
     */
    @PostMapping("/select/getCheckWorkContent")
    public ResultVO<PreventDangerCheckWork> getCheckWorkContent(Authentication authentication, @RequestBody PreventDangerCheckWorkContentQueryReqDTO contentReqDTO) {
        //获取用户信息
        ContextCacheUser currentUser = (ContextCacheUser)authentication.getPrincipal();
        return dangerService.getCheckWorkContent(currentUser.getUid(), contentReqDTO);
    }
 
    /**
     * 隐患排查作业-新增
     */
    @PostMapping("/insert/saveCheckWork")
    public ResultVO<PreventDangerCheckWork> saveCheckWork(Authentication authentication, @RequestBody PreventDangerCheckWorkSaveReqDTO workSaveReqDTO) {
        //获取用户信息
        ContextCacheUser currentUser = (ContextCacheUser)authentication.getPrincipal();
        return dangerService.saveCheckWork(currentUser.getUid(), workSaveReqDTO);
    }
 
    /**
     * 隐患排查作业-修改
     */
    @PostMapping("/update/updateCheckWork")
    public ResultVO<PreventDangerCheckWork> updateCheckWork(Authentication authentication, @RequestBody PreventDangerCheckWorkUpdateReqDTO workUpdateReqDTO) {
        //获取用户信息
        ContextCacheUser currentUser = (ContextCacheUser)authentication.getPrincipal();
        return dangerService.updateCheckWork(currentUser.getUid(), workUpdateReqDTO);
    }
 
    /**
     * 隐患排查作业-删除
     */
    @PostMapping("/delete/deleteCheckWork")
    public ResultVO<PreventDangerCheckWork> deleteCheckWork(Authentication authentication, @RequestBody PreventDangerCheckWorkDeleteReqDTO workDeleteReqDTO) {
        //获取用户信息
        ContextCacheUser currentUser = (ContextCacheUser)authentication.getPrincipal();
        return dangerService.deleteCheckWork(currentUser.getUid(), workDeleteReqDTO);
    }
 
    /**
     * 排查作业-手工上报-配置
     */
    @PostMapping("/update/updateReport")
    public ResultVO<PreventRiskAnaUnit> updateCheckWorkReport(Authentication authentication, @RequestBody PreventHandReportConfigReqDTO preventHandReportConfigReqDTO) {
        //获取用户信息
        ContextCacheUser currentUser = (ContextCacheUser)authentication.getPrincipal();
        return dangerService.updateCheckWorkReport(currentUser.getUid(), preventHandReportConfigReqDTO);
    }
 
}