| | |
| | | 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;
|
| | |
| | | */
|
| | | @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");
|
| | |
| | | */
|
| | | @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");
|
| | |
| | | @Transactional
|
| | | @Override
|
| | | public int updateJobAndMeasure(HiddenDangerCheckJob hiddenDangerCheckJob) {
|
| | |
|
| | | // 2、若有变更,需要预先读取jobAndMeasure的uuid,保存下来
|
| | | PreventRiskJobAndMeasure jobAndMeasureByJobId = preventRiskJobAndMeasureService.getJobAndMeasureByJobId(hiddenDangerCheckJob.getJobId());
|
| | | String jobUuid = jobAndMeasureByJobId.getJobUuid();
|
| | |
| | | PreventRiskDangerCheckLog dangerCheck = new PreventRiskDangerCheckLog();
|
| | |
|
| | | dangerCheck.setUuid(dangerCheckUuid);
|
| | | dangerCheck.setCheckStatus(null);//
|
| | | dangerCheck.setCheckStatus((byte) 2);//
|
| | | dangerCheck.setCheckId(checkId);
|
| | | dangerCheck.setJobId(hdc.getJobId());
|
| | | //获取上报主配置信息
|
| | |
| | | dangerInfo.setDangerReason(hdcp.getDangerReason());
|
| | | dangerInfo.setDangerResult(hdcp.getDangerResult());
|
| | | dangerInfo.setHazardDangerType(hdcp.getHazardDangerType());
|
| | | //隐患状态 0未验收 1验收通过 2验收未通过 ,新建时为空
|
| | | //隐患状态 0未验收 1验收通过 2验收未通过
|
| | | if (hdcp.getAcceptStatus() == null){
|
| | | //设置为 空
|
| | | dangerInfo.setDangerState(null);
|
| | | dangerInfo.setDangerState(StatusEnum.RECTIFY_ING.getCode());
|
| | | } else if (hdcp.getAcceptStatus().equals(0)){
|
| | | //设置为整改中
|
| | | dangerInfo.setDangerState(StatusEnum.RECTIFY_ING.getCode());
|
| | |
| | | //设置为超期未整改
|
| | | dangerInfo.setDangerState(StatusEnum.RECTIFY_TIMEOUT_AND_FAIL.getCode());
|
| | | }
|
| | | // dangerInfo.setDangerState(null); //设置为 空
|
| | | dangerInfo.setTimeoutFlag(null);//暂时不清楚是否需要此功能,先设为空
|
| | | //获取上报主配置信息
|
| | | PreventReportConfig reportConfigById = preventReportConfigService.getReportConfigById(SyncEnum.REPORT_CONFIG_DANGER_INFO.getCode());
|
| | |
| | | PreventRiskDangerInfo dangerInfo = new PreventRiskDangerInfo();
|
| | |
|
| | | dangerInfo.setDangerCheckPointId(hdcp.getId());
|
| | |
|
| | | int acceptStatus = Integer.parseInt(hdcp.getAcceptStatus());
|
| | | //如果验收通过,设置为验收成功;验收失败,打回上一级进行整改,设置为整改中
|
| | | if (hdcp.getAcceptStatus().equals(0)){
|
| | | if (acceptStatus == 0){
|
| | | dangerInfo.setDangerState(StatusEnum.RECTIFY_ING.getCode());
|
| | | }else if (hdcp.getAcceptStatus().equals(1)){
|
| | | }else if (acceptStatus == 1){
|
| | | dangerInfo.setDangerState(StatusEnum.ACCEPT_SUCCESS.getCode());
|
| | | }
|
| | |
|
| | |
| | | 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
|
| | | public int updateCheckLog(Long checkId, HiddenDangerCheckPoint hdcp) {
|
| | | return preventRiskDangerCheckLogService.updateCheckLog(checkId, hdcp.getMobileCode());
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | // /**
|
| | | // * 全流程隐患上报-附属表信息插入
|
| | |
| | | //
|
| | | // return preventRiskDangerInfoService.insertDangerInfo(dangerInfo);
|
| | | // }
|
| | |
|
| | |
|
| | | } |