双重预防项目-国泰新华二开定制版
16639036659
2024-06-19 0c863db80b953da1d1067c9243a937b9438eddef
src/main/java/com/ruoyi/project/tr/specialCheck/service/impl/SpecialCheckScoreAndDangerLogServiceImpl.java
@@ -21,6 +21,7 @@
import org.springframework.util.ObjectUtils;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.List;
import java.util.UUID;
@@ -77,15 +78,7 @@
        ResultVO resultVO = new ResultVO<>();
        resultVO.setCode(ErrorCodes.REQUEST_PARAM_ERROR.getCode());
        TbSpecialCheckScoreAndDangerLog scoreAndDangerLog = BeanCopyUtils.copyBean(scoreAndDangerEditLog, TbSpecialCheckScoreAndDangerLog.class);
        if (scoreAndDangerLog.getTaskId() == null){
            resultVO.setMsg("任务不能为空");
            return resultVO;
        }
        TbBaseCheckTaskMapper baseCheckTaskByTaskId = baseCheckTaskMapper.getBaseCheckTaskByTaskId(scoreAndDangerLog.getTaskId());
        if (ObjectUtils.isEmpty(baseCheckTaskByTaskId)){
            resultVO.setMsg("任务不存在");
            return resultVO;
        }
        if (scoreAndDangerLog.getCheckItemId() == null){
            resultVO.setMsg("检查项不能为空");
            return resultVO;
@@ -121,6 +114,11 @@
            resultVO.setMsg("检查类型不能为空");
            return resultVO;
        }
        TbBaseCheckTaskMapper baseCheckTaskByTaskId = baseCheckTaskMapper.getBaseCheckTaskByTaskId(baseCheckItemByItemId.getTaskId());
        if (ObjectUtils.isEmpty(baseCheckTaskByTaskId)){
            resultVO.setMsg("专项任务不存在");
            return resultVO;
        }
        LocalDateTime dateTime = LocalDateTime.now();
        String uuid = UUID.randomUUID().toString();
@@ -138,7 +136,7 @@
        scoreAndDangerLog.setIsReject(baseCheckScoreByScoreId.getIsReject());
        scoreAndDangerLog.setDeductPoint(baseCheckScoreByScoreId.getDeductPoint());
        scoreAndDangerLog.setDeductIllustrate(baseCheckScoreByScoreId.getDeductIllustrate());
        scoreAndDangerLog.setCheckDate(LocalDateTime.ofInstant(scoreAndDangerEditLog.getCheckDate().toInstant(), ZoneId.systemDefault()));
@@ -160,20 +158,13 @@
    }
    @Override
    public ResultVO<TbSpecialCheckScoreAndDangerLog> updateSpecialCheckScoreAndDangerLog(TbSpecialCheckScoreAndDangerLog scoreAndDangerLog) {
    public ResultVO<TbSpecialCheckScoreAndDangerLog> updateSpecialCheckScoreAndDangerLog(TbSpecialCheckScoreAndDangerLogEditBO scoreAndDangerEditLog) {
        User sysUser = getSysUser();
        ResultVO resultVO = new ResultVO<>();
        resultVO.setCode(ErrorCodes.REQUEST_PARAM_ERROR.getCode());
        if (scoreAndDangerLog.getTaskId() == null){
            resultVO.setMsg("任务不能为空");
            return resultVO;
        }
        TbBaseCheckTaskMapper baseCheckTaskByTaskId = baseCheckTaskMapper.getBaseCheckTaskByTaskId(scoreAndDangerLog.getTaskId());
        if (ObjectUtils.isEmpty(baseCheckTaskByTaskId)){
            resultVO.setMsg("任务不存在");
            return resultVO;
        }
        TbSpecialCheckScoreAndDangerLog scoreAndDangerLog = BeanCopyUtils.copyBean(scoreAndDangerEditLog, TbSpecialCheckScoreAndDangerLog.class);
        if (scoreAndDangerLog.getCheckItemId() == null){
            resultVO.setMsg("检查项不能为空");
            return resultVO;
@@ -209,6 +200,11 @@
            resultVO.setMsg("检查类型不能为空");
            return resultVO;
        }
        TbBaseCheckTaskMapper baseCheckTaskByTaskId = baseCheckTaskMapper.getBaseCheckTaskByTaskId(baseCheckItemByItemId.getTaskId());
        if (ObjectUtils.isEmpty(baseCheckTaskByTaskId)){
            resultVO.setMsg("专项任务不存在");
            return resultVO;
        }
        LocalDateTime dateTime = LocalDateTime.now();
@@ -220,6 +216,7 @@
        scoreAndDangerLog.setIsReject(baseCheckScoreByScoreId.getIsReject());
        scoreAndDangerLog.setDeductPoint(baseCheckScoreByScoreId.getDeductPoint());
        scoreAndDangerLog.setDeductIllustrate(baseCheckScoreByScoreId.getDeductIllustrate());
        scoreAndDangerLog.setCheckDate(LocalDateTime.ofInstant(scoreAndDangerEditLog.getCheckDate().toInstant(), ZoneId.systemDefault()));
        int updateResult = scoreAndDangerLogMapper.updateSpecialCheckScoreAndDangerLogById(scoreAndDangerLog);
        if (updateResult == 0){