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.PreventDangerCheckWork;
|
import com.gk.hotwork.doublePrevention.entity.PreventRiskAnaUnit;
|
import com.gk.hotwork.doublePrevention.entity.dto.req.*;
|
import com.gk.hotwork.doublePrevention.service.DangerService;
|
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/checkWork")
|
public class PreventDangerCheckWorkController extends BaseController {
|
|
@Autowired
|
private DangerService dangerService;
|
|
/**
|
* 隐患排查作业-分页查询
|
*/
|
@PostMapping("/select/getCheckWorkPage")
|
public ResultVO<PreventDangerCheckWork> getCheckWorkPage(Authentication authentication, @RequestBody PreventDangerCheckWorkQueryReqDTO workQueryReqDTO) {
|
//获取用户信息
|
ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser());
|
return dangerService.getCheckWorkPage(currentUser.getUid(), workQueryReqDTO);
|
}
|
|
/**
|
* 隐患排查作业-任务列表
|
*/
|
@PostMapping("/select/listCheckWork")
|
public ResultVO<PreventDangerCheckWork> listCheckWork(Authentication authentication) {
|
//获取用户信息
|
ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser());
|
return dangerService.listCheckWork(currentUser.getUid());
|
}
|
|
/**
|
* 隐患排查作业-查看检查内容
|
*/
|
@PostMapping("/select/getCheckWorkContent")
|
public ResultVO<PreventDangerCheckWork> getCheckWorkContent(Authentication authentication, @RequestBody PreventDangerCheckWorkContentQueryReqDTO contentReqDTO) {
|
//获取用户信息
|
ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser());
|
return dangerService.getCheckWorkContent(currentUser.getUid(), contentReqDTO);
|
}
|
|
/**
|
* 隐患排查作业-新增
|
*/
|
@PostMapping("/insert/saveCheckWork")
|
public ResultVO<PreventDangerCheckWork> saveCheckWork(Authentication authentication, @RequestBody PreventDangerCheckWorkSaveReqDTO workSaveReqDTO) {
|
//获取用户信息
|
ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser());
|
return dangerService.saveCheckWork(currentUser.getUid(), workSaveReqDTO);
|
}
|
|
/**
|
* 隐患排查作业-修改
|
*/
|
@PostMapping("/update/updateCheckWork")
|
public ResultVO<PreventDangerCheckWork> updateCheckWork(Authentication authentication, @RequestBody PreventDangerCheckWorkUpdateReqDTO workUpdateReqDTO) {
|
//获取用户信息
|
ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser());
|
return dangerService.updateCheckWork(currentUser.getUid(), workUpdateReqDTO);
|
}
|
|
/**
|
* 隐患排查作业-删除
|
*/
|
@PostMapping("/delete/deleteCheckWork")
|
public ResultVO<PreventDangerCheckWork> deleteCheckWork(Authentication authentication, @RequestBody PreventDangerCheckWorkDeleteReqDTO workDeleteReqDTO) {
|
//获取用户信息
|
ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser());
|
return dangerService.deleteCheckWork(currentUser.getUid(), workDeleteReqDTO);
|
}
|
|
/**
|
* 排查作业-手工上报-配置
|
*/
|
@PostMapping("/update/updateReport")
|
public ResultVO<PreventRiskAnaUnit> updateCheckWorkReport(Authentication authentication, @RequestBody PreventHandReportConfigReqDTO preventHandReportConfigReqDTO) {
|
//获取用户信息
|
ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser());
|
return dangerService.updateCheckWorkReport(currentUser.getUid(), preventHandReportConfigReqDTO);
|
}
|
|
}
|