generated from dxfeng/secondev-chapanda-feishu
招聘阶段流转提醒
This commit is contained in:
parent
af0d00095a
commit
4423e73124
|
|
@ -95,8 +95,8 @@ public class CheckRepeatResume {
|
|||
* @param param 数据集合
|
||||
* @return 新插入简历的ID
|
||||
*/
|
||||
public int insertResumeMainTable(Map<String, Object> param) {
|
||||
Map<String, Object> map = insertResumeAndReturn(param);
|
||||
public int insertResumeMainTable(int creator, Map<String, Object> param) {
|
||||
Map<String, Object> map = insertResumeAndReturn(creator, param);
|
||||
return Util.getIntValue(Util.null2String(map.get("mainId")));
|
||||
}
|
||||
|
||||
|
|
@ -142,7 +142,7 @@ public class CheckRepeatResume {
|
|||
* @param param 数据集合
|
||||
* @return 简历插入信息
|
||||
*/
|
||||
public synchronized Map<String, Object> insertResumeAndReturn(Map<String, Object> param) {
|
||||
public synchronized Map<String, Object> insertResumeAndReturn(int creator, Map<String, Object> param) {
|
||||
Map<String, Object> returnMap = new HashMap<>();
|
||||
int mainId = -1;
|
||||
String sourceId;
|
||||
|
|
@ -155,6 +155,7 @@ public class CheckRepeatResume {
|
|||
returnMap.put("joinBlackList", joinBlackList);
|
||||
returnMap.put("isUpdate", false);
|
||||
returnMap.put("mainId", mainId);
|
||||
returnMap.put("isSendStep", false);
|
||||
if (joinBlackList) {
|
||||
return returnMap;
|
||||
}
|
||||
|
|
@ -163,8 +164,9 @@ public class CheckRepeatResume {
|
|||
List<Map<String, Object>> repeatResumeList = getRepeatResumeList(name, mobile);
|
||||
if (CollectionUtils.isEmpty(repeatResumeList)) {
|
||||
// 不存在重复数据,直接插入数据库
|
||||
mainId = insertData(param);
|
||||
mainId = insertData(creator, param);
|
||||
returnMap.put("mainId", mainId);
|
||||
returnMap.put("isSendStep", true);
|
||||
return returnMap;
|
||||
}
|
||||
|
||||
|
|
@ -175,15 +177,17 @@ public class CheckRepeatResume {
|
|||
// 当前存在待分配的简历
|
||||
sourceId = Util.null2String(sourceResume.get("id"));
|
||||
//取新简历有值的字段,更新已入库简历没有值的字段,已入库简历有值的字段不做更新,新简历入库并隐藏
|
||||
mainId = updateSourceResume(param, sourceResume);
|
||||
mainId = updateSourceResume(creator, param, sourceResume);
|
||||
returnMap.put("mainId", mainId);
|
||||
returnMap.put("sourceId", sourceId);
|
||||
returnMap.put("isUpdate", true);
|
||||
returnMap.put("isSendStep", false);
|
||||
return returnMap;
|
||||
} else {
|
||||
// 直接入库,不做任何处理
|
||||
mainId = insertData(param);
|
||||
mainId = insertData(creator, param);
|
||||
returnMap.put("mainId", mainId);
|
||||
returnMap.put("isSendStep", true);
|
||||
return returnMap;
|
||||
}
|
||||
} else if (ApplicationStatusEnum.CANDIDATE.getValue().equals(status)) {
|
||||
|
|
@ -196,13 +200,15 @@ public class CheckRepeatResume {
|
|||
}
|
||||
if (hasSamePosition) {
|
||||
// 若有相同职位的数据,新简历直接入库并隐藏
|
||||
mainId = insertHideData(param);
|
||||
mainId = insertHideData(creator, param);
|
||||
returnMap.put("mainId", mainId);
|
||||
returnMap.put("isSendStep", false);
|
||||
return returnMap;
|
||||
} else {
|
||||
// 没有相同职位的数据,新简历直接入库,不做任何处理
|
||||
mainId = insertData(param);
|
||||
mainId = insertData(creator, param);
|
||||
returnMap.put("mainId", mainId);
|
||||
returnMap.put("isSendStep", true);
|
||||
return returnMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -216,14 +222,14 @@ public class CheckRepeatResume {
|
|||
* @param dataMap 数据集合
|
||||
* @return
|
||||
*/
|
||||
private int insertData(Map<String, Object> dataMap) {
|
||||
private int insertData(int creator, Map<String, Object> dataMap) {
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
dataMap.put("modeuuid", uuid);
|
||||
int formModeId = ApplicantCommonInfo.getModeIdByTableName("uf_jcl_yppc");
|
||||
dataMap.put("formmodeid", formModeId);
|
||||
RecruitRecordSet.buildModeInsertFields(dataMap, 1);
|
||||
RecruitRecordSet.buildModeInsertFields(dataMap, creator);
|
||||
RecruitRecordSet.insertData(dataMap, "uf_jcl_yppc");
|
||||
return RecruitRecordSet.refreshRight(uuid, "uf_jcl_yppc", formModeId, 1);
|
||||
return RecruitRecordSet.refreshRight(uuid, "uf_jcl_yppc", formModeId, creator);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -232,11 +238,11 @@ public class CheckRepeatResume {
|
|||
* @param dataMap 数据集合
|
||||
* @return
|
||||
*/
|
||||
private int insertHideData(Map<String, Object> dataMap) {
|
||||
private int insertHideData(int creator, Map<String, Object> dataMap) {
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
dataMap.put("modeuuid", uuid);
|
||||
RecordSet rs = new RecordSet();
|
||||
RecruitRecordSet.buildModeInsertFields(dataMap, 1);
|
||||
RecruitRecordSet.buildModeInsertFields(dataMap, creator);
|
||||
RecruitRecordSet.insertData(dataMap, "uf_jcl_yppc");
|
||||
rs.executeQuery("select id from uf_jcl_yppc where modeuuid='" + uuid + "'");
|
||||
if (rs.next()) {
|
||||
|
|
@ -252,16 +258,16 @@ public class CheckRepeatResume {
|
|||
* @param sourceResume 源简历数据集合
|
||||
* @return
|
||||
*/
|
||||
private int updateSourceResume(Map<String, Object> param, Map<String, Object> sourceResume) {
|
||||
private int updateSourceResume(int creator, Map<String, Object> param, Map<String, Object> sourceResume) {
|
||||
replaceNullValues(param, sourceResume);
|
||||
// 更新投递时间为最新的 by zsy 20240704 待分配的投递时间要根据最新的去更新
|
||||
sourceResume.put("tdsj", DateUtil.getDateTime());
|
||||
// 处理操作人员、操作时间
|
||||
RecruitRecordSet.buildModeUpdateFields(sourceResume, 1);
|
||||
RecruitRecordSet.buildModeUpdateFields(sourceResume, creator);
|
||||
RecruitRecordSet.updateDataById(sourceResume, "uf_jcl_yppc");
|
||||
// 更新数据
|
||||
RecruitRecordSet.buildModeInsertFields(param, 1);
|
||||
return insertHideData(param);
|
||||
RecruitRecordSet.buildModeInsertFields(param, creator);
|
||||
return insertHideData(creator, param);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,264 @@
|
|||
package com.engine.recruit.conn;
|
||||
|
||||
import com.engine.common.service.HrmCommonService;
|
||||
import com.engine.common.service.impl.HrmCommonServiceImpl;
|
||||
import com.engine.recruit.constant.RecruitConstant;
|
||||
import com.engine.recruit.entity.message.PositionField;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.formmode.recruit.modeexpand.util.RecruitModeUtil;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2024/10/16
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class StepMsgCommonInfo {
|
||||
|
||||
/**
|
||||
* 获取提醒人员
|
||||
*
|
||||
* @param applicantId 候选人ID
|
||||
* @param positionId 职位ID
|
||||
* @param flowId 流程ID
|
||||
* @param stepId 当前阶段ID
|
||||
* @param user 当前操作人
|
||||
*/
|
||||
public static void sendMsg(String applicantId, String positionId, String flowId, String stepId, User user) {
|
||||
RecordSet rs = new RecordSet();
|
||||
List<String> ids = new ArrayList<>();
|
||||
boolean useFlowTips = true;
|
||||
String stepName = "";
|
||||
if (StringUtils.isNotBlank(stepId)) {
|
||||
rs.executeQuery("select id,jdmc,hj from uf_jcl_zpjdsz where sfqy = 0 and id = ? ", stepId);
|
||||
} else {
|
||||
rs.executeQuery("select id,jdmc,hj from uf_jcl_zpjdsz where sfqy = 0 and zplc = ? and hj = 0", flowId);
|
||||
}
|
||||
if (rs.next()) {
|
||||
stepId = rs.getString("id");
|
||||
stepName = rs.getString("jdmc");
|
||||
}
|
||||
rs.executeQuery("select qyzt from uf_jcl_step_config where zpzw = ?", positionId);
|
||||
if (rs.next()) {
|
||||
useFlowTips = !"1".equals(rs.getString("qyzt"));
|
||||
}
|
||||
if (!useFlowTips) {
|
||||
// 判断该职位是否设置提醒人员
|
||||
rs.executeQuery("select * from uf_jcl_jdtx where zpzw = ?", positionId);
|
||||
while (rs.next()) {
|
||||
useFlowTips = false;
|
||||
String zpjd = rs.getString("zpjd");
|
||||
if (StringUtils.isNotBlank(zpjd)) {
|
||||
List<String> strings = Arrays.asList(zpjd.split(","));
|
||||
if (strings.contains(stepId)) {
|
||||
ids.add(rs.getString("id"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (useFlowTips) {
|
||||
// 判断是否启用全部配置,未启用直接跳过
|
||||
String qyzt = "";
|
||||
rs.executeQuery("select qyzt from uf_jcl_step_config where zpzw = -1");
|
||||
if (rs.next()) {
|
||||
qyzt = rs.getString("qyzt");
|
||||
}
|
||||
if ("1".equals(qyzt)) {
|
||||
// 查询当前流程的配置
|
||||
rs.executeQuery("select * from uf_jcl_jdtx where zpzw is null and zplc = ?", flowId);
|
||||
while (rs.next()) {
|
||||
String zpjd = rs.getString("zpjd");
|
||||
if (StringUtils.isNotBlank(zpjd)) {
|
||||
List<String> strings = Arrays.asList(zpjd.split(","));
|
||||
if (strings.contains(stepId)) {
|
||||
ids.add(rs.getString("id"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (CollectionUtils.isNotEmpty(ids)) {
|
||||
Set<String> userSet = new HashSet<>();
|
||||
for (String id : ids) {
|
||||
Set<String> receiveUsers = getReceiveUsers(id, positionId);
|
||||
userSet.addAll(receiveUsers);
|
||||
}
|
||||
String applicantName = ApplicantCommonInfo.getApplicantName(applicantId);
|
||||
String applicantPosition = ApplicantCommonInfo.getApplicantPosition(positionId);
|
||||
// 发送消息提醒
|
||||
RecruitModeUtil.messagePush(RecruitConstant.INTERVIEW_MESSAGE_TYPE, "应聘进度通知", "应聘者:" + applicantName + ",应聘职位:" + applicantPosition + ",当前应聘进程已经流转至" + stepName + "阶段,请知悉。", userSet, user.getUID());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前职位、当前设置的提醒人员
|
||||
*
|
||||
* @param jdtxId
|
||||
* @param positionId
|
||||
* @return
|
||||
*/
|
||||
private static Set<String> getReceiveUsers(String jdtxId, String positionId) {
|
||||
Set<String> userSet = new HashSet<>();
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select * from uf_jcl_jdtx where id = ?", jdtxId);
|
||||
if (rs.next()) {
|
||||
// 提醒人员
|
||||
String txry = rs.getString("txry");
|
||||
getUserByUid(txry, userSet);
|
||||
// 提醒分部
|
||||
String txfb = rs.getString("txfb");
|
||||
getUserByCompany(txfb, userSet);
|
||||
// 提醒部门
|
||||
String txbm = rs.getString("txbm");
|
||||
getUserByDepartment(txbm, userSet);
|
||||
// 提醒岗位
|
||||
String txgw = rs.getString("txgw");
|
||||
getUserByJob(txgw, userSet);
|
||||
// 提醒角色
|
||||
String txjs = rs.getString("txjs");
|
||||
getUserByRole(txjs, userSet);
|
||||
String zpzwzd = rs.getString("zpzwzd");
|
||||
// 根据选择的字段,获取需要通知的人员ID
|
||||
dealPositionField(zpzwzd, positionId, userSet);
|
||||
}
|
||||
return userSet;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据选择的招聘职位字段,获取需要通知的人员ID
|
||||
*
|
||||
* @param positionFieldIds
|
||||
* @param positionId
|
||||
* @param userSet
|
||||
*/
|
||||
private static void dealPositionField(String positionFieldIds, String positionId, Set<String> userSet) {
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select * from workflow_billfield where id in(" + positionFieldIds + ")");
|
||||
List<PositionField> fieldList = new ArrayList<>();
|
||||
while (rs.next()) {
|
||||
PositionField build = PositionField.builder()
|
||||
.id(rs.getString("id"))
|
||||
.fieldName(rs.getString("fieldname"))
|
||||
.type(rs.getString("type"))
|
||||
.build();
|
||||
fieldList.add(build);
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(fieldList)) {
|
||||
Map<String, List<PositionField>> collect = fieldList.stream().collect(Collectors.groupingBy(PositionField::getMsgType));
|
||||
List<PositionField> userFieldList = collect.get("user");
|
||||
if (CollectionUtils.isNotEmpty(userFieldList)) {
|
||||
for (PositionField positionField : userFieldList) {
|
||||
String positionFieldValue = getPositionFieldValue(positionField, positionId);
|
||||
getUserByUid(positionFieldValue, userSet);
|
||||
}
|
||||
}
|
||||
List<PositionField> companyFieldList = collect.get("company");
|
||||
if (CollectionUtils.isNotEmpty(companyFieldList)) {
|
||||
for (PositionField positionField : companyFieldList) {
|
||||
String positionFieldValue = getPositionFieldValue(positionField, positionId);
|
||||
getUserByCompany(positionFieldValue, userSet);
|
||||
}
|
||||
}
|
||||
List<PositionField> departmentFieldList = collect.get("department");
|
||||
if (CollectionUtils.isNotEmpty(departmentFieldList)) {
|
||||
for (PositionField positionField : departmentFieldList) {
|
||||
String positionFieldValue = getPositionFieldValue(positionField, positionId);
|
||||
getUserByDepartment(positionFieldValue, userSet);
|
||||
}
|
||||
}
|
||||
List<PositionField> roleFieldList = collect.get("role");
|
||||
if (CollectionUtils.isNotEmpty(roleFieldList)) {
|
||||
for (PositionField positionField : roleFieldList) {
|
||||
String positionFieldValue = getPositionFieldValue(positionField, positionId);
|
||||
getUserByRole(positionFieldValue, userSet);
|
||||
}
|
||||
}
|
||||
List<PositionField> jobFieldList = collect.get("job");
|
||||
if (CollectionUtils.isNotEmpty(jobFieldList)) {
|
||||
for (PositionField positionField : jobFieldList) {
|
||||
String positionFieldValue = getPositionFieldValue(positionField, positionId);
|
||||
getUserByJob(positionFieldValue, userSet);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static void getUserByUid(String userStr, Set<String> userSet) {
|
||||
if (StringUtils.isNotBlank(userStr)) {
|
||||
userSet.addAll(Arrays.asList(userStr.split(",")));
|
||||
}
|
||||
}
|
||||
|
||||
private static void getUserByCompany(String companyStr, Set<String> userSet) {
|
||||
if (StringUtils.isNotBlank(companyStr)) {
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select id from hrmresource where subcompanyid1 in(" + companyStr + ")");
|
||||
while (rs.next()) {
|
||||
userSet.add(rs.getString("id"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void getUserByDepartment(String departmentStr, Set<String> userSet) {
|
||||
if (StringUtils.isNotBlank(departmentStr)) {
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select id from hrmresource where departmentid in(" + departmentStr + ")");
|
||||
while (rs.next()) {
|
||||
userSet.add(rs.getString("id"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void getUserByRole(String roleStr, Set<String> userSet) {
|
||||
if (StringUtils.isNotBlank(roleStr)) {
|
||||
String[] split = roleStr.split(",");
|
||||
for (String roleId : split) {
|
||||
HrmCommonService hrmCommonService = new HrmCommonServiceImpl();
|
||||
String hrmIds = hrmCommonService.getRoleMemberIds(roleId, "0");
|
||||
if (StringUtils.isNotBlank(hrmIds)) {
|
||||
userSet.addAll(Arrays.asList(hrmIds.split(",")));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void getUserByJob(String jobStr, Set<String> userSet) {
|
||||
if (StringUtils.isNotBlank(jobStr)) {
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select id from hrmresource where jobtitle in(" + jobStr + ")");
|
||||
while (rs.next()) {
|
||||
userSet.add(rs.getString("id"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前职位的字段值
|
||||
*
|
||||
* @param positionField 指定字段
|
||||
* @param positionId 招聘职位ID
|
||||
* @return
|
||||
*/
|
||||
private static String getPositionFieldValue(PositionField positionField, String positionId) {
|
||||
RecordSet rs = new RecordSet();
|
||||
String sql = "select " + positionField.getFieldName() + " from uf_jcl_zp_zpzw where id = " + positionId;
|
||||
rs.executeQuery(sql);
|
||||
if (rs.next()) {
|
||||
return rs.getString(positionField.getFieldName());
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
package com.engine.recruit.entity.message;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2024/10/16
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class PositionField {
|
||||
private String id;
|
||||
private String fieldName;
|
||||
private String type;
|
||||
private String msgType;
|
||||
|
||||
public String getMsgType() {
|
||||
String fieldMsgType = "";
|
||||
switch (type) {
|
||||
// 人员
|
||||
case "1":
|
||||
case "17":
|
||||
fieldMsgType = "user";
|
||||
break;
|
||||
// 分部
|
||||
case "164":
|
||||
case "169":
|
||||
case "170":
|
||||
case "194":
|
||||
fieldMsgType = "company";
|
||||
break;
|
||||
// 部门
|
||||
case "4":
|
||||
case "57":
|
||||
case "167":
|
||||
case "168":
|
||||
fieldMsgType = "department";
|
||||
break;
|
||||
// 角色
|
||||
case "267":
|
||||
case "65":
|
||||
fieldMsgType = "role";
|
||||
break;
|
||||
// 岗位
|
||||
case "24":
|
||||
case "278":
|
||||
fieldMsgType = "job";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return fieldMsgType;
|
||||
}
|
||||
}
|
||||
|
|
@ -58,6 +58,8 @@ public class QllResumePo {
|
|||
private String lyqd;
|
||||
private String gjrsjh;
|
||||
|
||||
private int userId;
|
||||
|
||||
|
||||
/**
|
||||
* 解析JSON数组,下载文件并入库
|
||||
|
|
@ -82,7 +84,7 @@ public class QllResumePo {
|
|||
if (StringUtils.isNotBlank(disposition)) {
|
||||
InputStream inputStream = response.bodyStream();
|
||||
int imageFileId = RecruitModeUtil.generateImageFileId(inputStream, name);
|
||||
int docId = RecruitModeUtil.createDocId(Convert.toInt(RecruitConstant.APPLICANTS_RESUMES_CATEGORY), imageFileId, new User(1));
|
||||
int docId = RecruitModeUtil.createDocId(Convert.toInt(RecruitConstant.APPLICANTS_RESUMES_CATEGORY), imageFileId, new User(userId));
|
||||
resumeId = String.valueOf(docId);
|
||||
} else {
|
||||
baseBean.writeLog("千里聆附件下载失败" + response.body());
|
||||
|
|
|
|||
|
|
@ -184,6 +184,11 @@ public class ApplicantResumeServiceImpl extends Service implements ApplicantResu
|
|||
} else {
|
||||
throw new CustomizeRunTimeException("转移阶段失败");
|
||||
}
|
||||
rs.executeQuery("select ypzw,zplc from uf_jcl_yppc where id = ?", billid);
|
||||
if(rs.next()) {
|
||||
StepMsgCommonInfo.sendMsg(String.valueOf(billid), Util.null2String(rs.getString("ypzw")), Util.null2String(rs.getString("zplc")), dqypjd, user);
|
||||
}
|
||||
|
||||
|
||||
otherParam.put("targetStep", ApplicantCommonInfo.getCurrentStep(billid).getDescription());
|
||||
|
||||
|
|
@ -214,6 +219,7 @@ public class ApplicantResumeServiceImpl extends Service implements ApplicantResu
|
|||
dqypjd = initialStage.get("jdlx");
|
||||
}
|
||||
rs.executeUpdate("update uf_jcl_yppc set ypzw = ? , zplc = ? , zpjd = ? , dqypjd = ?, zt = 1 where id = ?", ypzw, flowId, zpjd, dqypjd, billid);
|
||||
StepMsgCommonInfo.sendMsg(billid, Util.null2String(ypzw), Util.null2String(flowId), Util.null2String(zpjd), user);
|
||||
} else {
|
||||
String ids = Util.null2String(params.get("ids"));
|
||||
// 校验所选
|
||||
|
|
@ -238,6 +244,9 @@ public class ApplicantResumeServiceImpl extends Service implements ApplicantResu
|
|||
throw new CustomizeRunTimeException("当前应聘阶段获取失败");
|
||||
}
|
||||
rs.executeUpdate("update uf_jcl_yppc set ypzw = ? , zplc = ? , zpjd = ? , dqypjd = ?, zt = 1 where id in(" + ids + ")", ypzw, zplc, zpjd, dqypjd);
|
||||
for (String s : ids.split(",")) {
|
||||
StepMsgCommonInfo.sendMsg(s, Util.null2String(ypzw), Util.null2String(zplc), Util.null2String(zpjd), user);
|
||||
}
|
||||
}
|
||||
returnMap.put("msg", "操作成功");
|
||||
} else if (ApplicantOperateEnum.ARCHIVE.getOperateType().equals(operateType)) {
|
||||
|
|
@ -334,6 +343,9 @@ public class ApplicantResumeServiceImpl extends Service implements ApplicantResu
|
|||
//新建的时候添加共享
|
||||
modeRightInfo.editModeDataShare(user.getUID(), formModeId, targetId);
|
||||
|
||||
// 阶段提醒
|
||||
StepMsgCommonInfo.sendMsg(String.valueOf(targetId), Util.null2String(ypzw), Util.null2String(flowId), Util.null2String(mainDataMap.get("zpjd")), user);
|
||||
|
||||
// 复制明细表数据
|
||||
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);
|
||||
|
|
@ -646,7 +658,7 @@ public class ApplicantResumeServiceImpl extends Service implements ApplicantResu
|
|||
}
|
||||
|
||||
// 同步设置的标签
|
||||
List<Map<String, Object>> modeTabList = getModeTabs(applicantId, rs);
|
||||
List<Map<String, Object>> modeTabList = getModeTabs(applicantId, rs);
|
||||
String dateTime = DateUtil.getFullDate();
|
||||
String[] dateSplit = dateTime.split(" ");
|
||||
String createdate = dateSplit[0];
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.recruit.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.recruit.conn.StepMsgCommonInfo;
|
||||
import com.engine.recruit.entity.recruitflow.po.RecruitStepPo;
|
||||
import com.engine.recruit.exception.CustomizeRunTimeException;
|
||||
import com.engine.recruit.service.RecruitButtonService;
|
||||
|
|
@ -28,13 +29,15 @@ public class NextStageServiceImpl extends Service implements RecruitButtonServic
|
|||
String billId = Util.null2String(params.get("billId"));
|
||||
// 招聘阶段ID
|
||||
String stageId = null;
|
||||
String ypzw = "";
|
||||
// 招聘流程ID
|
||||
int recruitFlowId = -1;
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select zplc,zpjd from uf_jcl_yppc where id = ?", billId);
|
||||
rs.executeQuery("select ypzw,zplc,zpjd from uf_jcl_yppc where id = ?", billId);
|
||||
if (rs.next()) {
|
||||
recruitFlowId = rs.getInt("zplc");
|
||||
stageId = rs.getString("zpjd");
|
||||
ypzw = rs.getString("ypzw");
|
||||
}
|
||||
if (-1 == recruitFlowId) {
|
||||
throw new CustomizeRunTimeException("未设置对应招聘流程");
|
||||
|
|
@ -70,6 +73,9 @@ public class NextStageServiceImpl extends Service implements RecruitButtonServic
|
|||
rs.executeUpdate("update uf_jcl_yppc set zpjd = ?,dqypjd = ? where id = ?", target, jdlx, billId);
|
||||
}
|
||||
|
||||
// 阶段提醒
|
||||
StepMsgCommonInfo.sendMsg(billId, ypzw, String.valueOf(recruitFlowId), String.valueOf(target), user);
|
||||
|
||||
|
||||
return returnMap;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ public class ResumeRecognitionServiceImpl extends Service implements ResumeRecog
|
|||
|
||||
// 判断简历信息
|
||||
CheckRepeatResume instance = CheckRepeatResume.getInstance();
|
||||
Map<String, Object> map = instance.insertResumeAndReturn(resumeData);
|
||||
Map<String, Object> map = instance.insertResumeAndReturn(user.getUID(), resumeData);
|
||||
String mainId = Util.null2String(map.get("mainId"));
|
||||
String sourceId = Util.null2String(map.get("sourceId"));
|
||||
returnMap.put("mainId", mainId);
|
||||
|
|
@ -148,14 +148,13 @@ public class ResumeRecognitionServiceImpl extends Service implements ResumeRecog
|
|||
if ("fail".equals(status)) {
|
||||
throw new CustomizeRunTimeException("调用千里聆接口失败,失败原因:" + resultall.getString("info"));
|
||||
}
|
||||
baseBean.writeLog("千里聆OCR解析数据:" + resultall);
|
||||
JSONObject result = resultall.getJSONObject("result");
|
||||
baseBean.writeLog("千里聆OCR解析数据:" + result);
|
||||
Map<String, Object> dataMap = parseQllJsonToMapV2(result, isCard);
|
||||
returnMap.put("data", dataMap);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 千里聆解析字段内容处理(V2)
|
||||
*
|
||||
|
|
|
|||
|
|
@ -62,6 +62,9 @@ public class TalentPoolServiceImpl extends Service implements TalentPoolService
|
|||
RecruitRecordSet.insertData(insertDataMap, "uf_jcl_yppc");
|
||||
int pcId = RecruitRecordSet.refreshRight(uuid, "uf_jcl_yppc", formModeId, user.getUID());
|
||||
|
||||
// 阶段提醒
|
||||
StepMsgCommonInfo.sendMsg(String.valueOf(pcId), Util.null2String(ypzw), Util.null2String(insertDataMap.get("zplc")), Util.null2String(insertDataMap.get("zpjd")), user);
|
||||
|
||||
// 创建明细表数据
|
||||
rs.executeUpdate("insert into uf_jcl_yppc_dt1 (mainid,xxmc,xl,zy,kssj,jssj) select ?,xxmc,xl,zy,kssj,jssj from uf_jcl_rck_dt1 where mainid = ?", pcId, rcId);
|
||||
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_rck_dt2 where mainid = ?", pcId, rcId);
|
||||
|
|
|
|||
|
|
@ -2,10 +2,7 @@ package com.engine.recruit.thread;
|
|||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.engine.recruit.conn.ApplicantCommonInfo;
|
||||
import com.engine.recruit.conn.CheckRepeatResume;
|
||||
import com.engine.recruit.conn.PositionCommonInfo;
|
||||
import com.engine.recruit.conn.RecruitDataMap;
|
||||
import com.engine.recruit.conn.*;
|
||||
import com.engine.recruit.constant.RecruitConstant;
|
||||
import com.engine.recruit.entity.position.PositionSdkInstance;
|
||||
import com.engine.recruit.enums.ApplicationStatusEnum;
|
||||
|
|
@ -114,14 +111,19 @@ public class SdkResumeSavedThread extends LocalRunnable {
|
|||
|
||||
// 判断简历是否重复,插入主表
|
||||
CheckRepeatResume instance = CheckRepeatResume.getInstance();
|
||||
Map<String, Object> checkMap = instance.insertResumeAndReturn(params);
|
||||
Map<String, Object> checkMap = instance.insertResumeAndReturn(1, params);
|
||||
String mainId = Util.null2String(checkMap.get("mainId"));
|
||||
String sourceId = Util.null2String(checkMap.get("sourceId"));
|
||||
boolean isSendStep = (boolean) checkMap.get("isSendStep");
|
||||
|
||||
Thread.sleep(1000);
|
||||
if ("-1".equals(mainId)) {
|
||||
return;
|
||||
}
|
||||
if (isSendStep) {
|
||||
// 发送阶段提醒
|
||||
StepMsgCommonInfo.sendMsg(String.valueOf(mainId), Util.null2String(params.get("ypzw")), Util.null2String(params.get("zplc")), Util.null2String(params.get("zpjd")), user);
|
||||
}
|
||||
|
||||
// 插入明细表数据
|
||||
List<RecruitDataMap<Object>> jyjl = new ArrayList<>();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
package weaver.formmode.recruit.customsearch;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.formmode.customjavacode.AbstractCustomSqlConditionJavaCode;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2024/10/15
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class FlowStepSearchTemplate extends AbstractCustomSqlConditionJavaCode {
|
||||
@Override
|
||||
public String generateSqlCondition(Map<String, Object> param) throws Exception {
|
||||
// 只展示启用的数据
|
||||
String whereSql = "";
|
||||
Map<String, String> extensionParam = (Map<String, String>) param.get("extensionParam");
|
||||
String currenttime = Util.null2String(extensionParam.get("currenttime"));
|
||||
String zplc = Util.null2String(extensionParam.get("zplc"));
|
||||
if (StringUtils.isNotBlank(currenttime)) {
|
||||
String s = extensionParam.get("zplc_" + currenttime);
|
||||
zplc = StringUtils.isNotBlank(s) ? s : zplc;
|
||||
}
|
||||
|
||||
if (StringUtils.isBlank(zplc)) {
|
||||
zplc = "-1";
|
||||
}
|
||||
whereSql += " t1.zplc = '" + zplc + "' ";
|
||||
return whereSql;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package weaver.formmode.recruit.customsearch;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.formmode.customjavacode.AbstractCustomSqlConditionJavaCode;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 招聘流程,浏览按钮条件
|
||||
*
|
||||
* @author:dxfeng
|
||||
* @createTime: 2024/10/15
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class RecruitFlowSearchTemplate extends AbstractCustomSqlConditionJavaCode {
|
||||
@Override
|
||||
public String generateSqlCondition(Map<String, Object> param) {
|
||||
// 只展示启用的数据
|
||||
String whereSql = " t1.lczt = 0 ";
|
||||
Map<String, String> extensionParam = (Map<String, String>) param.get("extensionParam");
|
||||
String flowId = Util.null2String(extensionParam.get("flowId"));
|
||||
if (StringUtils.isNotBlank(flowId)) {
|
||||
whereSql += " and t1.id = '" + flowId + "' ";
|
||||
}
|
||||
return whereSql;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package weaver.formmode.recruit.customsearch;
|
||||
|
||||
import weaver.formmode.customjavacode.AbstractCustomSqlConditionJavaCode;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2024/10/19
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class StepMsgSearchTemplate extends AbstractCustomSqlConditionJavaCode {
|
||||
@Override
|
||||
public String generateSqlCondition(Map<String, Object> param) {
|
||||
|
||||
String isfromTab = Util.null2String(param.get("isfromTab"));
|
||||
String istabinline = Util.null2String(param.get("istabinline"));
|
||||
// 只展示启用的数据
|
||||
String whereSql = " zpzw is null ";
|
||||
if ("1".equals(isfromTab) && "1".equals(istabinline)) {
|
||||
whereSql = "";
|
||||
}
|
||||
return whereSql;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -64,6 +64,11 @@ public class CreatRckApplicantExpand extends AbstractModeExpandJavaCodeNew {
|
|||
RecruitRecordSet.updateDataById(insertDataMap, "uf_jcl_yppc");
|
||||
int pcId = RecruitRecordSet.refreshRight(uuid, "uf_jcl_yppc", formModeId, user.getUID());
|
||||
|
||||
if (pcId > 0) {
|
||||
// 阶段提醒
|
||||
StepMsgCommonInfo.sendMsg(String.valueOf(pcId), Util.null2String(insertDataMap.get("ypzw")), Util.null2String(insertDataMap.get("zplc")), Util.null2String(insertDataMap.get("zpjd")), user);
|
||||
}
|
||||
|
||||
// 创建明细表数据
|
||||
rs.executeUpdate("insert into uf_jcl_yppc_dt1 (mainid,xxmc,xl,zy,kssj,jssj) select ?,xxmc,xl,zy,kssj,jssj from uf_jcl_rck_dt1 where mainid = ?", pcId, rcId);
|
||||
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_rck_dt2 where mainid = ?", pcId, rcId);
|
||||
|
|
@ -73,7 +78,7 @@ public class CreatRckApplicantExpand extends AbstractModeExpandJavaCodeNew {
|
|||
}
|
||||
} catch (Exception e) {
|
||||
new BaseBean().writeLog(e);
|
||||
result.put("errmsg", "自定义出错信息");
|
||||
result.put("errmsg", e.getMessage());
|
||||
result.put("flag", "false");
|
||||
}
|
||||
return result;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,75 @@
|
|||
package weaver.formmode.recruit.modeexpand.departmentscreening;
|
||||
|
||||
import com.engine.recruit.constant.RecruitConstant;
|
||||
import com.weaver.formmodel.data.model.Formfield;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
|
||||
import weaver.formmode.recruit.modeexpand.util.RecruitModeUtil;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
import weaver.soa.workflow.request.MainTableInfo;
|
||||
import weaver.soa.workflow.request.Property;
|
||||
import weaver.soa.workflow.request.RequestInfo;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2024/10/12
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class EditScreenExpand extends AbstractModeExpandJavaCodeNew {
|
||||
@Override
|
||||
public Map<String, String> doModeExpand(Map<String, Object> params) {
|
||||
Map<String, String> result = new HashMap<>(2);
|
||||
try {
|
||||
//数据id
|
||||
int billId;
|
||||
//模块id
|
||||
int modeId;
|
||||
RequestInfo requestInfo = (RequestInfo) params.get("RequestInfo");
|
||||
User user = (User) params.get("user");
|
||||
if (requestInfo != null) {
|
||||
billId = Util.getIntValue(requestInfo.getRequestid());
|
||||
modeId = Util.getIntValue(requestInfo.getWorkflowid());
|
||||
if (billId > 0 && modeId > 0) {
|
||||
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
|
||||
Property[] properties = mainTableInfo.getProperty();
|
||||
Map<String, Object> mainDataMap = new HashMap<>();
|
||||
for (Property property : properties) {
|
||||
mainDataMap.put(property.getName(), property.getValue());
|
||||
}
|
||||
|
||||
// 发送消息提醒
|
||||
String messageType = RecruitConstant.SCREENING_MESSAGE_TYPE;
|
||||
String messageTitle = "筛选反馈提醒";
|
||||
String msgContent = "$fkr$已经提交了筛选反馈<br/>" +
|
||||
"应聘者:$ypz$;应聘职位:$ypzw$<br/>" +
|
||||
"筛选结果:jg";
|
||||
// 消息接收人
|
||||
Set<String> userIdSet = new HashSet<>();
|
||||
// 发送给创建人
|
||||
userIdSet.add(requestInfo.getCreatorid());
|
||||
|
||||
if (CollectionUtils.isNotEmpty(userIdSet)) {
|
||||
// 消息发送
|
||||
List<Formfield> fieldList = RecruitModeUtil.getFieldList("uf_jcl_bmsxfk");
|
||||
Map<String, Formfield> fieldMap = fieldList.stream().collect(Collectors.toMap(Formfield::getFieldname, item -> item, (k1, k2) -> k1));
|
||||
String msgStr = RecruitModeUtil.getMsgReplaceStr(msgContent, fieldMap, mainDataMap);
|
||||
RecruitModeUtil.messagePush(messageType, messageTitle, msgStr, userIdSet, user.getUID());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
new BaseBean().writeLog(e);
|
||||
result.put("errmsg", "自定义出错信息");
|
||||
result.put("flag", "false");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
@ -12,6 +12,7 @@ import weaver.common.DateUtil;
|
|||
import weaver.conn.RecordSet;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
@ -35,16 +36,36 @@ public class ExtractQllResumeThread extends Thread {
|
|||
for (Map<String, Object> map : mapList) {
|
||||
QllResumePo qllResumePo = RecruitUtil.parseMap2Object(map, QllResumePo.class);
|
||||
try {
|
||||
String email = "";
|
||||
rs.executeQuery("select lyyx from uf_jcl_jlzjb where id = ? ", qllResumePo.getId());
|
||||
if (rs.next()) {
|
||||
email = rs.getString("lyyx");
|
||||
}
|
||||
int creator = getCreator(rs, qllResumePo.getGjrsjh(), email);
|
||||
qllResumePo.setUserId(creator);
|
||||
baseBean.writeLog("千里聆简历解析开始,中间表ID=【" + qllResumePo.getId() + "】");
|
||||
RecruitDataMap<Object> dataMap = buildApplicantMap(qllResumePo);
|
||||
baseBean.writeLog("千里聆简历主表数据解析完成==" + JSON.toJSONString(dataMap));
|
||||
// 校验简历信息、并插入
|
||||
CheckRepeatResume instance = CheckRepeatResume.getInstance();
|
||||
Map<String, Object> checkMap = instance.insertResumeAndReturn(dataMap);
|
||||
Map<String, Object> checkMap = instance.insertResumeAndReturn(creator, dataMap);
|
||||
|
||||
String mainId = Util.null2String(checkMap.get("mainId"));
|
||||
String sourceId = Util.null2String(checkMap.get("sourceId"));
|
||||
baseBean.writeLog("千里聆简历主表数据插入完成,mainId==【" + mainId + "】,sourceId==【" + sourceId + "】");
|
||||
|
||||
boolean isSendStep = (boolean) checkMap.get("isSendStep");
|
||||
|
||||
Thread.sleep(1000);
|
||||
if ("-1".equals(mainId)) {
|
||||
return;
|
||||
}
|
||||
if (isSendStep) {
|
||||
// 发送阶段提醒
|
||||
User user = new User(creator);
|
||||
StepMsgCommonInfo.sendMsg(String.valueOf(mainId), Util.null2String(dataMap.get("ypzw")), Util.null2String(dataMap.get("zplc")), Util.null2String(dataMap.get("zpjd")), user);
|
||||
}
|
||||
|
||||
// 数据写入完成后,更新抽取状态为新插入的数据ID
|
||||
rs.executeUpdate("update uf_jcl_jlzjb set cqzt = 1 ,mainid = ? ,sourceid = ? where id = ? ", Convert.toInt(mainId), Convert.toInt(sourceId), qllResumePo.getId());
|
||||
|
||||
|
|
@ -120,4 +141,23 @@ public class ExtractQllResumeThread extends Thread {
|
|||
}
|
||||
|
||||
|
||||
private int getCreator(RecordSet rs, String phone, String email) {
|
||||
int uid = 1;
|
||||
if (StringUtils.isNotBlank(phone)) {
|
||||
rs.executeQuery("select id from hrmresource where mobile = ?", phone);
|
||||
if (rs.next()) {
|
||||
uid = Math.max(uid, rs.getInt("id"));
|
||||
}
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(email)) {
|
||||
rs.executeQuery("select id from hrmresource where email = ?", email);
|
||||
if (rs.next()) {
|
||||
uid = Math.max(uid, rs.getInt("id"));
|
||||
}
|
||||
}
|
||||
|
||||
return uid;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue