| | |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public Integer visitReporting(Visits visits) { |
| | | visits.setSourceType(Constants.ZERO); |
| | | isValidBaseParam(visits); |
| | | //检验被拜访人是否合法 |
| | | Member visitMember = isValideVisitedUser(visits.getMemberId()); |
| | |
| | | visits.setVisitType(Integer.valueOf(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.MDJ_VISIT_REQUIRED).getCode())); |
| | | visits.setIdcardNo(DESUtil.decrypt(Constants.EDS_PWD, visitMember.getIdcardNo())); |
| | | //初始化访客信息 |
| | | initVisitInfo(visits,date); |
| | | // initVisitInfo(visits,date); |
| | | visitsMapper.insert(visits); |
| | | return visits.getId(); |
| | | } |
| | |
| | | || StringUtils.isBlank( visits.getName()) |
| | | || StringUtils.isBlank( visits.getPhone()) |
| | | || StringUtils.isBlank( visits.getCompanyName()) |
| | | || visits.getIdcardType() == null |
| | | || Objects.isNull(visits.getType()) |
| | | // || StringUtils.isBlank( visits.getFaceImg() ) |
| | | || StringUtils.isBlank( visits.getIdcardNo() ) |
| | | || visits.getReceptMemberId() == null){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,信息填写不正确!"); |
| | | } |
| | | if(Constants.equalsInteger(visits.getType(),Constants.ZERO) |
| | | || Constants.equalsInteger(visits.getType(),Constants.ONE)){ |
| | | if( visits.getIdcardType() == null |
| | | || StringUtils.isBlank( visits.getIdcardNo() ) ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,信息填写不正确!"); |
| | | } |
| | | } |
| | | //访客报备 |
| | | if(visits.getType().equals(Constants.TWO) |
| | |
| | | || StringUtils.isBlank( visits.getPhone()) |
| | | || StringUtils.isBlank( visits.getCompanyName())) |
| | | || StringUtils.isBlank( visits.getCarNos()) |
| | | || Objects.isNull(visits.getReceptMemberId()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,信息填写不正确!"); |
| | | }else if(visits.getType().equals(Constants.ONE) && StringUtils.isBlank(visits.getConstructionReason())){ |
| | | |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,未填写施工事由!"); |
| | | } |
| | | if(visits.getEndtime().getTime() < System.currentTimeMillis()){ |