郑永安
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
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.PreventRiskMap;
import com.gkhy.safePlatform.doublePrevention.entity.dto.req.PreventRiskMapDeleteReqDTO;
import com.gkhy.safePlatform.doublePrevention.entity.dto.req.PreventRiskMapQueryReqDTO;
import com.gkhy.safePlatform.doublePrevention.entity.dto.req.PreventRiskMapSaveReqDTO;
import com.gkhy.safePlatform.doublePrevention.entity.dto.req.PreventRiskMapUpdateReqDTO;
import com.gkhy.safePlatform.doublePrevention.service.RiskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
 
import java.security.Principal;
 
@RestController
@RequestMapping("prevent/map")
public class PreventProduceMapController {
 
    @Autowired
    private RiskService riskService;
 
 
    /**
     * 风险分布图-分页查询详细信息
     */
    @PostMapping("/select/getRiskMapPage")
    public ResultVO<PreventRiskMap> getMapPage(@RequestBody PreventRiskMapQueryReqDTO riskMapQueryReqDTO) {
 
        return riskService.getMapPage(riskMapQueryReqDTO);
    }
 
    /**
     * 风险分布图-新增
     */
    @PostMapping("/insert/saveRiskMap")
    public ResultVO<PreventRiskMap> saveRiskMap(Authentication authentication, PreventRiskMapSaveReqDTO riskMapSaveReqDTO) {
        //获取用户信息
        ContextCacheUser currentUser = (ContextCacheUser)authentication.getPrincipal();
        return riskService.saveRiskMap(currentUser.getUid(), riskMapSaveReqDTO);
    }
 
    /**
     * 风险分布图-删除
     */
    @PostMapping("/delete/deleteRiskMap")
    public ResultVO<PreventRiskMap> deleteRiskMap(Authentication authentication, @RequestBody PreventRiskMapDeleteReqDTO riskMapDeleteReqDTO) {
        //获取用户信息
        ContextCacheUser currentUser = (ContextCacheUser)authentication.getPrincipal();
        return riskService.deleteRiskMap(currentUser.getUid(), riskMapDeleteReqDTO);
    }
 
    /**
     * 风险分布图-修改
     */
    @PostMapping("/update/updateRiskMap")
    public ResultVO<PreventRiskMap> updateRiskMap(Authentication authentication, @RequestBody PreventRiskMapUpdateReqDTO riskMapUpdateReqDTO) {
        //获取用户信息
        ContextCacheUser currentUser = (ContextCacheUser)authentication.getPrincipal();
        return riskService.updateRiskMap(currentUser.getUid(), riskMapUpdateReqDTO);
    }
 
 
    /**
     * 风险分布图-图
     */
    @PostMapping("/select/getMapImage")
    public ResultVO<PreventRiskMap> getMapImage(@RequestBody Long id) {
 
        return riskService.getMapImage(id);
    }
}