| | |
| | | import com.gkhy.safePlatform.commons.vo.SearchResultVO; |
| | | import com.gkhy.safePlatform.incidentManage.entity.*; |
| | | import com.gkhy.safePlatform.incidentManage.enums.AccidentResultCodes; |
| | | import com.gkhy.safePlatform.incidentManage.enums.WorkInjuryTypeEnum; |
| | | import com.gkhy.safePlatform.incidentManage.exception.AccidentException; |
| | | import com.gkhy.safePlatform.incidentManage.model.dto.req.WorkInjuryDeclarationFileReqDTO; |
| | | import com.gkhy.safePlatform.incidentManage.model.dto.req.WorkInjuryDeclarationReqDTO; |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 验证必填项 |
| | | * |
| | | * @return |
| | | */ |
| | | private void checkRequired(WorkInjuryDeclarationReqDTO WorkInjuryDeclarationReqDTO) { |
| | | private void checkRequired(WorkInjuryDeclarationReqDTO workInjuryDeclarationReqDTO) { |
| | | //申报人姓名 |
| | | if (StringUtils.isBlank(WorkInjuryDeclarationReqDTO.getDeclareUserName())) { |
| | | if (StringUtils.isBlank(workInjuryDeclarationReqDTO.getDeclareUserName())) { |
| | | throw new AccidentException(AccidentResultCodes.WORK_INJURY_DECLARATION_USERNAME_NULL); |
| | | } |
| | | //事故性别 |
| | | if (WorkInjuryDeclarationReqDTO.getDeclareUserGender() == null ) { |
| | | if (workInjuryDeclarationReqDTO.getDeclareUserGender() == null) { |
| | | throw new AccidentException(AccidentResultCodes.WORK_INJURY_DECLARATION_GENDER_NULL); |
| | | } |
| | | //申报人部门 |
| | | if (WorkInjuryDeclarationReqDTO.getDeclareDepartmentId()==null) { |
| | | if (workInjuryDeclarationReqDTO.getDeclareDepartmentId() == null) { |
| | | throw new AccidentException(AccidentResultCodes.WORK_INJURY_DECLARATION_USERNAME_NOT_EXIST); |
| | | } |
| | | //事故名称 |
| | | if (WorkInjuryDeclarationReqDTO.getAccidentExpressId() == null ) { |
| | | if (workInjuryDeclarationReqDTO.getAccidentExpressId() == null) { |
| | | throw new AccidentException(AccidentResultCodes.ACCIDENT_EXPRESS_NULL); |
| | | } |
| | | AccidentExpressInfoDetailDO accidentExpressInfo = accidentExpressInfoService.selectAccidentExpressById(WorkInjuryDeclarationReqDTO.getAccidentExpressId()); |
| | | AccidentExpressInfoDetailDO accidentExpressInfo = accidentExpressInfoService.selectAccidentExpressById(workInjuryDeclarationReqDTO.getAccidentExpressId()); |
| | | if (accidentExpressInfo == null) { |
| | | throw new AccidentException(AccidentResultCodes.ACCIDENT_EXPRESS_NOT_EXIST); |
| | | } |
| | | //工伤类型 |
| | | if (StringUtils.isBlank(WorkInjuryDeclarationReqDTO.getWorkInjuryType())) { |
| | | if (workInjuryDeclarationReqDTO.getWorkInjuryType() == null) { |
| | | throw new AccidentException(AccidentResultCodes.WORK_INJURY_DECLARATION_TYPE_NULL); |
| | | } |
| | | //申报日期 |
| | | if (WorkInjuryDeclarationReqDTO.getDeclareDate()==null) { |
| | | throw new AccidentException(AccidentResultCodes.WORK_INJURY_DECLARATION_Date_NULL); |
| | | if (workInjuryDeclarationReqDTO.getDeclareDate() == null) { |
| | | throw new AccidentException(AccidentResultCodes.WORK_INJURY_DECLARATION_DATA_NULL); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 枚举验证 |
| | | */ |
| | | private void checkEnum(WorkInjuryDeclarationReqDTO workInjuryDeclarationReqDTO) { |
| | | if (WorkInjuryTypeEnum.getByCode(workInjuryDeclarationReqDTO.getWorkInjuryType()) == null) { |
| | | throw new AccidentException(AccidentResultCodes.WORK_INJURY_DECLARATION_ENUMS_TYPE_NOT_EXIST); |
| | | } |
| | | } |
| | | } |