bugfix-企业登录注册

This commit is contained in:
2026-01-15 10:16:05 +08:00
parent 495692066e
commit 973c0b809e
2 changed files with 22 additions and 7 deletions

View File

@@ -48,6 +48,13 @@ public class Job extends BaseEntity
@ApiModelProperty("最大薪资(元)") @ApiModelProperty("最大薪资(元)")
private Long maxSalary; private Long maxSalary;
@TableField(exist = false)
private Long salaryMin;
@TableField(exist = false)
private Long salaryMax;
@Excel(name = "学历要求 对应字典education") @Excel(name = "学历要求 对应字典education")
@ApiModelProperty("学历要求 对应字典education") @ApiModelProperty("学历要求 对应字典education")
private String education; private String education;

View File

@@ -491,13 +491,21 @@ public class ESJobSearchImpl implements IESJobSearchService
Integer maxValue = StringUtil.findMaxValue(esJobSearch.getEducation()); Integer maxValue = StringUtil.findMaxValue(esJobSearch.getEducation());
wrapper.and(x->x.eq(ESJobDocument::getEducation_int,maxValue)); wrapper.and(x->x.eq(ESJobDocument::getEducation_int,maxValue));
} }
// 用户传入最小薪资:查询岗位最大薪资 >= 用户最小薪资(岗位薪资上限至少要达到用户期望) // 薪资范围筛选:兼容前端字段 salaryMin/salaryMax 和 minSalary/maxSalary
if(Objects.nonNull(esJobSearch.getMinSalary())){ Long userMinSalary = Objects.nonNull(esJobSearch.getSalaryMin()) ? esJobSearch.getSalaryMin() : esJobSearch.getMinSalary();
wrapper.and(x->x.ge(ESJobDocument::getMaxSalary,esJobSearch.getMinSalary())); Long userMaxSalary = Objects.nonNull(esJobSearch.getSalaryMax()) ? esJobSearch.getSalaryMax() : esJobSearch.getMaxSalary();
}
// 用户传入最大薪资:查询岗位最小薪资 <= 用户最大薪资(岗位薪资下限不能超过用户预算) // 岗位薪资范围与用户期望薪资范围有交集
if(Objects.nonNull(esJobSearch.getMaxSalary())){ // 条件:岗位最小薪资 <= 用户最大薪资 AND 岗位最大薪资 >= 用户最小薪资
wrapper.and(x->x.le(ESJobDocument::getMinSalary,esJobSearch.getMaxSalary())); if(Objects.nonNull(userMinSalary) && Objects.nonNull(userMaxSalary)){
wrapper.and(x->x.le(ESJobDocument::getMinSalary,userMaxSalary)
.ge(ESJobDocument::getMaxSalary,userMinSalary));
} else if(Objects.nonNull(userMinSalary)){
// 只有最小薪资:岗位最大薪资 >= 用户最小薪资
wrapper.and(x->x.ge(ESJobDocument::getMaxSalary,userMinSalary));
} else if(Objects.nonNull(userMaxSalary)){
// 只有最大薪资:岗位最小薪资 <= 用户最大薪资
wrapper.and(x->x.le(ESJobDocument::getMinSalary,userMaxSalary));
} }
if(!StringUtil.isEmptyOrNull(esJobSearch.getExperience())){ if(!StringUtil.isEmptyOrNull(esJobSearch.getExperience())){
Integer maxValue = StringUtil.findMaxValue(esJobSearch.getExperience()); Integer maxValue = StringUtil.findMaxValue(esJobSearch.getExperience());