Merge pull request 'feature/dxf' (#1) from feature/dxf into develop

Reviewed-on: http://221.226.25.34:3000/dxfeng/weaver-hrm-recruit/pulls/1
This commit is contained in:
dxfeng 2023-10-16 10:35:23 +08:00
commit ec3004c37d
74 changed files with 4370 additions and 79 deletions

View File

@ -0,0 +1,6 @@
#面试相关消息提醒,消息来源
INTERVIEW_MESSAGE_TYPE=85
#添加面试消息提醒表弟
INTERVIEW_ADD_MESSAGE_TITLE=面试安排提醒
#取消面试消息提醒表弟
INTERVIEW_CANCEL_MESSAGE_TITLE=取消面试提醒

View File

@ -0,0 +1,12 @@
package com.api.recruit.controller;
import javax.ws.rs.Path;
/**
* @author:dxfeng
* @createTime: 2023/09/20
* @version: 1.0
*/
@Path("/jcl/recruit/applicant")
public class ApplicantResumeController extends com.engine.recruit.controller.ApplicantResumeController{
}

View File

@ -0,0 +1,12 @@
package com.api.recruit.controller;
import javax.ws.rs.Path;
/**
* @author:dxfeng
* @createTime: 2023/09/26
* @version: 1.0
*/
@Path("/jcl/recruit/message")
public class MessageTemplateController extends com.engine.recruit.controller.MessageTemplateController {
}

View File

@ -0,0 +1,12 @@
package com.api.recruit.controller;
import javax.ws.rs.Path;
/**
* @author:dxfeng
* @createTime: 2023/09/18
* @version: 1.0
*/
@Path("/jcl/recruit/button")
public class RecruitButtonController extends com.engine.recruit.controller.RecruitButtonController{
}

View File

@ -0,0 +1,12 @@
package com.api.recruit.controller;
import javax.ws.rs.Path;
/**
* @author:dxfeng
* @createTime: 2023/09/20
* @version: 1.0
*/
@Path("/jcl/recruit/recruitflow")
public class RecruitFlowController extends com.engine.recruit.controller.RecruitFlowController{
}

View File

@ -0,0 +1,12 @@
package com.api.recruit.controller;
import javax.ws.rs.Path;
/**
* @author:dxfeng
* @createTime: 2023/10/09
* @version: 1.0
*/
@Path("/jcl/recruit/position")
public class RecruitPositionController extends com.engine.recruit.controller.RecruitPositionController{
}

View File

@ -0,0 +1,84 @@
package com.engine.recruit.controller;
import com.engine.common.util.ParamUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.recruit.util.ResponseResult;
import com.engine.recruit.wrapper.ApplicantResumeWrapper;
import weaver.general.Util;
import weaver.hrm.HrmUserVarify;
import weaver.hrm.User;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2023/09/20
* @version: 1.0
*/
public class ApplicantResumeController {
public ApplicantResumeWrapper getApplicantResumeWrapper(User user) {
return ServiceUtil.getService(ApplicantResumeWrapper.class, user);
}
@POST
@Path("/getApplicantsName")
@Produces(MediaType.APPLICATION_JSON)
public String getApplicantsName(@Context HttpServletRequest request, @Context HttpServletResponse response) {
User user = HrmUserVarify.getUser(request, response);
Map<String, Object> params = ParamUtil.request2Map(request);
String ids = Util.null2String(params.get("ids"));
return new ResponseResult<String, Map<String, Object>>(user).run(getApplicantResumeWrapper(user)::getApplicantsName, ids);
}
@POST
@Path("/getInterviewInfoById")
@Produces(MediaType.APPLICATION_JSON)
public String getInterviewInfoById(@Context HttpServletRequest request, @Context HttpServletResponse response) {
User user = HrmUserVarify.getUser(request, response);
Map<String, Object> params = ParamUtil.request2Map(request);
String id = Util.null2String(params.get("id"));
return new ResponseResult<String, Map<String, Object>>(user).run(getApplicantResumeWrapper(user)::getInterviewInfoById, id);
}
@POST
@Path("/getDisplayLayoutId")
@Produces(MediaType.APPLICATION_JSON)
public String getDisplayLayoutId(@Context HttpServletRequest request, @Context HttpServletResponse response) {
User user = HrmUserVarify.getUser(request, response);
Map<String, Object> params = ParamUtil.request2Map(request);
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getApplicantResumeWrapper(user)::getDisplayLayoutId, params);
}
@POST
@Path("/getTabCount")
@Produces(MediaType.APPLICATION_JSON)
public String getTabCount(@Context HttpServletRequest request, @Context HttpServletResponse response) {
User user = HrmUserVarify.getUser(request, response);
Map<String, Object> params = ParamUtil.request2Map(request);
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getApplicantResumeWrapper(user)::getTabCount, params);
}
@POST
@Path("/updateApplicantsInfo")
@Produces(MediaType.APPLICATION_JSON)
public String updateApplicantsInfo(@Context HttpServletRequest request, @Context HttpServletResponse response) {
User user = HrmUserVarify.getUser(request, response);
Map<String, Object> params = ParamUtil.request2Map(request);
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getApplicantResumeWrapper(user)::updateApplicantsInfo, params);
}
@POST
@Path("/fullOriginalResumeId")
@Produces(MediaType.APPLICATION_JSON)
public String fullOriginalResumeId(@Context HttpServletRequest request, @Context HttpServletResponse response) {
User user = HrmUserVarify.getUser(request, response);
Map<String, Object> param = ParamUtil.request2Map(request);
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getApplicantResumeWrapper(user)::fullOriginalResumeId, param);
}
}

View File

@ -0,0 +1,37 @@
package com.engine.recruit.controller;
import com.engine.common.util.ParamUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.recruit.util.ResponseResult;
import com.engine.recruit.wrapper.MessageTemplateWrapper;
import weaver.hrm.HrmUserVarify;
import weaver.hrm.User;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2023/09/26
* @version: 1.0
*/
public class MessageTemplateController {
public MessageTemplateWrapper getMessageTemplateWrapper(User user) {
return ServiceUtil.getService(MessageTemplateWrapper.class, user);
}
@POST
@Path("/getMessageContent")
@Produces(MediaType.APPLICATION_JSON)
public String getMessageContent(@Context HttpServletRequest request, @Context HttpServletResponse response) {
User user = HrmUserVarify.getUser(request, response);
Map<String, Object> params = ParamUtil.request2Map(request);
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getMessageTemplateWrapper(user)::getMessageContent, params);
}
}

View File

@ -0,0 +1,38 @@
package com.engine.recruit.controller;
import com.engine.common.util.ParamUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.recruit.util.ResponseResult;
import com.engine.recruit.wrapper.RecruitButtonWrapper;
import weaver.hrm.HrmUserVarify;
import weaver.hrm.User;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2023/09/18
* @version: 1.0
*/
public class RecruitButtonController {
public RecruitButtonWrapper getRecruitButtonWrapper(User user) {
return ServiceUtil.getService(RecruitButtonWrapper.class, user);
}
@POST
@Path("/executeButtonAction")
@Produces(MediaType.APPLICATION_JSON)
public String executeButtonAction(@Context HttpServletRequest request, @Context HttpServletResponse response) {
User user = HrmUserVarify.getUser(request, response);
Map<String, Object> params = ParamUtil.request2Map(request);
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getRecruitButtonWrapper(user)::execute, params);
}
}

View File

@ -0,0 +1,46 @@
package com.engine.recruit.controller;
import com.engine.common.util.ParamUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.recruit.util.ResponseResult;
import com.engine.recruit.wrapper.RecruitFlowWrapper;
import weaver.hrm.HrmUserVarify;
import weaver.hrm.User;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2023/09/20
* @version: 1.0
*/
public class RecruitFlowController {
public RecruitFlowWrapper getRecruitFlowWrapper(User user) {
return ServiceUtil.getService(RecruitFlowWrapper.class, user);
}
@GET
@Path("/getButtonList")
@Produces(MediaType.APPLICATION_JSON)
public String getButtonList(@Context HttpServletRequest request, @Context HttpServletResponse response) {
User user = HrmUserVarify.getUser(request, response);
Map<String, Object> params = ParamUtil.request2Map(request);
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getRecruitFlowWrapper(user)::getButtonList, params);
}
@GET
@Path("/getRecruitStepList")
@Produces(MediaType.APPLICATION_JSON)
public String getRecruitStepList(@Context HttpServletRequest request, @Context HttpServletResponse response) {
User user = HrmUserVarify.getUser(request, response);
Map<String, Object> params = ParamUtil.request2Map(request);
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getRecruitFlowWrapper(user)::getRecruitStepList, params);
}
}

View File

@ -0,0 +1,37 @@
package com.engine.recruit.controller;
import com.engine.common.util.ParamUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.recruit.util.ResponseResult;
import com.engine.recruit.wrapper.RecruitPositionWrapper;
import weaver.hrm.HrmUserVarify;
import weaver.hrm.User;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2023/10/09
* @version: 1.0
*/
public class RecruitPositionController {
public RecruitPositionWrapper getRecruitPositionWrapper(User user) {
return ServiceUtil.getService(RecruitPositionWrapper.class, user);
}
@POST
@Path("/updatePostInfo")
@Produces(MediaType.APPLICATION_JSON)
public String updatePostInfo(@Context HttpServletRequest request, @Context HttpServletResponse response) {
User user = HrmUserVarify.getUser(request, response);
Map<String, Object> param = ParamUtil.request2Map(request);
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getRecruitPositionWrapper(user)::updatePostInfo, param);
}
}

View File

@ -0,0 +1,27 @@
package com.engine.recruit.entity.recruitflow.po;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 招聘流程按钮实体类
*
* @author:dxfeng
* @createTime: 2023/09/25
* @version: 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class RecruitButton {
private String key;
private String buttonName;
private String tabName;
private String tabLink;
private String buttonKey;
private String buttonType;
private Integer orderNum;
}

View File

@ -0,0 +1,21 @@
package com.engine.recruit.entity.recruitflow.po;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author:dxfeng
* @createTime: 2023/10/12
* @version: 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class RecruitStepPo {
private int key;
private String description;
private String type;
}

View File

@ -0,0 +1,64 @@
package com.engine.recruit.entity.recruitflow.po;
import com.engine.recruit.util.RecruitFlowUtil;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2023/10/11
* @version: 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class RecruitTabPo {
private static final String SEARCH_URL = "/main/cube/search";
private String key;
private String title;
private String url;
private String viewcondition;
private String billId;
public String getUrl() {
return url;
}
public String getTitle() {
if (StringUtils.isNotBlank(url) && url.contains(SEARCH_URL)) {
Map<String, String> paramMap = RecruitFlowUtil.parseURL(getUrl());
String customId = paramMap.get("customid");
if (StringUtils.isBlank(customId)) {
return title;
}
// 查询对应查询列表的表名
RecordSet rs = new RecordSet();
rs.executeQuery("select tablename from workflow_bill where id = (select formid from mode_customsearch where id = ?)", customId);
if (rs.next()) {
String tableName = rs.getString("tablename");
String tabCount = "0";
if ("uf_jcl_yppc".equalsIgnoreCase(tableName)) {
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"));
}
} else {
rs.executeQuery("select count(1) as num from " + tableName + " where ypz = ? ", billId);
}
if (rs.next()) {
tabCount = rs.getString("num");
}
title += "(" + tabCount + ")";
}
}
return title;
}
}

View File

@ -0,0 +1,49 @@
package com.engine.recruit.enums;
/**
* @author:dxfeng
* @createTime: 2023/09/27
* @version: 1.0
*/
public enum ApplicantOperateEnum {
/**
* 应聘者相关操作类型
*/
ELIMINATE("eliminate", "淘汰"),
REFERRAL("referral", "转推其他职位"),
TRANSFER("transfer", "转移阶段");
ApplicantOperateEnum(String operateType, String operateDesc) {
this.operateType = operateType;
this.operateDesc = operateDesc;
}
private String operateType;
private String operateDesc;
public String getOperateType() {
return operateType;
}
public void setOperateType(String operateType) {
this.operateType = operateType;
}
public String getOperateDesc() {
return operateDesc;
}
public void setOperateDesc(String operateDesc) {
this.operateDesc = operateDesc;
}
public static ApplicantOperateEnum getOperateType(String operateType) {
for (ApplicantOperateEnum item : ApplicantOperateEnum.values()) {
if (item.operateType.equalsIgnoreCase(operateType)) {
return item;
}
}
throw new RuntimeException("不支持的操作类型");
}
}

View File

@ -0,0 +1,40 @@
package com.engine.recruit.enums;
/**
* @author:dxfeng
* @createTime: 2023/09/27
* @version: 1.0
*/
public enum ApplicationStatusEnum {
/**
* 应聘状态
*/
DISTRIBUTION("待分配", "0"),
CANDIDATE("候选中", "1"),
ARCHIVED("已归档", "2"),
OBSOLETE("已淘汰", "3");
ApplicationStatusEnum(String name, String value) {
this.name = name;
this.value = value;
}
private String name;
private String value;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}

View File

@ -0,0 +1,55 @@
package com.engine.recruit.enums;
/**
* @author:dxfeng
* @createTime: 2023/09/28
* @version: 1.0
*/
public enum CurrentApplicationStageEnum {
/**
* 当前操作阶段
*/
SCREENING("初筛", "0"),
WRITTEN("笔试", "1"),
INTERVIEW("面试", "2"),
EVALUATION("测评", "3"),
SALARY("薪酬谈判", "4"),
BACK("背调", "5"),
offer("offer", "6"),
EMPLOYMENT("待入职", "8"),
ENTRY("入职", "9 ");
CurrentApplicationStageEnum(String stageName, String stageValue) {
this.stageName = stageName;
this.stageValue = stageValue;
}
private String stageName;
private String stageValue;
public String getStageName() {
return stageName;
}
public void setStageName(String stageName) {
this.stageName = stageName;
}
public String getStageValue() {
return stageValue;
}
public void setStageValue(String stageValue) {
this.stageValue = stageValue;
}
public static CurrentApplicationStageEnum getOperateType(String operateType) {
for (CurrentApplicationStageEnum item : CurrentApplicationStageEnum.values()) {
if (item.stageValue.equalsIgnoreCase(operateType)) {
return item;
}
}
throw new RuntimeException("不支持的操作类型");
}
}

View File

@ -0,0 +1,41 @@
package com.engine.recruit.enums;
/**
* 入职状态枚举类
*
* @author:dxfeng
* @createTime: 2023/10/10
* @version: 1.0
*/
public enum EntryStatusEnum {
/**
* 入职状态
*/
PENDING("0", "待入职"),
EMPLOYED("0", "已入职"),
CANCEL("0", "取消入职");
EntryStatusEnum(String value, String desc) {
this.value = value;
this.desc = desc;
}
private String value;
private String desc;
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}

View File

@ -0,0 +1,49 @@
package com.engine.recruit.enums;
/**
* @author:dxfeng
* @createTime: 2023/09/27
* @version: 1.0
*/
public enum InterviewOperateTypeEnum {
/**
* 面试操作类型
*/
EVALUATE("evaluate", "面试评价"),
CANCEL("cancel", "取消面试"),
ARRANGE("arrange", "安排面试"),
ADJUSTMENT("adjustment", "调整面试");
InterviewOperateTypeEnum(String operateType, String operateDesc) {
this.operateType = operateType;
this.operateDesc = operateDesc;
}
private String operateType;
private String operateDesc;
public String getOperateType() {
return operateType;
}
public void setOperateType(String operateType) {
this.operateType = operateType;
}
public String getOperateDesc() {
return operateDesc;
}
public void setOperateDesc(String operateDesc) {
this.operateDesc = operateDesc;
}
public static InterviewOperateTypeEnum getOperateType(String operateType) {
for (InterviewOperateTypeEnum item : InterviewOperateTypeEnum.values()) {
if (item.operateType.equalsIgnoreCase(operateType)) {
return item;
}
}
throw new RuntimeException("不支持的操作类型");
}
}

View File

