1.给浪潮添加岗位申请、录用接口
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package com.ruoyi.cms.controller.cms;
|
package com.ruoyi.cms.controller.cms;
|
||||||
|
|
||||||
|
import com.alibaba.excel.util.StringUtils;
|
||||||
import com.ruoyi.cms.domain.Job;
|
import com.ruoyi.cms.domain.Job;
|
||||||
import com.ruoyi.cms.domain.JobApply;
|
import com.ruoyi.cms.domain.JobApply;
|
||||||
import com.ruoyi.cms.domain.vo.CandidateVO;
|
import com.ruoyi.cms.domain.vo.CandidateVO;
|
||||||
@@ -99,16 +100,66 @@ public class JobApplyController extends BaseController {
|
|||||||
@PutMapping("/applyAgree")
|
@PutMapping("/applyAgree")
|
||||||
public AjaxResult applyAgree(@RequestBody JobApply jobApply)
|
public AjaxResult applyAgree(@RequestBody JobApply jobApply)
|
||||||
{
|
{
|
||||||
if(jobApply.getJobId()==null){
|
if(jobApply.getId()==null){
|
||||||
return AjaxResult.error("岗位id为空");
|
return AjaxResult.error("参数id为空");
|
||||||
}
|
|
||||||
if(jobApply.getUserId()==null){
|
|
||||||
return AjaxResult.error("用户id为空!");
|
|
||||||
}
|
}
|
||||||
jobApply.setHire(StringUtil.HIRE_LY);
|
jobApply.setHire(StringUtil.HIRE_LY);
|
||||||
jobApply.setHireSource(StringUtil.HIRE_SOURCE_SYSTEM);
|
jobApply.setHireSource(StringUtil.HIRE_SOURCE_SYSTEM);
|
||||||
|
return success(iJobApplyService.updateJobApply(jobApply));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "岗位", businessType = BusinessType.INSERT)
|
||||||
|
@ApiOperation("招聘会-岗位申请")
|
||||||
|
@PostMapping("/zphApply")
|
||||||
|
public AjaxResult zphApply(@RequestBody JobApply jobApply)
|
||||||
|
{
|
||||||
|
if(jobApply.getJobId()==null){
|
||||||
|
return AjaxResult.error("岗位id为空");
|
||||||
|
}
|
||||||
|
String idCard = jobApply.getIdCard();
|
||||||
|
if(StringUtils.isBlank(idCard)){
|
||||||
|
return AjaxResult.error("身份证为空!");
|
||||||
|
}
|
||||||
|
if (!idCard.matches(StringUtil.SFZ_VALID_REGEX)) {
|
||||||
|
return AjaxResult.error("身份证格式不正确");
|
||||||
|
}
|
||||||
|
AppUser appUser=appUserService.selectAppuserByIdcard(idCard);
|
||||||
|
if(appUser==null){
|
||||||
|
return AjaxResult.error("在系统库中未查询到当前用户信息!");
|
||||||
|
}
|
||||||
|
jobApply.setUserId(appUser.getUserId());
|
||||||
|
JobApply parm=new JobApply();
|
||||||
|
parm.setJobId(jobApply.getJobId());
|
||||||
|
parm.setUserId(appUser.getUserId());
|
||||||
|
List<JobApply> applies=iJobApplyService.selectJobApplyList(parm);
|
||||||
|
if(applies!=null&&applies.size()>0){
|
||||||
|
return AjaxResult.error("当前用户,已申请过该岗位,请勿重复申请!");
|
||||||
|
}
|
||||||
return success(iJobApplyService.applyComJob(jobApply));
|
return success(iJobApplyService.applyComJob(jobApply));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Log(title = "岗位", businessType = BusinessType.INSERT)
|
||||||
|
@ApiOperation("招聘会-岗位录用")
|
||||||
|
@PostMapping("/zphApplyAgree")
|
||||||
|
public AjaxResult zphApplyAgree(@RequestBody JobApply jobApply)
|
||||||
|
{
|
||||||
|
if(jobApply.getJobId()==null){
|
||||||
|
return AjaxResult.error("岗位id为空");
|
||||||
|
}
|
||||||
|
String idCard = jobApply.getIdCard();
|
||||||
|
if(StringUtils.isBlank(idCard)){
|
||||||
|
return AjaxResult.error("身份证为空!");
|
||||||
|
}
|
||||||
|
if (!idCard.matches(StringUtil.SFZ_VALID_REGEX)) {
|
||||||
|
return AjaxResult.error("身份证格式不正确");
|
||||||
|
}
|
||||||
|
AppUser appUser=appUserService.selectAppuserByIdcard(idCard);
|
||||||
|
if(appUser==null){
|
||||||
|
return AjaxResult.error("在系统库中未查询到当前用户信息!");
|
||||||
|
}
|
||||||
|
jobApply.setUserId(appUser.getUserId());
|
||||||
|
jobApply.setHire(StringUtil.HIRE_LY);
|
||||||
|
jobApply.setHireSource(StringUtil.HIRE_SOURCE_ZPH);
|
||||||
|
return success(iJobApplyService.updateJobZphApply(jobApply));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,4 +43,8 @@ public class JobApply extends BaseEntity
|
|||||||
|
|
||||||
@ApiModelProperty("录用来源 0本系统 1招聘会")
|
@ApiModelProperty("录用来源 0本系统 1招聘会")
|
||||||
private String hireSource;
|
private String hireSource;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
@ApiModelProperty("身份证,招聘传递")
|
||||||
|
private String idCard;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,4 +37,6 @@ public interface JobApplyMapper extends BaseMapper<JobApply>
|
|||||||
List<CandidateVO> selectApplyJobUserList(AppUser appUser);
|
List<CandidateVO> selectApplyJobUserList(AppUser appUser);
|
||||||
|
|
||||||
List<Job> selectJobApplyListJob(JobApply jobApply);
|
List<Job> selectJobApplyListJob(JobApply jobApply);
|
||||||
|
|
||||||
|
public int updateJobZphApply(JobApply jobApply);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,4 +70,6 @@ public interface IJobApplyService
|
|||||||
public int applyComJob(JobApply jobApply);
|
public int applyComJob(JobApply jobApply);
|
||||||
|
|
||||||
public List<Job> selectJobApplyListJob(JobApply jobApply);
|
public List<Job> selectJobApplyListJob(JobApply jobApply);
|
||||||
|
|
||||||
|
public int updateJobZphApply(JobApply jobApply);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -155,4 +155,9 @@ public class JobApplyServiceImpl extends ServiceImpl<JobApplyMapper,JobApply> im
|
|||||||
public List<Job> selectJobApplyListJob(JobApply jobApply) {
|
public List<Job> selectJobApplyListJob(JobApply jobApply) {
|
||||||
return jobApplyMapper.selectJobApplyListJob(jobApply);
|
return jobApplyMapper.selectJobApplyListJob(jobApply);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int updateJobZphApply(JobApply jobApply) {
|
||||||
|
return jobApplyMapper.updateJobZphApply(jobApply);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,6 +49,11 @@ public class StringUtil {
|
|||||||
*/
|
*/
|
||||||
public static final String HIRE_SOURCE_ZPH="1";
|
public static final String HIRE_SOURCE_ZPH="1";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 身份证规则
|
||||||
|
*/
|
||||||
|
public static final String SFZ_VALID_REGEX="^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$";
|
||||||
|
|
||||||
public static Boolean isEmptyOrNull(String s){
|
public static Boolean isEmptyOrNull(String s){
|
||||||
if(Objects.isNull(s)){return true;}
|
if(Objects.isNull(s)){return true;}
|
||||||
return s.isEmpty();
|
return s.isEmpty();
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<select id="selectUserApplyList" parameterType="AppUser" resultType="com.ruoyi.common.core.domain.entity.AppUserShow">
|
<select id="selectUserApplyList" parameterType="AppUser" resultType="com.ruoyi.common.core.domain.entity.AppUserShow">
|
||||||
select a.user_id , a.name , a.age , a.sex , get_birth_date_from_id_card ( a.id_card ) as birth_date ,
|
select a.user_id , a.name , a.age , a.sex , get_birth_date_from_id_card ( a.id_card ) as birth_date ,
|
||||||
a.education , a.political_affiliation , a.phone , a.avatar , c.min_salary salaryMin ,c.max_salary salaryMax,a.area ,a.id_card ,
|
a.education , a.political_affiliation , a.phone , a.avatar , c.min_salary salaryMin ,c.max_salary salaryMax,a.area ,a.id_card ,
|
||||||
b.job_id ,c.job_title,e.name as company_name,b.hire,b.hire_source,b.create_time,e.company_id
|
b.job_id ,c.job_title,e.name as company_name,b.hire,b.hire_source,b.create_time,e.company_id,b.id as apply_id
|
||||||
from app_user a
|
from app_user a
|
||||||
inner join job_apply b on a.user_id = b.user_id and a.del_flag = '0' and b.del_flag = '0'
|
inner join job_apply b on a.user_id = b.user_id and a.del_flag = '0' and b.del_flag = '0'
|
||||||
INNER join job c on b.job_id=c.job_id and c.del_flag='0'
|
INNER join job c on b.job_id=c.job_id and c.del_flag='0'
|
||||||
|
|||||||
@@ -15,6 +15,8 @@
|
|||||||
<result property="updateBy" column="update_by" />
|
<result property="updateBy" column="update_by" />
|
||||||
<result property="updateTime" column="update_time" />
|
<result property="updateTime" column="update_time" />
|
||||||
<result property="remark" column="remark" />
|
<result property="remark" column="remark" />
|
||||||
|
<result property="hire" column="hire" />
|
||||||
|
<result property="hireSource" column="hire_source" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectJobApplyVo">
|
<sql id="selectJobApplyVo">
|
||||||
@@ -124,4 +126,8 @@
|
|||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<update id="updateJobZphApply" parameterType="JobApply">
|
||||||
|
update job_apply set update_time=sysdate(),update_by=#{updateBy},hire=#{hire},hire_source=#{hireSource} where user_id=#{userId} AND job_id=#{jobId}
|
||||||
|
</update>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -142,4 +142,8 @@ public class AppUserShow extends BaseEntity
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
@ApiModelProperty("岗位id")
|
@ApiModelProperty("岗位id")
|
||||||
private String jobId;
|
private String jobId;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
@ApiModelProperty("岗位申请id")
|
||||||
|
private String applyId;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user