bugfix-企业登录注册
This commit is contained in:
@@ -48,6 +48,13 @@ public class Job extends BaseEntity
|
||||
@ApiModelProperty("最大薪资(元)")
|
||||
private Long maxSalary;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
private Long salaryMin;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Long salaryMax;
|
||||
|
||||
@Excel(name = "学历要求 对应字典education")
|
||||
@ApiModelProperty("学历要求 对应字典education")
|
||||
private String education;
|
||||
|
||||
@@ -491,13 +491,21 @@ public class ESJobSearchImpl implements IESJobSearchService
|
||||
Integer maxValue = StringUtil.findMaxValue(esJobSearch.getEducation());
|
||||
wrapper.and(x->x.eq(ESJobDocument::getEducation_int,maxValue));
|
||||
}
|
||||
// 用户传入最小薪资:查询岗位最大薪资 >= 用户最小薪资(岗位薪资上限至少要达到用户期望)
|
||||
if(Objects.nonNull(esJobSearch.getMinSalary())){
|
||||
wrapper.and(x->x.ge(ESJobDocument::getMaxSalary,esJobSearch.getMinSalary()));
|
||||
}
|
||||
// 用户传入最大薪资:查询岗位最小薪资 <= 用户最大薪资(岗位薪资下限不能超过用户预算)
|
||||
if(Objects.nonNull(esJobSearch.getMaxSalary())){
|
||||
wrapper.and(x->x.le(ESJobDocument::getMinSalary,esJobSearch.getMaxSalary()));
|
||||
// 薪资范围筛选:兼容前端字段 salaryMin/salaryMax 和 minSalary/maxSalary
|
||||
Long userMinSalary = Objects.nonNull(esJobSearch.getSalaryMin()) ? esJobSearch.getSalaryMin() : esJobSearch.getMinSalary();
|
||||
Long userMaxSalary = Objects.nonNull(esJobSearch.getSalaryMax()) ? esJobSearch.getSalaryMax() : esJobSearch.getMaxSalary();
|
||||
|
||||
// 岗位薪资范围与用户期望薪资范围有交集
|
||||
// 条件:岗位最小薪资 <= 用户最大薪资 AND 岗位最大薪资 >= 用户最小薪资
|
||||
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())){
|
||||
Integer maxValue = StringUtil.findMaxValue(esJobSearch.getExperience());
|
||||
|
||||
Reference in New Issue
Block a user