1.给浪潮添加岗位申请、录用接口
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.ruoyi.cms.controller.cms;
|
||||
|
||||
import com.alibaba.excel.util.StringUtils;
|
||||
import com.ruoyi.cms.domain.Job;
|
||||
import com.ruoyi.cms.domain.JobApply;
|
||||
import com.ruoyi.cms.domain.vo.CandidateVO;
|
||||
@@ -99,16 +100,66 @@ public class JobApplyController extends BaseController {
|
||||
@PutMapping("/applyAgree")
|
||||
public AjaxResult applyAgree(@RequestBody JobApply jobApply)
|
||||
{
|
||||
if(jobApply.getJobId()==null){
|
||||
return AjaxResult.error("岗位id为空");
|
||||
}
|
||||
if(jobApply.getUserId()==null){
|
||||
return AjaxResult.error("用户id为空!");
|
||||
if(jobApply.getId()==null){
|
||||
return AjaxResult.error("参数id为空");
|
||||
}
|
||||
jobApply.setHire(StringUtil.HIRE_LY);
|
||||
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));
|
||||
}
|
||||
|
||||
|
||||
@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招聘会")
|
||||
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<Job> selectJobApplyListJob(JobApply jobApply);
|
||||
|
||||
public int updateJobZphApply(JobApply jobApply);
|
||||
}
|
||||
|
||||
@@ -70,4 +70,6 @@ public interface IJobApplyService
|
||||
public int applyComJob(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) {
|
||||
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 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){
|
||||
if(Objects.isNull(s)){return true;}
|
||||
return s.isEmpty();
|
||||
|
||||
Reference in New Issue
Block a user