@ -0,0 +1,54 @@
package com.engine.recruit.enums;
import com.engine.recruit.exception.CustomizeRunTimeException;
/**
* 发布渠道枚举类
*
* @author:dxfeng
* @createTime: 2023/10/08
* @version: 1.0
*/
public enum PositionThirdChannelEnum {
/**
* 发布渠道
*/
BOSSZHIPIN("0", "BOSS直聘"),
ZHILIANZHAOPIN("1", "智联"),
QIANCHENGWUYOU("2", "前程无忧"),
LAGO("3", "拉勾"),
LIEPIN("4", "猎聘");
PositionThirdChannelEnum(String value, String desc) {
this.value = value;
this.desc = desc;
}
private String value;
private String desc;
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public static PositionThirdChannelEnum getEnum(String value) {
for (PositionThirdChannelEnum item : PositionThirdChannelEnum.values()) {
if (item.value.equalsIgnoreCase(value)) {
return item;
}
}
throw new CustomizeRunTimeException("不支持的发布渠道");
}
}

View File

@ -1,6 +1,7 @@
package com.engine.recruit.enums;
/**
* <p>聚才林招聘</p>
* 需求状态枚举类
*
* @author:dxfeng

View File

@ -0,0 +1,21 @@
package com.engine.recruit.exception;
/**
* @author:dxfeng
* @createTime: 2023/09/18
* @version: 1.0
*/
public class CustomizeRunTimeException extends RuntimeException{
public CustomizeRunTimeException(String message) {
super(message);
}
public CustomizeRunTimeException(Throwable cause) {
super(cause);
}
public CustomizeRunTimeException(String message, Throwable cause) {
super(message, cause);
}
}

View File

@ -0,0 +1,37 @@
package com.engine.recruit.factory;
import com.engine.core.impl.Service;
import com.engine.recruit.service.RecruitButtonService;
/**
* <p>聚才林招聘</p>
* 招聘按钮工厂类
*
* @author:dxfeng
* @createTime: 2023/09/18
* @version: 1.0
*/
public class RecruitButtonFactory {
/**
* 根据类的全路径获取类对象
*
* @param className 类全路径
* @param <T>
* @return
*/
public static <T extends Service> Class<T> getClass(String className) {
Class<?> clazz;
try {
clazz = Class.forName(className);
if (!RecruitButtonService.class.isAssignableFrom(clazz)) {
throw new IllegalArgumentException("该类未实现RecruitButtonService");
}
return (Class<T>) clazz;
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
}
}

View File

@ -0,0 +1,65 @@
package com.engine.recruit.service;
import java.util.Map;
/**
* <p>聚才林招聘</p>
* <p>
* 应聘者简历服务类
*
* @author:dxfeng
* @createTime: 2023/09/20
* @version: 1.0
*/
public interface ApplicantResumeService {
/**
* 获取应聘者姓名
*
* @param ids 应聘者ID
* @return 应聘者姓名
*/
Map<String, Object> getApplicantsName(String ids);
/**
* 根据ID获取面试信息
*
* @param id
* @return 面试信息
*/
Map<String, Object> getInterviewInfoById(String id);
/**
* 获取编辑布局对应的显示布局ID
*
* @param params 入参
* @return 显示布局ID
*/
Map<String, Object> getDisplayLayoutId(Map<String, Object> params);
/**
* 获取关联Tab页数据统计条数
*
* @param params 入参
* @return 据统计条数
*/
Map<String, Object> getTabCount(Map<String, Object> params);
/**
* 更新应聘者信息
*
* @param params 入参
* @return
*/
Map<String, Object> updateApplicantsInfo(Map<String, Object> params);
/**
* 完善OCR导入的简历原始简历字段
*
* @param params
* @return
*/
Map<String, Object> fullOriginalResumeId(Map<String, Object> params);
}

View File

@ -0,0 +1,22 @@
package com.engine.recruit.service;
import java.util.Map;
/**
* <p>聚才林招聘</p>
* 消息模板接口
*
* @author:dxfeng
* @createTime: 2023/09/26
* @version: 1.0
*/
public interface MessageTemplateService {
/**
* 获取邮件模板内容
*
* @param params 入参
* @return 模板内容
*/
Map<String, Object> getMessageContent(Map<String, Object> params);
}

View File

@ -0,0 +1,22 @@
package com.engine.recruit.service;
import java.util.Map;
/**
* <p>聚才林招聘</p>
* 招聘流程按钮功能实现接口
*
* @author:dxfeng
* @createTime: 2023/09/18
* @version: 1.0
*/
public interface RecruitButtonService {
/**
* 按钮执行的业务逻辑
*
* @param params 参数集合
* @return 响应结果
*/
Map<String, Object> execute(Map<String, Object> params);
}

View File

@ -0,0 +1,29 @@
package com.engine.recruit.service;
import java.util.Map;
/**
* <p>聚才林招聘</p>
* 招聘流程接口
*
* @author:dxfeng
* @createTime: 2023/09/22
* @version: 1.0
*/
public interface RecruitFlowService {
/**
* 获取当前阶段操作按钮
*
* @param param 参数
* @return 操作按钮
*/
Map<String, Object> getButtonList(Map<String, Object> param);
/**
* 获取招聘阶段信息
*
* @param param 参数
* @return 招聘阶段
*/
Map<String, Object> getRecruitStepList(Map<String, Object> param);
}

View File

@ -0,0 +1,20 @@
package com.engine.recruit.service;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2023/10/09
* @version: 1.0
*/
public interface RecruitPositionService {
/**
* 更新职位信息
*
* @param param
* @return
*/
Map<String, Object> updatePostInfo(Map<String, Object> param);
}

View File

@ -0,0 +1,21 @@
package com.engine.recruit.service.impl;
import com.engine.core.impl.Service;
import com.engine.recruit.service.RecruitButtonService;
import java.util.Map;
/**
* <p>聚才林招聘</p>
* "添加备注"按钮实现类
*
* @author:dxfeng
* @createTime: 2023/09/18
* @version: 1.0
*/
public class AddRemarksServiceImpl extends Service implements RecruitButtonService {
@Override
public Map<String, Object> execute(Map<String, Object> params) {
return null;
}
}

View File

@ -0,0 +1,345 @@
package com.engine.recruit.service.impl;
import cn.hutool.core.convert.Convert;
import com.engine.core.impl.Service;
import com.engine.recruit.enums.ApplicantOperateEnum;
import com.engine.recruit.enums.ApplicationStatusEnum;
import com.engine.recruit.service.ApplicantResumeService;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.docs.docs.DocCoder;
import weaver.docs.docs.DocComInfo;
import weaver.docs.docs.DocImageManager;
import weaver.docs.docs.DocManager;
import weaver.file.ImageFileManager;
import weaver.general.TimeUtil;
import weaver.general.Util;
import weaver.hrm.User;
import weaver.hrm.resource.ResourceComInfo;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @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());
}
if (ApplicantOperateEnum.TRANSFER.getOperateType().equals(operateType)) {
String dqypjd = Util.null2String(params.get("dqypjd"));
String billid = Util.null2String(params.get("billid"));
rs.executeUpdate("update uf_jcl_yppc set dqypjd = ? where id = ?", dqypjd, billid);
}
return returnMap;
}
@Override
public Map<String, Object> fullOriginalResumeId(Map<String, Object> params) {
int imageFileId = Convert.toInt(params.get("imageFileId"));
int resumeId = Convert.toInt(params.get("resumeId"));
int secCategory = Convert.toInt(params.get("secCategory"));
RecordSet rs = new RecordSet();
try {
int docId = createDocId(secCategory, imageFileId, user);
// 更新原始简历信息设置应聘状态未待分配
rs.executeUpdate("update uf_jcl_yppc set ysjl=?,zt=? where id = ?", docId, 0, resumeId);
} catch (Exception e) {
throw new RuntimeException(e);
}
return new HashMap<>();
}
/**
* 构建普通数据格式
*
* @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;
}
/**
* 原始简历imageFieldId生成docId
*
* @param secCategory
* @param imageFieldId
* @param user
* @return
* @throws Exception
*/
public int createDocId(int secCategory, int imageFieldId, User user) throws Exception {
ImageFileManager manager = new ImageFileManager();
manager.getImageFileInfoById(imageFieldId);
String filenameqc = manager.getImageFileName();
String filenamebc = filenameqc.substring(0, filenameqc.lastIndexOf("."));
RecordSet rs = new RecordSet();
DocManager dm = new DocManager();
DocImageManager imgManger = new DocImageManager();
imgManger.setDocfiletype("2");
int docId = dm.getNextDocId(rs);
imgManger.setDocid(docId);
imgManger.setImagefileid(imageFieldId);
imgManger.setImagefilename(filenameqc);
imgManger.setIsextfile("1");
imgManger.AddDocImageInfo();
String date = TimeUtil.getCurrentDateString();
String time = TimeUtil.getOnlyCurrentTimeString();
dm.setId(docId);
dm.setMaincategory(0);
dm.setSubcategory(0);
dm.setSeccategory(secCategory);
dm.setLanguageid(user.getLanguage());
dm.setDocstatus("1");
dm.setDocsubject(filenamebc);
dm.setDoccreaterid(user.getUID());
dm.setDocCreaterType(user.getLogintype());
dm.setUsertype(user.getLogintype());
dm.setOwnerid(user.getUID());
dm.setOwnerType(user.getLogintype());
dm.setDoclastmoduserid(user.getUID());
dm.setDocLastModUserType(user.getLogintype());
dm.setDoccreatedate(date);
dm.setDoclastmoddate(date);
dm.setDoccreatetime(time);
dm.setDoclastmodtime(time);
dm.setDoclangurage(user.getLanguage());
dm.setKeyword(filenameqc);
dm.setIsapprover("0");
dm.setIsreply("");
dm.setDocdepartmentid(user.getUserDepartment());
dm.setDocreplyable("1");
dm.setAccessorycount(1);
dm.setParentids("" + docId);
dm.setUserid(user.getUID());
DocCoder docCoder = new DocCoder();
dm.setDocCode(docCoder.getDocCoder("" + secCategory));
dm.setDocEditionId(dm.getNextEditionId(rs));
dm.setDocEdition(1);
dm.AddDocInfo();
dm.AddShareInfo();
DocComInfo dc = new DocComInfo();
dc.addDocInfoCache("" + docId);
return docId;
}
}

View File

@ -0,0 +1,21 @@
package com.engine.recruit.service.impl;
import com.engine.core.impl.Service;
import com.engine.recruit.service.RecruitButtonService;
import java.util.Map;
/**
* <p>聚才林招聘</p>
* "归档人才库"按钮实现类
*
* @author:dxfeng
* @createTime: 2023/09/18
* @version: 1.0
*/
public class ArchiveTalentPoolServiceImpl extends Service implements RecruitButtonService {
@Override
public Map<String, Object> execute(Map<String, Object> params) {
return null;
}
}

View File

@ -0,0 +1,21 @@
package com.engine.recruit.service.impl;
import com.engine.core.impl.Service;
import com.engine.recruit.service.RecruitButtonService;
import java.util.Map;
/**
* <p>聚才林招聘</p>
* "安排面试"按钮实现类
*
* @author:dxfeng
* @createTime: 2023/09/18
* @version: 1.0
*/
public class ArrangeInterviewsServiceImpl extends Service implements RecruitButtonService {
@Override
public Map<String, Object> execute(Map<String, Object> params) {
return null;
}
}

View File

@ -0,0 +1,21 @@
package com.engine.recruit.service.impl;
import com.engine.core.impl.Service;
import com.engine.recruit.service.RecruitButtonService;
import java.util.Map;
/**
* <p>聚才林招聘</p>
* "背调结果登记"按钮实现类
*
* @author:dxfeng
* @createTime: 2023/09/18
* @version: 1.0
*/
public class BackToneRegistrationServiceImpl extends Service implements RecruitButtonService {
@Override
public Map<String, Object> execute(Map<String, Object> params) {
return null;
}
}

View File

@ -0,0 +1,21 @@
package com.engine.recruit.service.impl;
import com.engine.core.impl.Service;
import com.engine.recruit.service.RecruitButtonService;
import java.util.Map;
/**
* <p>聚才林招聘</p>
* "创建offer"按钮实现类
*
* @author:dxfeng
* @createTime: 2023/09/18
* @version: 1.0
*/
public class CreateOfferServiceImpl extends Service implements RecruitButtonService {
@Override
public Map<String, Object> execute(Map<String, Object> params) {
return null;
}
}

View File

@ -0,0 +1,21 @@
package com.engine.recruit.service.impl;
import com.engine.core.impl.Service;
import com.engine.recruit.service.RecruitButtonService;
import java.util.Map;
/**
* <p>聚才林招聘</p>
* "发放offer"按钮实现类
*
* @author:dxfeng
* @createTime: 2023/09/18
* @version: 1.0
*/
public class DistributeOffersServiceImpl extends Service implements RecruitButtonService {
@Override
public Map<String, Object> execute(Map<String, Object> params) {
return null;
}
}

View File

@ -0,0 +1,27 @@
package com.engine.recruit.service.impl;
import com.engine.core.impl.Service;
import com.engine.recruit.enums.ApplicationStatusEnum;
import com.engine.recruit.service.RecruitButtonService;
import weaver.conn.RecordSet;
import weaver.general.Util;
import java.util.Map;
/**
* <p>聚才林招聘</p>
* "淘汰"按钮实现类
*
* @author:dxfeng
* @createTime: 2023/09/18
* @version: 1.0
*/
public class EliminateServiceImpl extends Service implements RecruitButtonService {
@Override
public Map<String, Object> execute(Map<String, Object> params) {
String billId = Util.null2String(params.get("billId"));
RecordSet rs = new RecordSet();
rs.executeUpdate("update uf_jcl_yppc set zt = ? where id = ? ", ApplicationStatusEnum.OBSOLETE.getValue(), billId);
return null;
}
}

View File

@ -0,0 +1,21 @@
package com.engine.recruit.service.impl;
import com.engine.core.impl.Service;
import com.engine.recruit.service.RecruitButtonService;
import java.util.Map;
/**
* <p>聚才林招聘</p>
* "邀请更新简历"按钮实现类
*
* @author:dxfeng
* @createTime: 2023/09/18
* @version: 1.0
*/
public class InviteToUpdateResumeServiceImpl extends Service implements RecruitButtonService {
@Override
public Map<String, Object> execute(Map<String, Object> params) {
return null;
}
}

View File

@ -0,0 +1,21 @@
package com.engine.recruit.service.impl;
import com.engine.core.impl.Service;
import com.engine.recruit.service.RecruitButtonService;
import java.util.Map;
/**
* <p>聚才林招聘</p>
* "加入黑名单"按钮实现类
*
* @author:dxfeng
* @createTime: 2023/09/18
* @version: 1.0
*/
public class JoinBlacklistServiceImpl extends Service implements RecruitButtonService {
@Override
public Map<String, Object> execute(Map<String, Object> params) {
return null;
}
}

View File

@ -0,0 +1,32 @@
package com.engine.recruit.service.impl;
import com.engine.core.impl.Service;
import com.engine.recruit.service.MessageTemplateService;
import weaver.conn.RecordSet;
import weaver.general.Util;
import java.util.HashMap;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2023/09/26
* @version: 1.0
*/
public class MessageTemplateServiceImpl extends Service implements MessageTemplateService {
private static final String MESSAGE_TEMPLATE_TABLE = "uf_jcl_yjtzmb";
@Override
public Map<String, Object> getMessageContent(Map<String, Object> params) {
Map<String, Object> resMap = new HashMap<>();
String id = Util.null2String(params.get("id"));
String content = "";
RecordSet rs = new RecordSet();
rs.executeQuery("select yjnr from " + MESSAGE_TEMPLATE_TABLE + " where id = ?", id);
if (rs.next()) {
content = rs.getString("yjnr");
}
resMap.put("content", content);
return resMap;
}
}

View File

@ -0,0 +1,21 @@
package com.engine.recruit.service.impl;
import com.engine.core.impl.Service;
import com.engine.recruit.service.RecruitButtonService;
import java.util.Map;
/**
* <p>聚才林招聘</p>
* "谈判记录登记"按钮实现类
*
* @author:dxfeng
* @createTime: 2023/09/18
* @version: 1.0
*/
public class NegotiationRecordsServiceImpl extends Service implements RecruitButtonService {
@Override
public Map<String, Object> execute(Map<String, Object> params) {
return null;
}
}

View File

