| | |
| | |
|
| | | import com.github.pagehelper.Page;
|
| | | import com.github.pagehelper.PageHelper;
|
| | | import com.ruoyi.doublePrevention.entity.CJReport.PreventCJReportDangerInfo;
|
| | | import com.ruoyi.doublePrevention.enums.ErrorCodes;
|
| | | import com.ruoyi.doublePrevention.enums.ResultCodes;
|
| | | import com.ruoyi.doublePrevention.repository.PreventCJReportDangerInfoRepository;
|
| | | import com.ruoyi.doublePrevention.service.baseService.PreventCJReportDangerInfoService;
|
| | | import com.ruoyi.doublePrevention.vo.ResultVO;
|
| | | import com.ruoyi.project.system.user.domain.User;
|
| | | import com.ruoyi.project.tr.riskList.domain.RiskList;
|
| | | import com.ruoyi.project.tr.specialCheck.domin.BO.TbSpecialCheckItemDangerLogBO;
|
| | | import com.ruoyi.project.tr.specialCheck.domin.BO.TbSpecialCheckItemDangerLogUpdateBO;
|
| | | import com.ruoyi.project.tr.specialCheck.domin.TbBaseCheckItem;
|
| | | import com.ruoyi.project.tr.specialCheck.domin.TbBaseCheckScore;
|
| | | import com.ruoyi.project.tr.specialCheck.domin.TbSpecialCheckItemDangerLog;
|
| | | import com.ruoyi.project.tr.specialCheck.domin.TbSpecialCheckTaskLog;
|
| | | import com.ruoyi.project.tr.specialCheck.mapper.TbBaseCheckItemMapper;
|
| | | import com.ruoyi.project.tr.specialCheck.mapper.TbBaseCheckScoreMapper;
|
| | | import com.ruoyi.project.tr.specialCheck.mapper.TbBaseCheckTaskMapper;
|
| | | import com.ruoyi.project.tr.specialCheck.mapper.TbSpecialCheckItemDangerLogMapper;
|
| | | import com.ruoyi.project.tr.specialCheck.service.SpecialCheckItemDangerLogService;
|
| | | import com.ruoyi.project.tr.specialCheck.service.TbBaseCheckService;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.util.ObjectUtils;
|
| | |
| | |
|
| | | @Autowired
|
| | | private TbSpecialCheckItemDangerLogMapper itemDangerLogMapper;
|
| | |
|
| | | @Autowired
|
| | | private TbBaseCheckTaskMapper baseCheckTaskMapper;
|
| | |
|
| | | @Autowired
|
| | | private TbBaseCheckItemMapper baseCheckItemMapper;
|
| | |
|
| | | @Autowired
|
| | | private TbBaseCheckScoreMapper baseCheckScoreMapper;
|
| | |
|
| | | @Autowired
|
| | | private PreventCJReportDangerInfoRepository preventCJReportDangerInfoRepository;
|
| | |
|
| | |
|
| | |
|
| | | @Override
|
| | |
| | | ResultVO resultVO = new ResultVO<>();
|
| | | resultVO.setCode(ErrorCodes.REQUEST_PARAM_ERROR.getCode());
|
| | |
|
| | | // 四类id,挨个查询,判断是否存在
|
| | | if (itemDangerLog.getTaskId() == null){
|
| | | resultVO.setMsg("任务不能为空");
|
| | | return resultVO;
|
| | | }
|
| | | TbBaseCheckTaskMapper baseCheckTaskByTaskId = baseCheckTaskMapper.getBaseCheckTaskByTaskId(itemDangerLog.getTaskId());
|
| | | if (ObjectUtils.isEmpty(baseCheckTaskByTaskId)){
|
| | | resultVO.setMsg("任务不存在");
|
| | | return resultVO;
|
| | | }
|
| | | if (itemDangerLog.getCheckItemId() == null){
|
| | | resultVO.setMsg("检查项不能为空");
|
| | | return resultVO;
|
| | | }
|
| | | if (itemDangerLog.getTaskId() == null){
|
| | | resultVO.setMsg("任务不能为空");
|
| | | TbBaseCheckItem baseCheckItemByItemId = baseCheckItemMapper.getBaseCheckItemByItemId(itemDangerLog.getCheckItemId());
|
| | | if (ObjectUtils.isEmpty(baseCheckItemByItemId)){
|
| | | resultVO.setMsg("检查项不存在");
|
| | | return resultVO;
|
| | | }
|
| | | if (itemDangerLog.getCheckScoreId() == null){
|
| | | resultVO.setMsg("评分不能为空");
|
| | | return resultVO;
|
| | | }
|
| | | TbBaseCheckScore baseCheckScoreByScoreId = baseCheckScoreMapper.getBaseCheckScoreByScoreId(itemDangerLog.getCheckScoreId());
|
| | | if (ObjectUtils.isEmpty(baseCheckScoreByScoreId)){
|
| | | resultVO.setMsg("评分标准不存在");
|
| | | return resultVO;
|
| | | }
|
| | | if (itemDangerLog.getDangerId() == null){
|
| | | resultVO.setMsg("关联隐患不能为空");
|
| | | return resultVO;
|
| | | }
|
| | | PreventCJReportDangerInfo dangerById = preventCJReportDangerInfoRepository.getDangerById(itemDangerLog.getDangerId());
|
| | | if (ObjectUtils.isEmpty(dangerById)){
|
| | | resultVO.setMsg("隐患不存在");
|
| | | return resultVO;
|
| | | }
|
| | | if (itemDangerLog.getCheckDate() == null){
|
| | |
| | | ResultVO resultVO = new ResultVO<>();
|
| | | resultVO.setCode(ErrorCodes.REQUEST_PARAM_ERROR.getCode());
|
| | |
|
| | | // 四类id,挨个查询,判断是否存在
|
| | | if (updateBO.getTaskId() == null){
|
| | | resultVO.setMsg("任务不能为空");
|
| | | return resultVO;
|
| | | }
|
| | | TbBaseCheckTaskMapper baseCheckTaskByTaskId = baseCheckTaskMapper.getBaseCheckTaskByTaskId(updateBO.getTaskId());
|
| | | if (ObjectUtils.isEmpty(baseCheckTaskByTaskId)){
|
| | | resultVO.setMsg("任务不存在");
|
| | | return resultVO;
|
| | | }
|
| | | if (updateBO.getCheckItemId() == null){
|
| | | resultVO.setMsg("检查项不能为空");
|
| | | return resultVO;
|
| | | }
|
| | | if (updateBO.getTaskId() == null){
|
| | | resultVO.setMsg("任务不能为空");
|
| | | TbBaseCheckItem baseCheckItemByItemId = baseCheckItemMapper.getBaseCheckItemByItemId(updateBO.getCheckItemId());
|
| | | if (ObjectUtils.isEmpty(baseCheckItemByItemId)){
|
| | | resultVO.setMsg("检查项不存在");
|
| | | return resultVO;
|
| | | }
|
| | | if (updateBO.getCheckScoreId() == null){
|
| | | resultVO.setMsg("评分不能为空");
|
| | | return resultVO;
|
| | | }
|
| | | TbBaseCheckScore baseCheckScoreByScoreId = baseCheckScoreMapper.getBaseCheckScoreByScoreId(updateBO.getCheckScoreId());
|
| | | if (ObjectUtils.isEmpty(baseCheckScoreByScoreId)){
|
| | | resultVO.setMsg("评分标准不存在");
|
| | | return resultVO;
|
| | | }
|
| | | if (updateBO.getDangerId() == null){
|
| | | resultVO.setMsg("关联隐患不能为空");
|
| | | return resultVO;
|
| | | }
|
| | | PreventCJReportDangerInfo dangerById = preventCJReportDangerInfoRepository.getDangerById(updateBO.getDangerId());
|
| | | if (ObjectUtils.isEmpty(dangerById)){
|
| | | resultVO.setMsg("隐患不存在");
|
| | | return resultVO;
|
| | | }
|
| | | if (updateBO.getCheckDate() == null){
|
| | | resultVO.setMsg("检查时间不能为空");
|
| | | return resultVO;
|