server/dmvisit_service/src/main/java/com/doumee/core/utils/Constants.java
@@ -87,10 +87,22 @@ try { birthday = dateFormat.parse(birthdayString); } catch (Exception e) { throw new RuntimeException(e); // throw new RuntimeException(e); } return birthday; } public static Integer getSexByCardNo(String idCard){ if(idCard ==null || idCard.length()<17){ return null; } String str = idCard.substring(16, 17); // 截取身份证号的前六位数字作为出生日期 try { Integer num = Integer.parseInt(str); return (num % 2 !=0) ? 1:2 ; } catch (Exception e) { } return null; } /** * 判断是否为有效车牌号