| | |
| | |
|
| | | 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;
|
| | |
| | | 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;
|
| | |
| | | }
|
| | |
|
| | | @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;
|
| | |
| | | resultVO.setMsg("结果不能为空");
|
| | | return resultVO;
|
| | | }
|
| | | if (tbSpecialCheckTaskLog.getCheckDate() == null){
|
| | | if (taskLogEditBO.getCheckDate() == null){
|
| | | resultVO.setMsg("检查日期不能为空");
|
| | | return resultVO;
|
| | | }
|
| | |
| | | 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){
|
| | |
| | | }
|
| | |
|
| | | @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;
|
| | |
| | | resultVO.setMsg("结果不能为空");
|
| | | return resultVO;
|
| | | }
|
| | | if (updateBO.getCheckDate() == null){
|
| | | if (taskLogEditBO.getCheckDate() == null){
|
| | | resultVO.setMsg("检查日期不能为空");
|
| | | return resultVO;
|
| | | }
|
| | |
| | | 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){
|