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.PreventRiskAnaUnit; import com.gkhy.safePlatform.doublePrevention.entity.PreventRiskControlMeasure; import com.gkhy.safePlatform.doublePrevention.entity.dto.req.*; 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 java.security.Principal; @RestController @RequestMapping("prevent/riskControlMeasure") public class PreventRiskControlMeasureController { @Autowired private RiskService riskService; /** * 管控措施-分页查询 */ @PostMapping("/select/getRiskControlMeasurePage") public ResultVO getRiskControlMeasurePage(Authentication authentication, @RequestBody PreventRiskControlMeasureQueryReqDTO measureQueryReqDTO) { //获取用户信息 ContextCacheUser currentUser = (ContextCacheUser)authentication.getPrincipal(); return riskService.getRiskControlMeasurePage(currentUser.getUid(), measureQueryReqDTO); } /** * 管控措施-新增 */ @PostMapping("/insert/saveRiskControlMeasure") public ResultVO saveRiskControlMeasure(Authentication authentication, @RequestBody PreventRiskControlMeasureSaveReqDTO measureSaveReqDTO) { //获取用户信息 ContextCacheUser currentUser = (ContextCacheUser)authentication.getPrincipal(); return riskService.saveRiskControlMeasure(currentUser.getUid(), measureSaveReqDTO); } /** * 管控措施-修改 */ @PostMapping("/update/updateRiskControlMeasure") public ResultVO updateRiskControlMeasure(Authentication authentication, @RequestBody PreventRiskControlMeasureUpdateReqDTO measureUpdateReqDTO) { //获取用户信息 ContextCacheUser currentUser = (ContextCacheUser)authentication.getPrincipal(); return riskService.updateRiskControlMeasure(currentUser.getUid(), measureUpdateReqDTO); } /** * 管控措施-删除 */ @PostMapping("/delete/deleteRiskControlMeasure") public ResultVO deleteRiskControlMeasure(Authentication authentication, @RequestBody PreventRiskControlMeasureDeleteReqDTO measureDeleteReqDTO) { //获取用户信息 ContextCacheUser currentUser = (ContextCacheUser)authentication.getPrincipal(); return riskService.deleteRiskControlMeasure(currentUser.getUid(), measureDeleteReqDTO); } /** * 管控措施- 管控措施模板 */ @PostMapping("/select/listMeasures") public ResultVO listMeasures(Authentication authentication) { //获取用户信息 ContextCacheUser currentUser = (ContextCacheUser)authentication.getPrincipal(); return riskService.listMeasures(currentUser.getUid()); } /** * 安全风险事件-手工上报-配置 */ @PostMapping("/update/updateReport") public ResultVO updateMeasuresReport(Authentication authentication, @RequestBody PreventHandReportConfigReqDTO preventHandReportConfigReqDTO) { //获取用户信息 ContextCacheUser currentUser = (ContextCacheUser)authentication.getPrincipal(); return riskService.updateMeasuresReport(currentUser.getUid(), preventHandReportConfigReqDTO); } /** * 管控措施- 管控措施列表 */ @PostMapping("/select/listControlMeasure") public ResultVO listControlMeasure(Authentication authentication) { //获取用户信息 ContextCacheUser currentUser = (ContextCacheUser)authentication.getPrincipal(); return riskService.listControlMeasure(currentUser); } }