@ -0,0 +1,73 @@
package com.engine.recruit.service.impl;
import com.engine.core.impl.Service;
import com.engine.recruit.entity.recruitflow.po.RecruitStepPo;
import com.engine.recruit.exception.CustomizeRunTimeException;
import com.engine.recruit.service.RecruitButtonService;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.general.Util;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* <p>聚才林招聘</p>
* "进入下一阶段"按钮实现类
*
* @author:dxfeng
* @createTime: 2023/09/18
* @version: 1.0
*/
public class NextStageServiceImpl extends Service implements RecruitButtonService {
@Override
public Map<String, Object> execute(Map<String, Object> params) {
Map<String, Object> returnMap = new HashMap<>();
String billId = Util.null2String(params.get("billId"));
// 招聘阶段ID
String stageId = null;
// 招聘流程ID
int recruitFlowId = -1;
RecordSet rs = new RecordSet();
rs.executeQuery("select zplc,zpjd from uf_jcl_yppc where id = ?", billId);
if (rs.next()) {
recruitFlowId = rs.getInt("zplc");
stageId = rs.getString("zpjd");
}
if (-1 == recruitFlowId) {
throw new CustomizeRunTimeException("未设置对应招聘流程");
}
rs.executeQuery("select id,jdmc,hj from uf_jcl_zpjdsz where sfqy = 0 and zplc = ? order by zssx", recruitFlowId);
List<RecruitStepPo> stepList = new ArrayList<>();
while (rs.next()) {
stepList.add(RecruitStepPo.builder().key(rs.getInt("id")).description(rs.getString("jdmc")).type(rs.getString("hj")).build());
}
boolean found = false;
Integer target = null;
if (StringUtils.isBlank(stageId)) {
stageId = String.valueOf(stepList.get(0).getKey());
}
for (RecruitStepPo recruitStepPo : stepList) {
if (found) {
target = recruitStepPo.getKey();
break;
}
if (recruitStepPo.getKey() == Integer.parseInt(stageId)) {
found = true;
if ("2".equals(recruitStepPo.getType())) {
target = -1;
}
}
}
// 更新应聘者简历为下一阶段
rs.executeUpdate("update uf_jcl_yppc set zpjd = ? where id = ?", target, billId);
return returnMap;
}
}

View File

@ -0,0 +1,21 @@
package com.engine.recruit.service.impl;
import com.engine.core.impl.Service;
import com.engine.recruit.service.RecruitButtonService;
import java.util.Map;
/**
* <p>聚才林招聘</p>
* "转为待入职"按钮实现类
*
* @author:dxfeng
* @createTime: 2023/09/18
* @version: 1.0
*/
public class PendingEmploymentServiceImpl extends Service implements RecruitButtonService {
@Override
public Map<String, Object> execute(Map<String, Object> params) {
return null;
}
}

View File

@ -0,0 +1,130 @@
package com.engine.recruit.service.impl;
import com.engine.core.impl.Service;
import com.engine.recruit.entity.recruitflow.po.RecruitButton;
import com.engine.recruit.entity.recruitflow.po.RecruitStepPo;
import com.engine.recruit.entity.recruitflow.po.RecruitTabPo;
import com.engine.recruit.exception.CustomizeRunTimeException;
import com.engine.recruit.service.RecruitFlowService;
import com.engine.recruit.util.RecruitFlowUtil;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.general.Util;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2023/09/22
* @version: 1.0
*/
public class RecruitFlowServiceImpl extends Service implements RecruitFlowService {
@Override
public Map<String, Object> getButtonList(Map<String, Object> param) {
Map<String, Object> returnMap = new HashMap<>();
String billId = Util.null2String(param.get("billId"));
// 招聘阶段ID
String stageId = "";
// 招聘流程ID
int recruitFlowId = -1;
RecordSet rs = new RecordSet();
rs.executeQuery("select zplc,zpjd from uf_jcl_yppc where id = ?", billId);
if (rs.next()) {
recruitFlowId = rs.getInt("zplc");
stageId = rs.getString("zpjd");
}
if (-1 == recruitFlowId) {
throw new CustomizeRunTimeException("未设置对应招聘流程");
}
if (StringUtils.isBlank(stageId)) {
// 查询开始环节
rs.executeQuery("select id from uf_jcl_zpjdsz where zplc = ? and hj = 0", recruitFlowId);
if (rs.next()) {
stageId = rs.getString("id");
}
if (StringUtils.isBlank(stageId)) {
throw new RuntimeException("未找到对应招聘阶段");
}
}
rs.executeQuery("select a.id,a.zdyxsmc as buttonName, a.tzymbt as tabName, a.tzymdz as tabLink, a.zssx as orderNum, b.anbs as buttonKey, b.andz as buttonType from uf_jcl_zpjdsz_dt1 a inner join uf_jcl_lcczan b on a.czan = b.id where a.sfqy = 0 and mainid = ? order by zssx", stageId);
List<RecruitButton> buttonList = new ArrayList<>();
List<RecruitTabPo> tabList = new ArrayList<>();
while (rs.next()) {
buttonList.add(RecruitButton.builder()
.key(rs.getString("id"))
.buttonName(rs.getString("buttonName"))
.buttonKey(rs.getString("buttonKey"))
.tabName(rs.getString("tabName"))
.tabLink(RecruitFlowUtil.replaceURL(rs.getString("tabLink"), billId))
.buttonType(rs.getString("buttonType"))
.orderNum(rs.getInt("orderNum"))
.build());
}
rs.executeQuery("select ymbt as title,ymdz as url,zssx as orderNum from uf_jcl_zpjdsz_dt2 where mainid = ? order by orderNum", stageId);
int tabIndex = 0;
while (rs.next()) {
tabList.add(RecruitTabPo.builder()
.key(String.valueOf(tabIndex))
.viewcondition(String.valueOf(tabIndex))
.title(rs.getString("title"))
.url(RecruitFlowUtil.replaceURL(rs.getString("url"), billId))
.billId(billId)
.build());
tabIndex++;
}
// 当前阶段所有按钮信息
returnMap.put("buttonList", buttonList);
returnMap.put("tabList", tabList);
return returnMap;
}
@Override
public Map<String, Object> getRecruitStepList(Map<String, Object> param) {
Map<String, Object> returnMap = new HashMap<>();
String billId = Util.null2String(param.get("billId"));
// 招聘阶段ID
String stageId = "";
int currentStageId = 0;
// 招聘流程ID
int recruitFlowId = -1;
RecordSet rs = new RecordSet();
rs.executeQuery("select zplc,zpjd from uf_jcl_yppc where id = ?", billId);
if (rs.next()) {
recruitFlowId = rs.getInt("zplc");
stageId = rs.getString("zpjd");
}
if (-1 == recruitFlowId) {
throw new CustomizeRunTimeException("未设置对应招聘流程");
}
rs.executeQuery("select id,jdmc from uf_jcl_zpjdsz where sfqy = 0 and zplc = ? order by zssx", recruitFlowId);
int stepIndex = 0;
List<RecruitStepPo> stepList = new ArrayList<>();
while (rs.next()) {
String id = rs.getString("id");
if (stageId.equals(id)) {
currentStageId = stepIndex;
}
stepList.add(RecruitStepPo.builder().key(stepIndex).description(rs.getString("jdmc")).build());
stepIndex++;
}
if ("-1".equals(stageId)) {
currentStageId = stepList.size();
}
returnMap.put("stepList", stepList);
returnMap.put("currentStageId", currentStageId);
return returnMap;
}
}

View File

@ -0,0 +1,37 @@
package com.engine.recruit.service.impl;
import com.engine.core.impl.Service;
import com.engine.recruit.exception.CustomizeRunTimeException;
import com.engine.recruit.service.RecruitPositionService;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.general.Util;
import java.util.HashMap;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2023/10/09
* @version: 1.0
*/
public class RecruitPositionServiceImpl extends Service implements RecruitPositionService {
/**
* 招聘职位建模表
*/
private static final String MODE_TABLE_NAME = "uf_jcl_zp_zpzw";
@Override
public Map<String, Object> updatePostInfo(Map<String, Object> param) {
Map<String, Object> returnMap = new HashMap<>();
String zpzwfzr = Util.null2String(param.get("zpzwfzr"));
String zpxzr = Util.null2String(param.get("zpxzr"));
String ids = Util.null2String(param.get("ids"));
if (StringUtils.isBlank(ids)) {
throw new CustomizeRunTimeException("数据有误,请重试");
}
RecordSet rs = new RecordSet();
rs.executeUpdate(" update " + MODE_TABLE_NAME + " set zpzwfzr = ? ,zpxzr = ? where id in (" + ids + ")", zpzwfzr, zpxzr);
return returnMap;
}
}

View File

@ -0,0 +1,21 @@
package com.engine.recruit.service.impl;
import com.engine.core.impl.Service;
import com.engine.recruit.service.RecruitButtonService;
import java.util.Map;
/**
* <p>聚才林招聘</p>
* "笔试结果登记"按钮实现类
*
* @author:dxfeng
* @createTime: 2023/09/18
* @version: 1.0
*/
public class RegisterForWrittenServiceImpl extends Service implements RecruitButtonService {
@Override
public Map<String, Object> execute(Map<String, Object> params) {
return null;
}
}

View File

@ -0,0 +1,21 @@
package com.engine.recruit.service.impl;
import com.engine.core.impl.Service;
import com.engine.recruit.service.RecruitButtonService;
import java.util.Map;
/**
* <p>聚才林招聘</p>
* "业务筛选"按钮实现类
*
* @author:dxfeng
* @createTime: 2023/09/18
* @version: 1.0
*/
public class ScreenServiceImpl extends Service implements RecruitButtonService {
@Override
public Map<String, Object> execute(Map<String, Object> params) {
return null;
}
}

View File

@ -0,0 +1,21 @@
package com.engine.recruit.service.impl;
import com.engine.core.impl.Service;
import com.engine.recruit.service.RecruitButtonService;
import java.util.Map;
/**
* <p>聚才林招聘</p>
* "转推其他岗位"按钮实现类
*
* @author:dxfeng
* @createTime: 2023/09/18
* @version: 1.0
*/
public class TransferToOtherPositionsServiceImpl extends Service implements RecruitButtonService {
@Override
public Map<String, Object> execute(Map<String, Object> params) {
return null;
}
}

View File

@ -0,0 +1,19 @@
package com.engine.recruit.util;
/**
* @author:dxfeng
* @createTime: 2023/09/18
* @version: 1.0
*/
public class ExceptionUtil {
public static String getRealMessage(Throwable e) {
while (e != null) {
Throwable cause = e.getCause();
if (cause == null) {
return e.getMessage();
}
e = cause;
}
return "";
}
}

View File

@ -0,0 +1,57 @@
package com.engine.recruit.util;
import com.engine.recruit.exception.CustomizeRunTimeException;
import org.apache.commons.lang3.StringUtils;
import weaver.general.BaseBean;
import java.net.URLDecoder;
import java.util.HashMap;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2023/10/12
* @version: 1.0
*/
public class RecruitFlowUtil {
/**
* 解析url中参数信息
*
* @param urlString url地址
* @return
*/
public static Map<String, String> parseURL(String urlString) {
Map<String, String> params = new HashMap<>();
try {
if (StringUtils.isNotBlank(urlString)) {
if (urlString.contains("?")) {
urlString = urlString.split("\\?")[1];
}
String[] paramPairs = urlString.split("&");
for (String paramPair : paramPairs) {
String[] keyValue = paramPair.split("=");
String key = URLDecoder.decode(keyValue[0], "UTF-8");
String value = URLDecoder.decode(keyValue[1], "UTF-8");
params.put(key, value);
}
}
} catch (Exception e) {
new BaseBean().writeLog(e);
throw new CustomizeRunTimeException(urlString + "解析失败");
}
return params;
}
/**
* 替换URL中Id字段
*
* @param urlString
* @param billId
* @return
*/
public static String replaceURL(String urlString, String billId) {
return urlString.replaceAll("\\$parentid\\$", billId);
}
}

View File

@ -0,0 +1,27 @@
package com.engine.recruit.util;
import weaver.common.MessageUtil;
import weaver.general.Util;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2023/10/13
* @version: 1.0
*/
public class RecruitMessageUtils {
public static boolean SendEmail(Map<String, Object> param) {
String sendTo = Util.null2String(param.get("sendTo"));
String emailTitle = Util.null2String(param.get("emailTitle"));
String emailContent = Util.null2String(param.get("emailContent"));
//EmailWorkRunnable.threadModeReminder(sendTo, emailTitle, emailContent);
return MessageUtil.sendEmail(sendTo, emailTitle, emailContent);
}
public static boolean sendSMS(Map<String, Object> param) {
String receiver = Util.null2String(param.get("receiver"));
String content = Util.null2String(param.get("content"));
return MessageUtil.sendSMS(receiver, content);
}
}

View File

@ -0,0 +1,187 @@
package com.engine.recruit.util;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.engine.recruit.exception.CustomizeRunTimeException;
import com.engine.core.exception.ECException;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;
import weaver.general.BaseBean;
import weaver.hrm.User;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Supplier;
/**
* @author:dxfeng
* @createTime: 2023/09/18
* @version: 1.0
*/
@Slf4j
public class ResponseResult<T, R> {
private static final long serialVersionUID = 1L;
private final User user;
private final BaseBean baseBean = new BaseBean();
private final Boolean isLog = "true".equals(baseBean.getPropValue("hrmSalary", "log"));
public ResponseResult(User user) {
this.user = user;
}
/**
* 统一返回方法(自定义返回格式)
*/
public String customRun(Function<T, R> f, T t) {
try {
if (isLog) {
log.info("run api , param {}", t);
}
return getJsonString(f.apply(t));
} catch (CustomizeRunTimeException e) {
log.error("api run fail", e);
return Error(e.getMessage());
} catch (ECException e) {
log.error("api run fail", e);
Throwable cause = e.getCause();
return Error(cause.getMessage());
} catch (Exception e) {
log.error("api run fail", e);
return Error("系统异常!");
}
}
/**
* 统一返回方法
*/
public String run(Function<T, R> f, T t) {
try {
if (isLog) {
log.info("run api , param {}", t);
}
return Ok(f.apply(t));
} catch (CustomizeRunTimeException e) {
log.error("api run fail", e);
return Error(e.getMessage());
} catch (ECException e) {
log.error("api run fail", e);
Throwable cause = e.getCause();
return Error(cause.getMessage());
} catch (Exception e) {
log.error("api run fail", e);
return Error("系统异常!");
}
}
/**
* 统一返回方法有参无返回
*/
public String run(Consumer<T> f, T t) {
try {
if (isLog) {
log.info("run api , param {}", t);
}
f.accept(t);
return Ok();
} catch (CustomizeRunTimeException e) {
log.error("api run fail", e);
return Error(e.getMessage());
} catch (ECException e) {
log.error("api run fail", e);
return Error(ExceptionUtil.getRealMessage(e));
} catch (Exception e) {
log.error("api run fail", e);
return Error("系统异常!", e);
}
}
/**
* 统一返回方法无参有返回
*/
public String run(Supplier<R> f) {
try {
if (isLog) {
log.info("run api");
}
return Ok(f.get());
} catch (CustomizeRunTimeException e) {
log.error("api run fail", e);
return Error(e.getMessage());
} catch (ECException e) {
log.error("api run fail", e);
Throwable cause = e.getCause();
return Error(cause.getMessage());
} catch (Exception e) {
log.error("api run fail", e);
return Error("系统异常!", e);
}
}
private static String getJsonString(Object apidatas) {
ObjectMapper mapper = new ObjectMapper();
try {
return mapper.writeValueAsString(apidatas);
} catch (JsonProcessingException e) {
e.printStackTrace();
}
return "";
}
/**
* 成功返回
*/
private String Ok() {
Map<String, Object> apidatas = new HashMap<>();
apidatas.put("status", true);
return JSONObject.toJSONString(apidatas, SerializerFeature.DisableCircularReferenceDetect);
}
/**
* 成功返回
*/
private String Ok(R r) {
Map<String, Object> apidatas = new HashMap<>();
apidatas.put("status", true);
apidatas.put("data", r);
String success = getJsonString(apidatas);
if (isLog) {
log.info("run salary api success return {}", success);
}
return success;
}
/**
* 失败返回
*/
private static String Error(String message) {
Map<String, Object> apidatas = new HashMap<>();
apidatas.put("status", false);
apidatas.put("errormsg", message);
return JSONObject.toJSONString(apidatas, SerializerFeature.DisableCircularReferenceDetect);
}
/**
* 系统异常失败返回
*/
private static String Error(String message, Exception e) {
Map<String, Object> apidatas = new HashMap<>();
apidatas.put("status", false);
apidatas.put("errormsg", message);
apidatas.put("error", e.getMessage());
return JSONObject.toJSONString(apidatas, SerializerFeature.DisableCircularReferenceDetect);
}
}

