package com.gk.hotwork.doublePrevention.controller;
|
|
import com.gk.hotwork.Controller.Base.BaseController;
|
import com.gk.hotwork.Domain.co.ContextCacheUser;
|
import com.gk.hotwork.Domain.Vo.ResultVO;
|
import com.gk.hotwork.doublePrevention.entity.PreventRiskMap;
|
import com.gk.hotwork.doublePrevention.entity.dto.req.PreventRiskMapDeleteReqDTO;
|
import com.gk.hotwork.doublePrevention.entity.dto.req.PreventRiskMapQueryReqDTO;
|
import com.gk.hotwork.doublePrevention.entity.dto.req.PreventRiskMapSaveReqDTO;
|
import com.gk.hotwork.doublePrevention.entity.dto.req.PreventRiskMapUpdateReqDTO;
|
import com.gk.hotwork.doublePrevention.service.RiskService;
|
import com.gk.hotwork.doublePrevention.utils.CacheUserTransfer;
|
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;
|
|
@RestController
|
@RequestMapping("prevent/map")
|
public class PreventProduceMapController extends BaseController {
|
|
@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 = CacheUserTransfer.transfer(getUser());
|
return riskService.saveRiskMap(currentUser.getUid(), riskMapSaveReqDTO);
|
}
|
|
/**
|
* 风险分布图-删除
|
*/
|
@PostMapping("/delete/deleteRiskMap")
|
public ResultVO<PreventRiskMap> deleteRiskMap(Authentication authentication, @RequestBody PreventRiskMapDeleteReqDTO riskMapDeleteReqDTO) {
|
//获取用户信息
|
ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser());
|
return riskService.deleteRiskMap(currentUser.getUid(), riskMapDeleteReqDTO);
|
}
|
|
/**
|
* 风险分布图-修改
|
*/
|
@PostMapping("/update/updateRiskMap")
|
public ResultVO<PreventRiskMap> updateRiskMap(Authentication authentication, @RequestBody PreventRiskMapUpdateReqDTO riskMapUpdateReqDTO) {
|
//获取用户信息
|
ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser());
|
return riskService.updateRiskMap(currentUser.getUid(), riskMapUpdateReqDTO);
|
}
|
|
|
/**
|
* 风险分布图-图
|
*/
|
@PostMapping("/select/getMapImage")
|
public ResultVO<PreventRiskMap> getMapImage(@RequestBody Long id) {
|
|
return riskService.getMapImage(id);
|
}
|
}
|