双重预防项目-国泰新华二开定制版
huangzhen
2022-09-09 4c3185f4e6580bc2ad2afb869b57861eec9787cb
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
package com.ruoyi.doublePrevention.controller;
 
 
 
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.doublePrevention.entity.PreventRiskEvent;
import com.ruoyi.doublePrevention.entity.dto.req.*;
import com.ruoyi.doublePrevention.entity.dto.resp.PreventRiskEventListQueryRespDTO;
import com.ruoyi.doublePrevention.entity.dto.resp.PreventRiskEventPageQueryRespDTO;
import com.ruoyi.doublePrevention.entity.dto.resp.PreventRiskEventRespDTO;
import com.ruoyi.doublePrevention.enums.ErrorCodes;
import com.ruoyi.doublePrevention.enums.ResultCodes;
import com.ruoyi.doublePrevention.service.RiskService;
import com.ruoyi.doublePrevention.vo.ResultVO;
import com.ruoyi.project.system.user.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
import static com.ruoyi.common.utils.security.ShiroUtils.getSysUser;
 
@RestController
@RequestMapping("/riskEvent")
public class PreventRiskEventController {
 
    @Autowired
    private RiskService riskService;
 
    /**
     * 风险事件-分页查询
     */
    @PostMapping("/select/listRiskEventPage")
    public ResultVO<List<PreventRiskEventPageQueryRespDTO>> listRiskEventPage(@RequestBody PreventRiskEventPageQueryReqDTO riskEventQueryReqDTO) {
        return riskService.listRiskEventPage(riskEventQueryReqDTO);
    }
 
    /**
     * 风险事件-新增
     */
    @PostMapping("/insert/saveRiskEvent")
    public ResultVO<PreventRiskEvent> saveRiskEvent(@RequestBody PreventRiskEventSaveReqDTO riskEventSaveReqDTO) {
        return riskService.saveRiskEvent(riskEventSaveReqDTO);
    }
 
    /**
     * 风险事件-修改
     */
    @PostMapping("/update/updateRiskEvent")
    public ResultVO<PreventRiskEvent> updateRiskEvent(@RequestBody PreventRiskEventUpdateReqDTO riskEventUpdateReqDTO) {
        return riskService.updateRiskEvent(riskEventUpdateReqDTO);
    }
 
    /**
     * 风险事件-删除
     */
    @PostMapping("/delete/deleteRiskEvent")
    public ResultVO<PreventRiskEvent> deleteRiskEvent(@RequestBody PreventRiskEventDeleteReqDTO riskEventDeleteReqDTO) {
        return riskService.deleteRiskEvent(riskEventDeleteReqDTO);
    }
 
    /**
     * @description 根据风险事件的id查询风险事件
     */
    @PostMapping("/select/getRiskEventById")
    public ResultVO<PreventRiskEventRespDTO> getRiskEventById(@RequestBody PreventRiskEventGetReqDTO riskEventGetReqDTO){
        return riskService.getRiskEventById(riskEventGetReqDTO);
    }
 
    /**
     * @description 获取所有风险事件不分页
     */
    @GetMapping("/select/listRiskEvent")
    public ResultVO<List<PreventRiskEventListQueryRespDTO>> listRiskEvent() {
        return riskService.listRiskEvent();
    }
}