教育经历 “至今”时间兼容

This commit is contained in:
dxfeng 2025-11-20 14:23:24 +08:00
parent 833dc912ab
commit 71bf81bff5
1 changed files with 9 additions and 2 deletions

View File

@ -432,6 +432,8 @@ public class ResumeIdentifyServiceImpl extends Service implements ResumeIdentify
} }
if (obj.containsKey("学业信息")) { if (obj.containsKey("学业信息")) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy.MM.dd");
JSONArray jyjl = obj.getJSONArray("学业信息"); JSONArray jyjl = obj.getJSONArray("学业信息");
List<Map<String, String>> studyList = new ArrayList<>(); List<Map<String, String>> studyList = new ArrayList<>();
if (null != jyjl && jyjl.size() > 0) { if (null != jyjl && jyjl.size() > 0) {
@ -452,14 +454,19 @@ public class ResumeIdentifyServiceImpl extends Service implements ResumeIdentify
// 毕业时间 // 毕业时间
String[] split = jdsq.split("-"); String[] split = jdsq.split("-");
if (split.length == 2) { if (split.length == 2) {
studyMap.put("bysj", split[1]); String bysj = split[1];
try {
dateFormat.parse(bysj);
} catch (ParseException e) {
bysj = "";
}
studyMap.put("bysj", bysj);
} }
studyList.add(studyMap); studyList.add(studyMap);
} }
} }
detailMap.put("jyjl", studyList); detailMap.put("jyjl", studyList);
if (CollectionUtils.isNotEmpty(studyList)) { if (CollectionUtils.isNotEmpty(studyList)) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy.MM.dd");
List<Map<String, String>> sortedList = studyList.stream() List<Map<String, String>> sortedList = studyList.stream()
.sorted((map1, map2) -> { .sorted((map1, map2) -> {
String dateStr1 = map1.get("bysj"); String dateStr1 = map1.get("bysj");