Compare commits

..

9 Commits

Author SHA1 Message Date
sh
3d69e3d262 添加发布日期映射问题 2026-03-12 18:00:30 +08:00
sh
e2bfb520fa 修改放逐条件 2026-03-12 15:20:26 +08:00
sh
9c58cd9168 修改查询条件为多选 2026-03-12 14:47:47 +08:00
sh
d918189775 1.修改岗位上传添加社会信用代码
2.修改es查询时,不放逐添加,修改为精准查询
2026-03-10 20:37:47 +08:00
sh
132e4886d7 修改区划类型 2026-03-07 12:43:51 +08:00
sh
39c5faa532 判断用户名不为空 2026-02-27 13:31:24 +08:00
sh
e2e5539c03 1.修改同一个手机号,不同的openid时处理办法 2026-02-26 18:58:53 +08:00
sh
3d1c1e7d06 Merge remote-tracking branch 'origin/main' 2026-02-25 12:52:18 +08:00
sh
8de501e733 判断用户名不为空 2026-02-25 12:51:49 +08:00
11 changed files with 164 additions and 41 deletions

View File

@@ -1,5 +1,6 @@
package com.ruoyi.cms.controller.cms;
import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSON;
import com.ruoyi.cms.domain.*;
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.JobExcelVo;
import com.ruoyi.cms.service.*;
import com.ruoyi.cms.util.EasyExcelUtils;
import com.ruoyi.cms.util.RoleUtils;
import com.ruoyi.cms.util.StringUtil;
import com.ruoyi.cms.util.excel.JobExcelListener;
import com.ruoyi.cms.util.sensitiveWord.SensitiveWordChecker;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.annotation.Log;
@@ -40,6 +41,7 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* 岗位Controller
@@ -390,14 +392,29 @@ public class CmsJobController extends BaseController
}
try (InputStream inputStream = file.getInputStream()){
List<JobExcelVo> allExcelVoList = new ArrayList<>();
EasyExcelUtils.readExcelByBatch(inputStream, JobExcelVo.class, 100, list -> {
allExcelVoList.addAll(list);
});
if (CollectionUtils.isEmpty(allExcelVoList)) {
throw new Exception("Excel文件中无有效数据");
JobExcelListener listener = new JobExcelListener();
EasyExcel.read(inputStream, JobExcelVo.class, listener).sheet().headRowNumber(1).doRead();
if (listener.hasColumnError()) {
return AjaxResult.error(listener.getColumnErrorMsg());
}
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("已上传!");
} catch (Exception e) {
e.printStackTrace();

View File

@@ -58,7 +58,7 @@ public class ESJobDocument
private String jobLocation;
@ApiModelProperty("工作地点区县字典代码")
private Integer jobLocationAreaCode;
private String jobLocationAreaCode;
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty("发布时间")

View File

@@ -118,7 +118,7 @@ public class Job extends BaseEntity
@ApiModelProperty("是否发布 0未发布 1发布")
private Integer isPublish;
@ApiModelProperty("数据来源")
@ApiModelProperty("数据来源 0系统自录1 365平台同步2招聘会同步3岗位抓取")
private String dataSource;
@ApiModelProperty("岗位链接")

View File

@@ -44,41 +44,46 @@ public class JobExcelVo
@ApiModelProperty("用人单位名称")
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 = "招聘人数")
@ApiModelProperty("招聘人数")
private Long vacancies;
@ExcelProperty(value = "职位名称", index = 7)
@ExcelProperty(value = "职位名称", index = 8)
@ApiModelProperty("岗位描述")
private String description;
@ExcelProperty(value = "职位名称", index = 8)
@ExcelProperty(value = "职位名称", index = 9)
@ApiModelProperty("岗位分类")
private String jobCategory;
@ExcelProperty(value = "职位名称", index = 9)
@ExcelProperty(value = "职位名称", index = 10)
@ApiModelProperty("岗位类型 0疆内 1疆外")
private String jobType;
@ExcelProperty(value = "职位名称", index = 10)
@ExcelProperty(value = "职位名称", index = 11)
@ApiModelProperty("类型 0常规岗位 1就业见习岗位 2实习实训岗位 3社区实践岗位 4零工 对应字段字典position_type")
private String type;
@ExcelProperty(value = "职位名称", index = 11)
@ExcelProperty(value = "职位名称", index = 12)
@ApiModelProperty("工作地点")
private String jobAddress;
@ExcelProperty(value = "职位名称", index = 12)
@ExcelProperty(value = "职位名称", index = 13)
@Excel(name = "岗位区划")
@ApiModelProperty("岗位区划")
private String jobLocation;
@ExcelProperty(value = "联系人", index = 13)
@ExcelProperty(value = "联系人", index = 14)
@ApiModelProperty("联系人")
private String contactPerson;
@ExcelProperty(value = "联系人电话", index = 14)
@ExcelProperty(value = "联系人电话", index = 15)
@ApiModelProperty("联系人电话")
private String contactPersonPhone;

View File

@@ -33,4 +33,6 @@ public interface CompanyMapper extends BaseMapper<Company>
List<Company> selectByNames(List<String> list);
public Company selectByCode(@Param("code") String code);
List<Company> selectBycodes(List<String> list);
}

View File

