diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/ESJobSearchImpl.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/ESJobSearchImpl.java index abdb71e..410ed28 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/ESJobSearchImpl.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/ESJobSearchImpl.java @@ -747,42 +747,41 @@ public class ESJobSearchImpl implements IESJobSearchService Company company=iCompanyService.selectCompanyByCompanyId(job.getCompanyId()); 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 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 lambdaEsQueryWrapper = new LambdaEsQueryWrapper(); - lambdaEsQueryWrapper.eq(ESJobDocument::getJobId,job.getJobId()); - esJobDocumentMapper.delete(lambdaEsQueryWrapper); - esJobDocumentMapper.insert(esJobDocument); } public List selectByIds(Long[] jobIds) {