| | |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import com.gkhy.safePlatform.commons.vo.SearchResultVO; |
| | | import com.gkhy.safePlatform.incidentManage.entity.*; |
| | | import com.gkhy.safePlatform.incidentManage.enums.AccidentExpressEnum; |
| | | import com.gkhy.safePlatform.incidentManage.enums.AccidentResultCodes; |
| | | import com.gkhy.safePlatform.incidentManage.exception.AccidentException; |
| | | import com.gkhy.safePlatform.incidentManage.model.dto.req.AccidentExpressCasualtyReqDTO; |
| | |
| | | |
| | | depPool.put(dep.getDepId(), dep.getDepName()); |
| | | } |
| | | }} |
| | | } |
| | | } |
| | | |
| | | String depName = depPool.get(AccidentExpressPageRespDTO.getAccidentDepartmentId()); |
| | | AccidentExpressPageRespDTO.setDeptName(depName); |
| | |
| | | String uName = contextCacheUser.getRealName(); |
| | | //必填项验证 |
| | | checkRequired(accidentExpressReqDTO); |
| | | |
| | | //枚举验证 |
| | | checkEnum(accidentExpressReqDTO); |
| | | |
| | | Date nowDate = new Date(); |
| | | //1.新增事故快报 |
| | |
| | | |
| | | @Override |
| | | public ResultVO updateAccidentExpress(Long uid, AccidentExpressReqDTO accidentExpressReqDTO) { |
| | | |
| | | //必填项验证 |
| | | checkRequired(accidentExpressReqDTO); |
| | | //枚举验证 |
| | | checkEnum(accidentExpressReqDTO); |
| | | |
| | | Date nowDate = new Date(); |
| | | //查询是否存在 |
| | | AccidentExpressInfoDetailDO AccidentExpressInfoDetailDO = accidentExpressInfoService.selectAccidentExpressById(accidentExpressReqDTO.getId()); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 验证必填项 |
| | | * |
| | | * @return |
| | | */ |
| | | private void checkRequired(AccidentExpressReqDTO AccidentExpressReqDTO) { |
| | | private void checkRequired(AccidentExpressReqDTO accidentExpressReqDTO) { |
| | | //名称 |
| | | if (StringUtils.isBlank(AccidentExpressReqDTO.getAccidentName())) { |
| | | if (StringUtils.isBlank(accidentExpressReqDTO.getAccidentName())) { |
| | | throw new AccidentException(AccidentResultCodes.EXPRESS_NAME_NULL); |
| | | } |
| | | //部门 |
| | | if (AccidentExpressReqDTO.getAccidentDepartmentId()==null) { |
| | | if (accidentExpressReqDTO.getAccidentDepartmentId() == null) { |
| | | throw new AccidentException(AccidentResultCodes.EXPRESS_DEPARTMENT_NULL); |
| | | } |
| | | //发生时间 |
| | | if (AccidentExpressReqDTO.getOccurrenceTime() == null ) { |
| | | if (accidentExpressReqDTO.getOccurrenceTime() == null) { |
| | | throw new AccidentException(AccidentResultCodes.EXPRESS_TIME_NULL); |
| | | } |
| | | //发生地点 |
| | | if (StringUtils.isBlank(AccidentExpressReqDTO.getOccurrencePlace())) { |
| | | if (StringUtils.isBlank(accidentExpressReqDTO.getOccurrencePlace())) { |
| | | throw new AccidentException(AccidentResultCodes.EXPRESS_PLACE_NULL); |
| | | } |
| | | //事故原因 |
| | | if (StringUtils.isBlank(AccidentExpressReqDTO.getAccidentCause())) { |
| | | if (accidentExpressReqDTO.getAccidentCause() == null) { |
| | | throw new AccidentException(AccidentResultCodes.EXPRESS_CAUSE_NULL); |
| | | } |
| | | //是否有伤亡 |
| | | if (AccidentExpressReqDTO.getCasualties()==null) { |
| | | if (accidentExpressReqDTO.getCasualties() == null) { |
| | | throw new AccidentException(AccidentResultCodes.EXPRESS_CASUALTIES_NULL); |
| | | } |
| | | //简要经过 |
| | | if (StringUtils.isBlank(AccidentExpressReqDTO.getAccidentBriefProcess())) { |
| | | if (StringUtils.isBlank(accidentExpressReqDTO.getAccidentBriefProcess())) { |
| | | throw new AccidentException(AccidentResultCodes.EXPRESS_BRIEF_PROCESS_NULL); |
| | | } |
| | | //初步分析 |
| | | if (StringUtils.isBlank(AccidentExpressReqDTO.getAccidentCausesPreliminaryAnalysis())) { |
| | | if (StringUtils.isBlank(accidentExpressReqDTO.getAccidentCausesPreliminaryAnalysis())) { |
| | | throw new AccidentException(AccidentResultCodes.EXPRESS_CASE_PRELIMINARY_ANALYSIS_NULL); |
| | | } |
| | | //应急防范措施 |
| | | if (StringUtils.isBlank(AccidentExpressReqDTO.getEmergencyPrecautions())) { |
| | | if (StringUtils.isBlank(accidentExpressReqDTO.getEmergencyPrecautions())) { |
| | | throw new AccidentException(AccidentResultCodes.EXPRESS_EMERGENCY_PRECAUTIONS_NULL); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * 枚举验证 |
| | | * |
| | | */ |
| | | private void checkEnum(AccidentExpressReqDTO accidentExpressReqDTO){ |
| | | if (AccidentExpressEnum.getByCode(accidentExpressReqDTO.getAccidentCause())==null){ |
| | | throw new AccidentException(AccidentResultCodes.EXPRESS_ENUMS_CAUSE_NOT_EXIST); |
| | | } |
| | | } |
| | | |
| | | } |