@@ -15,7 +15,9 @@ import com.ruoyi.cms.util.StringUtil;
import com.ruoyi.common.core.domain.entity.Company;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SiteSecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.bean.BeanUtils;
import org.dromara.easyes.core.biz.EsPageInfo;
import org.dromara.easyes.core.conditions.select.LambdaEsQueryWrapper;
@@ -201,6 +203,10 @@ public class ESJobSearchImpl implements IESJobSearchService
if(StringUtil.isEmptyOrNull(job.getCompanyNature())){
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);
}
@@ -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())));
}
if(!StringUtil.isEmptyOrNull(esJobSearch.getEducation())){
Integer maxValue = StringUtil.findMaxValue(esJobSearch.getEducation());
wrapper.and(x->x.le(ESJobDocument::getEducation_int,maxValue));
//Integer maxValue = StringUtil.findMaxValue(esJobSearch.getEducation());
//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())){
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()));
}
if(!StringUtil.isEmptyOrNull(esJobSearch.getExperience())){
Integer maxValue = StringUtil.findMaxValue(esJobSearch.getExperience());
wrapper.and(x->x.le(ESJobDocument::getExperience_int,maxValue));
//Integer maxValue = StringUtil.findMaxValue(esJobSearch.getExperience());
//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())){
//wrapper.and(x->x.eq(ESJobDocument::getJobCategory,esJobSearch.getJobCategory()));
@@ -509,8 +519,10 @@ public class ESJobSearchImpl implements IESJobSearchService
.like(ESJobDocument::getJobTitle, targetValue));
}
if(!StringUtil.isEmptyOrNull(esJobSearch.getScale())){
Integer maxValue = StringUtil.findMaxValue(esJobSearch.getScale());
wrapper.and(x->x.le(ESJobDocument::getScale,maxValue));
//Integer maxValue = StringUtil.findMaxValue(esJobSearch.getScale());
//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())){
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()));
}
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())){
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()));
}
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())){
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));
}
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())){
List<Integer> integers = StringUtil.convertStringToIntegerList(jobQuery.getArea());
wrapper.and(x->x.in(ESJobDocument::getJobLocationAreaCode,integers));
}
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())){
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())));
}
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())){
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())){
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()));
}
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())){
wrapper.and(a->a.eq(ESJobDocument::getJobType,jobQuery.getJobType()));

View File

@@ -1175,7 +1175,7 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
*/
private Map<String, Long> companyNameToIdMap(List<JobExcelVo> allExcelVoList) {
Set<String> companyNameSet = allExcelVoList.stream()
.map(JobExcelVo::getCompanyName)
.map(JobExcelVo::getCode)
.filter(StringUtils::hasText)
.collect(Collectors.toSet());
@@ -1183,13 +1183,13 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
return Collections.emptyMap();
}
List<Company> companies = companyMapper.selectByNames(new ArrayList<>(companyNameSet));
List<Company> companies = companyMapper.selectBycodes(new ArrayList<>(companyNameSet));
if (CollectionUtils.isEmpty(companies)) {
return Collections.emptyMap();
}
return companies.stream()
.collect(Collectors.toMap(
Company::getName,
Company::getCode,
Company::getCompanyId,
(v1, v2) -> v1
));
@@ -1225,7 +1225,7 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
String companyName = it.getCompanyName();
job.setCompanyName(companyName);
job.setCompanyId(companyNameToIdMap.getOrDefault(companyName, null));
job.setCompanyId(companyNameToIdMap.getOrDefault(it.getCode(), null));
return job;
}).collect(Collectors.toList());

View File

@@ -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);
}
}

View File

@@ -129,4 +129,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by create_time desc limit 1
</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>

View File

@@ -78,9 +78,11 @@ public class AsyncFactory
}
try {
String loginTime=DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,new Date());
String userNameCipher=SpringUtils.getBean(EncryptDecryptUtil.class).sm3Hash(username);
if(!StringUtils.isBlank(username)){
String userNameCipher=SpringUtils.getBean(EncryptDecryptUtil.class).sm3Hash(username);
logininfor.setUserNameCipher(userNameCipher);
}
String operTimeCipher=SpringUtils.getBean(EncryptDecryptUtil.class).sm3Hash(loginTime);
logininfor.setUserNameCipher(userNameCipher);
logininfor.setLoginTimeCipher(operTimeCipher);
logininfor.setLoginTime(loginTime);
}catch (org.quickssl.api.CryptoClient.CryptoException e) {
@@ -133,9 +135,11 @@ public class AsyncFactory
// 远程查询操作地点
try {
String operTime=DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,new Date());
String operNameCipher=SpringUtils.getBean(EncryptDecryptUtil.class).sm3Hash(operLog.getOperName());
if(!StringUtils.isBlank(operLog.getOperName())){
String operNameCipher=SpringUtils.getBean(EncryptDecryptUtil.class).sm3Hash(operLog.getOperName());
operLog.setOperNameCipher(operNameCipher);
}
String operTimeCipher=SpringUtils.getBean(EncryptDecryptUtil.class).sm3Hash(operTime);
operLog.setOperNameCipher(operNameCipher);
operLog.setOperTimeCipher(operTimeCipher);
operLog.setOperTime(operTime);
}catch (org.quickssl.api.CryptoClient.CryptoException e) {

View File

@@ -588,7 +588,9 @@ public class SysLoginService
if (StringUtils.hasText(phoneUser.getOpenid()) && !openid.equals(phoneUser.getOpenid())) {
System.out.printf("手机号绑定冲突phone:%s, oldOpenid:%s, newOpenid:%s%n",
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);