1.修改岗位上传添加社会信用代码
2.修改es查询时,不放逐添加,修改为精准查询
This commit is contained in:
@@ -247,7 +247,7 @@ public class ESJobSearchImpl implements IESJobSearchService
|
||||
|
||||
List<ESJobDocument> esJobDocuments = esJobDocumentMapper.selectList(wrapper);
|
||||
|
||||
if (!isCompanyUser &&esJobDocuments.size() < esJobSearch.getPageSize()) {
|
||||
/*if (!isCompanyUser &&esJobDocuments.size() < esJobSearch.getPageSize()) {
|
||||
// 定义要逐步放宽的搜索条件字段
|
||||
List<Runnable> relaxConditions = new ArrayList<>();
|
||||
relaxConditions.add(() -> newSearch.setArea(null));
|
||||
@@ -290,7 +290,7 @@ public class ESJobSearchImpl implements IESJobSearchService
|
||||
} else {
|
||||
esJobDocuments = allDocuments;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
return esJobDocuments;
|
||||
}
|
||||
@@ -489,7 +489,8 @@ public class ESJobSearchImpl implements IESJobSearchService
|
||||
}
|
||||
if(!StringUtil.isEmptyOrNull(esJobSearch.getEducation())){
|
||||
Integer maxValue = StringUtil.findMaxValue(esJobSearch.getEducation());
|
||||
wrapper.and(x->x.le(ESJobDocument::getEducation_int,maxValue));
|
||||
//wrapper.and(x->x.le(ESJobDocument::getEducation_int,maxValue));//模糊查询
|
||||
wrapper.and(x->x.eq(ESJobDocument::getEducation_int,maxValue));//精准查询
|
||||
}
|
||||
if(Objects.nonNull(esJobSearch.getMaxSalary())){
|
||||
wrapper.and(x->x.le(ESJobDocument::getMaxSalary,esJobSearch.getMaxSalary()));
|
||||
@@ -499,7 +500,8 @@ public class ESJobSearchImpl implements IESJobSearchService
|
||||
}
|
||||
if(!StringUtil.isEmptyOrNull(esJobSearch.getExperience())){
|
||||
Integer maxValue = StringUtil.findMaxValue(esJobSearch.getExperience());
|
||||
wrapper.and(x->x.le(ESJobDocument::getExperience_int,maxValue));
|
||||
//wrapper.and(x->x.le(ESJobDocument::getExperience_int,maxValue));
|
||||
wrapper.and(x->x.eq(ESJobDocument::getExperience_int,maxValue));//精准查询
|
||||
}
|
||||
if(!StringUtil.isEmptyOrNull(esJobSearch.getJobCategory())){
|
||||
//wrapper.and(x->x.eq(ESJobDocument::getJobCategory,esJobSearch.getJobCategory()));
|
||||
@@ -510,7 +512,8 @@ public class ESJobSearchImpl implements IESJobSearchService
|
||||
}
|
||||
if(!StringUtil.isEmptyOrNull(esJobSearch.getScale())){
|
||||
Integer maxValue = StringUtil.findMaxValue(esJobSearch.getScale());
|
||||
wrapper.and(x->x.le(ESJobDocument::getScale,maxValue));
|
||||
//wrapper.and(x->x.le(ESJobDocument::getScale,maxValue));
|
||||
wrapper.and(x->x.eq(ESJobDocument::getScale,maxValue));//精准查询
|
||||
}
|
||||
if(!StringUtil.isEmptyOrNull(esJobSearch.getArea())){
|
||||
List<Integer> integers = StringUtil.convertStringToIntegerList(esJobSearch.getArea());
|
||||
@@ -544,7 +547,7 @@ public class ESJobSearchImpl implements IESJobSearchService
|
||||
wrapper.and(x->x.like(ESJobDocument::getRegionCode,esJobSearch.getRegionCode()));
|
||||
}
|
||||
if(!StringUtil.isEmptyOrNull(esJobSearch.getStaffType())){
|
||||
wrapper.and(x->x.like(ESJobDocument::getStaffType,esJobSearch.getStaffType()));
|
||||
wrapper.and(x->x.eq(ESJobDocument::getStaffType,esJobSearch.getStaffType()));
|
||||
}
|
||||
if(!StringUtil.isEmptyOrNull(esJobSearch.getJobStatus())){
|
||||
wrapper.and(x->x.eq(ESJobDocument::getJobStatus,esJobSearch.getJobStatus()));
|
||||
@@ -587,14 +590,16 @@ public class ESJobSearchImpl implements IESJobSearchService
|
||||
.match(ESJobDocument::getDescription,jobQuery.getJobTitle(),1.0f));
|
||||
}
|
||||
if(!StringUtil.isEmptyOrNull(jobQuery.getEducation())){
|
||||
wrapper.and(a->a.le(ESJobDocument::getEducation,jobQuery.getEducation()));
|
||||
//wrapper.and(a->a.le(ESJobDocument::getEducation,jobQuery.getEducation()));
|
||||
wrapper.and(a->a.eq(ESJobDocument::getEducation,jobQuery.getEducation()));
|
||||
}
|
||||
if(!StringUtil.isEmptyOrNull(jobQuery.getArea())){
|
||||
List<Integer> integers = StringUtil.convertStringToIntegerList(jobQuery.getArea());
|
||||
wrapper.and(x->x.in(ESJobDocument::getJobLocationAreaCode,integers));
|
||||
}
|
||||
if(!StringUtil.isEmptyOrNull(jobQuery.getExperience())){
|
||||
wrapper.and(a->a.le(ESJobDocument::getExperience,jobQuery.getExperience()));
|
||||
//wrapper.and(a->a.le(ESJobDocument::getExperience,jobQuery.getExperience()));
|
||||
wrapper.and(a->a.eq(ESJobDocument::getExperience,jobQuery.getExperience()));
|
||||
}
|
||||
if(Objects.nonNull(jobQuery.getMaxSalary())){
|
||||
wrapper.and(x->x.le(ESJobDocument::getMaxSalary,jobQuery.getMaxSalary()));
|
||||
@@ -811,7 +816,7 @@ public class ESJobSearchImpl implements IESJobSearchService
|
||||
wrapper.limit(esJobSearch.getPageSize());
|
||||
List<ESJobDocument> esJobDocuments = esJobDocumentMapper.selectList(wrapper);
|
||||
|
||||
if (esJobDocuments.size() < esJobSearch.getPageSize()) {
|
||||
/*if (esJobDocuments.size() < esJobSearch.getPageSize()) {
|
||||
// 定义要逐步放宽的搜索条件字段
|
||||
List<Runnable> relaxConditions = new ArrayList<>();
|
||||
relaxConditions.add(() -> newSearch.setArea(null));
|
||||
@@ -854,7 +859,7 @@ public class ESJobSearchImpl implements IESJobSearchService
|
||||
} else {
|
||||
esJobDocuments = allDocuments;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
return esJobDocuments;
|
||||
}
|
||||
|
||||
@@ -1175,7 +1175,7 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
|
||||
*/
|
||||
private Map<String, Long> companyNameToIdMap(List<JobExcelVo> allExcelVoList) {
|
||||
Set<String> companyNameSet = allExcelVoList.stream()
|
||||
.map(JobExcelVo::getCompanyName)
|
||||
.map(JobExcelVo::getCode)
|
||||
.filter(StringUtils::hasText)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
@@ -1183,13 +1183,13 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
|
||||
List<Company> companies = companyMapper.selectByNames(new ArrayList<>(companyNameSet));
|
||||
List<Company> companies = companyMapper.selectBycodes(new ArrayList<>(companyNameSet));
|
||||
if (CollectionUtils.isEmpty(companies)) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
return companies.stream()
|
||||
.collect(Collectors.toMap(
|
||||
Company::getName,
|
||||
Company::getCode,
|
||||
Company::getCompanyId,
|
||||
(v1, v2) -> v1
|
||||
));
|
||||
@@ -1225,7 +1225,7 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
|
||||
|
||||
String companyName = it.getCompanyName();
|
||||
job.setCompanyName(companyName);
|
||||
job.setCompanyId(companyNameToIdMap.getOrDefault(companyName, null));
|
||||
job.setCompanyId(companyNameToIdMap.getOrDefault(it.getCode(), null));
|
||||
|
||||
return job;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
Reference in New Issue
Block a user