| | |
| | | /** |
| | | * 隐患计划执行中---隐患登记 |
| | | */ |
| | | @Transactional |
| | | public ApiResult editPointDangerRegisterSave(String str, ApiRequestHeader header) { |
| | | //验证userId,loginName,token,deviceType,deviceId,appType 是否一致 |
| | | ApiRequestHeader requestHeader = getHeader(header); |
| | |
| | | } |
| | | if (ObjectUtils.isEmpty(hdcp.getFindTime())){ |
| | | throw new RuntimeException("发现时间不能为空"); |
| | | } |
| | | if(ObjectUtils.isEmpty(hdcp.getDangerSrc())){ |
| | | throw new RuntimeException("隐患来源不能为空"); |
| | | } |
| | | hdcp.setRegisterCreateTime(DateUtils.getNowDate());//设置隐患登记上报创建时间 |
| | | hdcp.setRegisterUserId(Long.valueOf(header.userId));//设置隐患登记上报创建人ID |
| | |
| | | hdcp.setUpdateTime(DateUtils.getNowDate()); |
| | | i = hdcpService.updateHiddenDangerCheckPoint(hdcp); |
| | | //20250623增加此逻辑 |
| | | 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("修改失败"); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | return ApiResult.success("隐患排查计划执行--隐患登记--成功"); |
| | | } catch (Exception e) { |
| | | return ApiResult.error("异常"); |
| | | return ApiResult.error(e.getMessage()); |
| | | } |
| | | } |
| | | |