1.修改企业联系人保存

2.修改es搜索排序
This commit is contained in:
chenshaohua
2026-07-21 12:42:41 +08:00
parent 9039effee4
commit e9a9509f7c
2 changed files with 29 additions and 18 deletions

View File

@@ -169,13 +169,18 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
companyContactMapper.update(null,Wrappers.<CompanyContact>lambdaUpdate() companyContactMapper.update(null,Wrappers.<CompanyContact>lambdaUpdate()
.eq(CompanyContact::getCompanyId, company.getCompanyId()) .eq(CompanyContact::getCompanyId, company.getCompanyId())
.set(CompanyContact::getDelFlag, Constants.Del_FLAG_DELETE)); .set(CompanyContact::getDelFlag, Constants.Del_FLAG_DELETE));
if(!Objects.isNull(company.getCompanyContactList())){ List<CompanyContact> contactList = company.getCompanyContactList();
company.getCompanyContactList().forEach(x -> { if (!Objects.isNull(contactList)) {
CompanyContact companyContact = new CompanyContact(); for (CompanyContact x : contactList) {
companyContact.setCompanyId(company.getCompanyId()); CompanyContact entity = new CompanyContact();
BeanUtils.copyProperties(x, companyContact); entity.setCompanyId(company.getCompanyId());
companyContactMapper.insert(companyContact); BeanUtils.copyProperties(x, entity);
}); if (entity.getId() != null) {
companyContactMapper.updateById(entity);
} else {
companyContactMapper.insert(entity);
}
}
} }
if (companyNatureChanged) { if (companyNatureChanged) {
List<Long> jobIds = jobMapper.selectList(Wrappers.<Job>lambdaQuery() List<Long> jobIds = jobMapper.selectList(Wrappers.<Job>lambdaQuery()

View File

@@ -778,18 +778,24 @@ public class ESJobSearchImpl implements IESJobSearchService
wrapper.trackScores(); wrapper.trackScores();
wrapper.sortByScore(SortOrder.DESC); wrapper.sortByScore(SortOrder.DESC);
if(Objects.nonNull(jobQuery.getOrder())){ if(Objects.nonNull(jobQuery.getOrder())){
wrapper.sort(SortBuilders.fieldSort("postingDate").order(SortOrder.DESC).missing("_last")); switch (jobQuery.getOrder()) {
if(jobQuery.getOrder()==1){ case 0: // 推荐:权重 → 最新发布
wrapper.orderByDesc(ESJobDocument::getIsHot); wrapper.sort(SortBuilders.fieldSort("postingDate").order(SortOrder.DESC).missing("_last"));
wrapper.orderByDesc(ESJobDocument::getApplyNum); break;
wrapper.orderByDesc(ESJobDocument::getView); case 1: // 最热:权重 → 热度
wrapper.orderByDesc(ESJobDocument::getIsHot);
wrapper.orderByDesc(ESJobDocument::getApplyNum);
wrapper.orderByDesc(ESJobDocument::getView);
break;
case 2: // 最新发布:权重 → 最新发布
wrapper.sort(SortBuilders.fieldSort("postingDate").order(SortOrder.DESC).missing("_last"));
break;
case 3: // 最大薪资:权重 → 最高薪资
wrapper.orderByDesc(ESJobDocument::getMaxSalary);
break;
default: // 默认:权重 → 最新发布
wrapper.sort(SortBuilders.fieldSort("postingDate").order(SortOrder.DESC).missing("_last"));
} }
if(jobQuery.getOrder()==3){
wrapper.orderByDesc(ESJobDocument::getMaxSalary);
}
}else{
//默认按照发布时间倒叙
wrapper.sort(SortBuilders.fieldSort("postingDate").order(SortOrder.DESC).missing("_last"));
} }
EsPageInfo<ESJobDocument> esJobDocumentEsPageInfo = esJobDocumentMapper.pageQuery(wrapper, pageNum, pageSize); EsPageInfo<ESJobDocument> esJobDocumentEsPageInfo = esJobDocumentMapper.pageQuery(wrapper, pageNum, pageSize);
return esJobDocumentEsPageInfo; return esJobDocumentEsPageInfo;