View File

@ -0,0 +1,44 @@
package com.engine.recruit.wrapper;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.recruit.service.ApplicantResumeService;
import com.engine.recruit.service.impl.ApplicantResumeServiceImpl;
import weaver.hrm.User;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2023/09/20
* @version: 1.0
*/
public class ApplicantResumeWrapper extends Service {
private ApplicantResumeService getApplicantResumeService(User user) {
return ServiceUtil.getService(ApplicantResumeServiceImpl.class, user);
}
public Map<String, Object> getApplicantsName(String ids) {
return getApplicantResumeService(user).getApplicantsName(ids);
}
public Map<String, Object> getInterviewInfoById(String id) {
return getApplicantResumeService(user).getInterviewInfoById(id);
}
public Map<String, Object> getDisplayLayoutId(Map<String, Object> params) {
return getApplicantResumeService(user).getDisplayLayoutId(params);
}
public Map<String, Object> getTabCount(Map<String, Object> params) {
return getApplicantResumeService(user).getTabCount(params);
}
public Map<String, Object> updateApplicantsInfo(Map<String, Object> params) {
return getApplicantResumeService(user).updateApplicantsInfo(params);
}
public Map<String, Object> fullOriginalResumeId(Map<String, Object> params) {
return getApplicantResumeService(user).fullOriginalResumeId(params);
}
}

View File

@ -0,0 +1,24 @@
package com.engine.recruit.wrapper;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.recruit.service.MessageTemplateService;
import com.engine.recruit.service.impl.MessageTemplateServiceImpl;
import weaver.hrm.User;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2023/09/26
* @version: 1.0
*/
public class MessageTemplateWrapper extends Service {
private MessageTemplateService getMessageTemplateService(User user) {
return ServiceUtil.getService(MessageTemplateServiceImpl.class, user);
}
public Map<String, Object> getMessageContent(Map<String, Object> params) {
return getMessageTemplateService(user).getMessageContent(params);
}
}

View File

@ -0,0 +1,43 @@
package com.engine.recruit.wrapper;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.recruit.factory.RecruitButtonFactory;
import com.engine.recruit.service.RecruitButtonService;
import weaver.general.Util;
import weaver.hrm.User;
import java.util.Map;
/**
* <p>聚才林招聘</p>
*
* @author:dxfeng
* @createTime: 2023/09/18
* @version: 1.0
*/
public class RecruitButtonWrapper extends Service {
/**
* 根据类全路径获取对应的实现类
*
* @param user 当前用户
* @param classPath 类全路径
* @return
*/
private RecruitButtonService getRecruitButtonService(User user, String classPath) {
return ServiceUtil.getService(RecruitButtonFactory.getClass(classPath), user);
}
/**
* 执行对应实现类的方法
*
* @param params 参数集合
*/
public Map<String, Object> execute(Map<String, Object> params) {
// 获取实现类全路径
String buttonKey = Util.null2String(params.get("buttonKey"));
return getRecruitButtonService(user, buttonKey).execute(params);
}
}

View File

@ -0,0 +1,28 @@
package com.engine.recruit.wrapper;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.recruit.service.RecruitFlowService;
import com.engine.recruit.service.impl.RecruitFlowServiceImpl;
import weaver.hrm.User;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2023/09/20
* @version: 1.0
*/
public class RecruitFlowWrapper extends Service {
private RecruitFlowService getRecruitFlowService(User user) {
return ServiceUtil.getService(RecruitFlowServiceImpl.class, user);
}
public Map<String, Object> getButtonList(Map<String, Object> param) {
return getRecruitFlowService(user).getButtonList(param);
}
public Map<String, Object> getRecruitStepList(Map<String, Object> param) {
return getRecruitFlowService(user).getRecruitStepList(param);
}
}

View File

@ -0,0 +1,24 @@
package com.engine.recruit.wrapper;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.recruit.service.RecruitPositionService;
import com.engine.recruit.service.impl.RecruitPositionServiceImpl;
import weaver.hrm.User;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2023/10/09
* @version: 1.0
*/
public class RecruitPositionWrapper extends Service {
private RecruitPositionService getRecruitPositionService(User user) {
return ServiceUtil.getService(RecruitPositionServiceImpl.class, user);
}
public Map<String, Object> updatePostInfo(Map<String, Object> param) {
return getRecruitPositionService(user).updatePostInfo(param);
}
}

View File

@ -0,0 +1,134 @@
package weaver.formmode.recruit.modeexpand.applicant;
import com.engine.recruit.enums.ApplicantOperateEnum;
import com.engine.recruit.enums.CurrentApplicationStageEnum;
import com.engine.recruit.enums.InterviewOperateTypeEnum;
import org.apache.commons.lang3.StringUtils;
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
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.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2023/09/28
* @version: 1.0
*/
public class UpdateApplicantModeExpand extends AbstractModeExpandJavaCodeNew {
@Override
public Map<String, String> doModeExpand(Map<String, Object> params) {
Map<String, String> result = new HashMap<>();
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<>(16);
for (Property property : properties) {
mainDataMap.put(property.getName(), property.getValue());
}
String operateType = Util.null2String(params.get("operateType"));
if (StringUtils.isBlank(operateType)) {
operateType = InterviewOperateTypeEnum.ARRANGE.getOperateType();
}
ApplicantOperateEnum operateTypeEnum = ApplicantOperateEnum.getOperateType(operateType);
switch (operateTypeEnum) {
// 转移阶段
case TRANSFER:
default:
break;
}
}
}
} catch (Exception e) {
result.put("errmsg", "自定义出错信息");
result.put("flag", "false");
}
return result;
}
private void transferApplicant(Map<String, Object> mainDataMap) {
// 当前应聘阶段
String currentApplicationStage = Util.null2String(mainDataMap.get("dqypjd"));
// 待入职入职状态数据推入职管理建模
if (CurrentApplicationStageEnum.EMPLOYMENT.getStageValue().equals(currentApplicationStage) || CurrentApplicationStageEnum.ENTRY.getStageValue().equals(currentApplicationStage)) {
String modeTableName = "uf_jcl_rzgl";
String insertSql = "insert into " + modeTableName + " () values ()";
}
}
private List<Object> buildParamList(Map<String, Object> map) {
List<Object> param = new ArrayList<>();
// 填充建模表相关字段
param.add(map.get("modedatacreatertype"));
param.add(map.get("formmodeid"));
param.add(map.get("modedatacreater"));
param.add(map.get("modedatacreatedate"));
param.add(map.get("modedatacreatetime"));
param.add(map.get("modedatamodifier"));
param.add(map.get("modedatamodifydatetime"));
// 表单字段
// 信息采集ID
// param.add(map.get(""));
// 姓名
param.add(map.get("xm"));
// 身份证号
param.add(map.get("sfz"));
// 年龄
param.add(map.get("nl"));
// 性别
param.add(map.get("xb"));
// 手机号码
param.add(map.get("sjhm"));
// 电子邮箱
param.add(map.get("dzyx"));
// 入职公司
param.add(map.get("rzgs"));
//// 入职部门
//param.add(map.get("rzbm"));
//// 直接上级
//param.add(map.get("zjsj"));
//// 岗位
//param.add(map.get("gw"));
// 预计入职日期
param.add(map.get("yjrzrq"));
// 关联招聘需求
param.add(map.get("glzpxq"));
// 入职状态
param.add(map.get("rzzt"));
// 信息采集
param.add(map.get("xxcj"));
// 入职流程
param.add(map.get("rzlc"));
// 入职流程状态
param.add(map.get("rzlczt"));
// 批次ID
param.add(map.get("pcid"));
// 取消原因
param.add(map.get("qxyy"));
return param;
}
}

View File

@ -1,4 +1,4 @@
package weaver.formmode.recruit.demandmanage;
package weaver.formmode.recruit.modeexpand.demandmanage;
import com.engine.recruit.enums.RecruitStatusEnum;
import weaver.common.DateUtil;
@ -13,6 +13,7 @@ import java.util.HashMap;
import java.util.Map;
/**
* <p>聚才林招聘</p>
* 完成需求
* <p>完成需求更新状态为招聘完成置空结束日期完成日期取当前日期</p>
*

View File

@ -1,4 +1,4 @@
package weaver.formmode.recruit.demandmanage;
package weaver.formmode.recruit.modeexpand.demandmanage;
import com.engine.recruit.enums.RecruitStatusEnum;
import weaver.conn.RecordSet;
@ -12,6 +12,7 @@ import java.util.HashMap;
import java.util.Map;
/**
* <p>聚才林招聘</p>
* 开启需求
* <p>开启需求状态为进行中置空完成日期和结束日期</p>
*

View File

@ -1,4 +1,4 @@
package weaver.formmode.recruit.demandmanage;
package weaver.formmode.recruit.modeexpand.demandmanage;
import com.engine.recruit.enums.RecruitStatusEnum;
import weaver.common.DateUtil;
@ -13,6 +13,7 @@ import java.util.HashMap;
import java.util.Map;
/**
* <p>聚才林招聘</p>
* 关闭需求
* <p>关闭需求状态为招聘停止置空完成日期结束日期取当前日期</p>
*

View File

@ -0,0 +1,159 @@
package weaver.formmode.recruit.modeexpand.departmentscreening;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import weaver.common.DateUtil;
import weaver.conn.RecordSet;
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
import weaver.formmode.setup.ModeRightInfo;
import weaver.general.BaseBean;
import weaver.general.Util;
import weaver.hrm.User;
import weaver.soa.workflow.request.*;
import java.util.*;
/**
* <p>聚才林招聘</p>
* 批量发起部门筛选转部门筛选反馈数据
*
* @author:dxfeng
* @createTime: 2023/09/18
* @version: 1.0
*/
public class BatchAddDeptScreeningModeExpand extends AbstractModeExpandJavaCodeNew {
/**
* JCL_部门筛选反馈(uf_jcl_bmsxfk)
*/
private static final String MODE_TABLE_NAME = "uf_jcl_bmsxfk";
@Override
public Map<String, String> doModeExpand(Map<String, Object> param) {
Map<String, String> result = new HashMap<>();
try {
RequestInfo requestInfo = (RequestInfo) param.get("RequestInfo");
if (requestInfo != null) {
int formModeId = -1;
RecordSet rs = new RecordSet();
rs.executeQuery("select id from modeinfo where formid =( select id from workflow_bill where tablename = ? )", MODE_TABLE_NAME);
if (rs.next()) {
formModeId = rs.getInt("id");
}
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
Property[] properties = mainTableInfo.getProperty();
Map<String, Object> mainDataMap = new HashMap<>();
for (Property property : properties) {
mainDataMap.put(property.getName(), property.getValue());
}
User user = (User) param.get("user");
// 部门筛选ID
mainDataMap.put("bmsxid", requestInfo.getRequestid());
// 状态
mainDataMap.put("zt", "0");
// 填充建模数据基本信息
mainDataMap.put("formmodeid", formModeId);
mainDataMap.put("modedatacreater", user.getUID());
String dateTime = DateUtil.getFullDate();
String[] split = dateTime.split(" ");
mainDataMap.put("modedatacreatedate", split[0]);
mainDataMap.put("modedatacreatetime", split[1]);
mainDataMap.put("modedatamodifier", user.getUID());
mainDataMap.put("modedatamodifydatetime", dateTime);
mainDataMap.put("modedatacreatertype", "0");
List<Map<String, Object>> detailMapList = new ArrayList<>();
DetailTableInfo detailTableInfo = requestInfo.getDetailTableInfo();
DetailTable detailTable = detailTableInfo.getDetailTable(0);
Row[] rows = detailTable.getRow();
for (Row row : rows) {
Map<String, Object> detailDataMap = new HashMap<>(mainDataMap);
Cell[] cells = row.getCell();
for (Cell cell : cells) {
detailDataMap.put(cell.getName(), cell.getValue());
}
detailMapList.add(detailDataMap);
}
for (Map<String, Object> detailDataMap : detailMapList) {
List<List<Object>> paramList = new ArrayList<>();
buildParamList(detailDataMap, paramList);
if (CollectionUtils.isNotEmpty(paramList)) {
String insertSql = "insert into " + MODE_TABLE_NAME + " (modeuuid, modedatacreatertype, formmodeid, modedatacreater, modedatacreatedate, modedatacreatetime, modedatamodifier, modedatamodifydatetime, bmsxid, ypz, ypzw, tdsj, zt, pcid, fkr) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
for (List<Object> objects : paramList) {
String uuid = UUID.randomUUID().toString();
objects.add(0, uuid);
rs.executeUpdate(insertSql, objects);
refreshRight(rs, uuid, formModeId);
}
}
}
}
} catch (Exception e) {
new BaseBean().writeLog(e);
result.put("errmsg", "自定义出错信息");
result.put("flag", "false");
}
return result;
}
/**
* 构建批量插入数据集合
*
* @param map 表单参数
* @param paramList 待插入数据集合
*/
private void buildParamList(Map<String, Object> map, List<List<Object>> paramList) {
List<Object> param = new ArrayList<>();
// 填充建模表相关字段
param.add(map.get("modedatacreatertype"));
param.add(map.get("formmodeid"));
param.add(map.get("modedatacreater"));
param.add(map.get("modedatacreatedate"));
param.add(map.get("modedatacreatetime"));
param.add(map.get("modedatamodifier"));
param.add(map.get("modedatamodifydatetime"));
//部门筛选ID
param.add(map.get("bmsxid"));
// 应聘者
param.add(map.get("ypz"));
// 应聘职位
param.add(map.get("ypzw"));
// 投递时间
param.add(map.get("tdsj"));
// 状态
param.add(map.get("zt"));
// 批次ID
param.add(map.get("pcid"));
// 反馈人
String fkr = Util.null2String(map.get("fkr"));
if (StringUtils.isNotBlank(fkr)) {
String[] fkrArray = fkr.split(",");
for (String fkrId : fkrArray) {
ArrayList<Object> objects = new ArrayList<>(param);
objects.add(fkrId);
paramList.add(objects);
}
}
}
/**
* 权限重构
*
* @param rs RecordSet
* @param uuid UUID
* @param formModeId 建模ID
*/
private void refreshRight(RecordSet rs, String uuid, int formModeId) {
rs.executeQuery("select id from " + MODE_TABLE_NAME + " where modeuuid='" + uuid + "'");
if (rs.next()) {
//建模数据的id
int bid = Util.getIntValue(rs.getString("id"));
ModeRightInfo modeRightInfo = new ModeRightInfo();
modeRightInfo.setNewRight(true);
//新建的时候添加共享
modeRightInfo.editModeDataShare(1, formModeId, bid);
}
}
}

View File

