| | |
| | | ResultVO resultVO = new ResultVO<>();
|
| | | resultVO.setCode(ErrorCodes.REQUEST_PARAM_ERROR.getCode());
|
| | |
|
| | | resultVO.setCode("200");
|
| | | resultVO.setMsg("保存成功");
|
| | |
|
| | | if (ObjectUtils.isEmpty(updateReqBO.getId())){
|
| | | throw new RuntimeException("所选记录不能为空");
|
| | | }
|
| | | PreventOverhaulLog overhaulLogById = overhaulLogRepository.getOverhaulLogById(updateReqBO.getId());
|
| | | if (ObjectUtils.isEmpty(overhaulLogById)){
|
| | | throw new RuntimeException("记录不存在或已被被删除");
|
| | | }
|
| | | if (ObjectUtils.isEmpty(updateReqBO.getRiskUnitId())){
|
| | | resultVO.setMsg("所属安全风险分析单元");
|
| | | return resultVO;
|
| | | throw new RuntimeException("安全风险分析单元为空");
|
| | | }
|
| | | if (ObjectUtils.isEmpty(updateReqBO.getStopStartTime())){
|
| | | resultVO.setMsg("装置停用或者检维修开始时间");
|
| | | return resultVO;
|
| | | throw new RuntimeException("装置停用或者检维修开始时间为空");
|
| | | }
|
| | | if (ObjectUtils.isEmpty(updateReqBO.getStopEndTime())){
|
| | | resultVO.setMsg("装置停用或者检维修结束时间");
|
| | | return resultVO;
|
| | | throw new RuntimeException("装置停用或者检维修结束时间为空");
|
| | | }
|
| | | if (updateReqBO.getStopReason().isEmpty()){
|
| | | resultVO.setMsg("描述停用原因");
|
| | | return resultVO;
|
| | | throw new RuntimeException("停用原因为空");
|
| | | }
|
| | |
|
| | | Date date = new Date();
|
| | |
| | | preventOverhaulLog.setDeleteStatus((byte) 0);
|
| | | preventOverhaulLog.setLastEditUserName(sysUser.getUserName());
|
| | | preventOverhaulLog.setGmtModitify(date);
|
| | | preventOverhaulLog.setRiskUnitId(null);// todo 暂时未设置
|
| | | preventOverhaulLog.setLastEditUserName(sysUser.getUserName());
|
| | | preventOverhaulLog.setGmtModitify(date);
|
| | |
|
| | |
|
| | | //todo 对所属企业id和uuid没有进行设置
|
| | |
| | | preventOverhaulLog.setReportSwitch(SyncEnum.REPORT_OFF.getCode());
|
| | | }
|
| | |
|
| | | int result = overhaulLogRepository.updateOverhaulLog(updateReqBO);
|
| | | int result = overhaulLogRepository.updateOverhaulLog(preventOverhaulLog);
|
| | | if (result < 1){
|
| | | throw new RuntimeException("操作失败");
|
| | | }
|
| | |
|
| | | resultVO.setCount(result);
|
| | | resultVO.setCode("200");
|
| | | resultVO.setMsg("保存成功");
|
| | |
|
| | | return resultVO;
|
| | | }
|