处理问题

This commit is contained in:
TS-QD1 2023-03-13 18:18:05 +08:00
parent 2f2376ca4e
commit 4ded4d64d7

View File

@ -6,6 +6,7 @@ import net.sf.jsqlparser.expression.DateTimeLiteralExpression;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime; import org.joda.time.DateTime;
import org.joda.time.Days; import org.joda.time.Days;
import org.joda.time.LocalDateTime;
import org.joda.time.Years; import org.joda.time.Years;
import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormat;
@ -601,8 +602,8 @@ public class IdCardVerifyUtil {
public static Integer getIdCardAge(String cardNo) { public static Integer getIdCardAge(String cardNo) {
String birthday = getIdCardBirthday(cardNo); String birthday = getIdCardBirthday(cardNo);
DateTime nowDateTime = DateTime.now(); LocalDateTime nowDateTime = LocalDateTime.now();
DateTime birthdayDateTime = DateTime.parse(birthday, DateTimeFormat.forPattern(ISystemConstant.DATE_FORMATTER_YYYY_MM_DD)); LocalDateTime birthdayDateTime = LocalDateTime.parse(birthday, DateTimeFormat.forPattern(ISystemConstant.DATE_FORMATTER_YYYY_MM_DD));
return Years.yearsBetween(birthdayDateTime, nowDateTime).getYears(); return Years.yearsBetween(birthdayDateTime, nowDateTime).getYears();
} }