@ -0,0 +1,147 @@
package weaver.formmode.recruit.modeexpand.departmentscreening;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import weaver.common.DateUtil;
import weaver.conn.RecordSet;
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
import weaver.formmode.setup.ModeRightInfo;
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.*;
/**
* <p>聚才林招聘</p>
* 单一发起部门筛选转部门筛选反馈数据
*
* @author:dxfeng
* @createTime: 2023/09/18
* @version: 1.0
*/
public class SingleAddDeptScreeningModeExpand extends AbstractModeExpandJavaCodeNew {
/**
* JCL_部门筛选反馈(uf_jcl_bmsxfk)
*/
private static final String MODE_TABLE_NAME = "uf_jcl_bmsxfk";
@Override
public Map<String, String> doModeExpand(Map<String, Object> param) {
Map<String, String> result = new HashMap<>();
try {
RequestInfo requestInfo = (RequestInfo) param.get("RequestInfo");
if (requestInfo != null) {
Map<String, Object> dataMap = new HashMap<>();
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
Property[] properties = mainTableInfo.getProperty();
for (Property property : properties) {
dataMap.put(property.getName(), property.getValue());
}
int formModeId = -1;
RecordSet rs = new RecordSet();
rs.executeQuery("select id from modeinfo where formid =( select id from workflow_bill where tablename = ? )", MODE_TABLE_NAME);
if (rs.next()) {
formModeId = rs.getInt("id");
}
User user = (User) param.get("user");
// 部门筛选ID
dataMap.put("bmsxid", requestInfo.getRequestid());
// 状态
dataMap.put("zt", "0");
// 填充建模数据基本信息
dataMap.put("formmodeid", formModeId);
dataMap.put("modedatacreater", user.getUID());
String dateTime = DateUtil.getFullDate();
String[] split = dateTime.split(" ");
dataMap.put("modedatacreatedate", split[0]);
dataMap.put("modedatacreatetime", split[1]);
dataMap.put("modedatamodifier", user.getUID());
dataMap.put("modedatamodifydatetime", dateTime);
dataMap.put("modedatacreatertype", "0");
List<List<Object>> paramList = new ArrayList<>();
buildParamList(dataMap, paramList);
if (CollectionUtils.isNotEmpty(paramList)) {
String insertSql = "insert into " + MODE_TABLE_NAME + " (modeuuid, modedatacreatertype, formmodeid, modedatacreater, modedatacreatedate, modedatacreatetime, modedatamodifier, modedatamodifydatetime, bmsxid, ypz, ypzw, tdsj, zt, pcid, fkr) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
for (List<Object> objects : paramList) {
String uuid = UUID.randomUUID().toString();
objects.add(0, uuid);
rs.executeUpdate(insertSql, objects);
refreshRight(rs, uuid, formModeId);
}
}
}
} catch (Exception e) {
new BaseBean().writeLog(e);
result.put("errmsg", "自定义出错信息");
result.put("flag", "false");
}
return result;
}
/**
* 构建批量插入数据集合
*
* @param map 表单参数
* @param paramList 待插入数据集合
*/
private void buildParamList(Map<String, Object> map, List<List<Object>> paramList) {
List<Object> param = new ArrayList<>();
// 填充建模表相关字段
param.add(map.get("modedatacreatertype"));
param.add(map.get("formmodeid"));
param.add(map.get("modedatacreater"));
param.add(map.get("modedatacreatedate"));
param.add(map.get("modedatacreatetime"));
param.add(map.get("modedatamodifier"));
param.add(map.get("modedatamodifydatetime"));
//部门筛选ID
param.add(map.get("bmsxid"));
// 应聘者
param.add(map.get("ypz"));
// 应聘职位
param.add(map.get("ypzw"));
// 投递时间
param.add(map.get("tdsj"));
// 状态
param.add(map.get("zt"));
// 批次ID
param.add(map.get("pcid"));
// 反馈人
String fkr = Util.null2String(map.get("fkr"));
if (StringUtils.isNotBlank(fkr)) {
String[] fkrArray = fkr.split(",");
for (String fkrId : fkrArray) {
ArrayList<Object> objects = new ArrayList<>(param);
objects.add(fkrId);
paramList.add(objects);
}
}
}
/**
* 权限重构
*
* @param rs RecordSet
* @param uuid UUID
* @param formModeId 建模ID
*/
private void refreshRight(RecordSet rs, String uuid, int formModeId) {
rs.executeQuery("select id from " + MODE_TABLE_NAME + " where modeuuid='" + uuid + "'");
if (rs.next()) {
//建模数据的id
int bid = Util.getIntValue(rs.getString("id"));
ModeRightInfo modeRightInfo = new ModeRightInfo();
modeRightInfo.setNewRight(true);
//新建的时候添加共享
modeRightInfo.editModeDataShare(1, formModeId, bid);
}
}
}

View File

@ -0,0 +1,68 @@
package weaver.formmode.recruit.modeexpand.entrymanager;
import com.engine.recruit.enums.EntryStatusEnum;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
import weaver.general.Util;
import weaver.soa.workflow.request.MainTableInfo;
import weaver.soa.workflow.request.Property;
import weaver.soa.workflow.request.RequestInfo;
import java.util.HashMap;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2023/10/07
* @version: 1.0
*/
public class AddEntryModeExpand extends AbstractModeExpandJavaCodeNew {
@Override
public Map<String, String> doModeExpand(Map<String, Object> param) {
Map<String, String> result = new HashMap<>();
try {
int billId;
int modeId;
RequestInfo requestInfo = (RequestInfo) param.get("RequestInfo");
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, String> mainDataMap = new HashMap<>();
for (Property property : properties) {
mainDataMap.put(property.getName(), property.getValue());
}
RecordSet rs = new RecordSet();
String pcid = mainDataMap.get("pcid");
String sfzh = mainDataMap.get("sfzh");
String rzzt = mainDataMap.get("rzzt");
// 根据身份证号判定只能有一个状态为待入职的数据
if (EntryStatusEnum.PENDING.getValue().equals(rzzt)) {
rs.executeQuery("select count(id) as num from uf_jcl_rzgl where sfzh = ? and id != ? and rzzt = ? ", sfzh, billId, rzzt);
int countNum = 0;
if (rs.next()) {
countNum = rs.getInt("num");
}
if (countNum > 0) {
result.put("errmsg", "当前身份证号已存在待入职状态数据");
result.put("flag", "false");
return result;
}
}
// 更新应聘者当前应聘阶段
String dqypjd = Util.null2String(param.get("dqypjd"));
if (StringUtils.isNotBlank(dqypjd)) {
rs.executeUpdate("update uf_jcl_yppc set dqypjd = ? where id = ?", dqypjd, pcid);
}
}
}
} catch (Exception e) {
result.put("errmsg", "自定义出错信息");
result.put("flag", "false");
}
return result;
}
}

View File

@ -0,0 +1,214 @@
package weaver.formmode.recruit.modeexpand.interview;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import weaver.common.DateUtil;
import weaver.conn.RecordSet;
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
import weaver.formmode.recruit.modeexpand.util.RecruitModeUtil;
import weaver.formmode.setup.ModeRightInfo;
import weaver.general.BaseBean;
import weaver.general.Util;
import weaver.hrm.User;
import weaver.soa.workflow.request.*;
import java.io.UnsupportedEncodingException;
import java.util.*;
/**
* <p>聚才林招聘</p>
* 批量面试推送面试评价
*
* @author:dxfeng
* @createTime: 2023/09/22
* @version: 1.0
*/
public class BatchAddInterviewResultModeExpand extends AbstractModeExpandJavaCodeNew {
private static final String MODE_TABLE_NAME = "uf_jcl_ms";
/**
* 消息来源ID
*/
private final String messageType;
/**
* 消息提醒标题
*/
private final String title;
public BatchAddInterviewResultModeExpand() throws UnsupportedEncodingException {
super();
messageType = RecruitModeUtil.getRecruitPropValue("INTERVIEW_MESSAGE_TYPE");
title = RecruitModeUtil.getRecruitPropValue("INTERVIEW_ADD_MESSAGE_TITLE");
}
@Override
public Map<String, String> doModeExpand(Map<String, Object> param) {
Map<String, String> result = new HashMap<>();
try {
RequestInfo requestInfo = (RequestInfo) param.get("RequestInfo");
if (requestInfo != null) {
int formModeId = -1;
int formId = -1;
RecordSet rs = new RecordSet();
rs.executeQuery("select id from workflow_bill where tablename = ?", MODE_TABLE_NAME);
if (rs.next()) {
formId = rs.getInt("id");
}
rs.executeQuery("select id from modeinfo where formid =?", formId);
if (rs.next()) {
formModeId = rs.getInt("id");
}
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
Property[] properties = mainTableInfo.getProperty();
Map<String, Object> mainDataMap = new HashMap<>();
for (Property property : properties) {
mainDataMap.put(property.getName(), RecruitModeUtil.parseBlankToNull(property.getValue()));
}
User user = (User) param.get("user");
// 填充建模数据基本信息
mainDataMap.put("formmodeid", formModeId);
mainDataMap.put("modedatacreater", user.getUID());
String dateTime = DateUtil.getFullDate();
String[] split = dateTime.split(" ");
mainDataMap.put("modedatacreatedate", split[0]);
mainDataMap.put("modedatacreatetime", split[1]);
mainDataMap.put("modedatamodifier", user.getUID());
mainDataMap.put("modedatamodifydatetime", dateTime);
mainDataMap.put("modedatacreatertype", "0");
//mainDataMap.put("bsapid", requestInfo.getRequestid());
List<Map<String, Object>> detailMapList = new ArrayList<>();
DetailTableInfo detailTableInfo = requestInfo.getDetailTableInfo();
DetailTable detailTable = detailTableInfo.getDetailTable(0);
Row[] rows = detailTable.getRow();
for (Row row : rows) {
Map<String, Object> detailDataMap = new HashMap<>(mainDataMap);
Cell[] cells = row.getCell();
for (Cell cell : cells) {
detailDataMap.put(cell.getName(), RecruitModeUtil.parseBlankToNull(cell.getValue()));
}
detailMapList.add(detailDataMap);
}
String insertSql = "insert into " + MODE_TABLE_NAME + " (modeuuid, modedatacreatertype, formmodeid, modedatacreater, modedatacreatedate, modedatacreatetime, modedatamodifier, modedatamodifydatetime, pcid, ypz, ypzw, tdsj, sjhm, dzyx, tzypz, msfs, mshj, msc, msg, ptmsg, ptmsgsfcymspj, msrq, zt) values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
StringBuilder msgBuilder = new StringBuilder();
for (Map<String, Object> detailDataMap : detailMapList) {
List<Object> paramList = buildParamList(detailDataMap);
if (CollectionUtils.isNotEmpty(paramList)) {
String uuid = UUID.randomUUID().toString();
paramList.add(0, uuid);
rs.executeUpdate(insertSql, paramList);
rs.executeQuery("select id from " + MODE_TABLE_NAME + " where modeuuid='" + uuid + "'");
if (rs.next()) {
// 权限重构
int bid = Util.getIntValue(rs.getString("id"));
ModeRightInfo modeRightInfo = new ModeRightInfo();
modeRightInfo.setNewRight(true);
modeRightInfo.editModeDataShare(1, formModeId, bid);
getApplicantsInfo(msgBuilder, Util.null2String(detailDataMap.get("ypz")), Util.null2String(detailDataMap.get("ypzw")));
}
}
}
if (StringUtils.isNotBlank(msgBuilder)) {
msgBuilder.insert(0, RecruitModeUtil.getResourceNames(requestInfo.getCreatorid()) + "安排了一场面试<br/>");
String msrq = Util.null2String(mainDataMap.get("msrq"));
String msg = Util.null2String(mainDataMap.get("msg"));
String ptmsg = Util.null2String(mainDataMap.get("ptmsg"));
String msdd = Util.null2String(mainDataMap.get("msdd"));
msgBuilder.append("面试时间:").append(msrq).append(";面试官:").append(RecruitModeUtil.getResourceNames(msg)).append("").append(RecruitModeUtil.getResourceNames(ptmsg)).append("<br/>");
msgBuilder.append("面试地址:").append(msdd);
// 消息发送
Set<String> userIdSet = new HashSet<>();
userIdSet.addAll(Arrays.asList(msg.split(",")));
userIdSet.addAll(Arrays.asList(ptmsg.split(",")));
RecruitModeUtil.messagePush(messageType, title, msgBuilder.toString(), userIdSet, user.getUID());
}
}
} catch (Exception e) {
new BaseBean().writeLog(e);
result.put("errmsg", "自定义出错信息");
result.put("flag", "false");
}
return result;
}
/**
* 构建批量插入数据集合
*
* @param map 表单参数
*/
private List<Object> buildParamList(Map<String, Object> map) {
List<Object> param = new ArrayList<>();
// 填充建模表相关字段
param.add(map.get("modedatacreatertype"));
param.add(map.get("formmodeid"));
param.add(map.get("modedatacreater"));
param.add(map.get("modedatacreatedate"));
param.add(map.get("modedatacreatetime"));
param.add(map.get("modedatamodifier"));
param.add(map.get("modedatamodifydatetime"));
// 表单字段
// 批次ID
param.add(map.get("pcid"));
// 应聘者
param.add(map.get("ypz"));
// 投递职位
param.add(map.get("ypzw"));
// 投递时间
param.add(map.get("tdsj"));
// 手机号码
param.add(map.get("sjhm"));
// 电子邮箱
param.add(map.get("dzyx"));
// 通知应聘者
param.add(map.get("tzypz"));
// 面试方式
param.add(map.get("msfs"));
// 面试环节
param.add(map.get("mshj"));
// 面试轮次
param.add(map.get("msc"));
// 面试官
param.add(map.get("msg"));
// 陪同面试官
param.add(map.get("ptmsg"));
// 陪同面试官是否参与面试评价
param.add(map.get("ptmsgsfcymspj"));
// 面试日期
param.add(map.get("msrq"));
// 面试状态,默认值待面试
param.add("0");
return param;
}
/**
* 获取应聘者信息
*
* @param msgBuilder 消息内容
* @param applicantId 应聘者ID
* @param positionId 应聘职位ID
*/
private void getApplicantsInfo(StringBuilder msgBuilder, String applicantId, String positionId) {
if (StringUtils.isAnyBlank(applicantId, positionId)) {
return;
}
RecordSet rs = new RecordSet();
rs.executeQuery("select xm from uf_jcl_yppc where id = ?", applicantId);
if (rs.next()) {
msgBuilder.append("应聘者:").append(rs.getString("xm"));
}
rs.executeQuery("select zpzwmc from uf_jcl_zp_zpzw where id = ?", positionId);
if (rs.next()) {
msgBuilder.append(";应聘职位:").append(rs.getString("zpzwmc"));
}
msgBuilder.append("<br/>");
}
}

View File

@ -0,0 +1,111 @@
package weaver.formmode.recruit.modeexpand.interview;
import com.engine.recruit.enums.InterviewOperateTypeEnum;
import org.apache.commons.lang3.StringUtils;
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
import weaver.formmode.recruit.modeexpand.util.ApplicantCommonInfo;
import weaver.formmode.recruit.modeexpand.util.RecruitModeUtil;
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.*;
/**
* <p>聚才林招聘</p>
* 面试保存按钮拓展接口
*
* @author:dxfeng
* @createTime: 2023/09/27
* @version: 1.0
*/
public class CreateInterviewModeExpand extends AbstractModeExpandJavaCodeNew {
/**
* 消息来源ID
*/
private String messageType;
/**
* 消息提醒标题
*/
private String title;
@Override
public Map<String, String> doModeExpand(Map<String, Object> params) {
Map<String, String> result = new HashMap<>();
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<>(16);
for (Property property : properties) {
mainDataMap.put(property.getName(), property.getValue());
}
String operateType = Util.null2String(params.get("operateType"));
if (StringUtils.isBlank(operateType)) {
operateType = InterviewOperateTypeEnum.ARRANGE.getOperateType();
}
InterviewOperateTypeEnum operateTypeEnum = InterviewOperateTypeEnum.getOperateType(operateType);
switch (operateTypeEnum) {
case ARRANGE:
messageType = RecruitModeUtil.getRecruitPropValue("INTERVIEW_MESSAGE_TYPE");
title = RecruitModeUtil.getRecruitPropValue("INTERVIEW_ADD_MESSAGE_TITLE");
arrangeInterview(user, mainDataMap);
default:
break;
}
}
}
} catch (Exception e) {
result.put("errmsg", "自定义出错信息");
result.put("flag", "false");
}
return result;
}
/**
* 安排面试拓展动作
*
* @param user
* @param mainDataMap
*/
private void arrangeInterview(User user, Map<String, Object> mainDataMap) {
StringBuilder msgBuilder = new StringBuilder();
msgBuilder.append(RecruitModeUtil.getResourceNames(String.valueOf(user.getUID()))).append("安排了一场面试<br/>");
String ypz = Util.null2String(mainDataMap.get("ypz"));
String ypzw = Util.null2String(mainDataMap.get("ypzw"));
String msrq = Util.null2String(mainDataMap.get("msrq"));
String msg = Util.null2String(mainDataMap.get("msg"));
String ptmsg = Util.null2String(mainDataMap.get("ptmsg"));
String msdd = Util.null2String(mainDataMap.get("msdd"));
msgBuilder.append("应聘者:").append(ApplicantCommonInfo.getApplicantName(ypz));
msgBuilder.append(";应聘职位:").append(ApplicantCommonInfo.getApplicantPosition(ypzw));
msgBuilder.append("<br/>");
msgBuilder.append("面试时间:").append(msrq).append(";面试官:").append(RecruitModeUtil.getResourceNames(msg)).append("").append(RecruitModeUtil.getResourceNames(ptmsg)).append("<br/>");
msgBuilder.append("面试地址:").append(msdd);
// 消息发送
Set<String> userIdSet = new HashSet<>();
userIdSet.addAll(Arrays.asList(msg.split(",")));
userIdSet.addAll(Arrays.asList(ptmsg.split(",")));
RecruitModeUtil.messagePush(messageType, title, msgBuilder.toString(), userIdSet, user.getUID());
}
}

View File

@ -0,0 +1,164 @@
package weaver.formmode.recruit.modeexpand.interview;
import com.engine.recruit.enums.InterviewOperateTypeEnum;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
import weaver.formmode.recruit.modeexpand.util.ApplicantCommonInfo;
import weaver.formmode.recruit.modeexpand.util.RecruitModeUtil;
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.*;
/**
* @author:dxfeng
* @createTime: 2023/09/27
* @version: 1.0
*/
public class UpdateInterviewModeExpand extends AbstractModeExpandJavaCodeNew {
private static final String MODE_TABLE_NAME = "uf_jcl_ms";
/**
* 消息来源ID
*/
private String messageType;
/**
* 消息提醒标题
*/
private String title;
@Override
public Map<String, String> doModeExpand(Map<String, Object> params) {
Map<String, String> result = new HashMap<>();
try {
//数据id
int billId;
//模块id
int modeId;
RequestInfo requestInfo = (RequestInfo) params.get("RequestInfo");
if (requestInfo != null) {
billId = Util.getIntValue(requestInfo.getRequestid());
modeId = Util.getIntValue(requestInfo.getWorkflowid());
if (billId > 0 && modeId > 0) {
User user = (User) params.get("user");
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 operateType = Util.null2String(params.get("operateType"));
if (StringUtils.isBlank(operateType)) {
// 为空则默认为新建布局安排面试
operateType = InterviewOperateTypeEnum.ARRANGE.getOperateType();
}
InterviewOperateTypeEnum operateTypeEnum = InterviewOperateTypeEnum.getOperateType(operateType);
switch (operateTypeEnum) {
case EVALUATE:
// 面试评价
messageType = RecruitModeUtil.getRecruitPropValue("INTERVIEW_MESSAGE_TYPE");
title = RecruitModeUtil.getRecruitPropValue("INTERVIEW_EVALUATE_MESSAGE_TITLE");
evaluateInterview(params, requestInfo.getCreatorid(), mainDataMap);
break;
case CANCEL:
// 面试取消
messageType = RecruitModeUtil.getRecruitPropValue("INTERVIEW_MESSAGE_TYPE");
title = RecruitModeUtil.getRecruitPropValue("INTERVIEW_CANCEL_MESSAGE_TITLE");
cancelInterView(params, requestInfo, billId, mainDataMap);
break;
default:
break;
}
}
}
} catch (Exception e) {
result.put("errmsg", "自定义出错信息");
result.put("flag", "false");
}
return result;
}
/**
* 面试评价操作拓展动作
*
* @param params params
* @param creater creater
* @param mainDataMap mainDataMap
*/
private void evaluateInterview(Map<String, Object> params, String creater, Map<String, Object> mainDataMap) {
String ypz = Util.null2String(mainDataMap.get("ypz"));
String ypzw = Util.null2String(mainDataMap.get("ypzw"));
String msfkr = Util.null2String(mainDataMap.get("msfkr"));
String msrq = Util.null2String(mainDataMap.get("msrq"));
String msg = Util.null2String(mainDataMap.get("msg"));
String ptmsg = Util.null2String(mainDataMap.get("ptmsg"));
String jg = Util.null2String(mainDataMap.get("jg"));
String formId = Util.null2String(params.get("formId"));
StringBuilder msgBuilder = new StringBuilder();
msgBuilder.append(RecruitModeUtil.getResourceNames(msfkr)).append("已经提交了面试评价");
msgBuilder.append("<br/>");
msgBuilder.append("应聘者:").append(ApplicantCommonInfo.getApplicantName(ypz)).append(";应聘职位:").append(ApplicantCommonInfo.getApplicantPosition(ypzw));
msgBuilder.append("<br/>");
msgBuilder.append("面试时间:").append(msrq).append(";面试官:").append(RecruitModeUtil.getResourceNames(msg)).append("").append(RecruitModeUtil.getResourceNames(ptmsg));
msgBuilder.append("<br/>");
msgBuilder.append("面试结果:").append(ApplicantCommonInfo.getSelectName(formId, "jg", jg));
User user = (User) params.get("user");
// 消息发送,通知创建人
Set<String> userIdSet = new HashSet<>();
userIdSet.add(creater);
RecruitModeUtil.messagePush(messageType, title, msgBuilder.toString(), userIdSet, user.getUID());
}
/**
* 取消面试拓展动作
*
* @param params params
* @param requestInfo requestInfo
* @param billId billId
* @param mainDataMap mainDataMap
*/
private void cancelInterView(Map<String, Object> params, RequestInfo requestInfo, int billId, Map<String, Object> mainDataMap) {
// 更新面试状态为已取消
RecordSet rs = new RecordSet();
rs.executeUpdate("update " + MODE_TABLE_NAME + " set zt = 4 where id = ?", billId);
// 发送消息
String msrq = Util.null2String(mainDataMap.get("msrq"));
String msg = Util.null2String(mainDataMap.get("msg"));
String ptmsg = Util.null2String(mainDataMap.get("ptmsg"));
String msdd = Util.null2String(mainDataMap.get("msdd"));
String formId = Util.null2String(params.get("formId"));
StringBuilder msgBuilder = new StringBuilder();
msgBuilder.append(RecruitModeUtil.getResourceNames(requestInfo.getCreatorid())).append("取消了面试,请知悉。取消原因:").append(ApplicantCommonInfo.getSelectName(formId, "qxyy", Util.null2String(mainDataMap.get("qxyy")))).append("<br/>");
msgBuilder.append("应聘者:").append(ApplicantCommonInfo.getApplicantName(Util.null2String(mainDataMap.get("ypz"))));
msgBuilder.append(";应聘职位:").append(ApplicantCommonInfo.getApplicantPosition(Util.null2String(mainDataMap.get("ypzw"))));
msgBuilder.append("<br/>");
msgBuilder.append("面试时间:").append(msrq).append(";面试官:").append(RecruitModeUtil.getResourceNames(msg)).append("").append(RecruitModeUtil.getResourceNames(ptmsg)).append("<br/>");
msgBuilder.append("面试地址:").append(msdd);
// 消息发送
Set<String> userIdSet = new HashSet<>();
userIdSet.addAll(Arrays.asList(msg.split(",")));
userIdSet.addAll(Arrays.asList(ptmsg.split(",")));
RecruitModeUtil.messagePush(messageType, title, msgBuilder.toString(), userIdSet, Integer.parseInt(requestInfo.getCreatorid()));
}
}

View File

@ -0,0 +1,64 @@
package weaver.formmode.recruit.modeexpand.position;
import com.weaver.rpa.sdk.clients.application.resume.ERPAResumeSDKClient;
import com.weaver.rpa.sdk.clients.core.ERPASDKClients;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
import weaver.general.BaseBean;
import weaver.general.Util;
import weaver.hrm.User;
import weaver.soa.workflow.request.RequestInfo;
import java.util.HashMap;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2023/10/07
* @version: 1.0
*/
public class ClosePositionModeExpand extends AbstractModeExpandJavaCodeNew {
@Override
public Map<String, String> doModeExpand(Map<String, Object> param) {
String tableName = "uf_jcl_zp_zpzw";
Map<String, String> result = new HashMap<>(16);
try {
User user = (User) param.get("user");
int billId;
int modeId;
RequestInfo requestInfo = (RequestInfo) param.get("RequestInfo");
if (requestInfo != null) {
billId = Util.getIntValue(requestInfo.getRequestid());
modeId = Util.getIntValue(requestInfo.getWorkflowid());
if (billId > 0 && modeId > 0) {
RecordSet rs = new RecordSet();
rs.executeQuery("select qllgwid from " + tableName + " where id = ?", billId);
if (rs.next()) {
String qllgwid = rs.getString("qllgwid");
if (StringUtils.isBlank(qllgwid)) {
new BaseBean().writeLog("billId=" + billId + ",当前职位暂未发布,无需进行下架操作");
result.put("errmsg", "当前职位暂未发布,无需进行下架操作");
result.put("flag", "false");
return result;
}
long jobId = Long.parseLong(qllgwid);
ERPAResumeSDKClient client = ERPASDKClients.getResumeSDKClient();
client.start();
String userId = String.valueOf(user.getUID());
client.closeResumeJob(userId, jobId);
rs.executeUpdate("update " + tableName + " set qdfbzt = ? where id = ?", 5, billId);
}
}
}
} catch (Exception e) {
new BaseBean().writeLog(e);
result.put("errmsg", e.getMessage());
result.put("flag", "false");
}
return result;
}
}

View File

@ -0,0 +1,132 @@
package weaver.formmode.recruit.modeexpand.position;
import com.alibaba.fastjson.JSON;
import com.weaver.rpa.sdk.clients.application.resume.ERPAResumeSDKClient;
import com.weaver.rpa.sdk.clients.application.resume.entity.ResumeJobDto;
import com.weaver.rpa.sdk.clients.core.ERPASDKClients;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.erpa.apps.entity.application.resume.dto.ResumeTaskResult;
import weaver.erpa.apps.entity.application.resume.enums.TaskResult;
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
import weaver.formmode.recruit.modeexpand.util.RecruitPositionUtil;
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.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2023/10/07
* @version: 1.0
*/
public class ReleasePositionModeExpand extends AbstractModeExpandJavaCodeNew {
@Override
public Map<String, String> doModeExpand(Map<String, Object> param) {
String tableName = "uf_jcl_zp_zpzw";
Map<String, String> resultMap = new HashMap<>(16);
try {
User user = (User) param.get("user");
int billId;
int modeId;
RequestInfo requestInfo = (RequestInfo) param.get("RequestInfo");
if (requestInfo != null) {
billId = Util.getIntValue(requestInfo.getRequestid());
modeId = Util.getIntValue(requestInfo.getWorkflowid());
if (billId > 0 && modeId > 0) {
long jobId = -1;
RecordSet rs = new RecordSet();
rs.executeQuery("select qllgwid from " + tableName + " where id = ?", billId);
if (rs.next()) {
String qllgwid = rs.getString("qllgwid");
if (StringUtils.isNotBlank(qllgwid)) {
jobId = Long.parseLong(qllgwid);
}
}
ERPAResumeSDKClient client = ERPASDKClients.getResumeSDKClient();
Map<String, Object> map = new HashMap<>(16);
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
Property[] properties = mainTableInfo.getProperty();
for (Property property : properties) {
map.put(property.getName(), property.getValue());
}
ResumeJobDto resumeJobDto = RecruitPositionUtil.convertMap2ResumeJobDto(map);
// 发布千里聆职位
if (!RecruitPositionUtil.checkAvailable(client)) {
new BaseBean().writeLog("千里聆未开通简历应用。");
resultMap.put("errmsg", "千里聆未开通简历应用。");
resultMap.put("flag", "false");
return resultMap;
}
String userId = String.valueOf(user.getUID());
// 未创建职位则先创建职位
if (jobId == -1) {
// 创建千里聆职位
jobId = client.addResumeJob(userId, resumeJobDto);
// 更新千里聆ID到建模表单
rs.executeUpdate("update " + tableName + " set qllgwid = ? where id = ?", jobId, billId);
}
// 在启动监听前需要配置好简历接收回调
client.addResumeSavedListener(resumeMqMessage -> {
new BaseBean().writeLog(JSON.toJSONString(resumeMqMessage));
});
client.start();
List<Integer> platformIds;
platformIds = resumeJobDto.getPlatformIds();
String errorMsg = "";
for (Integer platformId : platformIds) {
ResumeTaskResult result = client.releaseResumeJob(userId, jobId, platformId);
// 直接查看结果正在执行中会返回PENGING成功后会返回SUCCEED失败后会返回FAILED
TaskResult current = result.getResult();
new BaseBean().writeLog(current);
// 使用回调函数获取成功或者失败时的消息
result.onResult(() -> {
new BaseBean().writeLog("执行成功回调");
}, (reason) -> {
new BaseBean().writeLog("执行失败回调,原因:" + reason);
});
// 等待直到状态不再是PENDING
TaskResult taskResult = result.waitResult();
new BaseBean().writeLog(taskResult);
if (taskResult == TaskResult.SUCCEED) {
new BaseBean().writeLog("执行成功");
} else {
errorMsg = "执行失败,原因:" + result.getFailReason();
new BaseBean().writeLog(errorMsg);
break;
}
}
if (StringUtils.isNotBlank(errorMsg)) {
// 发布失败下架职位
client.closeResumeJob(userId, jobId);
// 更新状态为发布失败
rs.executeUpdate("update " + tableName + " set qdfbzt = ? where id = ?", 3, billId);
resultMap.put("errmsg", errorMsg);
resultMap.put("flag", "false");
return resultMap;
}
// 更新状态为已发布
rs.executeUpdate("update " + tableName + " set qdfbzt = ? where id = ?", 2, billId);
}
}
} catch (Exception e) {
new BaseBean().writeLog(e);
resultMap.put("errmsg", e.getMessage());
resultMap.put("flag", "false");
}
return resultMap;
}
}

View File

