16639036659
2023-05-16 5f1ab44b47d1e28121ecf6983fada2bc628a69fb
src/main/java/com/ruoyi/doublePrevention/service/impl/RiskServiceImpl.java
@@ -8,10 +8,8 @@
import com.ruoyi.doublePrevention.entity.*;
import com.ruoyi.doublePrevention.entity.dto.req.*;
import com.ruoyi.doublePrevention.entity.dto.resp.*;
import com.ruoyi.doublePrevention.enums.ErrorCodes;
import com.ruoyi.doublePrevention.enums.ResultCodes;
import com.ruoyi.doublePrevention.enums.StatusEnum;
import com.ruoyi.doublePrevention.enums.SyncEnum;
import com.ruoyi.doublePrevention.enums.*;
import com.ruoyi.doublePrevention.exception.AusinessException;
import com.ruoyi.doublePrevention.repository.param.PreventPointAndMeasureParams;
import com.ruoyi.doublePrevention.service.RiskService;
import com.ruoyi.doublePrevention.service.baseService.*;
@@ -283,11 +281,11 @@
            resultVO.setMsg("安全风险分析单元名称不能为空");
            return resultVO;
        }
        PreventRiskUnitUuid riskUnit = preventRiskUnitUuidService.getRiskUnitUuidById(riskUnitId);
        if (riskUnit == null){
            resultVO.setMsg("安全风险分析单元名称不存在");
            return resultVO;
        }
//        PreventRiskUnitUuid riskUnit = preventRiskUnitUuidService.getRiskUnitUuidById(riskUnitId);
//        if (riskUnit == null){
//            resultVO.setMsg("安全风险分析单元名称不存在");
//            return resultVO;
//        }
        if (StringUtils.isEmpty(riskEventName)){
            resultVO.setMsg("安全风险事件名称不能为空");
            return resultVO;
@@ -371,7 +369,7 @@
     */
    @Override
    public ResultVO<List<PreventRiskEventPageQueryRespDTO>> listRiskEventPage(PreventRiskEventPageQueryReqDTO riskEventQueryReqDTO) {
        Integer pageIndex = riskEventQueryReqDTO.getPageIndex();
        Integer pageIndex = riskEventQueryReqDTO.getPageNum();
        Integer pageSize = riskEventQueryReqDTO.getPageSize();
        if (pageIndex == 0 || pageSize == 0){
            return new ResultVO<>(ErrorCodes.REQUEST_PARAM_ERROR.getCode(),"当前页码或当前页显示数不能为0");
@@ -692,7 +690,7 @@
     */
    @Override
    public ResultVO<List<PreventRiskControlMeasurePageQueryRespDTO>> getRiskControlMeasurePage(PreventRiskControlMeasureQueryReqDTO measureQueryReqDTO) {
        Integer pageIndex = measureQueryReqDTO.getPageIndex();
        Integer pageIndex = measureQueryReqDTO.getPageNum();
        Integer pageSize = measureQueryReqDTO.getPageSize();
        if (pageIndex == 0 || pageSize == 0){
            return new ResultVO<>(ErrorCodes.REQUEST_PARAM_ERROR.getCode(),"当前页码或当前页显示数不能为0");
@@ -803,7 +801,7 @@
    @Override
    public int insertJobAndMeasure(Long jobId, HiddenDangerCheckJob hiddenDangerCheckJob) {
        String jobUuid = UUID.randomUUID().toString();
        PreventRiskJobAndMeasure jobAndMeasure = new PreventRiskJobAndMeasure();
        //根据RiskId查询对应的管控措施
@@ -811,6 +809,7 @@
        //遍历管控措施集合
        for (PreventRiskCheckUnit checkUnit : unitByRiskId) {
            String jobUuid = UUID.randomUUID().toString();
            PreventRiskControlMeasure preventRiskControlMeasureById = riskControlMeasureService.getPreventRiskControlMeasureById(checkUnit.getControlMeasureId());
            //封装数据
            jobAndMeasure.setJobId(jobId);
@@ -852,6 +851,7 @@
    @Transactional
    @Override
    public int updateJobAndMeasure(HiddenDangerCheckJob hiddenDangerCheckJob) {
        // 2、若有变更,需要预先读取jobAndMeasure的uuid,保存下来
        PreventRiskJobAndMeasure jobAndMeasureByJobId = preventRiskJobAndMeasureService.getJobAndMeasureByJobId(hiddenDangerCheckJob.getJobId());
        String jobUuid = jobAndMeasureByJobId.getJobUuid();
@@ -944,7 +944,7 @@
        PreventRiskDangerCheckLog dangerCheck = new PreventRiskDangerCheckLog();
        dangerCheck.setUuid(dangerCheckUuid);
        dangerCheck.setCheckStatus(null);
        dangerCheck.setCheckStatus((byte) 2);//
        dangerCheck.setCheckId(checkId);
        dangerCheck.setJobId(hdc.getJobId());
        //获取上报主配置信息
@@ -1024,6 +1024,7 @@
                return StatusEnum.EXEC_FAIL.getCode();
            }
        }
        //2、删除核查任务-检查点的附属表----老代码未删除检查点信息,此处暂不做处理
        return StatusEnum.EXEC_SUCCESS.getCode();
@@ -1296,8 +1297,35 @@
        ResultVO<List<PreventRiskControlMeasureListQueryRespDTO>> resultVO = new ResultVO<>(ResultCodes.OK,pageResult);
        return resultVO;
    }
    /**
     * 通过排查点,查找管控措施id
     */
    @Override
    public PreventRiskCheckUnit getRiskControlMeasureByCheckPointId(Long checkPointId) {
        return preventRiskCheckUnitService.getUnitByBaseCheckPointId(checkPointId);
    }
    /**
     * 查询管控措施信息
     */
    @Override
    public PreventRiskControlMeasure getRiskControlMeasureInfo(Long checkPointId) {
//    /**
        PreventRiskCheckUnit unitByBaseCheckPointId = preventRiskCheckUnitService.getUnitByBaseCheckPointId(checkPointId);
//        if (ObjectUtils.isEmpty(unitByBaseCheckPointId)){
//            throw new AusinessException(E.DATA_DATABASE_DUPLICATED, "数据不存在或已被删除");
//        }
        return riskControlMeasureService.getPreventRiskControlMeasureById(unitByBaseCheckPointId.getControlMeasureId());
    }
    /**
     * 查询隐患附属表信息
     */
    @Override
    public PreventRiskDangerInfo getDangerInfoById(Long id) {
        PreventRiskDangerInfo dangerInfobyHiddenDangerId = preventRiskDangerInfoService.getByHiddenDangerId(id);
        return dangerInfobyHiddenDangerId;
    }
    //    /**
//     * 全流程隐患上报-附属表信息插入
//     * */
//    @Override