| | |
| | | import com.ruoyi.common.utils.security.ShiroUtils; |
| | | import com.ruoyi.doublePrevention.entity.PreventRiskDangerCheckAndMeasure; |
| | | import com.ruoyi.doublePrevention.entity.PreventRiskDangerCheckLog; |
| | | import com.ruoyi.doublePrevention.entity.PreventRiskDangerInfo; |
| | | import com.ruoyi.doublePrevention.service.RiskService; |
| | | import com.ruoyi.doublePrevention.service.baseService.PreventRiskDangerCheckAndMeasureService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | |
| | | if (ObjectUtils.isEmpty(hdcp.getFindTime())){ |
| | | throw new RuntimeException("发现时间不能为空"); |
| | | } |
| | | if(ObjectUtils.isEmpty(hdcp.getDangerSrc())){ |
| | | throw new RuntimeException("隐患来源不能为空"); |
| | | } |
| | | hdcp.setUpdateBy(header.loginName); |
| | | hdcp.setUpdateTime(DateUtils.getNowDate()); |
| | | hdcp.setRegisterCreateTime(DateUtils.getNowDate());//设置隐患登记上报创建时间 |
| | |
| | | throw new RuntimeException("添加隐患信息失败"); |
| | | } |
| | | |
| | | //获取Id返回值 |
| | | // hdcp.getId(); |
| | | // int result = riskService.insertDangerInfo(hdcp.getId(), hdcp); |
| | | // if (result< 1){ |
| | | // throw new RuntimeException("添加隐患附属信息失败"); |
| | | // } |
| | | //获取Id返回值 20250623 放开 |
| | | hdcp.getId(); |
| | | int result = riskService.insertDangerInfo(hdcp.getId(), hdcp); |
| | | if (result< 1){ |
| | | throw new RuntimeException("添加隐患附属信息失败"); |
| | | } |
| | | |
| | | // PreventRiskDangerCheckAndMeasure dangerCheckPointInfo = preventRiskDangerCheckAndMeasureService.getByDangerCheckPointId(hdcp.getId()); |
| | | // riskService.updateCheckLog(dangerCheckPointInfo.getCheckId(), hdcp); |
| | |
| | | hdcp.setUpdateTime(DateUtils.getNowDate()); |
| | | i = hdcpService.updateHiddenDangerCheckPoint(hdcp); |
| | | |
| | | // todo-2022 此处修改附属表 |
| | | // int result = riskService.updateDangerInfo(hdcp); |
| | | // if (result < 1){ |
| | | // throw new RuntimeException("修改失败"); |
| | | // } |
| | | PreventRiskDangerInfo dangerInfoByDangerCheckPointId = riskService.getDangerInfoByDangerCheckPointId(hdcp.getId()); |
| | | if (dangerInfoByDangerCheckPointId != null){ |
| | | // todo-2022 此处修改附属表 20250623 放开 |
| | | int result = riskService.updateDangerInfo(hdcp); |
| | | if (result < 1){ |
| | | throw new RuntimeException("修改失败"); |
| | | } |
| | | }else { |
| | | int result = riskService.insertDangerInfo(hdcp.getId(), hdcp); |
| | | if (result < 1){ |
| | | throw new RuntimeException("修改失败"); |
| | | } |
| | | } |
| | | |
| | | // int result = riskService.insertDangerInfo(hdcp.getId(), hdcp); |
| | | // if (result< 1){ |
| | | // throw new RuntimeException("添加隐患附属信息失败"); |
| | |
| | | |
| | | return ApiResult.success("定时隐患排查--隐患登记--成功"); |
| | | } catch (Exception e) { |
| | | return ApiResult.error("异常"); |
| | | return ApiResult.error(e.getMessage()); |
| | | } |
| | | } |
| | | } |