添加岗位下架功

This commit is contained in:
sh
2026-02-03 17:29:27 +08:00
parent 6b7e359234
commit 7bd42fa687
10 changed files with 130 additions and 5 deletions

View File

@@ -113,4 +113,10 @@ public interface IJobService
public Integer getTotals(Job job);
void uploadFileJob(List<JobExcelVo> list);
public int jobDown(Long jobId);
public int jobUp(Long jobId);
void updateJobDown();
}

View File

@@ -546,6 +546,9 @@ public class ESJobSearchImpl implements IESJobSearchService
if(!StringUtil.isEmptyOrNull(esJobSearch.getStaffType())){
wrapper.and(x->x.like(ESJobDocument::getStaffType,esJobSearch.getStaffType()));
}
if(!StringUtil.isEmptyOrNull(esJobSearch.getJobStatus())){
wrapper.and(x->x.eq(ESJobDocument::getJobStatus,esJobSearch.getJobStatus()));
}
if(Objects.nonNull(esJobSearch.getOrder())){
if(esJobSearch.getOrder()==1){
wrapper.orderByDesc(ESJobDocument::getIsHot);

View File

@@ -1370,4 +1370,42 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
return new ArrayList<>(dedupMap.values());
}
@Transactional
@Override
public int jobDown(Long jobId) {
Job job=new Job();
job.setJobId(jobId);
job.setJobStatus("1");
job.setDownTime(DateUtils.dateTimeNow(DateUtils.YYYY_MM_DD_HH_MM_SS));
int i=jobMapper.updateStatus(job);
//刷新单条数据
iesJobSearchService.updateJob(jobId);
return i;
}
@Transactional
@Override
public int jobUp(Long jobId) {
Job job=new Job();
job.setJobId(jobId);
job.setJobStatus("0");
//刷新单条数据
int i=jobMapper.updateStatus(job);
iesJobSearchService.updateJob(jobId);
return i;
}
@Override
public void updateJobDown() {
//查询下架岗位
List<Job> list=jobMapper.getJobDownList();
List<Long> ids=list.stream().map(Job::getJobId).collect(Collectors.toList());
//更新岗位状态
jobMapper.updateJobDown(ids);
//刷新es
ids.forEach(it->{
iesJobSearchService.updateJob(it);
});
}
}