Commit 66699862 by 284718418@qq.com

应聘登记通知

测评通知
parent 932bb82e
......@@ -6,6 +6,7 @@ import cn.timer.api.bean.kqmk.*;
import cn.timer.api.bean.qyzx.QyzxEmpEntAsso;
import cn.timer.api.bean.qyzx.QyzxEmpLogin;
import cn.timer.api.bean.spmk.SpmkCustomApproval;
import cn.timer.api.bean.wechat.MessageTemplate;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.bean.zpgl.*;
import cn.timer.api.config.annotation.CurrentUser;
......@@ -17,17 +18,20 @@ import cn.timer.api.config.exception.CustomException;
import cn.timer.api.controller.kqgl.ClockInTool;
import cn.timer.api.controller.kqgl.atttimer.RealTimeUpdate;
import cn.timer.api.controller.zpgl.sevice.ZpglService;
import cn.timer.api.controller.zpgl.sevice.ZpglWxgzptService;
import cn.timer.api.dao.kqgl.UserEquiRelationMapper;
import cn.timer.api.dao.kqmk.KqglAssoKqzdkfsMapper;
import cn.timer.api.dao.qyzx.QyzxEmpLoginMapper;
import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dao.zpgl.ZpglRcxxMapper;
import cn.timer.api.dto.template.InterviewNotice;
import cn.timer.api.dto.zpgl.ImportCandidateDto;
import cn.timer.api.dto.zpgl.ZpglRcxxDto;
import cn.timer.api.dto.zpgl.ZpglRcxxEntryDto;
import cn.timer.api.utils.Md5;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
import cn.timer.api.utils.ZpglMessageTemplate;
import cn.timer.api.utils.query.BaseQuery;
import cn.timer.api.config.enuminterface.YgEnumInterface.jobStatus;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......@@ -96,6 +100,18 @@ public class ZpglController {
private ZpglService zpglService;
@Autowired
private ZpglRcxxMapper zpglRcxxMapper;
@Autowired
private ZpglWxgzptService zpglWxgzptService;
/**
* 0应聘登记
*/
public static final int APPLY_STATUS = 0;
/**
* 1测评
*/
public static final int CP_STATUS = 1;
@Value("${h5.url}")
private String h5Url;
/**
* 招聘-招聘中
......@@ -113,7 +129,7 @@ public class ZpglController {
try {
Page<ZpglRcxx> page = new Page<ZpglRcxx>(baseQuery.getPageNum(), baseQuery.getPageSize());
QueryWrapper<ZpglRcxx> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(ZpglRcxx::getOrgCode, userBean.getOrgCode()).eq(ZpglRcxx::getDeleteFlag,0);
queryWrapper.lambda().eq(ZpglRcxx::getOrgCode, userBean.getOrgCode()).eq(ZpglRcxx::getDeleteFlag, 0);
if (!StringUtils.isEmpty(zpglZwxxId) && zpglZwxxId > 0) {
queryWrapper.lambda().eq(ZpglRcxx::getZpglZwxxId, zpglZwxxId);
}
......@@ -129,14 +145,14 @@ public class ZpglController {
zpglRcxxPage.getSize();
Map<String, Object> map = new HashMap<>(9);
map.put("zpglRcxxs", zpglRcxxs);
map.put("FILTERING", this.getNum(queryWrapper,JxglEnumInterface.ResumeStatus.FILTERING.getType(),userBean.getOrgCode()));
map.put("FILTER_PASS", this.getNum(queryWrapper,JxglEnumInterface.ResumeStatus.FILTER_PASS.getType(),userBean.getOrgCode()));
map.put("INTERVIEW", this.getNum(queryWrapper,JxglEnumInterface.ResumeStatus.INTERVIEW.getType(),userBean.getOrgCode()));
map.put("INTERVIEWED", this.getNum(queryWrapper,JxglEnumInterface.ResumeStatus.INTERVIEWED.getType(),userBean.getOrgCode()));
map.put("INTERVIEW_PASS", this.getNum(queryWrapper,JxglEnumInterface.ResumeStatus.INTERVIEW_PASS.getType(),userBean.getOrgCode()));
map.put("EMPLOY", this.getNum(queryWrapper,JxglEnumInterface.ResumeStatus.EMPLOY.getType(),userBean.getOrgCode()));
map.put("OFFER", this.getNum(queryWrapper,JxglEnumInterface.ResumeStatus.OFFER.getType(),userBean.getOrgCode()));
map.put("ENTRYING", this.getNum(queryWrapper,JxglEnumInterface.ResumeStatus.ENTRYING.getType(),userBean.getOrgCode()));
map.put("FILTERING", this.getNum(queryWrapper, JxglEnumInterface.ResumeStatus.FILTERING.getType(), userBean.getOrgCode()));
map.put("FILTER_PASS", this.getNum(queryWrapper, JxglEnumInterface.ResumeStatus.FILTER_PASS.getType(), userBean.getOrgCode()));
map.put("INTERVIEW", this.getNum(queryWrapper, JxglEnumInterface.ResumeStatus.INTERVIEW.getType(), userBean.getOrgCode()));
map.put("INTERVIEWED", this.getNum(queryWrapper, JxglEnumInterface.ResumeStatus.INTERVIEWED.getType(), userBean.getOrgCode()));
map.put("INTERVIEW_PASS", this.getNum(queryWrapper, JxglEnumInterface.ResumeStatus.INTERVIEW_PASS.getType(), userBean.getOrgCode()));
map.put("EMPLOY", this.getNum(queryWrapper, JxglEnumInterface.ResumeStatus.EMPLOY.getType(), userBean.getOrgCode()));
map.put("OFFER", this.getNum(queryWrapper, JxglEnumInterface.ResumeStatus.OFFER.getType(), userBean.getOrgCode()));
map.put("ENTRYING", this.getNum(queryWrapper, JxglEnumInterface.ResumeStatus.ENTRYING.getType(), userBean.getOrgCode()));
return ResultUtil.data(zpglRcxxPage, map, "搜索成功");
} catch (Exception e) {
......@@ -155,12 +171,12 @@ public class ZpglController {
@GetMapping(value = "/zwxx/{deleteFlag}")
@ApiOperation(value = "2.职位信息", httpMethod = "GET", notes = "职位信息deleteFlag:0")
@ApiOperationSupport(order = 2)
public Result<Object> zwxx(@CurrentUser UserBean userBean,@PathVariable Integer deleteFlag) {
public Result<Object> zwxx(@CurrentUser UserBean userBean, @PathVariable Integer deleteFlag) {
try {
QueryWrapper<ZpglZwxx> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(ZpglZwxx::getOrgCode, userBean.getOrgCode());
if(deleteFlag.intValue() == 1 ){
queryWrapper.lambda().eq(ZpglZwxx::getDeleteFlag,0);
if (deleteFlag.intValue() == 1) {
queryWrapper.lambda().eq(ZpglZwxx::getDeleteFlag, 0);
}
List<ZpglZwxx> zpglZwxxs = ZpglZwxx.builder().build().selectList(queryWrapper);
return ResultUtil.data(zpglZwxxs, "查询成功");
......@@ -181,7 +197,7 @@ public class ZpglController {
@ApiOperationSupport(order = 3)
public Result<Object> operation(@CurrentUser UserBean userBean, @RequestBody ZpglRcxxDto zpglRcxxDto) {
try {
return zpglService.updateZpglRcxx(userBean,zpglRcxxDto)?ResultUtil.success():ResultUtil.error();
return zpglService.updateZpglRcxx(userBean, zpglRcxxDto) ? ResultUtil.success() : ResultUtil.error();
} catch (Exception e) {
e.printStackTrace();
throw new CustomException("招聘-变更状态失败");
......@@ -201,7 +217,7 @@ public class ZpglController {
public Result<Object> addygda(@CurrentUser UserBean userBean, @Validated @RequestBody ZpglRcxxEntryDto addygdaDto) {
try {
ZpglRcxx zpglRcxx = ZpglRcxx.builder().id(addygdaDto.getId()).build().selectById();
if(StringUtils.isEmpty(zpglRcxx)){
if (StringUtils.isEmpty(zpglRcxx)) {
return ResultUtil.error("确认入职添加员工档案失败");
}
......@@ -237,7 +253,7 @@ public class ZpglController {
YgglMainEmp ygglMainEmp = ygglMainEmpMapper.selectOne(new QueryWrapper<YgglMainEmp>().lambda()
.eq(YgglMainEmp::getPhone, phone).eq(YgglMainEmp::getOrgCode, orgCode));
if(!StringUtils.isEmpty(ygglMainEmp)){
if (!StringUtils.isEmpty(ygglMainEmp)) {
return ResultUtil.error("该手机号已被使用,请输入正确手机号");
}
QyzxEmpEntAsso.builder().empNum(login.getId()).orgCode(orgCode).userType(SysRoleType.U_TYPE_EMP.getType())
......@@ -275,7 +291,7 @@ public class ZpglController {
} else {
uskqj.setIsGly(0);
}
if (!uskqj.insert()){
if (!uskqj.insert()) {
return ResultUtil.error("操作失败--新增用户与设备关系");
}
}
......@@ -308,7 +324,7 @@ public class ZpglController {
}
// 招聘-变更人才信息状态
// 添加面试流程记录
zpglService.updateZpglRcxx(userBean,zpglRcxxDto);
zpglService.updateZpglRcxx(userBean, zpglRcxxDto);
// 维护微信公众平台表++++++++++++++++++++++++++++++++++++++++++++
try {
realtimeupdate.AttendanceTask(userBean.getOrgCode(), ygglMainEmp.getEmpNum(), 2, null);
......@@ -335,40 +351,40 @@ public class ZpglController {
@ApiOperation(value = "5.招聘-已淘汰,人才库列表", httpMethod = "GET", notes = "招聘-已淘汰,人才库列表")
@ApiOperationSupport(order = 5)
public Result<Object> recruitFail(@CurrentUser UserBean userBean, BaseQuery baseQuery,
@ApiParam("搜索关键字") @RequestParam(required = false) String query,
@ApiParam("职位ID") @RequestParam(required = false) Integer zpglZwxxId,
@ApiParam("状态") @RequestParam(required = false) Integer status,
@ApiParam("排序") @RequestParam(required = false) Integer orderBy) {
@ApiParam("搜索关键字") @RequestParam(required = false) String query,
@ApiParam("职位ID") @RequestParam(required = false) Integer zpglZwxxId,
@ApiParam("状态") @RequestParam(required = false) Integer status,
@ApiParam("排序") @RequestParam(required = false) Integer orderBy) {
try {
Page<ZpglRcxx> page = new Page<ZpglRcxx>(baseQuery.getPageNum(), baseQuery.getPageSize());
MPJQueryWrapper<ZpglRcxx> queryWrapper = new MPJQueryWrapper<>();
queryWrapper.selectAll(ZpglRcxx.class).select("zf.fail_cause")
.leftJoin("zpgl_fail zf on t.zpgl_fail_id = zf.id");
queryWrapper.eq("t.org_code", userBean.getOrgCode()).eq("t.delete_flag",0).eq("zf.org_code", userBean.getOrgCode());
.leftJoin("zpgl_fail zf on t.zpgl_fail_id = zf.id");
queryWrapper.eq("t.org_code", userBean.getOrgCode()).eq("t.delete_flag", 0).eq("zf.org_code", userBean.getOrgCode());
if (!StringUtils.isEmpty(zpglZwxxId) && zpglZwxxId > 0) {
queryWrapper.eq("t.zpgl_zwxx_id", zpglZwxxId);
}
if (!StringUtils.isEmpty(query)) {
queryWrapper.and(qw -> qw.like("t.name", query).or().eq("t.mobile", query).or().eq("t.mail", query));
}
if(!StringUtils.isEmpty(status)){
if (!StringUtils.isEmpty(status)) {
queryWrapper.eq("t.status", 9);
queryWrapper.eq("zf.zpgl_rcxx_status", status);
}else {
} else {
queryWrapper.eq("t.ifrck", 1);
}
if(!StringUtils.isEmpty(orderBy)){
if (!StringUtils.isEmpty(orderBy)) {
// 排序 1最近跟进时间 2最近入库时间 3最早入库时间
if(orderBy.intValue() == 1){
if (orderBy.intValue() == 1) {
queryWrapper.orderByDesc("t.update_time");
}else if(orderBy.intValue() == 2){
} else if (orderBy.intValue() == 2) {
queryWrapper.orderByDesc("t.ifrck_time");
}else if(orderBy.intValue() == 3){
} else if (orderBy.intValue() == 3) {
queryWrapper.orderByAsc("t.ifrck_time");
}
}
IPage<ZpglRcxx> zpglRcxxPage = zpglRcxxMapper.selectJoinPage(page,ZpglRcxx.class,queryWrapper);
IPage<ZpglRcxx> zpglRcxxPage = zpglRcxxMapper.selectJoinPage(page, ZpglRcxx.class, queryWrapper);
List<ZpglRcxx> zpglRcxxs = page.getRecords();
zpglRcxxPage.getCurrent();
zpglRcxxPage.getPages();
......@@ -382,6 +398,7 @@ public class ZpglController {
}
}
/**
* 招聘-逻辑删除人才信息
*
......@@ -393,13 +410,14 @@ public class ZpglController {
@ApiOperationSupport(order = 5)
public Result<Object> edit(@CurrentUser UserBean userBean, @PathVariable Integer id) {
try {
return ZpglRcxx.builder().id(id).deleteFlag(1).userId(userBean.getEmpNum()).build().updateById()?ResultUtil.success("操作成功"):ResultUtil.error("操作失败");
return ZpglRcxx.builder().id(id).deleteFlag(1).userId(userBean.getEmpNum()).build().updateById() ? ResultUtil.success("操作成功") : ResultUtil.error("操作失败");
} catch (Exception e) {
e.printStackTrace();
throw new CustomException("招聘-删除人才信息失败");
}
}
/**
* 招聘-移入/出人才库
*
......@@ -411,7 +429,7 @@ public class ZpglController {
@ApiOperationSupport(order = 6)
public Result<Object> remove(@CurrentUser UserBean userBean, @PathVariable Integer id, @PathVariable Integer ifrck) {
try {
return ZpglRcxx.builder().id(id).ifrck(ifrck).userId(userBean.getEmpNum()).build().updateById()?ResultUtil.success("操作成功"):ResultUtil.error("操作失败");
return ZpglRcxx.builder().id(id).ifrck(ifrck).userId(userBean.getEmpNum()).build().updateById() ? ResultUtil.success("操作成功") : ResultUtil.error("操作失败");
} catch (Exception e) {
e.printStackTrace();
throw new CustomException("招聘-删除人才信息失败");
......@@ -421,6 +439,7 @@ public class ZpglController {
/**
* 招聘-导入候选人简历
*
* @param userBean
* @param file
* @param request
......@@ -433,18 +452,18 @@ public class ZpglController {
public Result<Object> resumeImportCandidate(@CurrentUser UserBean userBean, @RequestParam(required = true) MultipartFile file,
@ApiParam("招聘渠道ID") @RequestParam(required = false) Integer zpglZpqdId,
@ApiParam("职位信息Id") @RequestParam(required = true) Integer zpglZwxxId,
@ApiParam("状态") @RequestParam(required = true) Integer status,HttpServletRequest request) {
@ApiParam("状态") @RequestParam(required = true) Integer status, HttpServletRequest request) {
try {
ImportCandidateDto importCandidateDto = new ImportCandidateDto();
importCandidateDto.setStatus(status);
importCandidateDto.setZpglZpqdId(zpglZpqdId);
importCandidateDto.setZpglZwxxId(zpglZwxxId);
// 获取文件 文档类型,目前支持pdf,doc,docx,wps,txt,jpg,jpeg,png,bmp,tif格式
String suffix = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);
if(StringUtils.isEmpty(suffix)){
String suffix = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") + 1);
if (StringUtils.isEmpty(suffix)) {
return ResultUtil.error("导入简历失败,请检查是否为简历文件~");
}
if("pdf,doc,docx,wps,txt,jpg,jpeg,png,bmp,tif".indexOf(suffix) == -1){
if ("pdf,doc,docx,wps,txt,jpg,jpeg,png,bmp,tif".indexOf(suffix) == -1) {
return ResultUtil.error("导入简历失败,目前支持pdf,doc,docx,wps,txt,jpg,jpeg,png,bmp,tif格式~");
}
importCandidateDto.setSuffix(suffix);
......@@ -458,6 +477,7 @@ public class ZpglController {
}
}
/**
* 招聘-更改招聘职位
*
......@@ -469,7 +489,7 @@ public class ZpglController {
@ApiOperationSupport(order = 8)
public Result<Object> deitZwxx(@CurrentUser UserBean userBean, @RequestBody ZpglRcxxDto zpglRcxxDto) {
try {
return zpglService.updateZpglRcxxZwxx(userBean,zpglRcxxDto)?ResultUtil.success("更改招聘职位成功"):ResultUtil.error("更改招聘职位失败");
return zpglService.updateZpglRcxxZwxx(userBean, zpglRcxxDto) ? ResultUtil.success("更改招聘职位成功") : ResultUtil.error("更改招聘职位失败");
} catch (Exception e) {
e.printStackTrace();
throw new CustomException("招聘-更改招聘职位失败");
......@@ -492,22 +512,22 @@ public class ZpglController {
// 工作经验
List<ZpglRcxxExperience> zpglRcxxExperiences = ZpglRcxxExperience.builder().build().selectList(
new QueryWrapper<ZpglRcxxExperience>().lambda().eq(ZpglRcxxExperience::getZpglRcxxId, zpglRcxxId)
.eq(ZpglRcxxExperience::getIsDelete,0).orderByDesc(ZpglRcxxExperience::getEndTime)
.eq(ZpglRcxxExperience::getIsDelete, 0).orderByDesc(ZpglRcxxExperience::getEndTime)
);
// 教育经历
List<ZpglRcxxStudy> zpglRcxxStudys = ZpglRcxxStudy.builder().build().selectList(
new QueryWrapper<ZpglRcxxStudy>().lambda().eq(ZpglRcxxStudy::getZpglRcxxId, zpglRcxxId)
.eq(ZpglRcxxStudy::getIsDelete,0).orderByDesc(ZpglRcxxStudy::getEndTime)
.eq(ZpglRcxxStudy::getIsDelete, 0).orderByDesc(ZpglRcxxStudy::getEndTime)
);
// 项目经历
List<ZpglRcxxProject> zpglRcxxProjects = ZpglRcxxProject.builder().build().selectList(
new QueryWrapper<ZpglRcxxProject>().lambda().eq(ZpglRcxxProject::getZpglRcxxId, zpglRcxxId)
.eq(ZpglRcxxProject::getDeleteFlag,0).orderByDesc(ZpglRcxxProject::getEndTime)
.eq(ZpglRcxxProject::getDeleteFlag, 0).orderByDesc(ZpglRcxxProject::getEndTime)
);
// 培训经验
List<ZpglRcxxTrain> zpglRcxxTrains = ZpglRcxxTrain.builder().build().selectList(
new QueryWrapper<ZpglRcxxTrain>().lambda().eq(ZpglRcxxTrain::getZpglRcxxId, zpglRcxxId)
.eq(ZpglRcxxTrain::getIsDelete,0).orderByDesc(ZpglRcxxTrain::getEndTime)
.eq(ZpglRcxxTrain::getIsDelete, 0).orderByDesc(ZpglRcxxTrain::getEndTime)
);
// FPA性格测评数据
......@@ -524,7 +544,7 @@ public class ZpglController {
map.put("zpglRcxxTrains", zpglRcxxTrains);
map.put("zpglDtk", zpglDtk);
map.put("zpglRcxxOffer", zpglRcxxOffer);
return ResultUtil.data(map,"搜索成功");
return ResultUtil.data(map, "搜索成功");
} catch (Exception e) {
e.printStackTrace();
......@@ -545,9 +565,9 @@ public class ZpglController {
public Result<Object> customApproval(@CurrentUser UserBean userBean) {
try {
List<SpmkCustomApproval> spmkCustomApprovals = SpmkCustomApproval.builder().build().selectList(
new QueryWrapper<SpmkCustomApproval>().select("id","name")
.lambda().eq(SpmkCustomApproval::getOrgCode,userBean.getOrgCode())
.eq(SpmkCustomApproval::getAssoType,10)
new QueryWrapper<SpmkCustomApproval>().select("id", "name")
.lambda().eq(SpmkCustomApproval::getOrgCode, userBean.getOrgCode())
.eq(SpmkCustomApproval::getAssoType, 10)
);
return ResultUtil.data(spmkCustomApprovals);
} catch (Exception e) {
......@@ -558,15 +578,65 @@ public class ZpglController {
}
/**
* 招聘-发起应聘登记或者测评 status:0应聘登记,1测评
*
* @param
* @return
*/
@GetMapping(value = "/send_apply_cp/{id}/{status}")
@ApiOperation(value = "11.招聘-发起应聘登记或者测评", httpMethod = "GET", notes = "status:0应聘登记,1测评")
@ApiOperationSupport(order = 11)
public Result<Object> sendApplyOrCp(@CurrentUser UserBean userBean, @PathVariable Integer id, @PathVariable Integer status) {
try {
ZpglRcxx zpglRcxx = ZpglRcxx.builder().id(id).build().selectById();
if (StringUtils.isEmpty(zpglRcxx)) {
log.error("招聘-发起应聘登记或测评:id={} 空数据", id);
return ResultUtil.error("操作失败~");
}
InterviewNotice interviewNotice = new InterviewNotice();
interviewNotice.setName(zpglRcxx.getName());
interviewNotice.setEmail(zpglRcxx.getMail());
//公众号类型 1:8小时企业管理 2:优领人才网
interviewNotice.setWxgzhType(1);
//0 即时发送,1 定时发送
interviewNotice.setTiming(0);
interviewNotice.setType(JxglEnumInterface.NoticeWay.WECHAT_PUBLIC.getType());
interviewNotice.setInterviewTime(new Date());
// 通知面试者
interviewNotice.setZpglRcxxId(zpglRcxx.getId());
interviewNotice.setMobile(zpglRcxx.getMobile());
interviewNotice.setRemark("点击填写");
// 发送应聘登记表消息
if (APPLY_STATUS == status.intValue()) {
interviewNotice.setTemplateId(MessageTemplate.TEMPLATE_ID_TO_INTERVIEWER);
interviewNotice.setUrl(h5Url + "?mobile=" + zpglRcxx.getMobile() + "&orgId=" + userBean.getOrgCode() + "#/basicInfo");
interviewNotice.setContentStr(ZpglMessageTemplate.print(ZpglMessageTemplate.TO_APPLY, new String[]{zpglRcxx.getName()}));
// 发送FPA测评消息
} else {
interviewNotice.setTemplateId(MessageTemplate.TEMPLATE_ID_TO_INTERVIEWER);
interviewNotice.setContentStr(ZpglMessageTemplate.print(ZpglMessageTemplate.TO_CEPIN, new String[]{zpglRcxx.getName()}));
interviewNotice.setUrl(h5Url + "/?zpglRcxxId=" + zpglRcxx.getId() + "#/cpxt");
}
log.info("TO_INTERVIEWEE sendApplyOrCePin MessageQueue info:{}", zpglWxgzptService.sendApplyOrCePin(interviewNotice));
return ResultUtil.success();
} catch (Exception e) {
e.printStackTrace();
throw new CustomException("操作失败");
}
}
/**
* 获取统计数据
*
* @param queryWrapper
* @param status
* @param orgCode
* @return
*/
private Integer getNum(QueryWrapper<ZpglRcxx> queryWrapper,Integer status,Integer orgCode){
private Integer getNum(QueryWrapper<ZpglRcxx> queryWrapper, Integer status, Integer orgCode) {
queryWrapper.clear();
queryWrapper.lambda().eq(ZpglRcxx::getOrgCode, orgCode).eq(ZpglRcxx::getDeleteFlag,0);
queryWrapper.lambda().eq(ZpglRcxx::getOrgCode, orgCode).eq(ZpglRcxx::getDeleteFlag, 0);
return ZpglRcxx.builder().build().selectCount(queryWrapper.lambda().eq(ZpglRcxx::getStatus, status));
}
......
......@@ -68,7 +68,7 @@ public class ZpglServiceImpl implements ZpglService {
public boolean updateZpglRcxx(UserBean userBean, ZpglRcxxDto zpglRcxxDto) {
boolean count = false;
ZpglRcxx zpglRcxxEntity = ZpglRcxx.builder().id(zpglRcxxDto.getId()).build().selectById();
if(StringUtils.isEmpty(zpglRcxxEntity)){
if (StringUtils.isEmpty(zpglRcxxEntity)) {
return count;
}
zpglRcxxDto.setName(zpglRcxxEntity.getName());
......@@ -77,7 +77,7 @@ public class ZpglServiceImpl implements ZpglService {
zpglMslcLog.setZpglRcxxId(zpglRcxxDto.getId());
zpglMslcLog.setUserId(userBean.getEmpNum());
zpglMslcLog.setUserName(userBean.getQyzxEmpLogin().getUsername());
if(!StringUtils.isEmpty(zpglRcxxDto.getIfrck()) && zpglRcxxDto.getIfrck().intValue() == 1){
if (!StringUtils.isEmpty(zpglRcxxDto.getIfrck()) && zpglRcxxDto.getIfrck().intValue() == 1) {
zpglRcxx.setIfrckTime(new Date());
}
String detail = "";
......@@ -136,9 +136,9 @@ public class ZpglServiceImpl implements ZpglService {
detail = ZpglMessageTemplate.print(ZpglMessageTemplate.OFFER, new String[]{
userBean.getQyzxEmpLogin().getUsername()});
//发送offer
ZpglRcxxOffer zpglRcxxOffer = this.insertZpglRcxxOffer(userBean,zpglRcxxDto);
ZpglRcxxOffer zpglRcxxOffer = this.insertZpglRcxxOffer(userBean, zpglRcxxDto);
zpglRcxxOffer.setReceiverEmail(zpglRcxxEntity.getMail());
Thread pthread=new Thread(new ZpglSendMessageThread(mailSender, zpglRcxxOffer));
Thread pthread = new Thread(new ZpglSendMessageThread(mailSender, zpglRcxxOffer));
pthread.start();
break;
case 8:
......@@ -155,19 +155,19 @@ public class ZpglServiceImpl implements ZpglService {
zpglRcxx.setZpglFailId(zpglRcxxDto.getZpglFailId());
zpglRcxx.setRemarks(zpglRcxxDto.getRemarks());
ZpglFail zpglFail = ZpglFail.builder().id(zpglRcxxDto.getZpglFailId()).build().selectById();
String messageTemplate = ZpglMessageTemplate.ENTRYING,titleLabel="";
String messageTemplate = ZpglMessageTemplate.ENTRYING, titleLabel = "";
if (!StringUtils.isEmpty(zpglFail)) {
if (zpglFail.getZpglRcxxStatus().equals(JxglEnumInterface.ResumeStatus.INTERVIEWED.getType())) {
titleLabel = JxglEnumInterface.ResumeStatus.INTERVIEWED.getName();
zpglRcxxStatus = JxglEnumInterface.MslcLogStatus.OTHER.getType();
messageTemplate = ZpglMessageTemplate.INTERVIEWED_ENTRYING;
}
if(zpglFail.getZpglRcxxStatus().equals(JxglEnumInterface.ResumeStatus.INTERVIEW_PASS.getType())){
if (zpglFail.getZpglRcxxStatus().equals(JxglEnumInterface.ResumeStatus.INTERVIEW_PASS.getType())) {
titleLabel = JxglEnumInterface.ResumeStatus.INTERVIEW_PASS.getName();
zpglRcxxStatus = JxglEnumInterface.MslcLogStatus.OTHER.getType();
messageTemplate = ZpglMessageTemplate.INTERVIEWED_ENTRYING;
}
if(zpglFail.getZpglRcxxStatus().equals(JxglEnumInterface.ResumeStatus.INTERVIEW.getType())){
if (zpglFail.getZpglRcxxStatus().equals(JxglEnumInterface.ResumeStatus.INTERVIEW.getType())) {
titleLabel = JxglEnumInterface.ResumeStatus.INTERVIEW.getName();
zpglRcxxStatus = JxglEnumInterface.MslcLogStatus.OTHER.getType();
messageTemplate = ZpglMessageTemplate.INTERVIEWED_ENTRYING;
......@@ -211,30 +211,36 @@ public class ZpglServiceImpl implements ZpglService {
count = zpglRcxx.updateById();
zpglMslcLogService.addZpglMslcLog(zpglMslcLog);
// 发送面试通知
if(count && JxglEnumInterface.ResumeStatus.INTERVIEW.equals(zpglRcxxDto.getStatus()) && JxglEnumInterface.NoticeWay.WECHAT_PUBLIC.equals(zpglRcxxDto.getNoticeWay())){
if (count && JxglEnumInterface.ResumeStatus.INTERVIEW.getType().equals(zpglRcxxDto.getStatus()) && JxglEnumInterface.NoticeWay.WECHAT_PUBLIC.getType().equals(zpglRcxxDto.getNoticeWay())) {
InterviewNotice interviewNotice = new InterviewNotice();
ZpglZwxx zpglZwxx = ZpglZwxx.builder().id(zpglRcxxEntity.getZpglZwxxId()).build().selectById();
if (!StringUtils.isEmpty(zpglZwxx)) {
interviewNotice.setZpglZwxxName(zpglZwxx.getName());
}
interviewNotice.setName(zpglRcxxEntity.getName());
interviewNotice.setType(zpglRcxxDto.getNoticeWay());
interviewNotice.setEmail(zpglRcxxEntity.getMail());
//公众号类型 1:8小时企业管理 2:优领人才网
interviewNotice.setWxgzhType(1);
//1 即时发送,2 定时发送
interviewNotice.setTiming(1);
//0 即时发送,1 定时发送
interviewNotice.setTiming(0);
interviewNotice.setInterviewTime(zpglRcxxDto.getInterviewTime());
// 通知面试官
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().select("phone").lambda()
.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()).eq(YgglMainEmp::getEmpNum, zpglRcxxDto.getId()));
if(!StringUtils.isEmpty(ygglMainEmp)){
.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()).eq(YgglMainEmp::getEmpNum, zpglRcxxDto.getInterviewerId()));
if (!StringUtils.isEmpty(ygglMainEmp)) {
interviewNotice.setMobile(ygglMainEmp.getPhone());
interviewNotice.setYgglMainEmpId(ygglMainEmp.getId());
}
interviewNotice.setTemplateId(MessageTemplate.TEMPLATE_ID_TO_INTERVIEWER);
zpglWxgzptService.addInterviewMessageQueue(interviewNotice);
interviewNotice.setContentStr(ZpglMessageTemplate.print(ZpglMessageTemplate.TO_INTERVIEWER, new String[]{interviewNotice.getZpglZwxxName(), interviewNotice.getName()}));
log.info("TO_INTERVIEWER addInterviewMessageQueue info:{}", zpglWxgzptService.addInterviewMessageQueue(interviewNotice));
// 通知面试者
interviewNotice.setZpglRcxxId(zpglRcxxEntity.getId());
interviewNotice.setMobile(zpglRcxxEntity.getMobile());
interviewNotice.setTemplateId(MessageTemplate.TEMPLATE_ID_TO_INTERVIEWEE);
zpglWxgzptService.addInterviewMessageQueue(interviewNotice);
interviewNotice.setRemark("如有疑问,请联系 HR");
interviewNotice.setContentStr(ZpglMessageTemplate.print(ZpglMessageTemplate.TO_INTERVIEWEE, new String[]{interviewNotice.getName(), interviewNotice.getZpglZwxxName()}));
log.info("TO_INTERVIEWEE addInterviewMessageQueue info:{}", zpglWxgzptService.addInterviewMessageQueue(interviewNotice));
}
return count;
}
......@@ -252,24 +258,24 @@ public class ZpglServiceImpl implements ZpglService {
BaiduTicResumeDto baiduTicResumeDto = BaiduTicResumeDto.builder().filename(file.getOriginalFilename()).filetype(importCandidateDto.getSuffix()).filedata(Base64.getStrFromPath(file)).build();
ResponseEntity<String> resumeString = baiduTicUtil.getResumeByCvParser(baiduTicResumeDto);
JSONObject json = (JSONObject) JSONObject.parse(resumeString.getBody());
log.info("招聘-导入候选人简历{}",resumeString.getBody());
log.info("招聘-导入候选人简历{}", resumeString.getBody());
ResumeExtract resumeExtract = null;
if("success".equals(json.get("error_msg"))){
if(StringUtils.isEmpty(json.get("results"))){
if ("success".equals(json.get("error_msg"))) {
if (StringUtils.isEmpty(json.get("results"))) {
log.info("招聘-导入候选人简历:results is null");
return ResultUtil.error("导入简历失败,请检查是否为简历文件~");
}
JSONArray array = (JSONArray)json.get("results");
if(StringUtils.isEmpty(array.get(0))){
JSONArray array = (JSONArray) json.get("results");
if (StringUtils.isEmpty(array.get(0))) {
log.info("招聘-导入候选人简历:results is null");
return ResultUtil.error("导入简历失败,请检查是否为简历文件~");
}
JSONObject resultsJsonObject = (JSONObject) array.get(0);
resumeExtract = JSONObject.toJavaObject((JSONObject)resultsJsonObject.get("extract"), ResumeExtract.class);
}else {
resumeExtract = JSONObject.toJavaObject((JSONObject) resultsJsonObject.get("extract"), ResumeExtract.class);
} else {
return ResultUtil.error("导入简历失败,请检查是否为简历文件~");
}
if(StringUtils.isEmpty(resumeExtract) || StringUtils.isEmpty(resumeExtract.getBasic_infos())){
if (StringUtils.isEmpty(resumeExtract) || StringUtils.isEmpty(resumeExtract.getBasic_infos())) {
return ResultUtil.error("导入简历失败,请检查是否为简历文件~");
}
return this.addZpglRcxx(userBean, resumeExtract, importCandidateDto);
......@@ -283,7 +289,7 @@ public class ZpglServiceImpl implements ZpglService {
zpglMslcLog.setUserId(userBean.getEmpNum());
zpglMslcLog.setUserName(userBean.getQyzxEmpLogin().getUsername());
zpglMslcLog.setZpglRcxxStatus(JxglEnumInterface.MslcLogStatus.OTHER.getType());
zpglMslcLog.setDetail(userBean.getQyzxEmpLogin().getUsername()+" 更改候选人应聘职位.");
zpglMslcLog.setDetail(userBean.getQyzxEmpLogin().getUsername() + " 更改候选人应聘职位.");
zpglRcxx.updateById();
return zpglMslcLogService.addZpglMslcLog(zpglMslcLog);
}
......@@ -291,10 +297,11 @@ public class ZpglServiceImpl implements ZpglService {
/**
* 导入简历
* 同步人才信息 教育资讯 基本信息 其他信息 项目信息 工作信息
*
* @param resumeExtract
* @param importCandidateDto
*/
private Result<Object> addZpglRcxx(UserBean userBean,ResumeExtract resumeExtract, ImportCandidateDto importCandidateDto){
private Result<Object> addZpglRcxx(UserBean userBean, ResumeExtract resumeExtract, ImportCandidateDto importCandidateDto) {
ZpglRcxx zpglRcxx = ZpglRcxx.builder().build();
zpglRcxx.setZpglZwxxId(importCandidateDto.getZpglZwxxId());
zpglRcxx.setStatus(importCandidateDto.getStatus());
......@@ -302,100 +309,100 @@ public class ZpglServiceImpl implements ZpglService {
zpglRcxx.setOrgCode(userBean.getOrgCode().toString());
Integer highesteducation = null;
// 添加人才信息
if(!StringUtils.isEmpty(resumeExtract.getBasic_infos())){
if (!StringUtils.isEmpty(resumeExtract.getBasic_infos())) {
zpglRcxx.setName(resumeExtract.getBasic_infos().getName());
String phone = resumeExtract.getBasic_infos().getPhone_numbers();
if(StringUtils.isEmpty(phone)){
if (StringUtils.isEmpty(phone)) {
return ResultUtil.error("导入简历失败,手机号码不存在~");
}
// 查询简历是否重复导入
ZpglRcxx zpglRcxxEntiyt= ZpglRcxx.builder().build().selectOne(new QueryWrapper<ZpglRcxx>().lambda().eq(ZpglRcxx::getMobile,phone).eq(ZpglRcxx::getDeleteFlag,0));
if(!StringUtils.isEmpty(zpglRcxxEntiyt)){
ZpglRcxx zpglRcxxEntiyt = ZpglRcxx.builder().build().selectOne(new QueryWrapper<ZpglRcxx>().lambda().eq(ZpglRcxx::getMobile, phone).eq(ZpglRcxx::getDeleteFlag, 0));
if (!StringUtils.isEmpty(zpglRcxxEntiyt)) {
return ResultUtil.error("简历已入库,请勿重复导入");
}
zpglRcxx.setMobile(phone);
zpglRcxx.setMail(resumeExtract.getBasic_infos().getEmail_address());
zpglRcxx.setWeixin(resumeExtract.getBasic_infos().getWechat());
zpglRcxx.setIdCard(resumeExtract.getBasic_infos().getId_number());
if(!StringUtils.isEmpty(resumeExtract.getBasic_infos().getGender())){
zpglRcxx.setSex(resumeExtract.getBasic_infos().getGender().indexOf("男") != -1?0:1);
if (!StringUtils.isEmpty(resumeExtract.getBasic_infos().getGender())) {
zpglRcxx.setSex(resumeExtract.getBasic_infos().getGender().indexOf("男") != -1 ? 0 : 1);
}
//出生日期,格式化为 年-月,如2000-01,若只有年,则只显示年,如2000
if(!StringUtils.isEmpty(resumeExtract.getBasic_infos().getBirth_date())&&resumeExtract.getBasic_infos().getBirth_date().length() > 0){
if (!StringUtils.isEmpty(resumeExtract.getBasic_infos().getBirth_date()) && resumeExtract.getBasic_infos().getBirth_date().length() > 0) {
zpglRcxx.setDatebirth(this.getDate(resumeExtract.getBasic_infos().getBirth_date()));
}
if(!StringUtils.isEmpty(resumeExtract.getBasic_infos().getNation())){
NationClass nationClass = NationClass.builder().build().selectOne(new QueryWrapper<NationClass>().lambda().like(NationClass::getName,resumeExtract.getBasic_infos().getNation()));
if(!StringUtils.isEmpty(nationClass)){
if (!StringUtils.isEmpty(resumeExtract.getBasic_infos().getNation())) {
NationClass nationClass = NationClass.builder().build().selectOne(new QueryWrapper<NationClass>().lambda().like(NationClass::getName, resumeExtract.getBasic_infos().getNation()));
if (!StringUtils.isEmpty(nationClass)) {
zpglRcxx.setNationClassId(nationClass.getId());
}
}
zpglRcxx.setAddress(resumeExtract.getBasic_infos().getHome_location());
zpglRcxx.setUniversitie(resumeExtract.getBasic_infos().getSchool());
if(!StringUtils.isEmpty(resumeExtract.getBasic_infos().getCur_duration())){
if (!StringUtils.isEmpty(resumeExtract.getBasic_infos().getCur_duration())) {
zpglRcxx.setWorkyears(Integer.parseInt(resumeExtract.getBasic_infos().getCur_duration()));
}
zpglRcxx.setCompany(resumeExtract.getBasic_infos().getCur_company());
zpglRcxx.insert();
}
if(!StringUtils.isEmpty(zpglRcxx.getId()) ){
if (!StringUtils.isEmpty(zpglRcxx.getId())) {
// 添加教育经历
if(!StringUtils.isEmpty(resumeExtract.getEducation_infos())){
if (!StringUtils.isEmpty(resumeExtract.getEducation_infos())) {
ZpglRcxxStudy zpglRcxxStudy = ZpglRcxxStudy.builder().zpglRcxxId(zpglRcxx.getId()).build();
List<EducationInfo> list = resumeExtract.getEducation_infos();
for (EducationInfo entity : list ) {
if(!StringUtils.isEmpty(entity.getStart_time()) && entity.getStart_time().length() > 0) {
for (EducationInfo entity : list) {
if (!StringUtils.isEmpty(entity.getStart_time()) && entity.getStart_time().length() > 0) {
zpglRcxxStudy.setStartTime(this.getDate(entity.getStart_time()));
}
if(!StringUtils.isEmpty(entity.getEnd_time()) && entity.getEnd_time().length() > 0) {
if (!StringUtils.isEmpty(entity.getEnd_time()) && entity.getEnd_time().length() > 0) {
zpglRcxxStudy.setEndTime(this.getDate(entity.getEnd_time()));
}
zpglRcxxStudy.setSubject(entity.getMajor());
zpglRcxxStudy.setSchoolName(StringUtils.isEmpty(entity.getSchool())?entity.getCollege():entity.getSchool());
zpglRcxxStudy.setSchoolName(StringUtils.isEmpty(entity.getSchool()) ? entity.getCollege() : entity.getSchool());
zpglRcxxStudy.setEducation(this.getEducation(entity.getSchooling_record()));
highesteducation = zpglRcxxStudy.getEducation();
zpglRcxxStudy.insert();
}
}
// 添加工作经验
if(!StringUtils.isEmpty(resumeExtract.getWork_infos())){
if (!StringUtils.isEmpty(resumeExtract.getWork_infos())) {
ZpglRcxxExperience zpglRcxxExperience = ZpglRcxxExperience.builder().zpglRcxxId(zpglRcxx.getId()).build();
List<WorkInfo> list = resumeExtract.getWork_infos();
for (WorkInfo entity : list ) {
for (WorkInfo entity : list) {
zpglRcxxExperience.setCompany(entity.getCompany());
zpglRcxxExperience.setJobName(entity.getJob());
zpglRcxxExperience.setDepartment(entity.getDepartment());
zpglRcxxExperience.setWorkContent(entity.getDescribe());
if(!StringUtils.isEmpty(entity.getEnd_time()) && entity.getEnd_time().length() > 0) {
if (!StringUtils.isEmpty(entity.getEnd_time()) && entity.getEnd_time().length() > 0) {
zpglRcxxExperience.setEndTime(this.getDate(entity.getEnd_time()));
}
if(!StringUtils.isEmpty(entity.getStart_time()) && entity.getStart_time().length() > 0) {
if (!StringUtils.isEmpty(entity.getStart_time()) && entity.getStart_time().length() > 0) {
zpglRcxxExperience.setStartTime(this.getDate(entity.getStart_time()));
}
zpglRcxxExperience.insert();
}
}
// 添加项目信息
if(!StringUtils.isEmpty(resumeExtract.getProject_infos())){
if (!StringUtils.isEmpty(resumeExtract.getProject_infos())) {
ZpglRcxxProject zpglRcxxProject = ZpglRcxxProject.builder().zpglRcxxId(zpglRcxx.getId()).build();
List<ProjectInfo> list = resumeExtract.getProject_infos();
for (ProjectInfo entity : list ) {
for (ProjectInfo entity : list) {
zpglRcxxProject.setProjectDescribe(entity.getDescribe());
zpglRcxxProject.setDuty(entity.getDuty());
zpglRcxxProject.setJob(entity.getJob());
zpglRcxxProject.setLocation(entity.getLocation());
zpglRcxxProject.setProjectName(entity.getProject_name());
if(!StringUtils.isEmpty(entity.getStart_time()) && entity.getStart_time().length() > 0) {
if (!StringUtils.isEmpty(entity.getStart_time()) && entity.getStart_time().length() > 0) {
zpglRcxxProject.setStartTime(this.getDate(entity.getStart_time()));
}
if(!StringUtils.isEmpty(entity.getEnd_time()) && entity.getEnd_time().length() > 0) {
if (!StringUtils.isEmpty(entity.getEnd_time()) && entity.getEnd_time().length() > 0) {
zpglRcxxProject.setEndTime(this.getDate(entity.getEnd_time()));
}
zpglRcxxProject.insert();
}
}
if(!StringUtils.isEmpty(highesteducation)){
if (!StringUtils.isEmpty(highesteducation)) {
ZpglRcxx.builder().id(zpglRcxx.getId()).highesteducation(highesteducation.toString()).build().updateById();
}
......@@ -405,44 +412,46 @@ public class ZpglServiceImpl implements ZpglService {
/**
* 根据string时间获取date(2019-10或2019)
*
* @param date
* @return
*/
private Date getDate(String date){
private Date getDate(String date) {
String datebirth = "";
String[] num = date.split("-");
if(num.length == 1){
datebirth = num[0]+"-1-1";
}else if(num.length == 2){
datebirth = num[0]+"-"+num[1]+"-1";
if (num.length == 1) {
datebirth = num[0] + "-1-1";
} else if (num.length == 2) {
datebirth = num[0] + "-" + num[1] + "-1";
}
return datebirth.length()>0?ClockInTool.strToDateLong(datebirth):null;
return datebirth.length() > 0 ? ClockInTool.strToDateLong(datebirth) : null;
}
/**
* 获取学历类型
*
* @param str
* @return
*/
private Integer getEducation(String str){
private Integer getEducation(String str) {
Integer education = null;
if(StringUtils.isEmpty(str)){
if (StringUtils.isEmpty(str)) {
return education;
}
// 博士研究生/硕士研究生/本科/专科/高中/中专/初中
if(str.indexOf("初中")!=-1){
if (str.indexOf("初中") != -1) {
education = 2;
}else if(str.indexOf("中专")!=-1){
} else if (str.indexOf("中专") != -1) {
education = 4;
}else if(str.indexOf("高中")!=-1){
} else if (str.indexOf("高中") != -1) {
education = 3;
}else if(str.indexOf("专科")!=-1){
} else if (str.indexOf("专科") != -1) {
education = 5;
}else if(str.indexOf("本科")!=-1){
} else if (str.indexOf("本科") != -1) {
education = 6;
}else if(str.indexOf("硕士研究生")!=-1){
} else if (str.indexOf("硕士研究生") != -1) {
education = 7;
}else if(str.indexOf("博士研究生")!=-1){
} else if (str.indexOf("博士研究生") != -1) {
education = 8;
}
return education;
......@@ -450,11 +459,12 @@ public class ZpglServiceImpl implements ZpglService {
/**
* 添加offer记录
*
* @param userBean
* @param zpglRcxxDto
* @return
*/
private ZpglRcxxOffer insertZpglRcxxOffer(UserBean userBean,ZpglRcxxDto zpglRcxxDto){
private ZpglRcxxOffer insertZpglRcxxOffer(UserBean userBean, ZpglRcxxDto zpglRcxxDto) {
Integer orgCode = userBean.getOrgCode();
ZpglRcxxOffer zpglRcxxOffer = ZpglRcxxOffer.builder().build();
zpglRcxxOffer.setOrgCode(orgCode);
......@@ -473,18 +483,18 @@ public class ZpglServiceImpl implements ZpglService {
ZzglBmgwM z = ZzglBmgwM.builder().build().selectOne(
new QueryWrapper<ZzglBmgwM>().lambda().eq(ZzglBmgwM::getOrgCode, orgCode).eq(ZzglBmgwM::getId, bmid));
if (!StringUtils.isEmpty(z)) {
zpglRcxxOffer.setBumen( z.getName());
zpglRcxxOffer.setBumen(z.getName());
}
// 所在公司
ZzglBmgwM company = ZzglBmgwM.builder().build().selectOne(
new QueryWrapper<ZzglBmgwM>().select("name").lambda().eq(ZzglBmgwM::getOrgCode, orgCode).eq(ZzglBmgwM::getUpId, 0));
if(!StringUtils.isEmpty(company)){
zpglRcxxOffer.setTitle(company.getName()+"录用函");
if (!StringUtils.isEmpty(company)) {
zpglRcxxOffer.setTitle(company.getName() + "录用函");
zpglRcxxOffer.setCompanyName(company.getName());
}
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().select("phone","name","work_email").lambda()
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().select("phone", "name", "work_email").lambda()
.eq(YgglMainEmp::getOrgCode, orgCode).eq(YgglMainEmp::getEmpNum, zpglRcxxDto.getLinkId()));
if(!StringUtils.isEmpty(ygglMainEmp)){
if (!StringUtils.isEmpty(ygglMainEmp)) {
zpglRcxxOffer.setLinkName(ygglMainEmp.getName());
zpglRcxxOffer.setLinkPhone(ygglMainEmp.getPhone());
zpglRcxxOffer.setLinkEmail(ygglMainEmp.getWorkEmail());
......
......@@ -25,4 +25,12 @@ public interface ZpglWxgzptService {
* @return
*/
String addInterviewMessageQueue(InterviewNotice interviewNotice);
/**
* 发起应聘登记 or 测评
* 添加消息队列
* @param interviewNotice
* @return
*/
String sendApplyOrCePin(InterviewNotice interviewNotice);
}
......@@ -48,18 +48,23 @@ public class ZpglWxgzptServiceImpl implements ZpglWxgzptService {
*/
@Override
public String addInterviewMessageQueue(InterviewNotice interviewNotice) {
return HttpUtil.post(serverUrl + "/wxgzh/addMessageQueue", this.copyMessageQueueToMap(interviewNotice));
}
@Override
public String sendApplyOrCePin(InterviewNotice interviewNotice) {
return HttpUtil.post(serverUrl + "/wxgzh/addMessageQueue", this.copyMessageQueueToMap(interviewNotice));
}
private Map copyMessageQueueToMap(InterviewNotice interviewNotice){
//消息队列对象
MessageQueueDto mqd = new MessageQueueDto();
BeanUtils.copyProperties(interviewNotice, mqd);
/** 模板消息内容 start */
List<TemplateData> templateData = new ArrayList<>();
if (MessageTemplate.TEMPLATE_ID_TO_INTERVIEWER.equals(interviewNotice.getTemplateId())) {
TemplateData key1 = new TemplateData("first", "您好," + interviewNotice.getZpglZwxxName() + interviewNotice.getName() + "已安排由您面试", "#000000");
templateData.add(key1);
} else if (MessageTemplate.TEMPLATE_ID_TO_INTERVIEWEE.equals(interviewNotice.getTemplateId())) {
TemplateData key1 = new TemplateData("first", "候选人" + interviewNotice.getName() + "你好!你所投递的" + interviewNotice.getZpglZwxxName() + "为你安排了面试", "#000000");
templateData.add(key1);
}
// 内容
TemplateData key1 = new TemplateData("first", interviewNotice.getContentStr(), "#000000");
templateData.add(key1);
// 面试职位
TemplateData key2 = new TemplateData("keyword1", interviewNotice.getZpglZwxxName(), "#000000");
templateData.add(key2);
......@@ -76,26 +81,7 @@ public class ZpglWxgzptServiceImpl implements ZpglWxgzptService {
mqd.setContent(content);
/** 模板消息内容 end */
/**
* //消息内容模板消息 json格式 普通消息字符串类型
* //手机号
* mqd.setMobile("18212310017");
* //类型(1 短信,2 邮件,3 微信模板消息)
* mqd.setType(2);
* //公众号类型 1:8小时企业管理 2:优领人才网
* mqd.setWxgzhType(1);
* //1 即时发送,2 定时发送
* mqd.setTiming(1);
* //模板id
* mqd.setTemplateId(interviewNotice.getTemplateId());
* //网页地址
* mqd.setUrl(null);
* //小程序页面地址
* mqd.setWxxcxPageId(null);
*/
Map map = JSON.parseObject(JSON.toJSONString(mqd), Map.class);
return HttpUtil.post(serverUrl + "/wxgzh/addMessageQueue", map);
return map;
}
}
......@@ -34,6 +34,10 @@ public class InterviewNotice extends MessageQueueDto {
* 备注
*/
private String remark;
/**
* 内容
*/
private String contentStr;
public void setInterviewTime(Date interviewTime){
this.interviewTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(interviewTime);
......
......@@ -35,7 +35,7 @@ public class MessageQueueDto {
private String content;
/**
* 类型(1 短信,2 邮件,3 微信模板消息)
* 类型 1:全部 2:短信 3:邮件 4.微信公众号
*/
private Integer type;
......
......@@ -22,6 +22,11 @@ public class ZpglMessageTemplate {
public static final String INTERVIEWED_ENTRYING ="{0} 将候选人状态从[{3}]更改为[面试淘汰], 淘汰原因:{1},备注:{2}";
public static final String OFFER_ENTRYING ="{0} 将候选人状态从[{3}}]更改为[录用淘汰], 淘汰原因:{1},备注:{2}";
public static final String TO_INTERVIEWER ="您好,{0}{1}已安排由您面试";
public static final String TO_INTERVIEWEE ="候选人{0}你好!你所投递的 {1} 职位为你安排了面试";
public static final String TO_APPLY ="候选人{0}您好!请您认真填写应聘登记表";
public static final String TO_CEPIN ="候选人{0}您好!请您认真填写FPA测评试卷";
public static final String OFFER_TEMPLATE = "<!DOCTYPE html><html lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:th=\"http://www.thymeleaf.org\"><body><div><p style=\" line-height: 1.5;\">尊敬的<span>{0}</span></p>"+
"<p style=\" line-height: 1.5;\"><br></p>"+
"<p style=\"text-indent: 2em; line-height: 1.5;\">感谢您对公司的认可,非常荣幸地通知您,您已被我司正式录用,欢迎您加入<span>{1}</span></p>"+
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment