Compare commits
7 Commits
3d1c1e7d06
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 3d69e3d262 | |||
| e2bfb520fa | |||
| 9c58cd9168 | |||
| d918189775 | |||
| 132e4886d7 | |||
| 39c5faa532 | |||
| e2e5539c03 |
@@ -1,5 +1,6 @@
|
|||||||
package com.ruoyi.cms.controller.cms;
|
package com.ruoyi.cms.controller.cms;
|
||||||
|
|
||||||
|
import com.alibaba.excel.EasyExcel;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.ruoyi.cms.domain.*;
|
import com.ruoyi.cms.domain.*;
|
||||||
import com.ruoyi.cms.domain.query.ESJobSearch;
|
import com.ruoyi.cms.domain.query.ESJobSearch;
|
||||||
@@ -7,9 +8,9 @@ import com.ruoyi.cms.domain.vo.CandidateVO;
|
|||||||
import com.ruoyi.cms.domain.vo.CompanyVo;
|
import com.ruoyi.cms.domain.vo.CompanyVo;
|
||||||
import com.ruoyi.cms.domain.vo.JobExcelVo;
|
import com.ruoyi.cms.domain.vo.JobExcelVo;
|
||||||
import com.ruoyi.cms.service.*;
|
import com.ruoyi.cms.service.*;
|
||||||
import com.ruoyi.cms.util.EasyExcelUtils;
|
|
||||||
import com.ruoyi.cms.util.RoleUtils;
|
import com.ruoyi.cms.util.RoleUtils;
|
||||||
import com.ruoyi.cms.util.StringUtil;
|
import com.ruoyi.cms.util.StringUtil;
|
||||||
|
import com.ruoyi.cms.util.excel.JobExcelListener;
|
||||||
import com.ruoyi.cms.util.sensitiveWord.SensitiveWordChecker;
|
import com.ruoyi.cms.util.sensitiveWord.SensitiveWordChecker;
|
||||||
import com.ruoyi.common.annotation.Anonymous;
|
import com.ruoyi.common.annotation.Anonymous;
|
||||||
import com.ruoyi.common.annotation.Log;
|
import com.ruoyi.common.annotation.Log;
|
||||||
@@ -40,6 +41,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 岗位Controller
|
* 岗位Controller
|
||||||
@@ -390,14 +392,29 @@ public class CmsJobController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
try (InputStream inputStream = file.getInputStream()){
|
try (InputStream inputStream = file.getInputStream()){
|
||||||
List<JobExcelVo> allExcelVoList = new ArrayList<>();
|
JobExcelListener listener = new JobExcelListener();
|
||||||
EasyExcelUtils.readExcelByBatch(inputStream, JobExcelVo.class, 100, list -> {
|
EasyExcel.read(inputStream, JobExcelVo.class, listener).sheet().headRowNumber(1).doRead();
|
||||||
allExcelVoList.addAll(list);
|
|
||||||
});
|
if (listener.hasColumnError()) {
|
||||||
if (CollectionUtils.isEmpty(allExcelVoList)) {
|
return AjaxResult.error(listener.getColumnErrorMsg());
|
||||||
throw new Exception("Excel文件中无有效数据");
|
|
||||||
}
|
}
|
||||||
jobService.uploadFileJob(allExcelVoList);
|
|
||||||
|
List<Integer> emptyRowNumbers = listener.getEmptyRowNumbers();
|
||||||
|
List<JobExcelVo> validDataList = listener.getValidDataList();
|
||||||
|
int emptyCount = emptyRowNumbers.size();
|
||||||
|
|
||||||
|
if (emptyCount > 0) {
|
||||||
|
String rowNumStr = emptyRowNumbers.stream()
|
||||||
|
.map(String::valueOf)
|
||||||
|
.collect(Collectors.joining("、"));
|
||||||
|
return AjaxResult.error(String.format("检测到第%s行社会信用代码为空,本次上传终止,未插入任何数据!", rowNumStr));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CollectionUtils.isEmpty(validDataList)) {
|
||||||
|
return AjaxResult.error("Excel文件中无有效数据!");
|
||||||
|
}
|
||||||
|
|
||||||
|
jobService.uploadFileJob(validDataList);
|
||||||
return AjaxResult.success("已上传!");
|
return AjaxResult.success("已上传!");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ public class ESJobDocument
|
|||||||
private String jobLocation;
|
private String jobLocation;
|
||||||
|
|
||||||
@ApiModelProperty("工作地点区县字典代码")
|
@ApiModelProperty("工作地点区县字典代码")
|
||||||
private Integer jobLocationAreaCode;
|
private String jobLocationAreaCode;
|
||||||
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@ApiModelProperty("发布时间")
|
@ApiModelProperty("发布时间")
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ public class Job extends BaseEntity
|
|||||||
@ApiModelProperty("是否发布 0未发布 1发布")
|
@ApiModelProperty("是否发布 0未发布 1发布")
|
||||||
private Integer isPublish;
|
private Integer isPublish;
|
||||||
|
|
||||||
@ApiModelProperty("数据来源")
|
@ApiModelProperty("数据来源 0系统自录,1 365平台同步,2招聘会同步,3岗位抓取")
|
||||||
private String dataSource;
|
private String dataSource;
|
||||||
|
|
||||||
@ApiModelProperty("岗位链接")
|
@ApiModelProperty("岗位链接")
|
||||||
|
|||||||
@@ -44,41 +44,46 @@ public class JobExcelVo
|
|||||||
@ApiModelProperty("用人单位名称")
|
@ApiModelProperty("用人单位名称")
|
||||||
private String companyName;
|
private String companyName;
|
||||||
|
|
||||||
@ExcelProperty(value = "职位名称", index = 6,converter = LongConverter.class)
|
@ExcelProperty(value = "社会信用代码", index = 6)
|
||||||
|
@Excel(name = "社会信用代码")
|
||||||
|
@ApiModelProperty("社会信用代码")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "职位名称", index = 7,converter = LongConverter.class)
|
||||||
@Excel(name = "招聘人数")
|
@Excel(name = "招聘人数")
|
||||||
@ApiModelProperty("招聘人数")
|
@ApiModelProperty("招聘人数")
|
||||||
private Long vacancies;
|
private Long vacancies;
|
||||||
|
|
||||||
@ExcelProperty(value = "职位名称", index = 7)
|
@ExcelProperty(value = "职位名称", index = 8)
|
||||||
@ApiModelProperty("岗位描述")
|
@ApiModelProperty("岗位描述")
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
@ExcelProperty(value = "职位名称", index = 8)
|
@ExcelProperty(value = "职位名称", index = 9)
|
||||||
@ApiModelProperty("岗位分类")
|
@ApiModelProperty("岗位分类")
|
||||||
private String jobCategory;
|
private String jobCategory;
|
||||||
|
|
||||||
@ExcelProperty(value = "职位名称", index = 9)
|
@ExcelProperty(value = "职位名称", index = 10)
|
||||||
@ApiModelProperty("岗位类型 0疆内 1疆外")
|
@ApiModelProperty("岗位类型 0疆内 1疆外")
|
||||||
private String jobType;
|
private String jobType;
|
||||||
|
|
||||||
@ExcelProperty(value = "职位名称", index = 10)
|
@ExcelProperty(value = "职位名称", index = 11)
|
||||||
@ApiModelProperty("类型 0常规岗位 1就业见习岗位 2实习实训岗位 3社区实践岗位 4零工 对应字段字典position_type")
|
@ApiModelProperty("类型 0常规岗位 1就业见习岗位 2实习实训岗位 3社区实践岗位 4零工 对应字段字典position_type")
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
@ExcelProperty(value = "职位名称", index = 11)
|
@ExcelProperty(value = "职位名称", index = 12)
|
||||||
@ApiModelProperty("工作地点")
|
@ApiModelProperty("工作地点")
|
||||||
private String jobAddress;
|
private String jobAddress;
|
||||||
|
|
||||||
@ExcelProperty(value = "职位名称", index = 12)
|
@ExcelProperty(value = "职位名称", index = 13)
|
||||||
@Excel(name = "岗位区划")
|
@Excel(name = "岗位区划")
|
||||||
@ApiModelProperty("岗位区划")
|
@ApiModelProperty("岗位区划")
|
||||||
private String jobLocation;
|
private String jobLocation;
|
||||||
|
|
||||||
@ExcelProperty(value = "联系人", index = 13)
|
@ExcelProperty(value = "联系人", index = 14)
|
||||||
@ApiModelProperty("联系人")
|
@ApiModelProperty("联系人")
|
||||||
private String contactPerson;
|
private String contactPerson;
|
||||||
|
|
||||||
@ExcelProperty(value = "联系人电话", index = 14)
|
@ExcelProperty(value = "联系人电话", index = 15)
|
||||||
@ApiModelProperty("联系人电话")
|
@ApiModelProperty("联系人电话")
|
||||||
private String contactPersonPhone;
|
private String contactPersonPhone;
|
||||||
|
|
||||||
|
|||||||
@@ -33,4 +33,6 @@ public interface CompanyMapper extends BaseMapper<Company>
|
|||||||
List<Company> selectByNames(List<String> list);
|
List<Company> selectByNames(List<String> list);
|
||||||
|
|
||||||
public Company selectByCode(@Param("code") String code);
|
public Company selectByCode(@Param("code") String code);
|
||||||
|
|
||||||
|
List<Company> selectBycodes(List<String> list);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,9 @@ import com.ruoyi.cms.util.StringUtil;
|
|||||||
import com.ruoyi.common.core.domain.entity.Company;
|
import com.ruoyi.common.core.domain.entity.Company;
|
||||||
import com.ruoyi.common.core.redis.RedisCache;
|
import com.ruoyi.common.core.redis.RedisCache;
|
||||||
import com.ruoyi.common.core.text.Convert;
|
import com.ruoyi.common.core.text.Convert;
|
||||||
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import com.ruoyi.common.utils.SiteSecurityUtils;
|
import com.ruoyi.common.utils.SiteSecurityUtils;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.common.utils.bean.BeanUtils;
|
import com.ruoyi.common.utils.bean.BeanUtils;
|
||||||
import org.dromara.easyes.core.biz.EsPageInfo;
|
import org.dromara.easyes.core.biz.EsPageInfo;
|
||||||
import org.dromara.easyes.core.conditions.select.LambdaEsQueryWrapper;
|
import org.dromara.easyes.core.conditions.select.LambdaEsQueryWrapper;
|
||||||
@@ -201,6 +203,10 @@ public class ESJobSearchImpl implements IESJobSearchService
|
|||||||
if(StringUtil.isEmptyOrNull(job.getCompanyNature())){
|
if(StringUtil.isEmptyOrNull(job.getCompanyNature())){
|
||||||
esJobDocument.setCompanyNature("6");
|
esJobDocument.setCompanyNature("6");
|
||||||
}
|
}
|
||||||
|
if (StringUtils.isNotEmpty(job.getPostingDate())) {
|
||||||
|
Date date = DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS,job.getPostingDate());
|
||||||
|
esJobDocument.setPostingDate(date);
|
||||||
|
}
|
||||||
esJobDocumentList.add(esJobDocument);
|
esJobDocumentList.add(esJobDocument);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -488,8 +494,10 @@ public class ESJobSearchImpl implements IESJobSearchService
|
|||||||
wrapper.geoDistance(ESJobDocument::getLatAndLon,Double.valueOf(esJobSearch.getRadius()), DistanceUnit.KILOMETERS,new GeoPoint(Double.parseDouble(esJobSearch.getLatitude().toString()), Double.parseDouble(esJobSearch.getLongitude().toString())));
|
wrapper.geoDistance(ESJobDocument::getLatAndLon,Double.valueOf(esJobSearch.getRadius()), DistanceUnit.KILOMETERS,new GeoPoint(Double.parseDouble(esJobSearch.getLatitude().toString()), Double.parseDouble(esJobSearch.getLongitude().toString())));
|
||||||
}
|
}
|
||||||
if(!StringUtil.isEmptyOrNull(esJobSearch.getEducation())){
|
if(!StringUtil.isEmptyOrNull(esJobSearch.getEducation())){
|
||||||
Integer maxValue = StringUtil.findMaxValue(esJobSearch.getEducation());
|
//Integer maxValue = StringUtil.findMaxValue(esJobSearch.getEducation());
|
||||||
wrapper.and(x->x.le(ESJobDocument::getEducation_int,maxValue));
|
//wrapper.and(x->x.le(ESJobDocument::getEducation_int,maxValue));//模糊查询
|
||||||
|
List<Integer> integers=StringUtil.convertStringToIntegerList(esJobSearch.getEducation());
|
||||||
|
wrapper.and(x->x.in(ESJobDocument::getEducation,integers));
|
||||||
}
|
}
|
||||||
if(Objects.nonNull(esJobSearch.getMaxSalary())){
|
if(Objects.nonNull(esJobSearch.getMaxSalary())){
|
||||||
wrapper.and(x->x.le(ESJobDocument::getMaxSalary,esJobSearch.getMaxSalary()));
|
wrapper.and(x->x.le(ESJobDocument::getMaxSalary,esJobSearch.getMaxSalary()));
|
||||||
@@ -498,8 +506,10 @@ public class ESJobSearchImpl implements IESJobSearchService
|
|||||||
wrapper.and(x->x.ge(ESJobDocument::getMinSalary,esJobSearch.getMinSalary()));
|
wrapper.and(x->x.ge(ESJobDocument::getMinSalary,esJobSearch.getMinSalary()));
|
||||||
}
|
}
|
||||||
if(!StringUtil.isEmptyOrNull(esJobSearch.getExperience())){
|
if(!StringUtil.isEmptyOrNull(esJobSearch.getExperience())){
|
||||||
Integer maxValue = StringUtil.findMaxValue(esJobSearch.getExperience());
|
//Integer maxValue = StringUtil.findMaxValue(esJobSearch.getExperience());
|
||||||
wrapper.and(x->x.le(ESJobDocument::getExperience_int,maxValue));
|
//wrapper.and(x->x.le(ESJobDocument::getExperience_int,maxValue));
|
||||||
|
List<Integer> integers = StringUtil.convertStringToIntegerList(esJobSearch.getExperience());
|
||||||
|
wrapper.and(x->x.in(ESJobDocument::getExperience_int,integers));//精准查询
|
||||||
}
|
}
|
||||||
if(!StringUtil.isEmptyOrNull(esJobSearch.getJobCategory())){
|
if(!StringUtil.isEmptyOrNull(esJobSearch.getJobCategory())){
|
||||||
//wrapper.and(x->x.eq(ESJobDocument::getJobCategory,esJobSearch.getJobCategory()));
|
//wrapper.and(x->x.eq(ESJobDocument::getJobCategory,esJobSearch.getJobCategory()));
|
||||||
@@ -509,8 +519,10 @@ public class ESJobSearchImpl implements IESJobSearchService
|
|||||||
.like(ESJobDocument::getJobTitle, targetValue));
|
.like(ESJobDocument::getJobTitle, targetValue));
|
||||||
}
|
}
|
||||||
if(!StringUtil.isEmptyOrNull(esJobSearch.getScale())){
|
if(!StringUtil.isEmptyOrNull(esJobSearch.getScale())){
|
||||||
Integer maxValue = StringUtil.findMaxValue(esJobSearch.getScale());
|
//Integer maxValue = StringUtil.findMaxValue(esJobSearch.getScale());
|
||||||
wrapper.and(x->x.le(ESJobDocument::getScale,maxValue));
|
//wrapper.and(x->x.le(ESJobDocument::getScale,maxValue));
|
||||||
|
List<Integer> integers = StringUtil.convertStringToIntegerList(esJobSearch.getScale());
|
||||||
|
wrapper.and(x->x.in(ESJobDocument::getScale,integers));//精准查询
|
||||||
}
|
}
|
||||||
if(!StringUtil.isEmptyOrNull(esJobSearch.getArea())){
|
if(!StringUtil.isEmptyOrNull(esJobSearch.getArea())){
|
||||||
List<Integer> integers = StringUtil.convertStringToIntegerList(esJobSearch.getArea());
|
List<Integer> integers = StringUtil.convertStringToIntegerList(esJobSearch.getArea());
|
||||||
@@ -520,7 +532,8 @@ public class ESJobSearchImpl implements IESJobSearchService
|
|||||||
wrapper.and(x->x.eq(ESJobDocument::getJobType,esJobSearch.getJobType()));
|
wrapper.and(x->x.eq(ESJobDocument::getJobType,esJobSearch.getJobType()));
|
||||||
}
|
}
|
||||||
if(!StringUtil.isEmptyOrNull(esJobSearch.getType())){
|
if(!StringUtil.isEmptyOrNull(esJobSearch.getType())){
|
||||||
wrapper.and(x->x.eq(ESJobDocument::getType,esJobSearch.getType()));
|
List<Integer> integers = StringUtil.convertStringToIntegerList(esJobSearch.getType());
|
||||||
|
wrapper.and(x->x.in(ESJobDocument::getType,integers));
|
||||||
}
|
}
|
||||||
if(!StringUtil.isEmptyOrNull(esJobSearch.getDescription())){
|
if(!StringUtil.isEmptyOrNull(esJobSearch.getDescription())){
|
||||||
wrapper.and(x->x.like(ESJobDocument::getDescription,esJobSearch.getDescription()));
|
wrapper.and(x->x.like(ESJobDocument::getDescription,esJobSearch.getDescription()));
|
||||||
@@ -544,7 +557,7 @@ public class ESJobSearchImpl implements IESJobSearchService
|
|||||||
wrapper.and(x->x.like(ESJobDocument::getRegionCode,esJobSearch.getRegionCode()));
|
wrapper.and(x->x.like(ESJobDocument::getRegionCode,esJobSearch.getRegionCode()));
|
||||||
}
|
}
|
||||||
if(!StringUtil.isEmptyOrNull(esJobSearch.getStaffType())){
|
if(!StringUtil.isEmptyOrNull(esJobSearch.getStaffType())){
|
||||||
wrapper.and(x->x.like(ESJobDocument::getStaffType,esJobSearch.getStaffType()));
|
wrapper.and(x->x.eq(ESJobDocument::getStaffType,esJobSearch.getStaffType()));
|
||||||
}
|
}
|
||||||
if(!StringUtil.isEmptyOrNull(esJobSearch.getJobStatus())){
|
if(!StringUtil.isEmptyOrNull(esJobSearch.getJobStatus())){
|
||||||
wrapper.and(x->x.eq(ESJobDocument::getJobStatus,esJobSearch.getJobStatus()));
|
wrapper.and(x->x.eq(ESJobDocument::getJobStatus,esJobSearch.getJobStatus()));
|
||||||
@@ -587,14 +600,19 @@ public class ESJobSearchImpl implements IESJobSearchService
|
|||||||
.match(ESJobDocument::getDescription,jobQuery.getJobTitle(),1.0f));
|
.match(ESJobDocument::getDescription,jobQuery.getJobTitle(),1.0f));
|
||||||
}
|
}
|
||||||
if(!StringUtil.isEmptyOrNull(jobQuery.getEducation())){
|
if(!StringUtil.isEmptyOrNull(jobQuery.getEducation())){
|
||||||
wrapper.and(a->a.le(ESJobDocument::getEducation,jobQuery.getEducation()));
|
//wrapper.and(a->a.le(ESJobDocument::getEducation,jobQuery.getEducation()));
|
||||||
|
//wrapper.and(a->a.eq(ESJobDocument::getEducation,jobQuery.getEducation()));
|
||||||
|
List<Integer> integers=StringUtil.convertStringToIntegerList(jobQuery.getEducation());
|
||||||
|
wrapper.and(a->a.in(ESJobDocument::getEducation,integers));
|
||||||
}
|
}
|
||||||
if(!StringUtil.isEmptyOrNull(jobQuery.getArea())){
|
if(!StringUtil.isEmptyOrNull(jobQuery.getArea())){
|
||||||
List<Integer> integers = StringUtil.convertStringToIntegerList(jobQuery.getArea());
|
List<Integer> integers = StringUtil.convertStringToIntegerList(jobQuery.getArea());
|
||||||
wrapper.and(x->x.in(ESJobDocument::getJobLocationAreaCode,integers));
|
wrapper.and(x->x.in(ESJobDocument::getJobLocationAreaCode,integers));
|
||||||
}
|
}
|
||||||
if(!StringUtil.isEmptyOrNull(jobQuery.getExperience())){
|
if(!StringUtil.isEmptyOrNull(jobQuery.getExperience())){
|
||||||
wrapper.and(a->a.le(ESJobDocument::getExperience,jobQuery.getExperience()));
|
//wrapper.and(a->a.le(ESJobDocument::getExperience,jobQuery.getExperience()));
|
||||||
|
List<Integer> integers = StringUtil.convertStringToIntegerList(jobQuery.getExperience());
|
||||||
|
wrapper.and(a->a.in(ESJobDocument::getExperience,integers));
|
||||||
}
|
}
|
||||||
if(Objects.nonNull(jobQuery.getMaxSalary())){
|
if(Objects.nonNull(jobQuery.getMaxSalary())){
|
||||||
wrapper.and(x->x.le(ESJobDocument::getMaxSalary,jobQuery.getMaxSalary()));
|
wrapper.and(x->x.le(ESJobDocument::getMaxSalary,jobQuery.getMaxSalary()));
|
||||||
@@ -612,10 +630,12 @@ public class ESJobSearchImpl implements IESJobSearchService
|
|||||||
wrapper.geoDistance(ESJobDocument::getLatAndLon,Double.valueOf(jobQuery.getRadius()), DistanceUnit.KILOMETERS,new GeoPoint(Double.parseDouble(jobQuery.getLatitude().toString()), Double.parseDouble(jobQuery.getLongitude().toString())));
|
wrapper.geoDistance(ESJobDocument::getLatAndLon,Double.valueOf(jobQuery.getRadius()), DistanceUnit.KILOMETERS,new GeoPoint(Double.parseDouble(jobQuery.getLatitude().toString()), Double.parseDouble(jobQuery.getLongitude().toString())));
|
||||||
}
|
}
|
||||||
if(jobQuery.getJobLocationAreaCode()!=null){
|
if(jobQuery.getJobLocationAreaCode()!=null){
|
||||||
wrapper.and(a->a.eq(ESJobDocument::getJobLocationAreaCode,jobQuery.getJobLocationAreaCode()));
|
List<Integer> integers = StringUtil.convertStringToIntegerList(jobQuery.getJobLocationAreaCode());
|
||||||
|
wrapper.and(a->a.in(ESJobDocument::getJobLocationAreaCode,integers));
|
||||||
}
|
}
|
||||||
if(!StringUtil.isEmptyOrNull(jobQuery.getScale())){
|
if(!StringUtil.isEmptyOrNull(jobQuery.getScale())){
|
||||||
wrapper.and(a->a.eq(ESJobDocument::getScale,jobQuery.getScale()));
|
List<Integer> integers = StringUtil.convertStringToIntegerList(jobQuery.getScale());
|
||||||
|
wrapper.and(a->a.in(ESJobDocument::getScale,integers));
|
||||||
}
|
}
|
||||||
if(!StringUtil.isEmptyOrNull(jobQuery.getSearchValue())){
|
if(!StringUtil.isEmptyOrNull(jobQuery.getSearchValue())){
|
||||||
wrapper.and(a->a.match(ESJobDocument::getDescription,jobQuery.getSearchValue(),4.0f));
|
wrapper.and(a->a.match(ESJobDocument::getDescription,jobQuery.getSearchValue(),4.0f));
|
||||||
@@ -624,7 +644,8 @@ public class ESJobSearchImpl implements IESJobSearchService
|
|||||||
wrapper.and(a->a.eq(ESJobDocument::getCompanyNature,jobQuery.getCompanyNature()));
|
wrapper.and(a->a.eq(ESJobDocument::getCompanyNature,jobQuery.getCompanyNature()));
|
||||||
}
|
}
|
||||||
if(!StringUtil.isEmptyOrNull(jobQuery.getType())){
|
if(!StringUtil.isEmptyOrNull(jobQuery.getType())){
|
||||||
wrapper.and(a->a.eq(ESJobDocument::getType,jobQuery.getType()));
|
List<Integer> integers = StringUtil.convertStringToIntegerList(jobQuery.getType());
|
||||||
|
wrapper.and(a->a.in(ESJobDocument::getType,integers));
|
||||||
}
|
}
|
||||||
if(!StringUtil.isEmptyOrNull(jobQuery.getJobType())){
|
if(!StringUtil.isEmptyOrNull(jobQuery.getJobType())){
|
||||||
wrapper.and(a->a.eq(ESJobDocument::getJobType,jobQuery.getJobType()));
|
wrapper.and(a->a.eq(ESJobDocument::getJobType,jobQuery.getJobType()));
|
||||||
|
|||||||
@@ -1175,7 +1175,7 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
|
|||||||
*/
|
*/
|
||||||
private Map<String, Long> companyNameToIdMap(List<JobExcelVo> allExcelVoList) {
|
private Map<String, Long> companyNameToIdMap(List<JobExcelVo> allExcelVoList) {
|
||||||
Set<String> companyNameSet = allExcelVoList.stream()
|
Set<String> companyNameSet = allExcelVoList.stream()
|
||||||
.map(JobExcelVo::getCompanyName)
|
.map(JobExcelVo::getCode)
|
||||||
.filter(StringUtils::hasText)
|
.filter(StringUtils::hasText)
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
|
|
||||||
@@ -1183,13 +1183,13 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
|
|||||||
return Collections.emptyMap();
|
return Collections.emptyMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Company> companies = companyMapper.selectByNames(new ArrayList<>(companyNameSet));
|
List<Company> companies = companyMapper.selectBycodes(new ArrayList<>(companyNameSet));
|
||||||
if (CollectionUtils.isEmpty(companies)) {
|
if (CollectionUtils.isEmpty(companies)) {
|
||||||
return Collections.emptyMap();
|
return Collections.emptyMap();
|
||||||
}
|
}
|
||||||
return companies.stream()
|
return companies.stream()
|
||||||
.collect(Collectors.toMap(
|
.collect(Collectors.toMap(
|
||||||
Company::getName,
|
Company::getCode,
|
||||||
Company::getCompanyId,
|
Company::getCompanyId,
|
||||||
(v1, v2) -> v1
|
(v1, v2) -> v1
|
||||||
));
|
));
|
||||||
@@ -1225,7 +1225,7 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
|
|||||||
|
|
||||||
String companyName = it.getCompanyName();
|
String companyName = it.getCompanyName();
|
||||||
job.setCompanyName(companyName);
|
job.setCompanyName(companyName);
|
||||||
job.setCompanyId(companyNameToIdMap.getOrDefault(companyName, null));
|
job.setCompanyId(companyNameToIdMap.getOrDefault(it.getCode(), null));
|
||||||
|
|
||||||
return job;
|
return job;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
|
|||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package com.ruoyi.cms.util.excel;
|
||||||
|
|
||||||
|
import com.alibaba.excel.context.AnalysisContext;
|
||||||
|
import com.alibaba.excel.event.AnalysisEventListener;
|
||||||
|
import com.alibaba.excel.metadata.data.ReadCellData;
|
||||||
|
import com.ruoyi.cms.domain.vo.JobExcelVo;
|
||||||
|
import lombok.Getter;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业岗位excel监听
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public class JobExcelListener extends AnalysisEventListener<JobExcelVo> {
|
||||||
|
|
||||||
|
private final List<JobExcelVo> validDataList = new ArrayList<>();
|
||||||
|
private final List<Integer> emptyRowNumbers = new ArrayList<>();
|
||||||
|
private boolean isHeadChecked = false;
|
||||||
|
private String columnErrorMsg;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void invokeHead(Map<Integer, ReadCellData<?>> headMap, AnalysisContext context) {
|
||||||
|
if (!isHeadChecked) {
|
||||||
|
ReadCellData<?> cellData = headMap.get(6);
|
||||||
|
String seventhColumnTitle = null;
|
||||||
|
if (cellData != null) {
|
||||||
|
seventhColumnTitle = cellData.getStringValue();
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(seventhColumnTitle) || !seventhColumnTitle.trim().equals("社会信用代码")) {
|
||||||
|
columnErrorMsg = "Excel模板格式错误:第7列标题应为「社会信用代码」,请下载标准模板后重新上传!";
|
||||||
|
}
|
||||||
|
|
||||||
|
isHeadChecked = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void invoke(JobExcelVo jobExcelVo, AnalysisContext analysisContext) {
|
||||||
|
int currentRowNum = analysisContext.readRowHolder().getRowIndex() + 1;
|
||||||
|
String creditCode = jobExcelVo.getCode();
|
||||||
|
|
||||||
|
if (creditCode != null) {
|
||||||
|
creditCode = creditCode.trim();
|
||||||
|
jobExcelVo.setCode(creditCode.toUpperCase());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StringUtils.isBlank(creditCode)) {
|
||||||
|
emptyRowNumbers.add(currentRowNum);
|
||||||
|
} else {
|
||||||
|
validDataList.add(jobExcelVo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doAfterAllAnalysed(AnalysisContext analysisContext) {}
|
||||||
|
|
||||||
|
public boolean hasColumnError() {
|
||||||
|
return StringUtils.isNotBlank(columnErrorMsg);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -129,4 +129,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
order by create_time desc limit 1
|
order by create_time desc limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectBycodes" resultType="com.ruoyi.common.core.domain.entity.Company" parameterType="java.util.List">
|
||||||
|
SELECT company_id, code FROM company
|
||||||
|
WHERE del_flag = '0' and code IN
|
||||||
|
<foreach collection="list" item="code" open="(" separator="," close=")">
|
||||||
|
#{code}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -135,9 +135,11 @@ public class AsyncFactory
|
|||||||
// 远程查询操作地点
|
// 远程查询操作地点
|
||||||
try {
|
try {
|
||||||
String operTime=DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,new Date());
|
String operTime=DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,new Date());
|
||||||
|
if(!StringUtils.isBlank(operLog.getOperName())){
|
||||||
String operNameCipher=SpringUtils.getBean(EncryptDecryptUtil.class).sm3Hash(operLog.getOperName());
|
String operNameCipher=SpringUtils.getBean(EncryptDecryptUtil.class).sm3Hash(operLog.getOperName());
|
||||||
String operTimeCipher=SpringUtils.getBean(EncryptDecryptUtil.class).sm3Hash(operTime);
|
|
||||||
operLog.setOperNameCipher(operNameCipher);
|
operLog.setOperNameCipher(operNameCipher);
|
||||||
|
}
|
||||||
|
String operTimeCipher=SpringUtils.getBean(EncryptDecryptUtil.class).sm3Hash(operTime);
|
||||||
operLog.setOperTimeCipher(operTimeCipher);
|
operLog.setOperTimeCipher(operTimeCipher);
|
||||||
operLog.setOperTime(operTime);
|
operLog.setOperTime(operTime);
|
||||||
}catch (org.quickssl.api.CryptoClient.CryptoException e) {
|
}catch (org.quickssl.api.CryptoClient.CryptoException e) {
|
||||||
|
|||||||
@@ -588,7 +588,9 @@ public class SysLoginService
|
|||||||
if (StringUtils.hasText(phoneUser.getOpenid()) && !openid.equals(phoneUser.getOpenid())) {
|
if (StringUtils.hasText(phoneUser.getOpenid()) && !openid.equals(phoneUser.getOpenid())) {
|
||||||
System.out.printf("手机号绑定冲突,phone:%s, oldOpenid:%s, newOpenid:%s%n",
|
System.out.printf("手机号绑定冲突,phone:%s, oldOpenid:%s, newOpenid:%s%n",
|
||||||
phoneUser.getPhone(), phoneUser.getOpenid(), openid);
|
phoneUser.getPhone(), phoneUser.getOpenid(), openid);
|
||||||
return AjaxResult.error("该手机号已绑定其他微信账号");
|
//如果手机号一致openid不一致重新注册小程序账号
|
||||||
|
ajax=handleNewUser(openid,unionid,phoneUser.getPhone(),userType,orgType);
|
||||||
|
return ajax;
|
||||||
}
|
}
|
||||||
//修改用户信息
|
//修改用户信息
|
||||||
updateAppUserCommon(phoneUser, openid, unionid, userType,orgType);
|
updateAppUserCommon(phoneUser, openid, unionid, userType,orgType);
|
||||||
|
|||||||
Reference in New Issue
Block a user