package com.gk.hotwork.doublePrevention.controller;
|
|
import com.gk.hotwork.Controller.Base.BaseController;
|
import com.gk.hotwork.Domain.Utils.PageUtils;
|
import com.gk.hotwork.Domain.Vo.PageQuery;
|
import com.gk.hotwork.Domain.co.ContextCacheUser;
|
import com.gk.hotwork.Domain.Vo.ResultVO;
|
import com.gk.hotwork.doublePrevention.entity.PreventDangerRectify;
|
import com.gk.hotwork.doublePrevention.entity.dto.query.OwnRectifyPageQuery;
|
import com.gk.hotwork.doublePrevention.entity.dto.req.*;
|
import com.gk.hotwork.doublePrevention.service.RectifyService;
|
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/dangerRectify")
|
public class PreventDangerRectifyController extends BaseController {
|
|
@Autowired
|
private RectifyService rectifyService;
|
|
/**
|
* 隐患整改清单-分页查询
|
*/
|
@PostMapping("/select/getDangerRectifyPage")
|
public ResultVO<PreventDangerRectify> getDangerRectifyPage(Authentication authentication, @RequestBody PreventDangerRectifyQueryReqDTO rectifyQueryReqDTO) {
|
//获取用户信息
|
ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser());
|
return rectifyService.getDangerRectifyPage(currentUser.getUid(), rectifyQueryReqDTO);
|
}
|
|
/**
|
* 隐患整改清单-查询:待验收与已验收
|
*/
|
@PostMapping("/select/getRectifyOverPage")
|
public ResultVO<PreventDangerRectify> getRectifyOverPage(Authentication authentication, @RequestBody PreventRectifyOverQueryReqDTO rectifyOverQueryReqDTO) {
|
//获取用户信息
|
ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser());
|
return rectifyService.getRectifyOverPage(currentUser.getUid(), rectifyOverQueryReqDTO);
|
}
|
|
// /**
|
// * 隐患整改清单-新增
|
// */
|
// @PostMapping("/insert/saveDangerRectify")
|
// public ResultVO<PreventDangerRectify> saveDangerRectify(Principal principal, @RequestBody PreventDangerRectifySaveReqDTO rectifySaveReqDTO) {
|
//
|
// //此处principal.getName就是id
|
// String userId =principal.getName();
|
// return rectifyService.saveDangerRectify(Long.valueOf(userId), rectifySaveReqDTO);
|
// }
|
|
/**
|
* 隐患整改清单-修改
|
*/
|
@PostMapping("/update/updateDangerRectify")
|
public ResultVO<PreventDangerRectify> updateDangerRectify(Authentication authentication, @RequestBody PreventDangerRectifyUpdateReqDTO rectifyUpdateReqDTO) {
|
//获取用户信息
|
ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser());
|
return rectifyService.updateDangerRectify(currentUser.getUid(), rectifyUpdateReqDTO);
|
}
|
|
/**
|
* 隐患整改清单-删除
|
*/
|
@PostMapping("/delete/deleteDangerRectify")
|
public ResultVO<PreventDangerRectify> deleteDangerRectify(Authentication authentication, @RequestBody PreventDangerRectifyDeleteReqDTO rectifyDeleteReqDTO) {
|
//获取用户信息
|
ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser());
|
return rectifyService.deleteDangerRectify(currentUser.getUid(), rectifyDeleteReqDTO);
|
}
|
|
/**
|
* 隐患整改清单--验收
|
*/
|
@PostMapping("/update/reportRectify")
|
public ResultVO<PreventDangerRectify> reportRectify(Authentication authentication, @RequestBody PreventDangerReportRectifyReqDTO reportRectiity) {
|
//获取用户信息
|
ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser());
|
return rectifyService.reportRectify(currentUser.getUid(), reportRectiity);
|
}
|
|
/**
|
* 隐患整改清单-填报--整改
|
*/
|
@PostMapping("/update/applyReport")
|
public ResultVO<PreventDangerRectify> applyReport(Authentication authentication, @RequestBody PreventDangerReportRectifyReqDTO reportRectiity) {
|
//获取用户信息
|
ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser());
|
return rectifyService.applyReport(currentUser.getUid(), reportRectiity);
|
}
|
|
/**
|
* 隐患整改--延期
|
*/
|
@PostMapping("/update/timeOutRectify")
|
public ResultVO<PreventDangerRectify> timeOutRectify(Authentication authentication, @RequestBody PreventDangerRectifyUpdateReqDTO updateReqDTO) {
|
//获取用户信息
|
ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser());
|
return rectifyService.timeOutRectify(currentUser.getUid(), updateReqDTO);
|
}
|
|
/**
|
* @Description: 获取当前用户需要他整改的即将超期的隐患单子
|
*/
|
@PostMapping("/own/toRectify/page")
|
public ResultVO ownRectifyPage(@RequestBody PageQuery<OwnRectifyPageQuery> pageQuery) {
|
//获取用户信息
|
ContextCacheUser currentUser = CacheUserTransfer.transfer(getUser());
|
PageUtils.checkCheck(pageQuery);
|
return rectifyService.listOwnRectifyPage(currentUser, pageQuery);
|
}
|
|
|
|
|
}
|