publish
This commit is contained in:
@@ -63,4 +63,8 @@ public interface IESJobSearchService
|
||||
ESJobDocument selectById(Long jobId);
|
||||
|
||||
void fix();
|
||||
|
||||
void updateJob(Long jobId);
|
||||
|
||||
void deleteJob(Long jobId);
|
||||
}
|
||||
|
@@ -497,4 +497,47 @@ public class ESJobSearchImpl implements IESJobSearchService
|
||||
jobMapper.insert(job);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteJob(Long jobId) {
|
||||
LambdaEsQueryWrapper<ESJobDocument> lambdaEsQueryWrapper = new LambdaEsQueryWrapper();
|
||||
lambdaEsQueryWrapper.eq(ESJobDocument::getJobId,jobId);
|
||||
esJobDocumentMapper.delete(lambdaEsQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateJob(Long jobId) {
|
||||
ESJobDocument esJobDocument = new ESJobDocument();
|
||||
Job job = jobMapper.selectById(jobId);
|
||||
|
||||
BeanUtils.copyBeanProp(esJobDocument, job);
|
||||
esJobDocument.setAppJobUrl("https://ks.zhaopinzao8dian.com/app#/packageA/pages/post/post?jobId="+ Base64.getEncoder().encodeToString(String.valueOf(job.getJobId()).getBytes()));
|
||||
if(!StringUtil.isEmptyOrNull(job.getScale())){
|
||||
esJobDocument.setScale(Integer.valueOf(job.getScale()));
|
||||
}else {
|
||||
esJobDocument.setScale(0);
|
||||
}
|
||||
if(!StringUtil.isEmptyOrNull(job.getExperience())){
|
||||
esJobDocument.setExperience_int(Integer.valueOf(job.getExperience()));
|
||||
}else {
|
||||
esJobDocument.setExperience("0");
|
||||
esJobDocument.setExperience_int(0);
|
||||
}
|
||||
if(!StringUtil.isEmptyOrNull(job.getEducation())){
|
||||
esJobDocument.setEducation_int(Integer.valueOf(job.getEducation()));
|
||||
}else {
|
||||
esJobDocument.setEducation("-1");
|
||||
esJobDocument.setEducation_int(-1);
|
||||
}
|
||||
if (esJobDocument.getLatitude() != null) {
|
||||
esJobDocument.setLatAndLon(esJobDocument.getLatitude().toString() + "," + esJobDocument.getLongitude().toString());
|
||||
}
|
||||
if(StringUtil.isEmptyOrNull(job.getCompanyNature())){
|
||||
esJobDocument.setCompanyNature("6");
|
||||
}
|
||||
LambdaEsQueryWrapper<ESJobDocument> lambdaEsQueryWrapper = new LambdaEsQueryWrapper();
|
||||
lambdaEsQueryWrapper.eq(ESJobDocument::getJobId,job.getJobId());
|
||||
esJobDocumentMapper.delete(lambdaEsQueryWrapper);
|
||||
esJobDocumentMapper.insert(esJobDocument);
|
||||
}
|
||||
}
|
||||
|
@@ -258,11 +258,14 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
String formattedDate = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
//修改岗位状态
|
||||
//修改岗位状态
|
||||
if(job.getIsPublish()!=null) {
|
||||
if(job.getIsPublish()==1){
|
||||
job.setPostingDate(formattedDate);
|
||||
iesJobSearchService.updateJob(job.getJobId());
|
||||
}else {
|
||||
job.setPostingDate(null);
|
||||
iesJobSearchService.deleteJob(job.getJobId());
|
||||
}
|
||||
}
|
||||
return jobMapper.updateById(job);
|
||||
|
Reference in New Issue
Block a user