generated from dxfeng/secondev-chapanda-feishu
692 lines
32 KiB
Java
692 lines
32 KiB
Java
package com.engine.recruit.service.impl;
|
||
|
||
import cn.hutool.core.convert.Convert;
|
||
import com.engine.core.impl.Service;
|
||
import com.engine.recruit.conn.*;
|
||
import com.engine.recruit.entity.record.ApplicantRecordPo;
|
||
import com.engine.recruit.entity.resume.OcrResumePo;
|
||
import com.engine.recruit.enums.ApplicantOperateEnum;
|
||
import com.engine.recruit.enums.ApplicationStatusEnum;
|
||
import com.engine.recruit.enums.RecordOperateEnum;
|
||
import com.engine.recruit.exception.CustomizeRunTimeException;
|
||
import com.engine.recruit.service.ApplicantResumeService;
|
||
import com.engine.recruit.util.RecruitUtil;
|
||
import org.apache.commons.collections.CollectionUtils;
|
||
import org.apache.commons.lang3.StringUtils;
|
||
import weaver.common.DateUtil;
|
||
import weaver.conn.RecordSet;
|
||
import weaver.formmode.recruit.modeexpand.util.RecruitModeUtil;
|
||
import weaver.formmode.setup.ModeRightInfo;
|
||
import weaver.general.Util;
|
||
import weaver.hrm.resource.ResourceComInfo;
|
||
|
||
import java.util.*;
|
||
|
||
/**
|
||
* @author:dxfeng
|
||
* @createTime: 2023/09/20
|
||
* @version: 1.0
|
||
*/
|
||
public class ApplicantResumeServiceImpl extends Service implements ApplicantResumeService {
|
||
|
||
@Override
|
||
public Map<String, Object> getApplicantsName(String ids) {
|
||
Map<String, Object> returnMap = new HashMap<>(1);
|
||
RecordSet rs = new RecordSet();
|
||
String[] split = ids.split(",");
|
||
List<Map<String, Object>> list = new ArrayList<>();
|
||
for (String id : split) {
|
||
rs.executeQuery("select xm from uf_jcl_yppc where id = ?", id);
|
||
if (rs.next()) {
|
||
Map<String, Object> rowMap = new HashMap<>();
|
||
rowMap.put("id", id);
|
||
rowMap.put("name", rs.getString("xm"));
|
||
list.add(rowMap);
|
||
}
|
||
}
|
||
returnMap.put("rows", list);
|
||
return returnMap;
|
||
}
|
||
|
||
@Override
|
||
public Map<String, Object> getInterviewInfoById(String id) {
|
||
Map<String, Object> returnMap = new HashMap<>(16);
|
||
String sql = "select a.ypz,b.xm,a.ypzw,b.tdsj,b.sjhm,b.dzyx,a.msfs,a.mshj ,a.msc,a.msg ,a.ptmsg,a.msrq,a.msdd ,a.msfkr from uf_jcl_ms a inner join uf_jcl_yppc b on a.ypz = b.id where a.id = ?";
|
||
RecordSet rs = new RecordSet();
|
||
rs.executeQuery(sql, id);
|
||
if (rs.next()) {
|
||
// 应聘者
|
||
returnMap.put("ypz", createApplicantBrowserMap(rs.getString("ypz"), rs.getString("xm")));
|
||
// 应聘职位
|
||
returnMap.put("ypzw", createAppliedPositionBrowserMap(rs.getString("ypzw")));
|
||
// 投递时间
|
||
returnMap.put("tdsj", createApplicantBrowserMap(rs.getString("tdsj")));
|
||
// 手机号码
|
||
returnMap.put("sjhm", createApplicantBrowserMap(rs.getString("sjhm")));
|
||
// 电子邮箱
|
||
returnMap.put("dzyx", createApplicantBrowserMap(rs.getString("dzyx")));
|
||
// 面试方式
|
||
returnMap.put("msfs", createApplicantBrowserMap(rs.getString("msfs")));
|
||
// 面试环节
|
||
returnMap.put("mshj", createApplicantBrowserMap(rs.getString("mshj")));
|
||
// 面试轮次
|
||
returnMap.put("msc", createApplicantBrowserMap(rs.getString("msc")));
|
||
// 面试官
|
||
returnMap.put("msg", createResourceBrowserMap(rs.getString("msg")));
|
||
// 陪同面试官
|
||
returnMap.put("ptmsg", createResourceBrowserMap(rs.getString("ptmsg")));
|
||
// 面试日期
|
||
returnMap.put("msrq", createApplicantBrowserMap(rs.getString("msrq")));
|
||
// 面试地址
|
||
returnMap.put("msdd", createApplicantBrowserMap(rs.getString("msdd")));
|
||
}
|
||
return returnMap;
|
||
}
|
||
|
||
@Override
|
||
public Map<String, Object> getDisplayLayoutId(Map<String, Object> params) {
|
||
Map<String, Object> returnMap = new HashMap<>();
|
||
String layoutId = Util.null2String(params.get("layoutid"));
|
||
String modeId = Util.null2String(params.get("modeId"));
|
||
returnMap.put("layoutId", layoutId);
|
||
RecordSet rs = new RecordSet();
|
||
rs.executeQuery("select layoutname from modehtmllayout where modeid = ? and id = ?", modeId, layoutId);
|
||
if (rs.next()) {
|
||
String layoutName = rs.getString("layoutname");
|
||
// 获取相同名称的显示布局ID
|
||
rs.executeQuery("select id from modehtmllayout where type = 0 and modeid = ? and layoutname =?", modeId, layoutName);
|
||
if (rs.next()) {
|
||
returnMap.put("layoutId", rs.getString("id"));
|
||
}
|
||
}
|
||
return returnMap;
|
||
}
|
||
|
||
@Override
|
||
public Map<String, Object> getTabCount(Map<String, Object> params) {
|
||
Map<String, Object> returnMap = new HashMap<>();
|
||
String billId = Util.null2String(params.get("billid"));
|
||
List<Integer> countList = new ArrayList<>();
|
||
RecordSet rs = new RecordSet();
|
||
// 部门筛选反馈
|
||
rs.executeQuery("select count(id) as num from uf_jcl_bmsxfk where ypz = ?", billId);
|
||
if (rs.next()) {
|
||
countList.add(rs.getInt("num"));
|
||
}
|
||
// 笔试
|
||
rs.executeQuery("select count(id) as num from uf_jcl_bs where ypz = ?", billId);
|
||
if (rs.next()) {
|
||
countList.add(rs.getInt("num"));
|
||
}
|
||
// 面试
|
||
rs.executeQuery("select count(id) as num from uf_jcl_ms where ypz = ?", billId);
|
||
if (rs.next()) {
|
||
countList.add(rs.getInt("num"));
|
||
}
|
||
// 背调
|
||
rs.executeQuery("select count(id) as num from uf_jcl_bd where ypz = ?", billId);
|
||
if (rs.next()) {
|
||
countList.add(rs.getInt("num"));
|
||
}
|
||
// 薪酬谈判
|
||
rs.executeQuery("select count(id) as num from uf_jcl_xctp where ypz = ?", billId);
|
||
if (rs.next()) {
|
||
countList.add(rs.getInt("num"));
|
||
}
|
||
// 历史投递记录
|
||
rs.executeQuery("select xm,sjhm from uf_jcl_yppc where id = ?", billId);
|
||
if (rs.next()) {
|
||
rs.executeQuery("select count(id) as num from uf_jcl_yppc where xm=? and sjhm =?", rs.getString("xm"), rs.getString("sjhm"));
|
||
if (rs.next()) {
|
||
countList.add(rs.getInt("num"));
|
||
}
|
||
} else {
|
||
countList.add(0);
|
||
}
|
||
|
||
|
||
returnMap.put("countList", countList);
|
||
return returnMap;
|
||
}
|
||
|
||
@Override
|
||
public Map<String, Object> updateApplicantsInfo(Map<String, Object> params) {
|
||
Map<String, Object> returnMap = new HashMap<>();
|
||
String operateType = Util.null2String(params.get("operateType"));
|
||
RecordSet rs = new RecordSet();
|
||
if (ApplicantOperateEnum.ELIMINATE.getOperateType().equals(operateType)) {
|
||
// 淘汰
|
||
String ids = Util.null2String(params.get("ids"));
|
||
rs.executeUpdate("update uf_jcl_yppc set zt = ? where id in (" + ids + ")", ApplicationStatusEnum.OBSOLETE.getValue());
|
||
|
||
// 插入应聘过程
|
||
String dateTime = DateUtil.getDateTime();
|
||
for (String s : ids.split(",")) {
|
||
ApplicantRecordPo recordPo = ApplicantRecordPo.builder()
|
||
.billId(s)
|
||
.operateTime(dateTime)
|
||
.user(user)
|
||
.recordOperateType(RecordOperateEnum.ELIMINATE)
|
||
.build();
|
||
recordPo.execute();
|
||
}
|
||
|
||
returnMap.put("msg", "操作成功");
|
||
} else if (ApplicantOperateEnum.TRANSFER.getOperateType().equals(operateType)) {
|
||
// 转移阶段
|
||
String dqypjd = Util.null2String(params.get("dqypjd"));
|
||
String billid = Util.null2String(params.get("billid"));
|
||
Map<String, Object> otherParam = new HashMap<>();
|
||
otherParam.put("sourceStep", ApplicantCommonInfo.getCurrentStep(billid).getDescription());
|
||
// 查询当前阶段的阶段类型
|
||
rs.executeQuery("select jdlx from uf_jcl_zpjdsz where id = ?", dqypjd);
|
||
if (rs.next()) {
|
||
String jdlx = rs.getString("jdlx");
|
||
rs.executeUpdate("update uf_jcl_yppc set zpjd = ?,dqypjd = ? where id = ?", dqypjd, jdlx, billid);
|
||
returnMap.put("msg", "操作成功");
|
||
} else {
|
||
throw new CustomizeRunTimeException("转移阶段失败");
|
||
}
|
||
|
||
otherParam.put("targetStep", ApplicantCommonInfo.getCurrentStep(billid).getDescription());
|
||
|
||
// 插入应聘过程
|
||
ApplicantRecordPo recordPo = ApplicantRecordPo.builder()
|
||
.billId(billid)
|
||
.operateTime(DateUtil.getDateTime())
|
||
.user(user)
|
||
.recordOperateType(RecordOperateEnum.TRANSFER_STAGE)
|
||
.otherParam(otherParam)
|
||
.build();
|
||
recordPo.execute();
|
||
} else if (ApplicantOperateEnum.ASSIGN.getOperateType().equals(operateType)) {
|
||
// 分配职位
|
||
String billid = Util.null2String(params.get("billid"));
|
||
String ypzw = Util.null2String(params.get("ypzw"));
|
||
if (StringUtils.isBlank(ypzw)) {
|
||
throw new CustomizeRunTimeException("应聘职位不可为空");
|
||
}
|
||
String flowId = PositionCommonInfo.getRecruitFlowId(ypzw);
|
||
Map<String, String> initialStage = ApplicantCommonInfo.getInitialStage(flowId);
|
||
String zpjd = "";
|
||
String dqypjd = "";
|
||
if (null != initialStage) {
|
||
zpjd = initialStage.get("zpjd");
|
||
dqypjd = initialStage.get("jdlx");
|
||
}
|
||
rs.executeUpdate("update uf_jcl_yppc set ypzw = ? , zplc = ? , zpjd = ? , dqypjd = ?, zt = 1 where id = ?", ypzw, flowId, zpjd, dqypjd, billid);
|
||
returnMap.put("msg", "操作成功");
|
||
} else if (ApplicantOperateEnum.ARCHIVE.getOperateType().equals(operateType)) {
|
||
// 归档人才库
|
||
String gdyy = Util.null2String(params.get("gdyy"));
|
||
String gdxxyy = Util.null2String(params.get("gdxxyy"));
|
||
String ids = Util.null2String(params.get("ids"));
|
||
if (StringUtils.isNotBlank(ids)) {
|
||
String[] split = ids.split(",");
|
||
String dateTime = DateUtil.getDateTime();
|
||
for (String id : split) {
|
||
rs.executeUpdate("update uf_jcl_yppc set gdyy = ?,gdxxyy = ? where id = ? ", gdyy, gdxxyy, id);
|
||
// 建模推送建模
|
||
archiveTalentPool(id, false, "");
|
||
// 更新应聘状态为已归档
|
||
rs.executeUpdate("update uf_jcl_yppc set zt = ? where id = ? ", ApplicationStatusEnum.ARCHIVED.getValue(), id);
|
||
|
||
// 插入应聘过程
|
||
Map<String, Object> otherParam = new HashMap<>();
|
||
otherParam.put("gdyy", gdyy);
|
||
otherParam.put("gdxxyy", gdxxyy);
|
||
|
||
ApplicantRecordPo recordPo = ApplicantRecordPo.builder()
|
||
.billId(id)
|
||
.operateTime(dateTime)
|
||
.user(user)
|
||
.recordOperateType(RecordOperateEnum.ARCHIVE_TALENT_POOL)
|
||
.otherParam(otherParam)
|
||
.build();
|
||
recordPo.execute();
|
||
}
|
||
} else {
|
||
throw new CustomizeRunTimeException("请至少选择一条数据");
|
||
}
|
||
} else if (ApplicantOperateEnum.REFERRAL.getOperateType().equals(operateType)) {
|
||
// 转推其他职位
|
||
String sourceId = Util.null2String(params.get("sourceId"));
|
||
String ypzw = Util.null2String(params.get("ypzw"));
|
||
|
||
rs.executeQuery("select * from uf_jcl_yppc where id = ?", sourceId);
|
||
Map<String, Object> mainDataMap = RecruitRecordSet.getSingleRecordMap(rs);
|
||
// 构建新数据
|
||
mainDataMap.put("ypzw", ypzw);
|
||
|
||
String flowId = PositionCommonInfo.getRecruitFlowId(ypzw);
|
||
Map<String, String> initialStage = ApplicantCommonInfo.getInitialStage(flowId);
|
||
if (null != initialStage) {
|
||
String zpjd = initialStage.get("zpjd");
|
||
String dqypjd = initialStage.get("jdlx");
|
||
if (StringUtils.isNotBlank(zpjd) && StringUtils.isNotBlank(dqypjd)) {
|
||
mainDataMap.put("zplc", flowId);
|
||
mainDataMap.put("zpjd", zpjd);
|
||
mainDataMap.put("dqypjd", dqypjd);
|
||
}
|
||
}
|
||
|
||
mainDataMap.put("zt", ApplicationStatusEnum.CANDIDATE.getValue());
|
||
RecruitRecordSet.buildModeInsertFields(mainDataMap, user.getUID());
|
||
String uuid = UUID.randomUUID().toString();
|
||
mainDataMap.put("modeuuid", uuid);
|
||
// 移除不需要插入的字段
|
||
mainDataMap.remove("id");
|
||
mainDataMap.remove("requestId");
|
||
mainDataMap.remove("form_biz_id");
|
||
|
||
// 插入数据
|
||
RecruitRecordSet.insertData(mainDataMap, "uf_jcl_yppc");
|
||
// 权限重构
|
||
rs.executeQuery("select id,formmodeid from uf_jcl_yppc where modeuuid='" + uuid + "'");
|
||
if (rs.next()) {
|
||
//建模数据的id
|
||
int targetId = Util.getIntValue(rs.getString("id"));
|
||
int formModeId = Util.getIntValue(rs.getString("formmodeid"));
|
||
ModeRightInfo modeRightInfo = new ModeRightInfo();
|
||
modeRightInfo.setNewRight(true);
|
||
//新建的时候添加共享
|
||
modeRightInfo.editModeDataShare(user.getUID(), formModeId, targetId);
|
||
|
||
// 复制明细表数据
|
||
rs.executeUpdate("insert into uf_jcl_yppc_dt1 (mainid,xxmc,xl,zy,kssj,jssj) select ?,xxmc,xl,zy,kssj,jssj from uf_jcl_yppc_dt1 where mainid = ?", targetId, sourceId);
|
||
rs.executeUpdate("insert into uf_jcl_yppc_dt2 (mainid,gsmc,kssj,jssj,gw,sqyxk,lzyy,gzzz) select ?,gsmc,kssj,jssj,gw,sqyxk,lzyy,gzzz from uf_jcl_yppc_dt2 where mainid = ?", targetId, sourceId);
|
||
rs.executeUpdate("insert into uf_jcl_yppc_dt3 (mainid,xmmc,kssj,jssj,drjs,xmms) select ?,xmmc,kssj,jssj,drjs,xmms from uf_jcl_yppc_dt3 where mainid = ?", targetId, sourceId);
|
||
rs.executeUpdate("insert into uf_jcl_yppc_dt4 (mainid,yylx,zwcd) select ?,yylx,zwcd from uf_jcl_yppc_dt4 where mainid = ?", targetId, sourceId);
|
||
}
|
||
|
||
|
||
}
|
||
return returnMap;
|
||
}
|
||
|
||
@Override
|
||
public Map<String, Object> fullOriginalResumeId(Map<String, Object> params) {
|
||
Map<String, Object> returnMap = new HashMap<>();
|
||
|
||
int imageFileId = Convert.toInt(params.get("imageFileId"));
|
||
int resumeId = Convert.toInt(params.get("resumeId"));
|
||
int secCategory = Convert.toInt(RecruitModeUtil.getRecruitPropValue("APPLICANTS_RESUMES_CATEGORY"));
|
||
RecordSet rs = new RecordSet();
|
||
try {
|
||
int docId = RecruitModeUtil.createDocId(secCategory, imageFileId, user);
|
||
// 更新原始简历信息
|
||
rs.executeUpdate("update uf_jcl_jlzjb set jlfj=?,ocr=1 where id = ?", docId, resumeId);
|
||
|
||
// 简历入库,并返回展示的应聘者简历ID
|
||
rs.executeQuery("select id,xm, xb, csrq, jg, yx, wx, qq, xjzd, ah, grys , jyjl , bysj , zgxl , zyjn , sxjl , yysp , zs, gzjl, ypzw, gzjy, xmjl, sjhm, nl, sfz, jlfj from uf_jcl_jlzjb where ocr = 1 and cqzt is null and id = ?", resumeId);
|
||
Map<String, Object> recordMap = RecruitRecordSet.getSingleRecordMap(rs);
|
||
OcrResumePo ocrResumePo = RecruitUtil.parseMap2Object(recordMap, OcrResumePo.class);
|
||
RecruitDataMap<Object> dataMap = buildApplicantMap(ocrResumePo);
|
||
// 校验简历信息、并插入
|
||
Map<String, Object> map = CheckRepeatResume.getInstance().insertResumeAndReturn(dataMap);
|
||
rs.executeUpdate("update uf_jcl_jlzjb set cqzt = 1 where id = ? ", ocrResumePo.getId());
|
||
String mainId = Util.null2String(map.get("mainId"));
|
||
String sourceId = Util.null2String(map.get("sourceId"));
|
||
returnMap.put("mainId", StringUtils.isNotBlank(sourceId) ? sourceId : mainId);
|
||
returnMap.put("sourceId", sourceId);
|
||
|
||
} catch (Exception e) {
|
||
throw new RuntimeException(e);
|
||
}
|
||
|
||
return returnMap;
|
||
}
|
||
|
||
@Override
|
||
public Map<String, Object> checkRepeatResume(Map<String, Object> param) {
|
||
String name = Util.null2String(param.get("xm"));
|
||
String mobile = Util.null2String(param.get("sjhm"));
|
||
String positionId = Util.null2String(param.get("ypzw"));
|
||
String billId = Util.null2String(param.get("billid"));
|
||
Map<String, Object> returnMap = new HashMap<>();
|
||
// 判断是否黑名单
|
||
boolean joinBlackList = CheckRepeatResume.joinBlackList(name, mobile);
|
||
if (joinBlackList) {
|
||
throw new CustomizeRunTimeException("保存失败,当前录入应聘者为黑名单人员");
|
||
}
|
||
List<Map<String, Object>> repeatPositionResumeList = CheckRepeatResume.getRepeatPositionResumeList(name, mobile, positionId, billId);
|
||
if (CollectionUtils.isNotEmpty(repeatPositionResumeList)) {
|
||
if (StringUtils.isBlank(positionId)) {
|
||
throw new CustomizeRunTimeException("保存失败,该人员已有待分配状态数据");
|
||
}
|
||
throw new CustomizeRunTimeException("保存失败,该人员已有相同的应聘中的职位");
|
||
}
|
||
return returnMap;
|
||
}
|
||
|
||
/**
|
||
* 构建普通数据格式
|
||
*
|
||
* @param value
|
||
* @return
|
||
*/
|
||
private Map<String, Object> createApplicantBrowserMap(String value) {
|
||
if (StringUtils.isBlank(value)) {
|
||
return null;
|
||
}
|
||
Map<String, Object> browserMap = new HashMap<>(1);
|
||
browserMap.put("value", value);
|
||
return browserMap;
|
||
}
|
||
|
||
/**
|
||
* 构建应聘者浏览按钮值
|
||
*
|
||
* @param id
|
||
* @param name
|
||
* @return
|
||
*/
|
||
private Map<String, Object> createApplicantBrowserMap(String id, String name) {
|
||
Map<String, Object> browserMap = new HashMap<>(2);
|
||
if (StringUtils.isBlank(id)) {
|
||
return browserMap;
|
||
}
|
||
browserMap.put("value", id);
|
||
List<Map<String, Object>> objList = new ArrayList<>();
|
||
Map<String, Object> obj = new HashMap<>(2);
|
||
obj.put("id", id);
|
||
obj.put("name", name);
|
||
objList.add(obj);
|
||
browserMap.put("specialobj", objList);
|
||
return browserMap;
|
||
}
|
||
|
||
/**
|
||
* 构建应聘职位浏览按钮
|
||
*
|
||
* @param id
|
||
* @return
|
||
*/
|
||
private Map<String, Object> createAppliedPositionBrowserMap(String id) {
|
||
Map<String, Object> browserMap = new HashMap<>(2);
|
||
if (StringUtils.isBlank(id)) {
|
||
return browserMap;
|
||
}
|
||
browserMap.put("value", id);
|
||
RecordSet rs = new RecordSet();
|
||
rs.executeQuery("select zpzwmc from uf_jcl_zp_zpzw where id = ?", id);
|
||
if (rs.next()) {
|
||
List<Map<String, Object>> objList = new ArrayList<>();
|
||
Map<String, Object> obj = new HashMap<>(2);
|
||
obj.put("id", id);
|
||
obj.put("name", rs.getString("zpzwmc"));
|
||
objList.add(obj);
|
||
browserMap.put("specialobj", objList);
|
||
}
|
||
return browserMap;
|
||
}
|
||
|
||
/**
|
||
* 构建人员浏览按钮值
|
||
*
|
||
* @param ids
|
||
* @return
|
||
*/
|
||
private Map<String, Object> createResourceBrowserMap(String ids) {
|
||
Map<String, Object> browserMap = new HashMap<>(2);
|
||
if (StringUtils.isBlank(ids)) {
|
||
return browserMap;
|
||
}
|
||
browserMap.put("value", ids);
|
||
List<Map<String, Object>> objList = new ArrayList<>();
|
||
String[] split = ids.split(",");
|
||
try {
|
||
ResourceComInfo resourceComInfo = new ResourceComInfo();
|
||
for (String s : split) {
|
||
Map<String, Object> obj = new HashMap<>(2);
|
||
obj.put("id", s);
|
||
obj.put("name", resourceComInfo.getLastname(s));
|
||
objList.add(obj);
|
||
}
|
||
} catch (Exception e) {
|
||
throw new RuntimeException(e);
|
||
}
|
||
browserMap.put("specialobj", objList);
|
||
return browserMap;
|
||
|
||
}
|
||
|
||
/**
|
||
* 归档人才库
|
||
*
|
||
* @param applicantId 应聘者ID
|
||
* @param joinBlacklist 是否加入黑名单
|
||
* @param gdyy 归档原因
|
||
*/
|
||
public void archiveTalentPool(String applicantId, boolean joinBlacklist, String gdyy) {
|
||
RecordSet rs = new RecordSet();
|
||
String name = "";
|
||
String mobile = "";
|
||
String talentPoolId = "";
|
||
rs.executeQuery("select xm,sjhm from uf_jcl_yppc where id = ?", applicantId);
|
||
if (rs.next()) {
|
||
name = rs.getString("xm");
|
||
mobile = rs.getString("sjhm");
|
||
}
|
||
|
||
rs.executeQuery("select id from uf_jcl_rck where xm = ? and sjhm = ?", name, mobile);
|
||
if (rs.next()) {
|
||
talentPoolId = rs.getString("id");
|
||
}
|
||
|
||
// 推送建模主表数据
|
||
Map<String, Object> dataMap = new RecruitDataMap<>();
|
||
String uuid = UUID.randomUUID().toString();
|
||
dataMap.put("modeuuid", uuid);
|
||
int formModeId = -1;
|
||
rs.executeQuery("select id from modeinfo where formid =( select id from workflow_bill where tablename = 'uf_jcl_rck' )");
|
||
if (rs.next()) {
|
||
formModeId = rs.getInt("id");
|
||
}
|
||
dataMap.put("formmodeid", formModeId);
|
||
// 构建建模表基本数据
|
||
RecruitRecordSet.buildModeInsertFields(dataMap, user.getUID());
|
||
rs.executeQuery("select * from uf_jcl_yppc where id = ?", applicantId);
|
||
if (rs.next()) {
|
||
dataMap.put("sfz", RecruitModeUtil.parseBlankToNull(rs.getString("sfz")));
|
||
dataMap.put("jlzp", RecruitModeUtil.parseBlankToNull(rs.getString("jlzp")));
|
||
dataMap.put("zhypzw", RecruitModeUtil.parseBlankToNull(rs.getString("ypzw")));
|
||
dataMap.put("ysjl", RecruitModeUtil.parseBlankToNull(rs.getString("ysjl")));
|
||
dataMap.put("jlly", RecruitModeUtil.parseBlankToNull(rs.getString("jlly")));
|
||
dataMap.put("xm", RecruitModeUtil.parseBlankToNull(rs.getString("xm")));
|
||
dataMap.put("xb", RecruitModeUtil.parseBlankToNull(rs.getString("xb")));
|
||
dataMap.put("sjhm", RecruitModeUtil.parseBlankToNull(rs.getString("sjhm")));
|
||
dataMap.put("dzyx", RecruitModeUtil.parseBlankToNull(rs.getString("dzyx")));
|
||
dataMap.put("csrq", RecruitModeUtil.parseBlankToNull(rs.getString("csrq")));
|
||
dataMap.put("nl", RecruitModeUtil.parseBlankToNull(rs.getString("nl")));
|
||
dataMap.put("zgxl", RecruitModeUtil.parseBlankToNull(rs.getString("zgxl")));
|
||
dataMap.put("zgxw", RecruitModeUtil.parseBlankToNull(rs.getString("zgxw")));
|
||
dataMap.put("byyx", RecruitModeUtil.parseBlankToNull(rs.getString("byyx")));
|
||
dataMap.put("zy", RecruitModeUtil.parseBlankToNull(rs.getString("zy")));
|
||
dataMap.put("hyzk", RecruitModeUtil.parseBlankToNull(rs.getString("hyzk")));
|
||
dataMap.put("gzjy", RecruitModeUtil.parseBlankToNull(rs.getString("gzjy")));
|
||
dataMap.put("zzzt", RecruitModeUtil.parseBlankToNull(rs.getString("zzzt")));
|
||
dataMap.put("dqszd", RecruitModeUtil.parseBlankToNull(rs.getString("dqszd")));
|
||
dataMap.put("zhtdsj", RecruitModeUtil.parseBlankToNull(rs.getString("tdsj")));
|
||
dataMap.put("cjr", RecruitModeUtil.parseBlankToNull(rs.getString("cjr")));
|
||
dataMap.put("zwpj", RecruitModeUtil.parseBlankToNull(rs.getString("zwpj")));
|
||
dataMap.put("mz", RecruitModeUtil.parseBlankToNull(rs.getString("mz")));
|
||
dataMap.put("jg", RecruitModeUtil.parseBlankToNull(rs.getString("jg")));
|
||
dataMap.put("zzmm", RecruitModeUtil.parseBlankToNull(rs.getString("zzmm")));
|
||
dataMap.put("sgcm", RecruitModeUtil.parseBlankToNull(rs.getString("sgcm")));
|
||
dataMap.put("tzkg", RecruitModeUtil.parseBlankToNull(rs.getString("tzkg")));
|
||
// 归档阶段
|
||
dataMap.put("gdjd", RecruitModeUtil.parseBlankToNull(rs.getString("dqypjd")));
|
||
dataMap.put("gdyy", RecruitModeUtil.parseBlankToNull(rs.getString("gdyy")));
|
||
dataMap.put("gdxxyy", RecruitModeUtil.parseBlankToNull(rs.getString("gdxxyy")));
|
||
}
|
||
// 历史投递次数
|
||
rs.executeQuery("select count(id) as num from uf_jcl_yppc where xm=? and sjhm =?", rs.getString("xm"), rs.getString("sjhm"));
|
||
if (rs.next()) {
|
||
dataMap.put("lstdcs", rs.getInt("num"));
|
||
}
|
||
// 是否加入黑名单
|
||
if (joinBlacklist) {
|
||
dataMap.put("sfjrhmd", 0);
|
||
// 归档原因黑名单
|
||
dataMap.put("gdyy", 16);
|
||
} else {
|
||
dataMap.put("sfjrhmd", 1);
|
||
}
|
||
|
||
if (StringUtils.isNotBlank(gdyy)) {
|
||
dataMap.put("gdyy", gdyy);
|
||
dataMap.put("gdxxyy", "");
|
||
}
|
||
|
||
RecruitRecordSet.insertData(dataMap, "uf_jcl_rck");
|
||
refreshRight(uuid, formModeId, applicantId);
|
||
|
||
|
||
// 删除人才库原来的数据
|
||
rs.executeUpdate("delete from uf_jcl_rck where id = ? ", talentPoolId);
|
||
rs.executeUpdate("delete from uf_jcl_rck_dt1 where mainid = ? ", talentPoolId);
|
||
rs.executeUpdate("delete from uf_jcl_rck_dt2 where mainid = ? ", talentPoolId);
|
||
rs.executeUpdate("delete from uf_jcl_rck_dt3 where mainid = ? ", talentPoolId);
|
||
rs.executeUpdate("delete from uf_jcl_rck_dt4 where mainid = ? ", talentPoolId);
|
||
}
|
||
|
||
|
||
/**
|
||
* 权限重构
|
||
*
|
||
* @param uuid UUID
|
||
* @param formModeId 建模ID
|
||
* @param applicantId 应聘者ID
|
||
*/
|
||
private void refreshRight(String uuid, int formModeId, String applicantId) {
|
||
RecordSet rs = new RecordSet();
|
||
rs.executeQuery("select id from uf_jcl_rck where modeuuid='" + uuid + "'");
|
||
if (rs.next()) {
|
||
//建模数据的id
|
||
int bid = Util.getIntValue(rs.getString("id"));
|
||
ModeRightInfo modeRightInfo = new ModeRightInfo();
|
||
modeRightInfo.setNewRight(true);
|
||
//新建的时候添加共享
|
||
modeRightInfo.editModeDataShare(user.getUID(), formModeId, bid);
|
||
|
||
// 插入明细表数据
|
||
rs.executeQuery("select * from uf_jcl_yppc_dt1 where mainid = ? ", applicantId);
|
||
List<List<Object>> insertList = new ArrayList<>();
|
||
while (rs.next()) {
|
||
List<Object> paramList = new ArrayList<>();
|
||
// mainid
|
||
paramList.add(bid);
|
||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("xxmc")));
|
||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("xl")));
|
||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("zy")));
|
||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("kssj")));
|
||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("jssj")));
|
||
insertList.add(paramList);
|
||
}
|
||
for (List<Object> list : insertList) {
|
||
rs.executeUpdate("insert into uf_jcl_rck_dt1 (mainid, xxmc, xl, zy, kssj, jssj) values (?, ?, ?, ?, ?, ?)", list);
|
||
}
|
||
|
||
rs.executeQuery("select * from uf_jcl_yppc_dt2 where mainid = ? ", applicantId);
|
||
insertList = new ArrayList<>();
|
||
while (rs.next()) {
|
||
List<Object> paramList = new ArrayList<>();
|
||
// mainid
|
||
paramList.add(bid);
|
||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("gsmc")));
|
||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("kssj")));
|
||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("jssj")));
|
||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("gw")));
|
||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("gzzz")));
|
||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("sqyxk")));
|
||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("lzyy")));
|
||
insertList.add(paramList);
|
||
}
|
||
for (List<Object> list : insertList) {
|
||
rs.executeUpdate("insert into uf_jcl_rck_dt2 (mainid, gsmc, kssj, jssj, gw, gzzz, sqyxk, lzyy) values (?, ?, ?, ?, ?, ?, ?, ?)", list);
|
||
}
|
||
|
||
rs.executeQuery("select * from uf_jcl_yppc_dt3 where mainid = ? ", applicantId);
|
||
insertList = new ArrayList<>();
|
||
while (rs.next()) {
|
||
List<Object> paramList = new ArrayList<>();
|
||
// mainid
|
||
paramList.add(bid);
|
||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("xmmc")));
|
||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("kssj")));
|
||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("jssj")));
|
||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("drjs")));
|
||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("xmms")));
|
||
insertList.add(paramList);
|
||
}
|
||
for (List<Object> list : insertList) {
|
||
rs.executeUpdate("insert into uf_jcl_rck_dt3 (mainid, xmmc, kssj, jssj, drjs, xmms) values (?, ?, ?, ?, ?, ?)", list);
|
||
}
|
||
|
||
rs.executeQuery("select * from uf_jcl_yppc_dt4 where mainid = ? ", applicantId);
|
||
insertList = new ArrayList<>();
|
||
while (rs.next()) {
|
||
List<Object> paramList = new ArrayList<>();
|
||
// mainid
|
||
paramList.add(bid);
|
||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("yylx")));
|
||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("zwcd")));
|
||
insertList.add(paramList);
|
||
}
|
||
for (List<Object> list : insertList) {
|
||
rs.executeUpdate("insert into uf_jcl_rck_dt4 (mainid, yylx, zwcd) values (?, ?, ?)", list);
|
||
}
|
||
}
|
||
}
|
||
|
||
/**
|
||
* 构建应聘者数据集合
|
||
*
|
||
* @param ocrResumePo
|
||
* @return
|
||
*/
|
||
private RecruitDataMap<Object> buildApplicantMap(OcrResumePo ocrResumePo) {
|
||
RecruitDataMap<Object> insertMap = new RecruitDataMap<>();
|
||
// 姓名
|
||
insertMap.put("xm", ocrResumePo.getXm());
|
||
// 电子邮箱
|
||
insertMap.put("dzyx", ocrResumePo.getYx());
|
||
// 年龄
|
||
insertMap.put("nl", ocrResumePo.getNl());
|
||
// 手机号码
|
||
insertMap.put("sjhm", ocrResumePo.getSjhm());
|
||
// 自我评价
|
||
insertMap.put("zwpj", ocrResumePo.getGrys());
|
||
// 身份证号
|
||
insertMap.put("sfz", ocrResumePo.getSfz());
|
||
// 原始简历
|
||
insertMap.put("ysjl", ocrResumePo.getJlfj());
|
||
// 性别
|
||
insertMap.put("xb", ocrResumePo.getXb());
|
||
// 投递时间
|
||
insertMap.put("tdsj", DateUtil.getDateTime());
|
||
String zt = ApplicationStatusEnum.DISTRIBUTION.getValue();
|
||
// 应聘职位
|
||
//String ypzw = ocrResumePo.getYpzw();
|
||
//if (StringUtils.isNotBlank(ypzw)) {
|
||
// String flowId = PositionCommonInfo.getRecruitFlowId(ypzw);
|
||
// Map<String, String> initialStage = ApplicantCommonInfo.getInitialStage(flowId);
|
||
// if (null != initialStage) {
|
||
// String zpjd = initialStage.get("zpjd");
|
||
// String dqypjd = initialStage.get("jdlx");
|
||
// if (StringUtils.isNotBlank(zpjd) && StringUtils.isNotBlank(dqypjd)) {
|
||
// insertMap.put("ypzw", ypzw);
|
||
// insertMap.put("zplc", flowId);
|
||
// insertMap.put("zpjd", zpjd);
|
||
// insertMap.put("dqypjd", dqypjd);
|
||
// zt = ApplicationStatusEnum.CANDIDATE.getValue();
|
||
// }
|
||
// }
|
||
//}
|
||
// 应聘状态
|
||
insertMap.put("zt", zt);
|
||
return insertMap;
|
||
}
|
||
}
|