@ -0,0 +1,182 @@
package weaver.formmode.recruit.modeexpand.process;
import org.apache.commons.lang3.StringUtils;
import weaver.common.DateUtil;
import weaver.conn.RecordSet;
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
import weaver.formmode.recruit.modeexpand.util.RecruitModeUtil;
import weaver.formmode.setup.ModeRightInfo;
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.*;
/**
* <p>聚才林招聘</p>
*
* <p>招聘流程新建时生成流程阶段关联数据</p>
*
* @author:dxfeng
* @createTime: 2023/09/19
* @version: 1.0
*/
public class RelatedStageModeExpand extends AbstractModeExpandJavaCodeNew {
private static final String MODE_TABLE_NAME = "uf_jcl_zpjdsz";
private static final String MODE_TABLE_NAME_DT1 = "uf_jcl_zpjdsz_dt1";
private static final String MODE_TABLE_NAME_DT2 = "uf_jcl_zpjdsz_dt2";
@Override
public Map<String, String> doModeExpand(Map<String, Object> param) {
Map<String, String> result = new HashMap<>();
try {
String billId;
RequestInfo requestInfo = (RequestInfo) param.get("RequestInfo");
if (requestInfo != null) {
billId = requestInfo.getRequestid();
// 获取表单名称
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
Property[] properties = mainTableInfo.getProperty();
Map<String, String> mainDataMap = new HashMap<>();
for (Property property : properties) {
mainDataMap.put(property.getName(), property.getValue());
}
// 开始阶段
String ksjd = mainDataMap.get("ksjd");
// 过程阶段
String gcjd = mainDataMap.get("gcjd");
// 结束阶段
String jsjd = mainDataMap.get("jsjd");
// 查询所有的操作阶段信息
User user = (User) param.get("user");
relatedStageData(user.getUID(), billId, ksjd, gcjd, jsjd);
}
} catch (Exception e) {
new BaseBean().writeLog(e);
result.put("errmsg", "完成需求操作失败");
result.put("flag", "false");
}
return result;
}
/**
* 生成关联的招聘阶段数据
*
* @param creator 创建者ID
* @param billId 当前数据ID
* @param processIds 路程表单所选阶段ID
*/
private void relatedStageData(int creator, String billId, String... processIds) {
String dateTime = DateUtil.getFullDate();
String[] dateSplit = dateTime.split(" ");
List<Object> paramsList = new ArrayList<>();
// modedatacreater
paramsList.add(creator);
// modedatacreatedate
paramsList.add(dateSplit[0]);
// modedatacreatetime
paramsList.add(dateSplit[1]);
// modedatamodifier
paramsList.add(creator);
// modedatamodifydatetime
paramsList.add(dateTime);
// modedatacreatertype
paramsList.add("0");
String processIdsStr = StringUtils.join(Arrays.asList(processIds), ",");
String insertSql = "insert into " + MODE_TABLE_NAME + " (modeuuid, modedatacreater, modedatacreatedate, modedatacreatetime, modedatamodifier, modedatamodifydatetime, modedatacreatertype, formmodeid, jdmc, jdms, jdlx, hj, sfqy, zssx, zpjd, zplc) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
if (StringUtils.isNotBlank(processIdsStr)) {
insertMainTableData(billId, processIdsStr, insertSql, paramsList);
}
}
/**
* 插入主表数据
*
* @param billId 招聘流程表单ID
* @param processIdsStr 招聘阶段ID
* @param insertSql 插入SQL语句
* @param paramsList 待插入参数集合
*/
private void insertMainTableData(String billId, String processIdsStr, String insertSql, List<Object> paramsList) {
RecordSet rs = new RecordSet();
rs.executeQuery("select * from uf_jcl_zpjdsz where id in (" + processIdsStr + ") order by hj,zssx");
while (rs.next()) {
String uuid = UUID.randomUUID().toString();
ArrayList<Object> insertList = new ArrayList<>(paramsList);
insertList.add(0, uuid);
String formModeId = rs.getString("formmodeid");
insertList.add(formModeId);
insertList.add(RecruitModeUtil.parseBlankToNull(rs.getString("jdmc")));
insertList.add(RecruitModeUtil.parseBlankToNull(rs.getString("jdms")));
insertList.add(RecruitModeUtil.parseBlankToNull(rs.getString("jdlx")));
insertList.add(RecruitModeUtil.parseBlankToNull(rs.getString("hj")));
insertList.add(RecruitModeUtil.parseBlankToNull(rs.getString("sfqy")));
insertList.add(RecruitModeUtil.parseBlankToNull(rs.getString("zssx")));
// zpjd
insertList.add(RecruitModeUtil.parseBlankToNull(rs.getString("id")));
// zplc
insertList.add(RecruitModeUtil.parseBlankToNull(billId));
// 插入主表数据
rs.executeUpdate(insertSql, insertList);
refreshRight(uuid, formModeId, rs.getString("id"));
}
}
/**
* 权限重构插入明细表数据
*
* @param uuid UUID
* @param formModeId formModeId
*/
private void refreshRight(String uuid, String formModeId, String processId) {
RecordSet rs = new RecordSet();
rs.executeQuery("select id from " + MODE_TABLE_NAME + " where modeuuid='" + uuid + "'");
if (rs.next()) {
//建模数据的id
String bid = rs.getString("id");
ModeRightInfo modeRightInfo = new ModeRightInfo();
modeRightInfo.setNewRight(true);
//新建的时候添加共享
modeRightInfo.editModeDataShare(1, Util.getIntValue(formModeId), Util.getIntValue(bid));
// 插入明细表数据
rs.executeQuery("select * from " + MODE_TABLE_NAME_DT1 + " where mainid = ? ", processId);
List<List<Object>> insertList = new ArrayList<>();
while (rs.next()) {
List<Object> paramList = new ArrayList<>();
// mainid
paramList.add(bid);
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("czan")));
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("zdyxsmc")));
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("sfqy")));
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("tzymbt")));
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("tzymdz")));
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("zssx")));
insertList.add(paramList);
}
for (List<Object> list : insertList) {
rs.executeUpdate("insert into " + MODE_TABLE_NAME_DT1 + " (mainid, czan, zdyxsmc, sfqy, tzymbt, tzymdz, zssx) values (?, ?, ?, ?, ?, ?, ?)", list);
}
insertList = new ArrayList<>();
rs.executeQuery("select * from " + MODE_TABLE_NAME_DT2 + " where mainid = ? ", processId);
while (rs.next()) {
List<Object> paramList = new ArrayList<>();
// mainid
paramList.add(bid);
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("ymbt")));
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("ymdz")));
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("zssx")));
insertList.add(paramList);
}
for (List<Object> list : insertList) {
rs.executeUpdate("insert into " + MODE_TABLE_NAME_DT2 + " (mainid, ymbt, ymdz, zssx) values (?, ?, ?, ?)", list);
}
}
}
}

View File

@ -0,0 +1,86 @@
package weaver.formmode.recruit.modeexpand.util;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import java.util.ArrayList;
import java.util.List;
/**
* @author:dxfeng
* @createTime: 2023/09/27
* @version: 1.0
*/
public class ApplicantCommonInfo {
/**
* 获取应聘者姓名
*
* @param applicantId 应聘者ID
* @return 应聘者姓名
*/
public static String getApplicantName(String applicantId) {
RecordSet rs = new RecordSet();
rs.executeQuery("select xm from uf_jcl_yppc where id = ?", applicantId);
if (rs.next()) {
return rs.getString("xm");
}
return "";
}
/**
* 获取应聘职位名称
*
* @param positionId 职位ID
* @return 职位名称
*/
public static String getApplicantPosition(String positionId) {
RecordSet rs = new RecordSet();
rs.executeQuery("select zpzwmc from uf_jcl_zp_zpzw where id = ?", positionId);
if (rs.next()) {
return rs.getString("zpzwmc");
}
return "";
}
/**
* 获取表单下拉框展示文本
*
* @param formId 表单ID
* @param fieldName 字段明湖曾
* @param value 下拉框值
* @return
*/
public static String getSelectName(String formId, String fieldName, String value) {
String cancelReason = "";
RecordSet rs = new RecordSet();
rs.executeQuery("select selectname from workflow_selectitem where fieldid =( select id from workflow_billfield where billid = ? and fieldname = ? ) and selectvalue = ?", formId, fieldName, value);
if (rs.next()) {
cancelReason = rs.getString("selectname");
}
return cancelReason;
}
/**
* 获取招聘通用浏览按钮展示内容
*
* @param id 浏览按钮ID
* @return 浏览按钮展示文本
*/
public static String getRecruitCommonBrowserValue(String id) {
if (StringUtils.isBlank(id)) {
return "";
}
List<String> value = new ArrayList<>();
RecordSet rs = new RecordSet();
String[] split = id.split(",");
for (String s : split) {
rs.executeQuery("select xxnr from uf_sjzd where id = ?", id);
if (rs.next()) {
value.add(rs.getString("xxnr"));
}
}
return StringUtils.join(value, ",");
}
}

View File

@ -0,0 +1,78 @@
package weaver.formmode.recruit.modeexpand.util;
import com.cloudstore.dev.api.bean.MessageBean;
import com.cloudstore.dev.api.bean.MessageType;
import com.cloudstore.dev.api.util.Util_Message;
import org.apache.commons.lang3.StringUtils;
import weaver.general.BaseBean;
import weaver.hrm.resource.ResourceComInfo;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Set;
/**
* @author:dxfeng
* @createTime: 2023/09/26
* @version: 1.0
*/
public class RecruitModeUtil {
/**
* 消息推送
*
* @param messageType 消息来源
* @param title 消息标题
* @param context 消息内容
* @param userIdList 接收人ID集合
* @param creater 消息创建者
*/
public static void messagePush(String messageType, String title, String context, Set<String> userIdList, Integer creater) {
MessageType message = MessageType.newInstance(Integer.parseInt(messageType));
try {
MessageBean messageBean = Util_Message.createMessage(message, userIdList, title, context, "", "");
messageBean.setCreater(creater);
Util_Message.store(messageBean);
} catch (IOException e) {
new BaseBean().writeLog(e);
e.printStackTrace();
}
}
/**
* 获取人员姓名
*
* @param ids 人员ID
* @return 人员姓名
*/
public static String getResourceNames(String ids) {
try {
return new ResourceComInfo().getLastnames(ids);
} catch (Exception e) {
new BaseBean().writeLog(e);
throw new RuntimeException(e);
}
}
/**
* 获取聚才林招聘相关配置文件
*
* @param key key
* @return value
*/
public static String getRecruitPropValue(String key) {
String value = new BaseBean().getPropValue("jclRecruit", key);
value = new String(value.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8);
return value;
}
/**
* 转换空字符串为null
*
* @param str 字符串
* @return 转换后的字符串
*/
public static Object parseBlankToNull(String str) {
return StringUtils.isBlank(str) ? null : str;
}
}

View File

@ -0,0 +1,208 @@
package weaver.formmode.recruit.modeexpand.util;
import cn.hutool.core.convert.Convert;
import com.alibaba.fastjson.JSON;
import com.engine.recruit.enums.PositionThirdChannelEnum;
import com.engine.recruit.exception.CustomizeRunTimeException;
import com.weaver.rpa.sdk.clients.application.resume.ERPAResumeSDKClient;
import com.weaver.rpa.sdk.clients.application.resume.common.ResumePlatform;
import com.weaver.rpa.sdk.clients.application.resume.entity.ResumeJobDto;
import com.weaver.rpa.sdk.utils.HttpClientUtils;
import org.apache.commons.lang3.StringUtils;
import weaver.general.BaseBean;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* 招聘职位工具类
*
* @author:dxfeng
* @createTime: 2023/10/08
* @version: 1.0
*/
public class RecruitPositionUtil {
static Map<Integer, PositionThirdChannelEnum> thirdChannelMap = new HashMap<>();
static {
thirdChannelMap.put(ResumePlatform.LAGO, PositionThirdChannelEnum.LAGO);
thirdChannelMap.put(ResumePlatform.BOSSZHIPIN, PositionThirdChannelEnum.BOSSZHIPIN);
thirdChannelMap.put(ResumePlatform.ZHILIANZHAOPIN, PositionThirdChannelEnum.ZHILIANZHAOPIN);
thirdChannelMap.put(ResumePlatform.QIANCHENGWUYOU, PositionThirdChannelEnum.QIANCHENGWUYOU);
thirdChannelMap.put(ResumePlatform.LIEPIN, PositionThirdChannelEnum.LIEPIN);
}
/**
* 将Map转换成ResumeJobDto对象
*
* @param map 数据集合
* @return ResumeJobDto对象
*/
public static ResumeJobDto convertMap2ResumeJobDto(Map<String, Object> map) {
String positionName = Convert.toStr(map.get("zpzwmc"));//职位名称
String positionDuty = Convert.toStr(map.get("gwzz"));//职位职责
String finishTime = Convert.toStr(map.get("zpjzrq"));//完成时间
String education = ApplicantCommonInfo.getRecruitCommonBrowserValue(Convert.toStr(map.get("zdxlyq")));//学历要求
String workYears = ApplicantCommonInfo.getRecruitCommonBrowserValue(Convert.toStr(map.get("gznx")));//工作年限
String positionNature = ApplicantCommonInfo.getRecruitCommonBrowserValue(Convert.toStr(map.get("zwxz")));//职位性质
Integer salaryMin = Convert.toInt(map.get("zdxzk"), 0);//最低薪酬
Integer salaryMax = Convert.toInt(map.get("zgxzk"), 0);// 最高薪酬
Integer xcyfs = Convert.toInt(map.get("xzyfs"), 12);// 薪酬月份数
Integer workingDays = Convert.toInt(map.get("sxmzdgts"), 1);// 实习每周到岗天数
Integer internshipDuration = Convert.toInt(map.get("sxscy"), 1);// 实习时长
String jobCategory = "不限";//职位类别
int experienceValue = -1;//不限
if ("应届毕业生".equals(workYears)) {
experienceValue = 1;
} else if ("一年以内".equals(workYears)) {
experienceValue = 1;
} else if ("1-3年".equals(workYears)) {
experienceValue = 2;
} else if ("3-5年".equals(workYears)) {
experienceValue = 3;
} else if ("5-10年".equals(workYears)) {
experienceValue = 5;
} else if ("10年以上".equals(workYears)) {
experienceValue = 6;
}
int educationValue = -1; //不限
if ("博士".equals(education)) {
educationValue = 8;
} else if ("MBA/EMBA".equals(education)) {
educationValue = 7;
} else if ("硕士".equals(education)) {
educationValue = 6;
} else if ("本科".equals(education)) {
educationValue = 5;
} else if ("大专".equals(education)) {
educationValue = 4;
} else if ("中专/中技".equals(education)) {
educationValue = 3;
} else if ("高中".equals(education)) {
educationValue = 2;
} else if ("初中及以下".equals(education)) {
educationValue = 1;
}
int resumeType = 1;// 兼职全职
if ("实习".equals(positionNature)) {
resumeType = 3;
} else if ("校招".equals(positionNature)) {
resumeType = 2;
}
// 招聘职位类型与特殊设置字段
ResumeJobDto resumeJobDto = new ResumeJobDto();
resumeJobDto.setResumeType(resumeType); // (必填,默认社招)招聘类型 1:社招 2:校招 3:实习
if (2 == resumeType && StringUtils.isBlank(finishTime)) {
throw new CustomizeRunTimeException("校招招聘截止时间必填");
}
resumeJobDto.setStopReumeTimeLong(stringTurnLong(finishTime));// (校招必填)仅校招: 招聘截止时间(时间戳)
resumeJobDto.setRequirementsTime(internshipDuration); // (实习必填,默认1个月)仅实习: 实习时长 1~12 单位:()
resumeJobDto.setWorkDate(workingDays); // (实习必填,默认1天)仅实习: 每周到岗天数 1~7 单位:()
// 招聘职位基本描述
resumeJobDto.setJobname(positionName); // 配置职位名称
resumeJobDto.setJobdesc(positionDuty); // 配置职位描述
resumeJobDto.setJobType(jobCategory); // 配置职位类别
// 招聘职位条件
//resumeJobDto.setKeywordStr(Lists.newArrayList("java")); // 职位关键词
resumeJobDto.setExperience(experienceValue); // (必填,默认不限)经验要求(实习无此字段) -1:不限 1:一年以下 2:1~3年 3:3~5年 5:5~10年 6:10年以上
resumeJobDto.setEducation(educationValue); // (必填,默认不限)学历要求 -1:不限 1:初中及以下 2:高中 3:中专/中技 4:大专 5:本科 6:硕士 7:MBA/EMBA 8:博士
//薪资福利
resumeJobDto.setExpectSalaryStart(salaryMin); // (必填)薪资范围开始 单位:(社招/校招: 千元/ 实习:/)
resumeJobDto.setExpectSalaryStop(salaryMax); // (必填)薪资范围截止 单位:(社招/校招: 千元/ 实习:/)
resumeJobDto.setExpectSalaryMonth(xcyfs); // (必填,默认12个月)薪资月份数(实习无此字段) 1224
// (必填)要发布的渠道平台Id
List<Integer> platformIds = matchPlatform(Convert.toStr(map.get("dsfqd")));
resumeJobDto.setPlatformIds(platformIds);
// 简历匹配度设置
resumeJobDto.setMappingageStart(-1); // (必填,默认不限)匹配年龄age开始 -1:不限
resumeJobDto.setMappingageStop(-1);// (必填,默认不限)匹配年龄age开始 -1:不限
resumeJobDto.setMappingSex(-1);// (必填,默认不限)匹配性别 -1:不限 0: 1:
resumeJobDto.setMappingeducationStr(Collections.singletonList(-1));// (必填,默认不限)匹配学历 -1:不限 1:初中及以下 2:高中 3:中专/中技 4:大专 5:本科 6:硕士 7:MBA/EMBA 8:博士
resumeJobDto.setMappingexperienceStr(Collections.singletonList(-1));// (必填,默认不限)匹配经验 -1:不限 1:1年内 2:1~3年 3:3~5年 4:5~10年 5:10年以上
// resumeJobDto.setMappingKeywordStr(Lists.newArrayList()); // 匹配关键词内容
resumeJobDto.setMappingStatus(1); // (必填,默认任一命中)匹配模式 1:任一命中 2:全部命中
return resumeJobDto;
}
/**
* 将字符串形式的时间转换为长整型时间戳
*
* @param timeString 字符串形式的时间
* @return 长整型时间戳
*/
private static Long stringTurnLong(String timeString) {
if (StringUtils.isBlank(timeString)) {
return null;
}
try {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date date = dateFormat.parse(timeString);
return date.getTime();
} catch (ParseException e) {
new BaseBean().writeLog(e);
}
return null;
}
/**
* 匹配三方发布平台
*
* @param platformIds 发布平台ids
* @return 发布平台
*/
private static List<Integer> matchPlatform(String platformIds) {
String[] split = platformIds.split(",");
List<Integer> platformIdList = new ArrayList<>();
for (String platformId : split) {
if (platformId == null) {
continue;
}
PositionThirdChannelEnum channelEnum = PositionThirdChannelEnum.getEnum(platformId);
switch (channelEnum) {
case BOSSZHIPIN:
platformIdList.add(ResumePlatform.BOSSZHIPIN);
break;
case LIEPIN:
platformIdList.add(ResumePlatform.LIEPIN);
break;
case LAGO:
platformIdList.add(ResumePlatform.LAGO);
break;
case QIANCHENGWUYOU:
platformIdList.add(ResumePlatform.QIANCHENGWUYOU);
break;
case ZHILIANZHAOPIN:
platformIdList.add(ResumePlatform.ZHILIANZHAOPIN);
break;
default:
break;
}
}
return platformIdList;
}
public static boolean checkAvailable(ERPAResumeSDKClient client) {
HttpClientUtils.setTimeout(10000);//默认10秒
if (client == null || !client.available()) {
new BaseBean().writeLog("checkAvailableclient=" + JSON.toJSONString(client));
return false;
} else {
return true;
}
}
}

