| | |
| | | * 判断是否为有效车牌号 |
| | | */ |
| | | public static boolean checkCarNo(String str) { |
| | | String patt="^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵川青藏琼宁秦川]\\\\d{5}[A-Z]$"; |
| | | Pattern r = Pattern.compile(patt); |
| | | Matcher matcher = r.matcher(str); |
| | | return matcher.find(); |
| | | // String patt="^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵川青藏琼宁秦川]\\\\d{5}[A-Z]$"; |
| | | // Pattern r = Pattern.compile(patt); |
| | | // Matcher matcher = r.matcher(str); |
| | | // String regex = "^[\u4e00-\u9fa5]{1}[A-Z]{1}[A-HJ-NP-Z]{1}[A-HJ-NP-Z0-9]{4}[D0-9X]$"; |
| | | // Pattern pattern = Pattern.compile(regex); |
| | | // Matcher matcher = pattern.matcher(str); |
| | | // boolean isMatcher = matcher.matches(); |
| | | // return isMatcher; |
| | | |
| | | |
| | | if (str.length() >= 7 && str.length() <= 8){ |
| | | Pattern pattern = Pattern.compile("^([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[a-zA-Z](([ABCDF]((?![IO])[a-zA-Z0-9](?![IO]))[0-9]{4})|([0-9]{5}[ABCDF]))|[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1})$"); |
| | | Matcher m = pattern.matcher(str); |
| | | if (!m.matches()){ |
| | | return false; |
| | | } |
| | | return true; |
| | | }else { |
| | | return false; |
| | | } |
| | | |
| | | } |
| | | |
| | | public static String getTuominStr(String s){ |
| | |
| | | int otherDeal = 4;//他人已处理 |
| | | } |
| | | |
| | | /** |
| | | * 获取车牌类型信息 |
| | | * |
| | | * @param plateNo |
| | | * @return 返回null,表示车牌不匹配 |
| | | */ |
| | | public static VehiclePlateNoEnum getVehiclePlateNo(String plateNo) { |
| | | for (VehiclePlateNoEnum vehiclePlateNoEnum : VehiclePlateNoEnum.values()) { |
| | | Matcher matcher = vehiclePlateNoEnum.pattern.matcher(plateNo); |
| | | if (matcher.find()) { |
| | | return vehiclePlateNoEnum; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | public enum VehiclePlateNoEnum { |
| | | /** |
| | | * 匹配民用车牌和使馆车牌 |
| | | * 1、第一位为汉子省份缩写 |
| | | * 2、第二位为大写字母城市编码 |
| | | * 3、后面是5位仅含字母和数字的组合 |
| | | */ |
| | | CIVIL_LICENSE_PLATE_AND_EMBASSY_LICENSE_PLATE(1, "民用车牌和使馆车牌", Pattern.compile("^[京津冀晋蒙辽吉黑沪苏浙皖闽赣鲁豫鄂湘粤桂琼川贵云渝藏陕甘青宁新]{1}[A-Z]{1}[0-9a-zA-Z]{5}$")), |
| | | /** |
| | | * 匹配特种车牌(挂,警,学,领,港,澳) |
| | | */ |
| | | SPECIAL_LICENSE_PLATES(2, "特种车牌", Pattern.compile("^[京津冀晋蒙辽吉黑沪苏浙皖闽赣鲁豫鄂湘粤桂琼川贵云渝藏陕甘青宁新]{1}[A-Z]{1}[0-9a-zA-Z]{4}[挂警学领港澳]{1}$")), |
| | | /** |
| | | * 匹配 |
| | | */ |
| | | ARMED_POLICE_CAR(3, "武警车牌", Pattern.compile("^WJ[京津冀晋蒙辽吉黑沪苏浙皖闽赣鲁豫鄂湘粤桂琼川贵云渝藏陕甘青宁新]?[0-9a-zA-Z]{5}$")), |
| | | /** |
| | | * 匹配军牌 |
| | | */ |
| | | MILITARY_CAR(4, "军用车牌", Pattern.compile("^[A-Z]{2}[0-9]{5}$")), |
| | | /** |
| | | * 小型新能源车 |
| | | * 1、匹配新能源车辆6位车牌 |
| | | */ |
| | | SMALL_NEW_ENERGY_VEHICLE(5, "小型新能源车牌", Pattern.compile("^[京津冀晋蒙辽吉黑沪苏浙皖闽赣鲁豫鄂湘粤桂琼川贵云渝藏陕甘青宁新]{1}[A-Z]{1}[DF]{1}[0-9a-zA-Z]{5}$")), |
| | | /** |
| | | * 大型新能源车 |
| | | */ |
| | | LARGE_NEW_ENERGY_VEHICLE(6, "大型新能源车牌", Pattern.compile("^[京津冀晋蒙辽吉黑沪苏浙皖闽赣鲁豫鄂湘粤桂琼川贵云渝藏陕甘青宁新]{1}[A-Z]{1}[0-9a-zA-Z]{5}[DF]{1}$")); |
| | | private int code; |
| | | |
| | | private String description; |
| | | |
| | | private Pattern pattern; |
| | | |
| | | VehiclePlateNoEnum(int code, String description, Pattern pattern) { |
| | | this.code = code; |
| | | this.description = description; |
| | | this.pattern = pattern; |
| | | } |
| | | |
| | | public int getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public String getDescription() { |
| | | return description; |
| | | } |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | System.out.println(Constants.checkCarNo("湘B40D17")); |
| | | System.out.println(Constants.checkCarNo("皖AP0637")); |
| | | System.out.println(Constants.getVehiclePlateNo("湘BD40D17").getDescription()); |
| | | |
| | | System.out.println(Constants.getVehiclePlateNo("湘B140D17").getDescription()); |
| | | System.out.println(Constants.getVehiclePlateNo("宿AP0637").getDescription()); |
| | | } |
| | | |
| | | |
| | |
| | | private Integer visitTimes; |
| | | |
| | | @ApiModelProperty(value = "最后访问时间") |
| | | @TableField(exist = false) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date lastVisitDate; |
| | | |
| | |
| | | .select(" (select STARTTIME from visits v where v.MEMBER_ID=t.id and v.ISDELETED=0 order by CREATE_DATE desc limit 1) as visitsLastDate"); |
| | | |
| | | queryWrapper.eq(Objects.nonNull(pageWrap.getModel().getCreaterId()),Member::getEditor,pageWrap.getModel().getCreaterId()); |
| | | queryWrapper.eq(Objects.nonNull(pageWrap.getModel().getType()),Member::getType,pageWrap.getModel().getType()); |
| | | queryWrapper |
| | | queryWrapper.eq(Objects.nonNull(pageWrap.getModel().getType()),Member::getType,pageWrap.getModel().getType()); |
| | | queryWrapper |
| | | .and(StringUtils.isNotBlank(pageWrap.getModel().getName()),ms->ms.like(Member::getPhone,pageWrap.getModel().getName()) |
| | | .or().like(Member::getName,pageWrap.getModel().getName())) |
| | | .and(StringUtils.isNotBlank(pageWrap.getModel().getCompanyName()), |
| | |
| | | } |
| | | |
| | | private Member getMemberListParam(String cardno, Visits visits, List<Member> addList, List<Member> editList) { |
| | | // if(!StringUtils.isNotBlank(visits.getCarNos()) |
| | | //// &&!Constants.checkCarNo(visits.getCarNos()) |
| | | // ){ |
| | | // throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,车牌号【"+visits.getCarNos()+"】不合法,请核实后重试~"); |
| | | // } |
| | | if(!StringUtils.isNotBlank(visits.getCarNos()) |
| | | &&Objects.isNull(Constants.getVehiclePlateNo(visits.getCarNos())) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对不起,车牌号【"+visits.getCarNos()+"】不合法,请核实后重试~"); |
| | | } |
| | | if(Constants.equalsInteger(Constants.ZERO, visits.getIdcardType())&&cardno.length()!=18 |
| | | //&&!IdcardUtil.isValidCard(cardno) |
| | | ){ |
| | |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,该身份证号被禁止访问申请,如有疑问,请联系您的拜访人进行核实"); |
| | | } |
| | | //核查预约用户是否存在未签离的预约记录 |
| | | isExsitNoOutVisisRecord(member); |
| | | |
| | | // isExsitNoOutVisisRecord(member); |
| | | |
| | | member.setFaceImg(visits.getFaceImg()); |
| | | member.setImgurl(StringUtils.isNotBlank(visits.getImgurl())?visits.getImgurl():null); |
| | | member.setEditDate(visits.getCreateDate()); |
| | |
| | | } |
| | | //根据手机号和身份证号码查询 当前预约的时间是否与其他预约记录有冲突 |
| | | if (visitsMapper.selectCount(new QueryWrapper<Visits>().lambda() |
| | | .notIn(Visits::getStatus,Constants.VisitStatus.cancel,Constants.VisitStatus.cancel,Constants.VisitStatus.noPass,Constants.VisitStatus.xfFail) |
| | | .and(ms -> ms.eq(Visits::getPhone, visits.getPhone()) |
| | | .or().eq(Visits::getIdcardDecode, Constants.getTuominStr(cardno))) |
| | | .notIn(Visits::getStatus,Constants.VisitStatus.cancel,Constants.VisitStatus.noPass,Constants.VisitStatus.xfFail) |
| | | // .and(ms -> ms.eq(Visits::getPhone, visits.getPhone()) |
| | | // .or().eq(Visits::getIdcardDecode, Constants.getTuominStr(cardno))) |
| | | .eq(Visits::getIdcardDecode, Constants.getTuominStr(cardno)) |
| | | .and(ms -> ms.apply(" visits.STARTTIME <= '" + DateUtil.DateToStr(visits.getStarttime(),"yyyy-MM-dd HH:mm:ss") + "' and visits.ENDTIME >= '" + DateUtil.DateToStr(visits.getStarttime(),"yyyy-MM-dd HH:mm:ss") + "' ") |
| | | .or().apply(" visits.STARTTIME <= '" + DateUtil.DateToStr(visits.getEndtime(),"yyyy-MM-dd HH:mm:ss") + "' and visits.ENDTIME >= '" + DateUtil.DateToStr(visits.getEndtime(),"yyyy-MM-dd HH:mm:ss") + "' ") |
| | | )) > Constants.ZERO) { |
| | |
| | | } |
| | | Member member = memberMapper.selectOne(new QueryWrapper<Member>().lambda().eq(Member::getErpId,param.getUserId()).last("limit 1")); |
| | | if(Objects.isNull(member)){ |
| | | return; |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"对不起,用户信息不存在!"); |
| | | } |
| | | List<Integer> doorIds = getRoleIdByParam(param.getRoleIds(),member); |
| | | //更新授权有效期 |