修复job为空时,漏洞问题

This commit is contained in:
sh
2026-05-26 13:07:27 +08:00
parent 2fc4a93cc8
commit 50558fdbc6

View File

@@ -747,42 +747,41 @@ public class ESJobSearchImpl implements IESJobSearchService
Company company=iCompanyService.selectCompanyByCompanyId(job.getCompanyId()); Company company=iCompanyService.selectCompanyByCompanyId(job.getCompanyId());
job.setCode(company.getCode()); job.setCode(company.getCode());
} }
BeanUtils.copyBeanProp(esJobDocument, job);
//生成jobId加密字段
String encryptJobId=SM4Utils.encryptEcb(SM4Constants.SM4_KET, String.valueOf(job!=null?job.getJobId():null));
esJobDocument.setEncryptJobId(encryptJobId);
if (job != null && job.getJobId() != null) {
esJobDocument.setAppJobUrl("https://www.xjksly.cn/app#/packageA/pages/post/post?jobId="+ encryptJobId);
}
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);
} }
BeanUtils.copyBeanProp(esJobDocument, job);
//生成jobId加密字段
String encryptJobId=SM4Utils.encryptEcb(SM4Constants.SM4_KET, String.valueOf(job!=null?job.getJobId():null));
esJobDocument.setEncryptJobId(encryptJobId);
if (job != null && job.getJobId() != null) {
esJobDocument.setAppJobUrl("https://www.xjksly.cn/app#/packageA/pages/post/post?jobId="+ encryptJobId);
}
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);
} }
public List<ESJobDocument> selectByIds(Long[] jobIds) { public List<ESJobDocument> selectByIds(Long[] jobIds) {