From c83429f44672c64e3fc24d7e4a267274574ce195 Mon Sep 17 00:00:00 2001 From: sjh Date: Fri, 6 Dec 2024 09:50:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=AF=8D=E4=BA=B2=E6=96=87?= =?UTF-8?q?=E5=8C=96=E7=A8=8B=E5=BA=A6=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../supervisiondata/event/ApplicationEvent.java | 1 + .../service/impl/PointServiceImpl.java | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/biutag/supervisiondata/event/ApplicationEvent.java b/src/main/java/com/biutag/supervisiondata/event/ApplicationEvent.java index 0002cbf..534cc24 100644 --- a/src/main/java/com/biutag/supervisiondata/event/ApplicationEvent.java +++ b/src/main/java/com/biutag/supervisiondata/event/ApplicationEvent.java @@ -137,6 +137,7 @@ public class ApplicationEvent { // pointService.syncFatherEducation(initDomain(List.of(102))); // pointService.syncMotherEducation(initDomain(List.of(103))); // pointService.syncDomicileType(initDomain(List.of(104))); + pointService.syncDomicileType(initDomain(List.of(105))); }); } diff --git a/src/main/java/com/biutag/supervisiondata/service/impl/PointServiceImpl.java b/src/main/java/com/biutag/supervisiondata/service/impl/PointServiceImpl.java index 1072141..8e9eddb 100644 --- a/src/main/java/com/biutag/supervisiondata/service/impl/PointServiceImpl.java +++ b/src/main/java/com/biutag/supervisiondata/service/impl/PointServiceImpl.java @@ -301,7 +301,7 @@ public class PointServiceImpl implements PointService { if (oldMap.get(fatherEducation.getGmsfhm()) != null) continue; idCode.put(fatherEducation.getGmsfhm(), 1); - int eduScore = getEduScore(fatherEducation); + int eduScore = getEduScore(fatherEducation, 1); ClueData data = ClueData.builder() .name(personal.getName()) .id(personal.getId().toString()) @@ -342,7 +342,7 @@ public class PointServiceImpl implements PointService { if (oldMap.get(motherEducation.getGmsfhm()) != null) continue; idCode.put(motherEducation.getGmsfhm(), 1); - int eduScore = getEduScore(motherEducation); + int eduScore = getEduScore(motherEducation, 2); ClueData data = ClueData.builder() .name(personal.getName()) .id(personal.getId().toString()) @@ -365,8 +365,14 @@ public class PointServiceImpl implements PointService { taskRepository.updateById(updateTask); } - private static int getEduScore(GBaseCSCZRK fatherEducation) { - return switch (fatherEducation.getFatherEducation()) { + private static int getEduScore(GBaseCSCZRK educations, int type) { + String education = ""; + if (type == 1) { + education = educations.getFatherEducation(); + } else if (type == 2) { + education = educations.getMotherEducation(); + } + return switch (education) { case "研究生", "研究生肄业", "研究生毕业", "大学毕业", "大学本科", "大学肄业", "相当大学毕业" -> 1;// 本科 case "大学专科和专科学校", "相当专科毕业", "专科毕业", "专科肄业" -> 2;// 大专 case "相当高中毕业", "相当中专或中技毕业", "中专中技肄业", "职业高中毕业", "中专毕业", "高中肄业",