diff --git a/src/com/customization/recruit/GetRecruitResumeProxyWithCmd.java b/src/com/customization/recruit/GetRecruitResumeProxyWithCmd.java new file mode 100644 index 0000000..b2a7724 --- /dev/null +++ b/src/com/customization/recruit/GetRecruitResumeProxyWithCmd.java @@ -0,0 +1,30 @@ +//package com.customization.recruit; +// +//import com.engine.core.cfg.annotation.CommandDynamicProxy; +//import com.engine.core.interceptor.AbstractCommandProxy; +//import com.engine.core.interceptor.Command; +//import com.engine.cube.cmd.restfulinterface.GetModeDataPageList; +//import weaver.hrm.User; +// +//import java.util.HashMap; +//import java.util.Map; +// +///** +// * @author:dxfeng +// * @createTime: 2024/10/18 +// * @version: 1.0 +// */ +//@CommandDynamicProxy(target = GetModeDataPageList.class, desc = "代理cmd") +//public class GetRecruitResumeProxyWithCmd extends AbstractCommandProxy> { +// @Override +// public Map execute(Command> command) { +// GetModeDataPageList cmd = (GetModeDataPageList) command; +// Map params = cmd.getParams(); +// User user = cmd.getUser(); +// Map map = nextExecute(command); +// // 执行原有的逻辑 +// Map result = new HashMap<>(); +// result.put("qnmd","哈哈哈哈哈哈哈哈红红火火恍恍惚惚哈哈哈哈哈") +// return result; +// } +//} diff --git a/src/com/engine/recruit/conn/CheckRepeatResume.java b/src/com/engine/recruit/conn/CheckRepeatResume.java index fe3ee68..cb36d35 100644 --- a/src/com/engine/recruit/conn/CheckRepeatResume.java +++ b/src/com/engine/recruit/conn/CheckRepeatResume.java @@ -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; } @@ -165,6 +166,7 @@ public class CheckRepeatResume { // 不存在重复数据,直接插入数据库 mainId = insertData(creator, param); returnMap.put("mainId", mainId); + returnMap.put("isSendStep", true); return returnMap; } @@ -179,11 +181,13 @@ public class CheckRepeatResume { returnMap.put("mainId", mainId); returnMap.put("sourceId", sourceId); returnMap.put("isUpdate", true); + returnMap.put("isSendStep", false); return returnMap; } else { // 直接入库,不做任何处理 mainId = insertData(creator, param); returnMap.put("mainId", mainId); + returnMap.put("isSendStep", true); return returnMap; } } else if (ApplicationStatusEnum.CANDIDATE.getValue().equals(status)) { @@ -198,11 +202,13 @@ public class CheckRepeatResume { // 若有相同职位的数据,新简历直接入库并隐藏 mainId = insertHideData(creator, param); returnMap.put("mainId", mainId); + returnMap.put("isSendStep", false); return returnMap; } else { // 没有相同职位的数据,新简历直接入库,不做任何处理 mainId = insertData(creator, param); returnMap.put("mainId", mainId); + returnMap.put("isSendStep", true); return returnMap; } } diff --git a/src/com/engine/recruit/conn/StepMsgCommonInfo.java b/src/com/engine/recruit/conn/StepMsgCommonInfo.java new file mode 100644 index 0000000..d074b65 --- /dev/null +++ b/src/com/engine/recruit/conn/StepMsgCommonInfo.java @@ -0,0 +1,254 @@ +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 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 * from uf_jcl_jdtx where zpzw = ?", positionId); + while (rs.next()) { + useFlowTips = false; + String zpjd = rs.getString("zpjd"); + if (StringUtils.isNotBlank(zpjd)) { + List strings = Arrays.asList(zpjd.split(",")); + if (strings.contains(stepId)) { + ids.add(rs.getString("id")); + } + } + } + + if (useFlowTips) { + // 判断是否启用全部配置,未启用直接跳过 + String stepReminder = RecruitConstant.getRecruitPropValue("ENABLE_STEP_REMINDER"); + if ("true".equals(stepReminder)) { + // 查询当前流程的配置 + 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 strings = Arrays.asList(zpjd.split(",")); + if (strings.contains(stepId)) { + ids.add(rs.getString("id")); + } + } + } + } + } + + if (CollectionUtils.isNotEmpty(ids)) { + Set userSet = new HashSet<>(); + for (String id : ids) { + Set receiveUsers = getReceiveUsers(id, positionId); + userSet.addAll(receiveUsers); + } + String applicantName = ApplicantCommonInfo.getApplicantName(applicantId); + String applicantPosition = ApplicantCommonInfo.getApplicantPosition(positionId); + //TODO 发送消息提醒 + RecruitModeUtil.messagePush(RecruitConstant.INTERVIEW_MESSAGE_TYPE, "应聘进度通知", "应聘者:" + applicantName + ",应聘职位:" + applicantPosition + ",当前应聘进程已经流转至" + stepName + "阶段,请知悉。", userSet, user.getUID()); + } + + } + + /** + * 获取当前职位、当前设置的提醒人员 + * + * @param jdtxId + * @param positionId + * @return + */ + private static Set getReceiveUsers(String jdtxId, String positionId) { + Set 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 userSet) { + RecordSet rs = new RecordSet(); + rs.executeQuery("select * from workflow_billfield where id in(" + positionFieldIds + ")"); + List 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> collect = fieldList.stream().collect(Collectors.groupingBy(PositionField::getMsgType)); + List userFieldList = collect.get("user"); + if (CollectionUtils.isNotEmpty(userFieldList)) { + for (PositionField positionField : userFieldList) { + String positionFieldValue = getPositionFieldValue(positionField, positionId); + getUserByUid(positionFieldValue, userSet); + } + } + List companyFieldList = collect.get("company"); + if (CollectionUtils.isNotEmpty(companyFieldList)) { + for (PositionField positionField : companyFieldList) { + String positionFieldValue = getPositionFieldValue(positionField, positionId); + getUserByCompany(positionFieldValue, userSet); + } + } + List departmentFieldList = collect.get("department"); + if (CollectionUtils.isNotEmpty(departmentFieldList)) { + for (PositionField positionField : departmentFieldList) { + String positionFieldValue = getPositionFieldValue(positionField, positionId); + getUserByDepartment(positionFieldValue, userSet); + } + } + List roleFieldList = collect.get("role"); + if (CollectionUtils.isNotEmpty(roleFieldList)) { + for (PositionField positionField : roleFieldList) { + String positionFieldValue = getPositionFieldValue(positionField, positionId); + getUserByRole(positionFieldValue, userSet); + } + } + List 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 userSet) { + if (StringUtils.isNotBlank(userStr)) { + userSet.addAll(Arrays.asList(userStr.split(","))); + } + } + + private static void getUserByCompany(String companyStr, Set 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 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 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 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 ""; + } + } + + +} diff --git a/src/com/engine/recruit/entity/message/PositionField.java b/src/com/engine/recruit/entity/message/PositionField.java new file mode 100644 index 0000000..e11034c --- /dev/null +++ b/src/com/engine/recruit/entity/message/PositionField.java @@ -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; + } +} diff --git a/src/com/engine/recruit/service/impl/ApplicantResumeServiceImpl.java b/src/com/engine/recruit/service/impl/ApplicantResumeServiceImpl.java index ce2d5b9..9b6cc60 100644 --- a/src/com/engine/recruit/service/impl/ApplicantResumeServiceImpl.java +++ b/src/com/engine/recruit/service/impl/ApplicantResumeServiceImpl.java @@ -177,6 +177,7 @@ public class ApplicantResumeServiceImpl extends Service implements ApplicantResu returnMap.put("msg", "操作成功"); } else if (ApplicantOperateEnum.TRANSFER.getOperateType().equals(operateType)) { + // TODO // 转移阶段 String dqypjd = Util.null2String(params.get("dqypjd")); String billid = Util.null2String(params.get("billid")); @@ -191,6 +192,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()); @@ -221,6 +227,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")); // 校验所选 @@ -245,6 +252,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)) { @@ -341,6 +351,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); @@ -405,7 +418,7 @@ public class ApplicantResumeServiceImpl extends Service implements ApplicantResu } catch (Exception e) { rs.writeLog("简历头像转换失败", e); } - }else { + } else { resumeCardInfo.setImage("/images/recruit/applicant.png"); } resumeCardInfo.setJobTitle(ApplicantCommonInfo.getApplicantPosition(map.getString("ypzw"))); diff --git a/src/com/engine/recruit/service/impl/NextStageServiceImpl.java b/src/com/engine/recruit/service/impl/NextStageServiceImpl.java index 88b2408..024f604 100644 --- a/src/com/engine/recruit/service/impl/NextStageServiceImpl.java +++ b/src/com/engine/recruit/service/impl/NextStageServiceImpl.java @@ -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); } + // TODO + StepMsgCommonInfo.sendMsg(billId, ypzw, String.valueOf(recruitFlowId), String.valueOf(target), user); + return returnMap; } diff --git a/src/com/engine/recruit/service/impl/TalentPoolServiceImpl.java b/src/com/engine/recruit/service/impl/TalentPoolServiceImpl.java index 511acb3..7c9e5b3 100644 --- a/src/com/engine/recruit/service/impl/TalentPoolServiceImpl.java +++ b/src/com/engine/recruit/service/impl/TalentPoolServiceImpl.java @@ -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); diff --git a/src/com/engine/recruit/thread/SdkResumeSavedThread.java b/src/com/engine/recruit/thread/SdkResumeSavedThread.java index d17e12d..69c47da 100644 --- a/src/com/engine/recruit/thread/SdkResumeSavedThread.java +++ b/src/com/engine/recruit/thread/SdkResumeSavedThread.java @@ -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; @@ -117,11 +114,16 @@ public class SdkResumeSavedThread extends LocalRunnable { Map 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> jyjl = new ArrayList<>(); diff --git a/src/weaver/formmode/recruit/customsearch/FlowStepSearchTemplate.java b/src/weaver/formmode/recruit/customsearch/FlowStepSearchTemplate.java new file mode 100644 index 0000000..519bf5f --- /dev/null +++ b/src/weaver/formmode/recruit/customsearch/FlowStepSearchTemplate.java @@ -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 param) throws Exception { + // 只展示启用的数据 + String whereSql = ""; + Map extensionParam = (Map) 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; + } +} diff --git a/src/weaver/formmode/recruit/customsearch/RecruitFlowSearchTemplate.java b/src/weaver/formmode/recruit/customsearch/RecruitFlowSearchTemplate.java new file mode 100644 index 0000000..8a1bdc7 --- /dev/null +++ b/src/weaver/formmode/recruit/customsearch/RecruitFlowSearchTemplate.java @@ -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 param) { + // 只展示启用的数据 + String whereSql = " t1.lczt = 0 "; + Map extensionParam = (Map) param.get("extensionParam"); + String flowId = Util.null2String(extensionParam.get("flowId")); + if (StringUtils.isNotBlank(flowId)) { + whereSql += " and t1.id = '" + flowId + "' "; + } + return whereSql; + } +} diff --git a/src/weaver/formmode/recruit/customsearch/StepMsgSearchTemplate.java b/src/weaver/formmode/recruit/customsearch/StepMsgSearchTemplate.java new file mode 100644 index 0000000..21ae1ba --- /dev/null +++ b/src/weaver/formmode/recruit/customsearch/StepMsgSearchTemplate.java @@ -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 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; + } + +} diff --git a/src/weaver/formmode/recruit/modeexpand/applicant/CreatRckApplicantExpand.java b/src/weaver/formmode/recruit/modeexpand/applicant/CreatRckApplicantExpand.java index bc6c927..20626c0 100644 --- a/src/weaver/formmode/recruit/modeexpand/applicant/CreatRckApplicantExpand.java +++ b/src/weaver/formmode/recruit/modeexpand/applicant/CreatRckApplicantExpand.java @@ -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; diff --git a/src/weaver/formmode/recruit/modeexpand/departmentscreening/EditScreenExpand.java b/src/weaver/formmode/recruit/modeexpand/departmentscreening/EditScreenExpand.java new file mode 100644 index 0000000..7fc68c0 --- /dev/null +++ b/src/weaver/formmode/recruit/modeexpand/departmentscreening/EditScreenExpand.java @@ -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 doModeExpand(Map params) { + Map 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 mainDataMap = new HashMap<>(); + for (Property property : properties) { + mainDataMap.put(property.getName(), property.getValue()); + } + + // 发送消息提醒 + String messageType = RecruitConstant.SCREENING_MESSAGE_TYPE; + String messageTitle = "筛选反馈提醒"; + String msgContent = "$fkr$已经提交了筛选反馈
" + + "应聘者:$ypz$;应聘职位:$ypzw$
" + + "筛选结果:jg"; + // 消息接收人 + Set userIdSet = new HashSet<>(); + // 发送给创建人 + userIdSet.add(requestInfo.getCreatorid()); + + if (CollectionUtils.isNotEmpty(userIdSet)) { + // 消息发送 + List fieldList = RecruitModeUtil.getFieldList("uf_jcl_bmsxfk"); + Map 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; + } +} diff --git a/src/weaver/formmode/recruit/modeexpand/interview/EditInterviewEvaluateExpand.java b/src/weaver/formmode/recruit/modeexpand/interview/EditInterviewEvaluateExpand.java index 8be61b3..1b6ede7 100644 --- a/src/weaver/formmode/recruit/modeexpand/interview/EditInterviewEvaluateExpand.java +++ b/src/weaver/formmode/recruit/modeexpand/interview/EditInterviewEvaluateExpand.java @@ -33,6 +33,7 @@ public class EditInterviewEvaluateExpand extends AbstractModeExpandJavaCodeNew { billId = Util.getIntValue(requestInfo.getRequestid()); modeId = Util.getIntValue(requestInfo.getWorkflowid()); if (billId > 0 && modeId > 0) { + String creater = requestInfo.getCreatorid(); MainTableInfo mainTableInfo = requestInfo.getMainTableInfo(); Property[] properties = mainTableInfo.getProperty(); Map mainDataMap = new HashMap<>(16); @@ -52,6 +53,36 @@ public class EditInterviewEvaluateExpand extends AbstractModeExpandJavaCodeNew { rs.executeUpdate("update uf_jcl_ms set zt = 0 where id = ? ", msid); } + //// 发送消息 + //String messageType = RecruitConstant.INTERVIEW_MESSAGE_TYPE; + //String title = RecruitConstant.INTERVIEW_EVALUATE_MESSAGE_TITLE; + // + // + //String ypz = Util.null2String(mainDataMap.get("ypz")); + //String ypzw = Util.null2String(mainDataMap.get("ypzw")); + //String msfkr = Util.null2String(mainDataMap.get("msfktxr")); + //String msrq = Util.null2String(mainDataMap.get("msrq")); + //String msg = Util.null2String(mainDataMap.get("msg")); + //String ptmsg = Util.null2String(mainDataMap.get("ptmsg")); + //String formId = Util.null2String(params.get("formId")); + // + //StringBuilder msgBuilder = new StringBuilder(); + //msgBuilder.append(RecruitModeUtil.getResourceNames(msfkr)).append("已经提交了面试评价"); + //msgBuilder.append("
"); + //msgBuilder.append("应聘者:").append(ApplicantCommonInfo.getApplicantName(ypz)).append(";应聘职位:").append(ApplicantCommonInfo.getApplicantPosition(ypzw)); + //msgBuilder.append("
"); + //msgBuilder.append("面试时间:").append(msrq).append(";面试官:").append(RecruitModeUtil.getResourceNames(msg)).append(",").append(RecruitModeUtil.getResourceNames(ptmsg)); + //msgBuilder.append("
"); + //msgBuilder.append("面试结果:").append(ApplicantCommonInfo.getSelectName(formId, "jg", jg)); + // + // + //// 消息发送,通知创建人 + //Set userIdSet = new HashSet<>(); + //userIdSet.add(creater); + //String linkUrl = "spa/cube/index.html#/main/cube/card?billid=" + billId + "&type=0&modeId=" + modeId; + //RecruitModeUtil.messagePush(messageType, title, msgBuilder.toString(), userIdSet, user.getUID(), linkUrl, ""); + + } } } catch (Exception e) { diff --git a/src/weaver/interfaces/recruit/thread/ExtractQllResumeThread.java b/src/weaver/interfaces/recruit/thread/ExtractQllResumeThread.java index 9d064c1..f526814 100644 --- a/src/weaver/interfaces/recruit/thread/ExtractQllResumeThread.java +++ b/src/weaver/interfaces/recruit/thread/ExtractQllResumeThread.java @@ -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; @@ -48,10 +49,23 @@ public class ExtractQllResumeThread extends Thread { // 校验简历信息、并插入 CheckRepeatResume instance = CheckRepeatResume.getInstance(); Map 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());