|
|
@@ -296,6 +296,24 @@ public class ResumesServiceImpl extends ServiceImpl<ResumesDao, Resumes> impleme
|
|
|
// 包装为不可修改的Map,防止外部篡改
|
|
|
SALARY_RANGE_MAP = Collections.unmodifiableMap(tempMap);
|
|
|
}
|
|
|
+ // 工作经验范围映射(键:经验选项名称,值:int数组[minYears, maxYears])
|
|
|
+ private static Map<String, int[]> WORK_EXPERIENCE_RANGE_MAP = Collections.emptyMap();
|
|
|
+
|
|
|
+ // 静态代码块:初始化工作经验范围映射(按选项顺序定义)
|
|
|
+ static {
|
|
|
+ Map<String, int[]> tempMap = new HashMap<>();
|
|
|
+ // 注意:数组第一个元素是minYears(最小年限),第二个是maxYears(最大年限)
|
|
|
+ tempMap.put("1年以内", new int[]{0, 1}); // 0 ≤ 工作经验 < 1年
|
|
|
+ tempMap.put("1-3年", new int[]{1, 3}); // 1 ≤ 工作经验 < 3年
|
|
|
+ tempMap.put("3-5年", new int[]{3, 5}); // 3 ≤ 工作经验 < 5年
|
|
|
+ tempMap.put("5-10年", new int[]{5, 10}); // 5 ≤ 工作经验 < 10年
|
|
|
+ tempMap.put("10年以上", new int[]{10, Integer.MAX_VALUE}); // 工作经验 ≥ 10年(无上限)
|
|
|
+ tempMap.put("应届生", new int[]{0, 0}); // 0年经验(无工作经验)
|
|
|
+ tempMap.put("在校生", new int[]{0, 0}); // 0年经验(无工作经验)
|
|
|
+
|
|
|
+ // 包装为不可修改的Map,防止外部篡改
|
|
|
+ WORK_EXPERIENCE_RANGE_MAP = Collections.unmodifiableMap(tempMap);
|
|
|
+ }
|
|
|
private ResumesListDto getMatch(ResumesListDto resumesListDto){
|
|
|
if (resumesListDto.getDegree()!=null){
|
|
|
resumesListDto.setDegree(String.valueOf(DEGREE_MIN_RANGE_MAP.get(resumesListDto.getDegree())));
|
|
|
@@ -306,7 +324,9 @@ public class ResumesServiceImpl extends ServiceImpl<ResumesDao, Resumes> impleme
|
|
|
resumesListDto.setMaxSalary(range[1]);
|
|
|
}
|
|
|
if (resumesListDto.getExpRange()!=null){
|
|
|
-
|
|
|
+ int[] range = WORK_EXPERIENCE_RANGE_MAP.get(resumesListDto.getEduRange());
|
|
|
+ resumesListDto.setMinWorkExp(range[0]);
|
|
|
+ resumesListDto.setMaxWorkExp(range[1]);
|
|
|
}
|
|
|
|
|
|
return resumesListDto;
|