双重预防项目-国泰新华二开定制版
16639036659
2024-06-19 70366a218269f3501b9a1f44338ef00beef518c1
src/main/java/com/ruoyi/project/tr/specialCheck/service/impl/SpecialCheckTaskServiceImpl.java
@@ -2,6 +2,7 @@
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.ruoyi.common.utils.BeanCopyUtils;
import com.ruoyi.doublePrevention.entity.PreventRiskControlMeasure;
import com.ruoyi.doublePrevention.enums.ErrorCodes;
import com.ruoyi.doublePrevention.enums.ResultCodes;
@@ -18,6 +19,7 @@
import org.springframework.util.ObjectUtils;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;
import java.util.List;
import java.util.UUID;
@@ -66,10 +68,12 @@
    }
    @Override
    public ResultVO<TbSpecialCheckTaskLog> addSpecialTask(TbSpecialCheckTaskLog tbSpecialCheckTaskLog) {
    public ResultVO<TbSpecialCheckTaskLog> addSpecialTask(TbSpecialCheckTaskLogEditBO taskLogEditBO) {
        User sysUser = getSysUser();
        ResultVO resultVO = new ResultVO<>();
        resultVO.setCode(ErrorCodes.REQUEST_PARAM_ERROR.getCode());
        TbSpecialCheckTaskLog tbSpecialCheckTaskLog = BeanCopyUtils.copyBean(taskLogEditBO, TbSpecialCheckTaskLog.class);
        if (tbSpecialCheckTaskLog.getHazardCode() == null){
            resultVO.setMsg("重大风险源不能为空");
            return resultVO;
@@ -91,7 +95,7 @@
            resultVO.setMsg("结果不能为空");
            return resultVO;
        }
        if (tbSpecialCheckTaskLog.getCheckDate() == null){
        if (taskLogEditBO.getCheckDate() == null){
            resultVO.setMsg("检查日期不能为空");
            return resultVO;
        }
@@ -108,6 +112,7 @@
        tbSpecialCheckTaskLog.setReportStatus((byte) 1);
        tbSpecialCheckTaskLog.setReportTime(null);
        tbSpecialCheckTaskLog.setDeleted((byte) 0);
        tbSpecialCheckTaskLog.setCheckDate(LocalDateTime.ofInstant(taskLogEditBO.getCheckDate().toInstant(), ZoneId.systemDefault()));
        int saveResult = taskSpecialLogMapper.save(tbSpecialCheckTaskLog);
        if (saveResult == 0){
@@ -126,10 +131,13 @@
    }
    @Override
    public ResultVO<TbSpecialCheckTaskLog> updateSpecialCheckTaskLog(TbSpecialCheckTaskLogUpdateBO updateBO) {
    public ResultVO<TbSpecialCheckTaskLog> updateSpecialCheckTaskLog(TbSpecialCheckTaskLogEditBO taskLogEditBO) {
        User sysUser = getSysUser();
        ResultVO resultVO = new ResultVO<>();
        resultVO.setCode(ErrorCodes.REQUEST_PARAM_ERROR.getCode());
        TbSpecialCheckTaskLogUpdateBO updateBO = BeanCopyUtils.copyBean(taskLogEditBO, TbSpecialCheckTaskLogUpdateBO.class);
        if (updateBO.getIndexId() == null){
            resultVO.setMsg("任务不能为空");
            return resultVO;
@@ -160,7 +168,7 @@
            resultVO.setMsg("结果不能为空");
            return resultVO;
        }
        if (updateBO.getCheckDate() == null){
        if (taskLogEditBO.getCheckDate() == null){
            resultVO.setMsg("检查日期不能为空");
            return resultVO;
        }
@@ -170,6 +178,7 @@
        updateBO.setUpdateDate(dateTime);
        updateBO.setUpdateBy(sysUser.getUserName());
        updateBO.setReportStatus((byte) 1);
        updateBO.setCheckDate(LocalDateTime.ofInstant(taskLogEditBO.getCheckDate().toInstant(), ZoneId.systemDefault()));
        int updateResult = taskSpecialLogMapper.updateSpecialCheckTaskLogById(updateBO);
        if (updateResult == 0){