| | |
| | | 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.*;
|
| | |
| | | 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;
|
| | |
| | | riskEvent.setEventResult(eventResult);
|
| | | riskEvent.setRiskEventName(riskEventName);
|
| | | riskEvent.setRiskUnitId(riskUnitId);
|
| | | riskEvent.setRiskUnitUuid(riskUnit.getRiskUnitUuid());
|
| | | // riskEvent.setRiskUnitUuid(riskUnit.getRiskUnitUuid());
|
| | | riskEvent.setDeleteStatus(StatusEnum.DELETE_STATUS_USE.getCode());
|
| | | riskEvent.setGmtCreate(date);
|
| | | riskEvent.setGmtModitify(date);
|
| | |
| | | Long riskEventId = measureQueryReqDTO.getRiskEventId();
|
| | |
|
| | | Page<PreventRiskControlMeasure> page = PageHelper.startPage(pageIndex, pageSize);
|
| | | riskControlMeasureService.listRiskEvenByCondition(controlType,riskEventId);
|
| | | riskControlMeasureService.listRiskControlMeasureByCondition(controlType,riskEventId);
|
| | |
|
| | | List<PreventRiskControlMeasure> result = page.getResult();
|
| | | Long total = page.getTotal();
|
| | |
| | | @Override
|
| | | public int insertJobAndMeasure(Long jobId, HiddenDangerCheckJob hiddenDangerCheckJob) {
|
| | |
|
| | | String jobUuid = UUID.randomUUID().toString();
|
| | |
|
| | | PreventRiskJobAndMeasure jobAndMeasure = new PreventRiskJobAndMeasure();
|
| | |
|
| | | //根据RiskId查询对应的管控措施
|
| | |
| | |
|
| | | //遍历管控措施集合
|
| | | for (PreventRiskCheckUnit checkUnit : unitByRiskId) {
|
| | | String jobUuid = UUID.randomUUID().toString();
|
| | | PreventRiskControlMeasure preventRiskControlMeasureById = riskControlMeasureService.getPreventRiskControlMeasureById(checkUnit.getControlMeasureId());
|
| | | //封装数据
|
| | | jobAndMeasure.setJobId(jobId);
|
| | |
| | | PreventRiskDangerCheckLog dangerCheck = new PreventRiskDangerCheckLog();
|
| | |
|
| | | dangerCheck.setUuid(dangerCheckUuid);
|
| | | dangerCheck.setCheckStatus(null);
|
| | | dangerCheck.setCheckStatus(null);//
|
| | | dangerCheck.setCheckId(checkId);
|
| | | dangerCheck.setJobId(hdc.getJobId());
|
| | | //获取上报主配置信息
|
| | |
| | | * 插入检查点附属表
|
| | | */
|
| | | @Override
|
| | | public void insertCheckAndMeasure(Long id, HiddenDangerCheckPoint hdcp) {
|
| | |
|
| | | public int insertCheckAndMeasure(Long id, HiddenDangerCheckPoint hdcp) {
|
| | | System.out.println("进入核查点保存方法");
|
| | | PreventRiskDangerCheckAndMeasure checkAndMeasure = new PreventRiskDangerCheckAndMeasure();
|
| | |
|
| | | //根据检查点信息,查询对应管控措施
|
| | |
| | | if (checkUnit == null){
|
| | | throw new RuntimeException("基础检查点不存在");
|
| | | }
|
| | |
|
| | | System.out.println("通过一次检验");
|
| | | PreventRiskControlMeasure controlMeasure = riskControlMeasureService.getPreventRiskControlMeasureById(checkUnit.getControlMeasureId());
|
| | | if (controlMeasure == null){
|
| | | throw new RuntimeException("管控措施已经被删除");
|
| | | }
|
| | |
|
| | | System.out.println("通过二次检验");
|
| | | //封装数据
|
| | | checkAndMeasure.setCheckId(hdcp.getCheckId());
|
| | | checkAndMeasure.setDangerCheckPointId(id);
|
| | | checkAndMeasure.setBaseCheckPointId(hdcp.getCheckPointId());
|
| | | checkAndMeasure.setControlMeasureId(controlMeasure.getId());
|
| | | checkAndMeasure.setCheckContent(controlMeasure.getCheckContent());
|
| | | checkAndMeasure.setCheckResult(null);
|
| | |
|
| | | checkAndMeasure.setCheckResult((byte) 4);
|
| | | System.out.println("数据封装完成");
|
| | | //写入核查任务检查点与管控措施信息
|
| | | preventRiskDangerCheckAndMeasureService.insertCheckAndMeasure(checkAndMeasure);
|
| | |
|
| | | int result = preventRiskDangerCheckAndMeasureService.insertCheckAndMeasure(checkAndMeasure);
|
| | | if (result <1){
|
| | | return StatusEnum.EXEC_FAIL.getCode();
|
| | | }
|
| | | return StatusEnum.EXEC_SUCCESS.getCode();
|
| | | }
|
| | | /**
|
| | | * todo-2022 填报时的操作
|
| | |
| | | return StatusEnum.EXEC_FAIL.getCode();
|
| | | }
|
| | | }
|
| | |
|
| | | //2、删除核查任务-检查点的附属表----老代码未删除检查点信息,此处暂不做处理
|
| | |
|
| | | return StatusEnum.EXEC_SUCCESS.getCode();
|
| | |
| | | @Override
|
| | | public List<PreventRiskUnitCodeAndNameListQueryRespDTO> listRiskUnitCodeAndName() {
|
| | | List<PreventRiskList> riskLists = preventRiskListService.listRiskUnitCodeAndName();
|
| | | if (riskLists == null){
|
| | | return null;
|
| | | }
|
| | | List<PreventRiskUnitCodeAndNameListQueryRespDTO> listQueryRespDTOs= riskLists.stream().map((riskList)->{
|
| | | PreventRiskUnitCodeAndNameListQueryRespDTO listQueryRespDTO = new PreventRiskUnitCodeAndNameListQueryRespDTO();
|
| | | BeanUtils.copyProperties(riskList,listQueryRespDTO);
|
| | |
| | | return listQueryRespDTOs;
|
| | | }
|
| | |
|
| | | // /**
|
| | |
|
| | | /**
|
| | | * 管控措施-不分页查询
|
| | | */
|
| | | @Override
|
| | | public ResultVO<List<PreventRiskControlMeasureListQueryRespDTO>> listRiskControlMeasure() {
|
| | |
|
| | | List<PreventRiskControlMeasure> controlMeasures = riskControlMeasureService.listRiskControlMeasure();
|
| | | List<PreventRiskControlMeasureListQueryRespDTO> pageResult = null;
|
| | | if (controlMeasures != null) {
|
| | | pageResult = controlMeasures.stream().map((preventRiskControlMeasure) -> {
|
| | | PreventRiskControlMeasureListQueryRespDTO dto = new PreventRiskControlMeasureListQueryRespDTO();
|
| | | BeanUtils.copyProperties(preventRiskControlMeasure, dto);
|
| | | return dto;
|
| | | }).collect(Collectors.toList());
|
| | | }
|
| | |
|
| | | 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
|