View File

@ -0,0 +1,150 @@
package weaver.formmode.recruit.modeexpand.written;
import org.apache.commons.collections.CollectionUtils;
import weaver.common.DateUtil;
import weaver.conn.RecordSet;
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
import weaver.formmode.setup.ModeRightInfo;
import weaver.general.BaseBean;
import weaver.general.Util;
import weaver.hrm.User;
import weaver.soa.workflow.request.*;
import java.util.*;
/**
* <p>聚才林招聘</p>
* 批量安排笔试推笔试结果
*
* @author:dxfeng
* @createTime: 2023/09/21
* @version: 1.0
*/
public class BatchAddWrittenResultModeExpand extends AbstractModeExpandJavaCodeNew {
private static final String MODE_TABLE_NAME = "uf_jcl_bs";
@Override
public Map<String, String> doModeExpand(Map<String, Object> param) {
Map<String, String> result = new HashMap<>();
try {
RequestInfo requestInfo = (RequestInfo) param.get("RequestInfo");
if (requestInfo != null) {
int formModeId = -1;
RecordSet rs = new RecordSet();
rs.executeQuery("select id from modeinfo where formid =( select id from workflow_bill where tablename = ? )", MODE_TABLE_NAME);
if (rs.next()) {
formModeId = rs.getInt("id");
}
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
Property[] properties = mainTableInfo.getProperty();
Map<String, Object> mainDataMap = new HashMap<>();
for (Property property : properties) {
mainDataMap.put(property.getName(), property.getValue());
}
// 填充建模数据基本信息
User user = (User) param.get("user");
mainDataMap.put("formmodeid", formModeId);
mainDataMap.put("modedatacreater", user.getUID());
String dateTime = DateUtil.getFullDate();
String[] split = dateTime.split(" ");
mainDataMap.put("modedatacreatedate", split[0]);
mainDataMap.put("modedatacreatetime", split[1]);
mainDataMap.put("modedatamodifier", user.getUID());
mainDataMap.put("modedatamodifydatetime", dateTime);
mainDataMap.put("modedatacreatertype", "0");
mainDataMap.put("bsapid", requestInfo.getRequestid());
List<Map<String, Object>> detailMapList = new ArrayList<>();
DetailTableInfo detailTableInfo = requestInfo.getDetailTableInfo();
DetailTable detailTable = detailTableInfo.getDetailTable(0);
Row[] rows = detailTable.getRow();
for (Row row : rows) {
Map<String, Object> detailDataMap = new HashMap<>(mainDataMap);
Cell[] cells = row.getCell();
for (Cell cell : cells) {
detailDataMap.put(cell.getName(), cell.getValue());
}
detailMapList.add(detailDataMap);
}
for (Map<String, Object> detailDataMap : detailMapList) {
List<List<Object>> paramList = new ArrayList<>();
buildParamList(detailDataMap, paramList);
if (CollectionUtils.isNotEmpty(paramList)) {
String insertSql = "insert into " + MODE_TABLE_NAME + " (modeuuid, modedatacreatertype, formmodeid, modedatacreater, modedatacreatedate, modedatacreatetime, modedatamodifier, modedatamodifydatetime, pcid, ypz, ypzw, bsmc, bssj, bssm, tdsj, bsapid, sjh, yx ) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
for (List<Object> objects : paramList) {
String uuid = UUID.randomUUID().toString();
objects.add(0, uuid);
rs.executeUpdate(insertSql, objects);
refreshRight(rs, uuid, formModeId);
}
}
}
}
} catch (Exception e) {
new BaseBean().writeLog(e);
result.put("errmsg", "自定义出错信息");
result.put("flag", "false");
}
return result;
}
/**
* 构建批量插入数据集合
*
* @param map 表单参数
* @param paramList 待插入数据集合
*/
private void buildParamList(Map<String, Object> map, List<List<Object>> paramList) {
List<Object> param = new ArrayList<>();
// 填充建模表相关字段
param.add(map.get("modedatacreatertype"));
param.add(map.get("formmodeid"));
param.add(map.get("modedatacreater"));
param.add(map.get("modedatacreatedate"));
param.add(map.get("modedatacreatetime"));
param.add(map.get("modedatamodifier"));
param.add(map.get("modedatamodifydatetime"));
// 表单字段
// 批次ID
param.add(map.get("pcid"));
// 应聘者
param.add(map.get("ypz"));
// 应聘职位
param.add(map.get("ypzw"));
//笔试名称
param.add(map.get("bsmc"));
// 笔试时间
param.add(map.get("bssj"));
// 笔试说明
param.add(map.get("bssm"));
param.add(map.get("tdsj"));
param.add(map.get("bsapid"));
param.add(map.get("sjh"));
param.add(map.get("yx"));
paramList.add(param);
}
/**
* 权限重构
*
* @param rs RecordSet
* @param uuid UUID
* @param formModeId 建模ID
*/
private void refreshRight(RecordSet rs, String uuid, int formModeId) {
rs.executeQuery("select id from " + MODE_TABLE_NAME + " where modeuuid='" + uuid + "'");
if (rs.next()) {
//建模数据的id
int bid = Util.getIntValue(rs.getString("id"));
ModeRightInfo modeRightInfo = new ModeRightInfo();
modeRightInfo.setNewRight(true);
//新建的时候添加共享
modeRightInfo.editModeDataShare(1, formModeId, bid);
}
}
}

View File

@ -1,19 +1,25 @@
package weaver.interfaces.recruit.action;
import com.cloudstore.dev.api.bean.MessageBean;
import com.cloudstore.dev.api.bean.MessageType;
import com.cloudstore.dev.api.util.Util_Message;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import weaver.common.DateUtil;
import weaver.conn.RecordSet;
import weaver.conn.RecordSetTrans;
import weaver.formmode.recruit.modeexpand.util.RecruitModeUtil;
import weaver.formmode.setup.ModeRightInfo;
import weaver.general.BaseBean;
import weaver.general.Util;
import weaver.hrm.resource.ResourceComInfo;
import weaver.interfaces.workflow.action.Action;
import weaver.soa.workflow.request.*;
import java.io.IOException;
import java.util.*;
/**
* <p>聚才林招聘</p>
* 招聘需求流程明细表数据转建模台账
*
* @author:dxfeng
@ -22,6 +28,14 @@ import java.util.*;
*/
public class RecruitFlowToModeAction implements Action {
private static String messageType;
private static String title;
private static String linkUrl;
private static String linkMobileUrl;
/**
* 建模台账表表名(uf_jcl_zp_zpxq)
*/
@ -30,6 +44,8 @@ public class RecruitFlowToModeAction implements Action {
@Override
public String execute(RequestInfo requestInfo) {
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
int billId = requestInfo.getRequestManager().getBillid();
int formid = requestInfo.getRequestManager().getFormid();
DetailTableInfo detailTableInfo = requestInfo.getDetailTableInfo();
DetailTable detailTable = detailTableInfo.getDetailTable(0);
@ -59,6 +75,11 @@ public class RecruitFlowToModeAction implements Action {
mainMap.put("modedatamodifydatetime", dateTime);
mainMap.put("modedatacreatertype", "0");
Map<String, String> messageMap = new HashMap<>();
messageMap.put("billId", String.valueOf(billId));
messageMap.put("formId", String.valueOf(formid));
messageMap.put("modeId", String.valueOf(formModeId));
List<Map<String, Object>> insertList = new ArrayList<>();
Row[] rows = detailTable.getRow();
for (Row row : rows) {
@ -66,7 +87,7 @@ public class RecruitFlowToModeAction implements Action {
detailMap.putAll(mainMap);
Cell[] cells = row.getCell();
for (Cell cell : cells) {
detailMap.put(cell.getName(), parseBlankToNull(cell.getValue()));
detailMap.put(cell.getName(), RecruitModeUtil.parseBlankToNull(cell.getValue()));
}
insertList.add(detailMap);
}
@ -79,14 +100,32 @@ public class RecruitFlowToModeAction implements Action {
String sql = " insert into " + MODE_TABLE_NAME + "(modeuuid,modedatacreatertype,formmodeid,modedatacreater,modedatacreatedate,modedatacreatetime,modedatamodifier,modedatamodifydatetime,xqsplc,xqzt,sqr,sqsj,sqbm,nd,spfs,xqlx,bz,xqmc,zpyy,zpxqfzr,szfb,szbm,gw,gwzz,rzyq,zwxz,gzdd,gznx,zdxlyq,zprs,qwdgsj)" +
" values ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
try {
List<List<Object>> paramList = new ArrayList<>();
// 构建插入参数集合
buildParamList(insertList, paramList);
for (List<Object> objects : paramList) {
for (Map<String, Object> map : insertList) {
List<Object> objects = buildParamList(map);
String uuid = UUID.randomUUID().toString();
objects.add(0, uuid);
rst.executeUpdate(sql, objects);
refreshRight(rst, uuid, formModeId);
// 申请人ID
String applicant = Util.null2String(map.get("sqr"));
// 申请人名称
String applicantName = new ResourceComInfo().getLastname(applicant);
// 需求名称
String requirementName = Util.null2String(map.get("xqmc"));
// 招聘需求负责人ID
String manager = Util.null2String(map.get("zpxqfzr"));
// 申请人集合
Set<String> applicantSet = new HashSet<>();
applicantSet.add(applicant);
// 需求负责人集合
Set<String> managerSet = new HashSet<>();
managerSet.add(manager);
// 消息提醒
messagePush(applicantName + ",你申请的“" + requirementName + "”招聘需求,正在进行中,请知悉。", messageMap, applicantSet);
messagePush("您有一个新的”" + requirementName + "“招聘需求,请查收。", messageMap, managerSet);
}
rst.commit();
} catch (Exception e) {
@ -104,79 +143,68 @@ public class RecruitFlowToModeAction implements Action {
/**
* 构建插入参数集合
*
* @param insertList 待插入数据集合
* @param paramList SQL插入参数集合
* @param map 表单数据集合
* @return 插入参数集合
*/
private void buildParamList(List<Map<String, Object>> insertList, List<List<Object>> paramList) {
for (Map<String, Object> map : insertList) {
List<Object> param = new ArrayList<>();
// 填充建模表相关字段
param.add(map.get("modedatacreatertype"));
param.add(map.get("formmodeid"));
param.add(map.get("modedatacreater"));
param.add(map.get("modedatacreatedate"));
param.add(map.get("modedatacreatetime"));
param.add(map.get("modedatamodifier"));
param.add(map.get("modedatamodifydatetime"));
// 需求审批流程
param.add(map.get("xqsplc"));
// 需求状态
param.add(map.get("xqzt"));
// 申请人
param.add(map.get("sqr"));
// 申请时间
param.add(map.get("sqsj"));
// 申请部门
param.add(map.get("sqbm"));
// 年度
param.add(map.get("nd"));
// 审批方式
param.add(map.get("spfs"));
// 需求类型
param.add(map.get("xqlx"));
// 备注
param.add(map.get("bz"));
// 需求名称
param.add(map.get("xqmc"));
// 招聘原因
param.add(map.get("zpyy"));
// 招聘需求负责人
param.add(map.get("zpxqfzr"));
// 所属分部
param.add(map.get("szfb"));
// 所属部门
param.add(map.get("szbm"));
// 岗位
param.add(map.get("gw"));
// 岗位职责
param.add(map.get("gwzz"));
// 任职要求
param.add(map.get("rzyq"));
// 职位性质
param.add(map.get("zwxz"));
// 工作地点
param.add(map.get("gzdd"));
// 工作年限
param.add(map.get("gznx"));
// 最低学历要求
param.add(map.get("zdxlyq"));
// 招聘人数
param.add(map.get("zprs"));
// 期望到岗时间
param.add(map.get("qwdgsj"));
paramList.add(param);
}
private List<Object> buildParamList(Map<String, Object> map) {
List<Object> param = new ArrayList<>();
// 填充建模表相关字段
param.add(map.get("modedatacreatertype"));
param.add(map.get("formmodeid"));
param.add(map.get("modedatacreater"));
param.add(map.get("modedatacreatedate"));
param.add(map.get("modedatacreatetime"));
param.add(map.get("modedatamodifier"));
param.add(map.get("modedatamodifydatetime"));
// 需求审批流程
param.add(map.get("xqsplc"));
// 需求状态
param.add(map.get("xqzt"));
// 申请人
param.add(map.get("sqr"));
// 申请时间
param.add(map.get("sqsj"));
// 申请部门
param.add(map.get("sqbm"));
// 年度
param.add(map.get("nd"));
// 审批方式
param.add(map.get("spfs"));
// 需求类型
param.add(map.get("xqlx"));
// 备注
param.add(map.get("bz"));
// 需求名称
param.add(map.get("xqmc"));
// 招聘原因
param.add(map.get("zpyy"));
// 招聘需求负责人
param.add(map.get("zpxqfzr"));
// 所属分部
param.add(map.get("szfb"));
// 所属部门
param.add(map.get("szbm"));
// 岗位
param.add(map.get("gw"));
// 岗位职责
param.add(map.get("gwzz"));
// 任职要求
param.add(map.get("rzyq"));
// 职位性质
param.add(map.get("zwxz"));
// 工作地点
param.add(map.get("gzdd"));
// 工作年限
param.add(map.get("gznx"));
// 最低学历要求
param.add(map.get("zdxlyq"));
// 招聘人数
param.add(map.get("zprs"));
// 期望到岗时间
param.add(map.get("qwdgsj"));
return param;
}
/**
* 将空字符串转化为NULL
*
* @param str 字符串
* @return Object
*/
private Object parseBlankToNull(String str) {
return StringUtils.isBlank(str) ? null : str;
}
/**
* 权限重构
@ -197,4 +225,72 @@ public class RecruitFlowToModeAction implements Action {
modeRightInfo.editModeDataShare(1, formModeId, bid);
}
}
/**
* 消息推送
*
* @param context 消息内容
* @param messageMap 消息 相关key
* @param userIdList 消息接收人ID集合
*/
private static void messagePush(String context, Map<String, String> messageMap, Set<String> userIdList) {
// 替换context内容信息;
// 替换URL内容信息
linkUrl = replaceUrlKeys(linkUrl, messageMap);
linkMobileUrl = replaceUrlKeys(linkMobileUrl, messageMap);
MessageType message = MessageType.newInstance(Integer.parseInt(messageType));
try {
MessageBean messageBean = Util_Message.createMessage(message, userIdList, title, context, linkUrl, linkMobileUrl);
messageBean.setCreater(1);
//message.setBizState("0");// 需要修改消息为已处理等状态时传入,表示消息最初状态为待处理
Util_Message.store(messageBean);
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* 替换url的相关key
*
* @param url 链接地址
* @param messageMap key集合
*/
private static String replaceUrlKeys(String url, Map<String, String> messageMap) {
return url.replace("$modeId$", messageMap.get("modeId")).replace("$formId$", messageMap.get("formId")).replace("$billid$", messageMap.get("billId"));
}
public static String getMessageType() {
return messageType;
}
public static void setMessageType(String messageType) {
RecruitFlowToModeAction.messageType = messageType;
}
public static String getTitle() {
return title;
}
public static void setTitle(String title) {
RecruitFlowToModeAction.title = title;
}
public static String getLinkUrl() {
return linkUrl;
}
public static void setLinkUrl(String linkUrl) {
RecruitFlowToModeAction.linkUrl = linkUrl;
}
public static String getLinkMobileUrl() {
return linkMobileUrl;
}
public static void setLinkMobileUrl(String linkMobileUrl) {
RecruitFlowToModeAction.linkMobileUrl = linkMobileUrl;
}
}