Compare commits

..

2 Commits

2 changed files with 16 additions and 5 deletions

View File

@@ -145,10 +145,10 @@ public class JobApplyServiceImpl extends ServiceImpl<JobApplyMapper,JobApply> im
List<Long> ids = jobApplies.stream().map(JobApply::getId).collect(Collectors.toList()); List<Long> ids = jobApplies.stream().map(JobApply::getId).collect(Collectors.toList());
jobApplyMapper.deleteBatchIds(ids); jobApplyMapper.deleteBatchIds(ids);
} }
jobApplyMapper.insert(jobApply); int num = jobApplyMapper.insert(jobApply);
//添加消息说明 //添加消息说明
return 0; return num;
} }
@Override @Override

View File

@@ -382,6 +382,10 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
if(!longs.isEmpty()){ if(!longs.isEmpty()){
fileMapper.updateBussinessids(longs,job.getJobId()); fileMapper.updateBussinessids(longs,job.getJobId());
} }
if (job.getIsPublish() == 1) {
//同步到es
iesJobSearchService.updateJob(job.getJobId());
}
} }
return insert; return insert;
} }
@@ -1093,16 +1097,23 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
private List<ESJobDocument> sysUserCollection(List<ESJobDocument> jobs){ private List<ESJobDocument> sysUserCollection(List<ESJobDocument> jobs){
if(jobs.isEmpty()){return new ArrayList<>();} if(jobs.isEmpty()){return new ArrayList<>();}
if(SecurityUtils.isLogin()){ // 优先使用 App 端用户,兜底使用 PC 端用户
Long userId = null;
if(SiteSecurityUtils.isLogin()){
userId = SiteSecurityUtils.getUserId();
} else if(SecurityUtils.isLogin()){
userId = SecurityUtils.getUserId();
}
if(userId != null){
//收藏 //收藏
Set<Long> collectionIds = jobCollectionMapper.selectList(Wrappers.<JobCollection>lambdaQuery() Set<Long> collectionIds = jobCollectionMapper.selectList(Wrappers.<JobCollection>lambdaQuery()
.eq(JobCollection::getUserId, SecurityUtils.getUserId()) .eq(JobCollection::getUserId, SecurityUtils.getUserId())
.in(JobCollection::getJobId, jobs.stream().map(ESJobDocument::getJobId).collect(Collectors.toList()))) .in(JobCollection::getJobId, jobs.stream().map(ESJobDocument::getJobId).collect(Collectors.toList())))
.stream().map(JobCollection::getJobId).collect(Collectors.toSet()); .stream().map(JobCollection::getJobId).collect(Collectors.toSet());
Set<Long> applyJobIds = new HashSet<>(); Set<Long> applyJobIds = new HashSet<>();
List<Job> jobList = jobApplyMapper.applyJob(SecurityUtils.getUserId()); List<Job> jobList = jobApplyMapper.applyJob(userId);
if (CollectionUtils.isNotEmpty(jobList)) { if (CollectionUtils.isNotEmpty(jobList)) {
applyJobIds = jobApplyMapper.applyJob(SecurityUtils.getUserId()).stream().map(Job::getJobId).collect(Collectors.toSet()); applyJobIds = jobList.stream().map(Job::getJobId).collect(Collectors.toSet());
} }
for (ESJobDocument j : jobs) { for (ESJobDocument j : jobs) {
if (collectionIds.contains(j.getJobId())) { if (collectionIds.contains(j.getJobId())) {