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.PostMapping;
|
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RestController;
|
|
import java.util.List;
|
|
import static com.ruoyi.common.utils.security.ShiroUtils.getSysUser;
|
|
@RestController
|
@RequestMapping("/prevent/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 获取所有风险事件不分页
|
*/
|
@PostMapping("/select/listRiskEvent")
|
public ResultVO<List<PreventRiskEventListQueryRespDTO>> listRiskEvent() {
|
return riskService.listRiskEvent();
|
}
|
}
|