package com.gkhy.safePlatform.specialWork.controller; import com.alibaba.fastjson.JSONObject; import com.gkhy.safePlatform.commons.co.ContextCacheUser; import com.gkhy.safePlatform.commons.enums.Module; import com.gkhy.safePlatform.commons.enums.ResultCodes; import com.gkhy.safePlatform.commons.query.PageQuery; import com.gkhy.safePlatform.commons.utils.PageUtils; import com.gkhy.safePlatform.commons.vo.ResultVO; import com.gkhy.safePlatform.equipment.rpc.api.model.dto.resp.SafeRfidMaterialDetailRPCRespDto; import com.gkhy.safePlatform.specialWork.entity.WorkProcessCheckInfo; import com.gkhy.safePlatform.specialWork.model.annotation.CommonLogEnable; import com.gkhy.safePlatform.specialWork.model.dto.req.WorkProcessCheckReqDTO; import com.gkhy.safePlatform.specialWork.model.dto.req.WorkProcessDetectionReqDTO; import com.gkhy.safePlatform.specialWork.model.dto.resp.*; import com.gkhy.safePlatform.specialWork.model.query.WorkProcessCheckPageQuery; import com.gkhy.safePlatform.specialWork.model.query.WorkProcessDetectionPageQuery; import com.gkhy.safePlatform.specialWork.model.query.WorkProcessWarningPageQuery; import com.gkhy.safePlatform.specialWork.model.query.WorkProcessWorkApplyQuery; import com.gkhy.safePlatform.specialWork.service.WorkProcessService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.Authentication; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; import java.util.List; import java.util.Map; @RestController @RequestMapping("work/process") public class WorkProcessController { @Autowired private WorkProcessService workProcessService; /** * @Description: 查询可上传的作业信息 */ @RequestMapping(value = "/workApply/list", method = RequestMethod.POST) public ResultVO> workApplyList(Authentication authentication,@RequestBody WorkProcessWorkApplyQuery query) { ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); List result = workProcessService.listReportableWorkApply(currentUser, query); return new ResultVO<>(ResultCodes.OK, result); } /** * @Description: 检测上报 */ @RequestMapping(value = "/detection/report", method = RequestMethod.POST) @CommonLogEnable(module = Module.SPECIAL_WORK,content = "检测上报") public ResultVO detectionReport(Authentication authentication, @RequestBody WorkProcessDetectionReqDTO reqDTO) { ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); workProcessService.detectionReport(currentUser, reqDTO); return new ResultVO(ResultCodes.OK); } /** * @Description: 检测分页 */ @RequestMapping(value = "/detection/page/list", method = RequestMethod.POST) public ResultVO> detectionPageList(Authentication authentication, @RequestBody PageQuery pageQuery) { ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); PageUtils.checkCheck(pageQuery); return workProcessService.listDetectionByPage(currentUser, pageQuery); } /** * @Description: 检查上报 */ @RequestMapping(value = "/check/report", method = RequestMethod.POST) @CommonLogEnable(module = Module.SPECIAL_WORK,content = "检查上报") public ResultVO checkReport(Authentication authentication, @RequestBody WorkProcessCheckReqDTO reqDTO) { ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); workProcessService.checkReport(currentUser, reqDTO); return new ResultVO(ResultCodes.OK); } /** * @Description: 检查分页 */ @RequestMapping(value = "/check/page/list", method = RequestMethod.POST) public ResultVO> checkPageList(Authentication authentication, @RequestBody PageQuery pageQuery) { ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); PageUtils.checkCheck(pageQuery); return workProcessService.listCheckByPage(currentUser, pageQuery); } /** * @Description: 预警分页 */ @RequestMapping(value = "/warning/page/list", method = RequestMethod.POST) public ResultVO> warningPageList(Authentication authentication, @RequestBody PageQuery pageQuery) { ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); PageUtils.checkCheck(pageQuery); return workProcessService.listWarningByPage(currentUser, pageQuery); } /** * 获取物资配置自动检查结果 */ /* @RequestMapping(value = "/check/material/list", method = RequestMethod.POST) public ResultVO> chekMaterialList(Authentication authentication, @RequestBody JSONObject jsonObject) { ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); String workPermitNo = jsonObject.getString("workPermitNo"); return workProcessService.chekMaterialList(currentUser, workPermitNo); }*/ @RequestMapping(value = "/check/material", method = RequestMethod.POST) public ResultVO> chekMaterialList(Authentication authentication, @RequestBody List rfids) { ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); return new ResultVO<>(ResultCodes.OK,workProcessService.getListByRfids(rfids)); } }