双重预防项目-国泰新华二开定制版
heheng
2025-06-24 e98eeaaa5766511fdb8e6d5e412eb1c59d1f07ce
src/main/java/com/ruoyi/project/mobile/service/ApiHiddenDangerCheckService.java
@@ -127,6 +127,9 @@
                for (HiddenDangerCheckPoint dangerCheckPoint : resultList) {
                    PreventRiskDangerInfo dangerInfo = riskService.getDangerInfoByDangerCheckPointId(dangerCheckPoint.getId());
                    if (ObjectUtils.isNotEmpty(dangerInfo)){
                        if (ObjectUtils.isNotEmpty(dangerInfo.getDangerSrc())){
                            dangerCheckPoint.setDangerSrc(dangerInfo.getDangerSrc());
                        }
                        if (ObjectUtils.isNotEmpty(dangerInfo.getReportTime())){
                            dangerCheckPoint.setReportTime(dangerInfo.getReportTime());
                        }
@@ -178,7 +181,7 @@
            }
            return ApiResult.success("隐患核查保存成功");
        } catch (Exception e) {
            return ApiResult.error("异常");
            return ApiResult.error(e.getMessage());
        }
    }
    /**
@@ -210,12 +213,27 @@
            }
            hdcpService.updateHiddenDangerCheckPoint(hdcp);
            //此处插入隐患附属表
            int result = riskService.insertDangerInfo(hdcp.getId(), hdcp);
            if (result< 1){
                throw new RuntimeException("添加隐患附属信息失败");
            //20250623 修改此处
            PreventRiskDangerInfo dangerInfoByDangerCheckPointId = riskService.getDangerInfoByDangerCheckPointId(hdcp.getId());
            if (ObjectUtils.isNotEmpty(dangerInfoByDangerCheckPointId)){
                //此处插入隐患附属表
                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.updateCheckLog(hdcp.getId(), hdcp);
//            if (result< 1){
//                throw new RuntimeException("添加隐患附属信息失败");
//            }
            HiddenDangerCheckPoint hiddenDangerCheckPoint = hiddenDangerCheckPointService.getHiddenDangerCheckPointById(hdcp.getId());
            int confirmResult = confirmLogService.saveConfirmLog(hiddenDangerCheckPoint);
@@ -227,7 +245,7 @@
            return ApiResult.success("隐患核查保存成功");
        } catch (Exception e) {
            return ApiResult.error("异常");
            return ApiResult.error(e.getMessage());
        }
    }
@@ -460,10 +478,20 @@
                hdcp.setCompanyId(user.getCompanyId());
                i = hdcpService.insertHiddenDangerCheckPoint(hdcp);
                //20250623增加此逻辑
                int result = riskService.insertDangerInfo(hdcp.getId(), hdcp);
                if (result< 1){
                    throw new RuntimeException("添加隐患附属信息失败");
                }
            }else{
                hdcp.setUpdateBy(user.getLoginName());
                hdcp.setUpdateTime(DateUtils.getNowDate());
                i = hdcpService.updateHiddenDangerCheckPoint(hdcp);
                //20250623增加此逻辑
                int result = riskService.updateDangerInfo(hdcp);
                if (result < 1){
                    throw new RuntimeException("修改失败");
                }
            }
            hdcpService.getTaskCountTotal(Long.valueOf(header.userId));//查询未执行任务总数量并推送