|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static long getAgeByIdCard(String idCard){ | 
|---|
|  |  |  | int birthYear = Integer.parseInt(idCard.substring(6, 10)); | 
|---|
|  |  |  | int birthMonth = Integer.parseInt(idCard.substring(10, 12)); | 
|---|
|  |  |  | int birthDay = Integer.parseInt(idCard.substring(12, 14)); | 
|---|
|  |  |  | try{ | 
|---|
|  |  |  | LocalDate birthDate = LocalDate.of(birthYear, birthMonth, birthDay); | 
|---|
|  |  |  | LocalDate currentDate = LocalDate.now(); | 
|---|
|  |  |  | long age = ChronoUnit.YEARS.between(birthDate, currentDate); | 
|---|
|  |  |  | return age; | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | int birthYear = Integer.parseInt(idCard.substring(6, 10)); | 
|---|
|  |  |  | int birthMonth = Integer.parseInt(idCard.substring(10, 12)); | 
|---|
|  |  |  | int birthDay = Integer.parseInt(idCard.substring(12, 14)); | 
|---|
|  |  |  | try{ | 
|---|
|  |  |  | LocalDate birthDate = LocalDate.of(birthYear, birthMonth, birthDay); | 
|---|
|  |  |  | LocalDate currentDate = LocalDate.now(); | 
|---|
|  |  |  | long age = ChronoUnit.YEARS.between(birthDate, currentDate); | 
|---|
|  |  |  | return age; | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"身份证号码错误:"+idCard); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"身份证号码错误:"+idCard); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return 0; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | WTBDCD(23, "待出单"), | 
|---|
|  |  |  | WTBYTH(24, "已退回"), | 
|---|
|  |  |  | WTBYGB(25, "已关闭"), | 
|---|
|  |  |  | WTBTBZ(26, "投保中"), | 
|---|
|  |  |  | //2024年4月25日15:17:13 修改 投保中 = 》 批改申请中 | 
|---|
|  |  |  | WTBTBZ(26, "批改申请中"), | 
|---|
|  |  |  | WTBBZZ(27, "保障中"), | 
|---|
|  |  |  | ; | 
|---|
|  |  |  | // 成员变量 | 
|---|