Compare commits
13 Commits
a6d43c0bca
...
main
Author | SHA1 | Date | |
---|---|---|---|
9b9e80dc62 | |||
7752c74063 | |||
f4730c60fb | |||
d57ce9e3fc | |||
8988c52594 | |||
ba3e66a3c4 | |||
aa55276a81 | |||
8c5ec3e0b3 | |||
c795e63e96 | |||
9281eb700b | |||
8cf753ad54 | |||
65487c073f | |||
4c28d07bc3 |
@@ -12,6 +12,7 @@ import com.ruoyi.common.annotation.BussinessLog;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
@@ -133,4 +134,14 @@ public class AppCompanyController extends BaseController
|
||||
Company status = companyService.registerStatus();
|
||||
return AjaxResult.success(status);
|
||||
}
|
||||
|
||||
@GetMapping("/queryCodeCompany")
|
||||
@ApiOperation("根据社会信用代码查询企业")
|
||||
public AjaxResult queryCodeCompany(@RequestParam("code") String code)
|
||||
{
|
||||
if (!StringUtils.hasText(code)) {
|
||||
return AjaxResult.error("社会信用代码不能为空");
|
||||
}
|
||||
return AjaxResult.success(companyService.queryCodeCompany(code));
|
||||
}
|
||||
}
|
||||
|
@@ -6,6 +6,7 @@ import com.ruoyi.cms.domain.query.ESJobSearch;
|
||||
import com.ruoyi.cms.service.IESJobSearchService;
|
||||
import com.ruoyi.cms.service.IJobCollectionService;
|
||||
import com.ruoyi.cms.service.IJobService;
|
||||
import com.ruoyi.cms.util.sensitiveWord.SensitiveWordChecker;
|
||||
import com.ruoyi.common.annotation.BussinessLog;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
@@ -13,6 +14,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.dromara.easyes.core.biz.EsPageInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -36,6 +38,8 @@ public class AppJobController extends BaseController
|
||||
private IJobCollectionService jobCollectionService;
|
||||
@Autowired
|
||||
private IESJobSearchService esJobSearchService;
|
||||
@Autowired
|
||||
private SensitiveWordChecker sensitiveWordChecker;
|
||||
|
||||
/**
|
||||
* 查询岗位列表
|
||||
@@ -192,7 +196,25 @@ public class AppJobController extends BaseController
|
||||
@PostMapping("/publishJob")
|
||||
public AjaxResult fix(@RequestBody Job job)
|
||||
{
|
||||
// 校验描述中的敏感词
|
||||
List<String> sensitiveWords = sensitiveWordChecker.checkSensitiveWords(job.getDescription());
|
||||
if (!sensitiveWords.isEmpty()) {
|
||||
String errorMsg = "描述中包含敏感词:" + String.join("、", sensitiveWords);
|
||||
return AjaxResult.error(errorMsg);
|
||||
}
|
||||
jobService.publishJob(job);
|
||||
return success();
|
||||
}
|
||||
|
||||
@GetMapping("/jobCompare")
|
||||
@ApiOperation("根据多个岗位id查询岗位详情")
|
||||
public AjaxResult jobCompare(@ApiParam("岗位ID数组") @RequestParam("jobIds") Long[] jobIds) {
|
||||
if (ArrayUtils.isEmpty(jobIds)) {
|
||||
return AjaxResult.error("请传递岗位ID参数(jobIds),多个ID用&分隔");
|
||||
}
|
||||
if (jobIds.length > 5) {
|
||||
return AjaxResult.error("最多支持对比5个岗位,请减少参数数量");
|
||||
}
|
||||
return success(esJobSearchService.selectByIds(jobIds));
|
||||
}
|
||||
}
|
||||
|
@@ -109,7 +109,7 @@ public class Job extends BaseEntity
|
||||
@ApiModelProperty("是否收藏 0为否 1为是")
|
||||
private Integer isCollection;
|
||||
|
||||
@ApiModelProperty("工作地点")
|
||||
@ApiModelProperty("岗位描述")
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty("是否发布 0未发布 1发布")
|
||||
@@ -169,4 +169,8 @@ public class Job extends BaseEntity
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty("岗位联系人列表")
|
||||
private List<JobContact> jobContactList;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty("附件列表")
|
||||
private List<File> filesList;
|
||||
}
|
||||
|
@@ -15,4 +15,6 @@ import java.util.List;
|
||||
public interface JobContactMapper extends BaseMapper<JobContact> {
|
||||
|
||||
List<JobContact> getSelectList(JobContact jobContact);
|
||||
|
||||
int batchInsert(List<JobContact> list);
|
||||
}
|
||||
|
@@ -75,4 +75,6 @@ public interface ICompanyService
|
||||
List<Company> approvalList(Company company);
|
||||
|
||||
Company approval(Company company);
|
||||
|
||||
Company queryCodeCompany(String code);
|
||||
}
|
||||
|
@@ -67,4 +67,6 @@ public interface IESJobSearchService
|
||||
void updateJob(Long jobId);
|
||||
|
||||
void deleteJob(Long jobId);
|
||||
|
||||
List<ESJobDocument> selectByIds(Long[] jobIds);
|
||||
}
|
||||
|
@@ -9,6 +9,7 @@ import java.util.stream.Collectors;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.ruoyi.cms.mapper.*;
|
||||
import com.ruoyi.cms.util.StringUtil;
|
||||
import com.ruoyi.common.core.domain.entity.Company;
|
||||
import com.ruoyi.common.core.domain.entity.JobTitle;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.domain.model.RegisterBody;
|
||||
@@ -130,13 +131,23 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper,AppUser> imple
|
||||
@Override
|
||||
public int registerAppUser(RegisterBody registerBody) {
|
||||
AppUser appUser=registerBody.getAppUser();
|
||||
appUser.setUserId(SiteSecurityUtils.getUserId());
|
||||
System.out.println("userId================"+SiteSecurityUtils.getUserId());
|
||||
if(SiteSecurityUtils.isLogin()){
|
||||
AppUser appUserResult=appUserMapper.selectById(SiteSecurityUtils.getUserId());
|
||||
if(appUser==null){
|
||||
appUser=appUserResult;
|
||||
}else{
|
||||
appUser.setPhone(appUserResult.getPhone());
|
||||
appUser.setUserId(appUserResult.getUserId());
|
||||
}
|
||||
}
|
||||
//角色集合
|
||||
Map mapUserRole=new HashMap<>();
|
||||
switch (appUser.getIsCompanyUser()){
|
||||
case "0"://企业
|
||||
if(registerBody.getCompany()!=null){
|
||||
Long companyId=registerBody.getCompany().getCompanyId();
|
||||
Company company=registerBody.getCompany();
|
||||
Long companyId=company.getCompanyId();
|
||||
if(companyId==null){
|
||||
companyMapper.insert(registerBody.getCompany());
|
||||
registerBody.getCompany().getCompanyContactList().forEach(it->{
|
||||
@@ -146,23 +157,31 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper,AppUser> imple
|
||||
if(registerBody.getCompany().getCompanyContactList()!=null){
|
||||
companyContactMapper.batchInsert(registerBody.getCompany().getCompanyContactList());
|
||||
}
|
||||
//保存app_user信息
|
||||
appUser.setIdCard(company.getCode());
|
||||
appUser.setName(company.getName());
|
||||
}
|
||||
mapUserRole.put("roleId",100);
|
||||
break;
|
||||
default://求职者
|
||||
if(registerBody.getExperiencesList()!=null){
|
||||
registerBody.getExperiencesList().forEach(it->{
|
||||
it.setUserId(SiteSecurityUtils.getUserId());
|
||||
});
|
||||
userWorkExperiencesMapper.batchInsert(registerBody.getExperiencesList());
|
||||
}
|
||||
if(registerBody.getAppSkillsList()!=null){
|
||||
registerBody.getAppSkillsList().forEach(it->{
|
||||
it.setUserId(SiteSecurityUtils.getUserId());
|
||||
});
|
||||
appSkillMapper.batchInsert(registerBody.getAppSkillsList());
|
||||
}
|
||||
mapUserRole.put("roleId",1);
|
||||
}
|
||||
//保存sys_user
|
||||
SysUser sysUser=new SysUser();
|
||||
sysUser.setUserId(appUser.getUserId());
|
||||
sysUser.setUserName(appUser.getPhone());
|
||||
sysUser.setNickName(appUser.getName());
|
||||
sysUser.setNickName(StringUtils.isEmpty(appUser.getName())?appUser.getPhone():appUser.getName());
|
||||
sysUser.setPassword(SecurityUtils.encryptPassword("123456"));
|
||||
sysUser.setPhonenumber(appUser.getPhone());
|
||||
sysUser.setSex(appUser.getSex());
|
||||
|
@@ -296,4 +296,9 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
|
||||
return company1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Company queryCodeCompany(String code) {
|
||||
Company companyResult = companyMapper.selectOne(Wrappers.<Company>lambdaQuery().eq(Company::getCode, code).orderByDesc(Company::getUpdateTime).last("LIMIT 1"));
|
||||
return companyResult;
|
||||
}
|
||||
}
|
||||
|
@@ -178,6 +178,12 @@ public class ESJobSearchImpl implements IESJobSearchService
|
||||
if(!StringUtil.isEmptyOrNull(esJobSearch.getType())){
|
||||
newSearch.setType(esJobSearch.getType());
|
||||
}
|
||||
if(!StringUtil.isEmptyOrNull(esJobSearch.getDescription())){
|
||||
newSearch.setDescription(esJobSearch.getDescription());
|
||||
}
|
||||
if(!StringUtil.isEmptyOrNull(esJobSearch.getCompanyNature())){
|
||||
newSearch.setCompanyNature(esJobSearch.getCompanyNature());
|
||||
}
|
||||
}
|
||||
|
||||
LambdaEsQueryWrapper<ESJobDocument> wrapper = getWrapper(newSearch,jobIds);
|
||||
@@ -405,6 +411,12 @@ public class ESJobSearchImpl implements IESJobSearchService
|
||||
if(!StringUtil.isEmptyOrNull(esJobSearch.getType())){
|
||||
wrapper.and(x->x.eq(ESJobDocument::getType,esJobSearch.getType()));
|
||||
}
|
||||
if(!StringUtil.isEmptyOrNull(esJobSearch.getDescription())){
|
||||
wrapper.and(x->x.like(ESJobDocument::getDescription,esJobSearch.getDescription()));
|
||||
}
|
||||
if(!StringUtil.isEmptyOrNull(esJobSearch.getCompanyNature())){
|
||||
wrapper.and(x->x.eq(ESJobDocument::getCompanyNature,esJobSearch.getCompanyNature()));
|
||||
}
|
||||
if(Objects.nonNull(esJobSearch.getOrder())){
|
||||
if(esJobSearch.getOrder()==1){
|
||||
wrapper.orderByDesc(ESJobDocument::getIsHot);
|
||||
@@ -553,4 +565,10 @@ public class ESJobSearchImpl implements IESJobSearchService
|
||||
esJobDocumentMapper.delete(lambdaEsQueryWrapper);
|
||||
esJobDocumentMapper.insert(esJobDocument);
|
||||
}
|
||||
|
||||
public List<ESJobDocument> selectByIds(Long[] jobIds) {
|
||||
LambdaEsQueryWrapper<ESJobDocument> wrapper = new LambdaEsQueryWrapper<>();
|
||||
wrapper.in(ESJobDocument::getJobId,jobIds);
|
||||
return esJobDocumentMapper.selectList(wrapper);
|
||||
}
|
||||
}
|
||||
|
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.ruoyi.cms.domain.*;
|
||||
import com.ruoyi.cms.domain.File;
|
||||
import com.ruoyi.cms.domain.query.ESJobSearch;
|
||||
import com.ruoyi.cms.domain.vo.CandidateVO;
|
||||
import com.ruoyi.cms.mapper.*;
|
||||
@@ -75,6 +76,8 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
|
||||
private RedisCache redisCache;
|
||||
@Autowired
|
||||
private JobContactMapper jobContactMapper;
|
||||
@Autowired
|
||||
private FileMapper fileMapper;
|
||||
|
||||
/**
|
||||
* 更新工作地址的经纬度信息
|
||||
@@ -206,6 +209,14 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
|
||||
if(contacts!=null){
|
||||
job.setJobContactList(contacts);
|
||||
}
|
||||
//查询附件
|
||||
File file=new File();
|
||||
file.setBussinessId(jobId);
|
||||
List<File> filesList=fileMapper.selectFileList(file);
|
||||
if(filesList!=null){
|
||||
job.setFilesList(filesList);
|
||||
}
|
||||
|
||||
return job;
|
||||
}
|
||||
|
||||
@@ -784,6 +795,12 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
|
||||
// }
|
||||
// job.setCompanyId(company.getCompanyId());
|
||||
jobMapper.insert(job);
|
||||
if(job.getJobContactList()!=null){
|
||||
job.getJobContactList().forEach(it->{
|
||||
it.setJobId(job.getJobId());
|
||||
});
|
||||
jobContactMapper.batchInsert(job.getJobContactList());
|
||||
}
|
||||
iesJobSearchService.updateJob(job.getJobId());
|
||||
}
|
||||
}
|
||||
|
@@ -29,10 +29,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="jobTitleId" column="job_title_id" />
|
||||
<result property="isRecommend" column="is_recommend" />
|
||||
<result property="idCard" column="id_card" />
|
||||
<result property="workExperience" column="work_experience" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAppUserVo">
|
||||
select user_id, name, age, sex, birth_date, education, political_affiliation, phone, avatar, salary_min, salary_max, area, status, del_flag, login_ip, login_date, create_by, create_time, update_by, update_time, remark,job_title_id,is_recommend,id_card from app_user
|
||||
select user_id, name, age, sex, birth_date, education, political_affiliation, phone, avatar, salary_min, salary_max, area, status, del_flag, login_ip, login_date, create_by, create_time, update_by, update_time, remark,job_title_id,is_recommend,id_card,work_experience from app_user
|
||||
</sql>
|
||||
|
||||
<select id="selectAppUserList" parameterType="AppUser" resultMap="AppUserResult">
|
||||
|
@@ -31,10 +31,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="notPassReason" column="not_pass_reason" />
|
||||
<result property="registeredAddress" column="registered_address" />
|
||||
<result property="isAbnormal" column="is_abnormal" />
|
||||
<result property="enterpriseType" column="enterprise_type" />
|
||||
<result property="isImpCompany" column="is_imp_company" />
|
||||
<result property="impCompanyType" column="imp_company_type" />
|
||||
<result property="legalPerson" column="legal_person" />
|
||||
<result property="legalIdCard" column="legal_id_card" />
|
||||
<result property="legalPhone" column="legal_phone" />
|
||||
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCompanyVo">
|
||||
select company_id, name, location, industry, scale, del_flag, create_by, create_time, update_by, update_time, remark,code,description,nature,total_recruitment,registered_address,contact_person,contact_person_phone,is_abnormal,not_pass_reason,status,case when status='2' then update_time else null end reject_time from company
|
||||
select company_id, name, location, industry, scale, del_flag, create_by, create_time, update_by, update_time, remark,code,description,nature,total_recruitment,registered_address,contact_person,contact_person_phone,is_abnormal,not_pass_reason,status,case when status='2' then update_time else null end reject_time,is_imp_company,imp_company_type,enterprise_type,legal_person,legal_id_card,legal_phone from company
|
||||
</sql>
|
||||
<insert id="batchInsert" parameterType="java.util.List">
|
||||
INSERT INTO company (
|
||||
|
@@ -42,4 +42,17 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="batchInsert" parameterType="java.util.List">
|
||||
INSERT INTO job_contact (
|
||||
job_id, contact_person, contact_person_phone,position,
|
||||
create_by, create_time, del_flag,remark
|
||||
) VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.jobId}, #{item.contactPerson}, #{item.contactPersonPhone},#{item.position},
|
||||
#{item.createBy}, #{item.createTime}, #{item.delFlag},#{item.remark}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
|
@@ -127,4 +127,7 @@ public class AppUser extends BaseEntity
|
||||
|
||||
@ApiModelProperty("民族")
|
||||
private String nation;
|
||||
|
||||
@ApiModelProperty("工作经验")
|
||||
private String workExperience;
|
||||
}
|
||||
|
@@ -50,7 +50,7 @@ public class Company extends BaseEntity
|
||||
@ApiModelProperty("单位介绍")
|
||||
private String description;
|
||||
|
||||
@Excel(name = "性质")
|
||||
@Excel(name = "性质-已改为企业类型")
|
||||
@ApiModelProperty("性质")
|
||||
private String nature;
|
||||
|
||||
@@ -111,4 +111,16 @@ public class Company extends BaseEntity
|
||||
|
||||
@ApiModelProperty("本地重点发展产业")
|
||||
private String impCompanyType;
|
||||
|
||||
@ApiModelProperty("是否是就业见习基地 0是 1否")
|
||||
private String enterpriseType;
|
||||
|
||||
@ApiModelProperty("法人姓名")
|
||||
private String legalPerson;
|
||||
|
||||
@ApiModelProperty("法人身份证")
|
||||
private String legalIdCard;
|
||||
|
||||
@ApiModelProperty("法人联系方式")
|
||||
private String legalPhone;
|
||||
}
|
||||
|
@@ -256,6 +256,10 @@ public class SysLoginService
|
||||
//验证是否登录过
|
||||
AppUser existingUser=appUserService.selectByOpenid(openid);
|
||||
if(existingUser!=null){
|
||||
if(StringUtils.isEmpty(existingUser.getIsCompanyUser())){
|
||||
existingUser.setIsCompanyUser(dto.getUserType());
|
||||
appUserService.updateAppUser(existingUser);
|
||||
}
|
||||
String token = loginUserIdApp(existingUser);
|
||||
ajax.put(Constants.TOKEN, token);
|
||||
ajax.put("isNewUser", false);
|
||||
@@ -291,6 +295,8 @@ public class SysLoginService
|
||||
// 5. 生成系统令牌
|
||||
token = loginUserIdApp(appUser);
|
||||
isNewUser=true;
|
||||
ajax.put("idCard",null);
|
||||
ajax.put("isCompanyUser",dto.getUserType());
|
||||
}
|
||||
ajax.put("isNewUser", isNewUser);
|
||||
ajax.put(Constants.TOKEN, token);
|
||||
|
Reference in New Issue
Block a user