Compare commits

...

25 Commits

Author SHA1 Message Date
dxfeng a2c89084b3 注释面试流程 邮件发送功能 5 months ago
dxfeng bf77e5f386 美之高 接受offer提醒指定角色 9 months ago
dxfeng 8d23a515d8 美之高 招聘报表 9 months ago
dxfeng 5cd47c7ae3 归档人才库操作 10 months ago
dxfeng dc2164c49a 接受offer,数据插入待入职台账 10 months ago
dxfeng 6302d7d9e0 offer发送,offer反馈 10 months ago
dxfeng 37ccf7888d 背调结果反馈 10 months ago
dxfeng 40660cc55b 面试归档接口动作 10 months ago
dxfeng f2798f8c1f 调整、取消面试 10 months ago
dxfeng 76712bfe64 日程创建、流程处理人动态获取 10 months ago
dxfeng 71908802ba 面试流程,消息提醒、日程、邮件 11 months ago
dxfeng e19a2add59 面试流程,消息提醒、日程、邮件 11 months ago
dxfeng 641587f8db 应聘登记,创建面试台账 11 months ago
dxfeng f9ca65f925 红太阳POC 11 months ago
dxfeng ce15e0b780 红太阳POC 11 months ago
dxfeng 113543f0ef 应聘登记 11 months ago
dxfeng f127eef41b 简历中心发送邮件、测评、应聘登记提交事件 11 months ago
dxfeng 8c57c92434 招聘需求-编制接口 11 months ago
dxfeng 34fb245ed0 开发环境搭建 11 months ago
dxfeng 9fe4786fdd 二开模板 12 months ago
dxfeng 1f7070c611 二开 班别出勤工时&请假时长计算扣减 2 years ago
dxfeng 884052dc1d 二开 班别出勤工时&请假时长计算扣减 2 years ago
dxfeng cf8841a775 二开 班别出勤工时&请假时长计算扣减 2 years ago
dxfeng dee3855003 KQFormatData 申请源码 2 years ago
dxfeng bc855b294b 源码提交-班别出勤工时&请假时长计算扣减 2 years ago

@ -1,13 +0,0 @@
package com.api.jygf.web;
import javax.ws.rs.Path;
/**
* @Author weaver_cl
* @Description:
* @Date 2022/10/9
* @Version V1.0
**/
@Path("/mobile/permission")
public class MobilePermissionsAction extends com.engine.jygf.web.MobilePermissionsAction {
}

@ -0,0 +1,12 @@
package com.api.mzg.web;
import javax.ws.rs.Path;
/**
* @author:dxfeng
* @createTime: 2024/08/29
* @version: 1.0
*/
@Path("/jcl/mzg/demand")
public class RecruitDemandController extends com.engine.mzg.web.RecruitDemandController{
}

@ -0,0 +1,12 @@
package com.api.mzg.web;
import javax.ws.rs.Path;
/**
* @author:dxfeng
* @createTime: 2024/09/05
* @version: 1.0
*/
@Path("/jcl/mzg/mobile")
public class RecruitMobileController extends com.engine.mzg.web.RecruitMobileController{
}

@ -1,68 +0,0 @@
package com.engine.jygf.cmd;
import com.engine.common.biz.AbstractCommonCommand;
import com.engine.common.entity.BizLogContext;
import com.engine.core.interceptor.CommandContext;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.hrm.User;
import weaver.wechat.util.Utils;
import java.util.*;
/**
* @Author weaver_cl
* @Description:
* @Date 2022/10/9
* @Version V1.0
**/
public class MobilePermissionsCmd extends AbstractCommonCommand<Map<String, Object>> {
private static final String FIELDID = "field100026"; //移动电话自定义字段
private static final String SCOPE = "HrmCustomFieldByInfoType";
private static final String SCOPEID = "-1";
public MobilePermissionsCmd(Map<String, Object> params, User user) {
this.user = user;
this.params = params;
}
@Override
public BizLogContext getLogContext() {
return null;
}
@Override
public Map<String, Object> execute(CommandContext commandContext) {
Map<String, Object> data = new HashMap<>();
String uid = Utils.null2String(user.getUID());
RecordSet rs = new RecordSet();
HashSet<String> ids = new HashSet<>();
ids.add(uid);
rs.executeQuery("select ckr,bckr from uf_yddhqx_dt1");
while (rs.next()) {
String ckr = Utils.null2String(rs.getString("ckr"));
String bckr = Utils.null2String(rs.getString("bckr"));
if (Arrays.asList(ckr.split(",")).contains(uid)) {
ids.addAll(Arrays.asList(bckr.split(",")));
}
}
Map<String,String> mobileInfo = new HashMap<>();
String value = StringUtils.join(ids,",");
rs.executeQuery("select id,"+FIELDID+" from cus_fielddata where scope = ? and scopeid = ?" +
" and id in ("+value+")",SCOPE,SCOPEID);
while (rs.next()){
mobileInfo.put(Utils.null2String(rs.getString("id")),rs.getString(FIELDID));
}
data.put("ids",ids);
data.put("mobileInfo",mobileInfo);
return data;
}
}

@ -1,16 +0,0 @@
package com.engine.jygf.service;
import weaver.hrm.User;
import java.util.Map;
/**
* @Author weaver_cl
* @Description:
* @Date 2022/10/9
* @Version V1.0
**/
public interface MobilePermissionsService {
Map<String, Object> getPermissionInfo(Map<String, Object> params, User user);
}

@ -1,24 +0,0 @@
package com.engine.jygf.service.impl;
import com.engine.core.impl.Service;
import com.engine.jygf.cmd.MobilePermissionsCmd;
import com.engine.jygf.service.MobilePermissionsService;
import weaver.hrm.User;
import java.util.Map;
/**
* @Author weaver_cl
* @Description:
* @Date 2022/10/9
* @Version V1.0
**/
public class MobilePermissionsServiceImpl extends Service implements MobilePermissionsService {
@Override
public Map<String, Object> getPermissionInfo(Map<String, Object> params, User user) {
return commandExecutor.execute(new MobilePermissionsCmd(params,user));
}
}

@ -1,57 +0,0 @@
package com.engine.jygf.web;
import com.alibaba.fastjson.JSONObject;
import com.engine.common.util.ParamUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.jygf.service.MobilePermissionsService;
import com.engine.jygf.service.impl.MobilePermissionsServiceImpl;
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.HashMap;
import java.util.Map;
/**
* @Author weaver_cl
* @Description:
* @Date 2022/10/9
* @Version V1.0
**/
public class MobilePermissionsAction {
public MobilePermissionsService getMobilePermissionsService(User user) {
return ServiceUtil.getService(MobilePermissionsServiceImpl.class,user);
}
/**
*
* @param request
* @param response
* @return
*/
@GET
@Path("/controller")
@Produces(MediaType.APPLICATION_JSON)
public String getPermissionInfo(@Context HttpServletRequest request, @Context HttpServletResponse response) {
Map<String, Object> apidatas = new HashMap<>();
try {
User user = HrmUserVarify.getUser(request, response);
//实例化Service 并调用业务类处理
apidatas = getMobilePermissionsService(user).getPermissionInfo(ParamUtil.request2Map(request), user);
} catch (Exception e) {
//异常处理
apidatas.put("api_status", false);
}
return JSONObject.toJSONString(apidatas);
}
}

@ -0,0 +1,241 @@
package com.engine.mzg.conn;
import com.engine.common.service.HrmCommonService;
import com.engine.common.service.impl.HrmCommonServiceImpl;
import com.engine.mzg.entity.SyncTableField;
import com.engine.mzg.exception.CustomizeRunTimeException;
import com.engine.mzg.util.RecruitUtil;
import com.weaver.formmodel.data.model.Formfield;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.formmode.IgnoreCaseHashMap;
import java.util.*;
/**
* @author:dxfeng
* @createTime: 2024/09/05
* @version: 1.0
*/
public class RecruitCommon {
/**
*
*
* @param key
* @return
*/
public static String getSettingValue(String key) {
RecordSet rs = new RecordSet();
rs.executeQuery("select pzz from uf_recruit_setting where pzx = ? ", key);
if (rs.next()) {
return rs.getString("pzz");
}
return "";
}
/**
*
*
* @param key
* @return
*/
public static String getSettingValue(String key, Map<String, Formfield> fieldMap, Map<String, Object> paramsData) {
RecordSet rs = new RecordSet();
rs.executeQuery("select pzz from uf_recruit_setting where pzx = ? ", key);
String content = "";
if (rs.next()) {
content = rs.getString("pzz");
}
if (StringUtils.isNotBlank(content)) {
content = RecruitUtil.getMsgReplaceStr(content, fieldMap, paramsData);
}
return content;
}
/**
* ID
*
* @param modeTable
* @return
*/
public static int getFormIdByTableName(String modeTable) {
int formId = -1;
RecordSet rs = new RecordSet();
rs.executeQuery("select id from workflow_bill where tablename = ? ", modeTable);
if (rs.next()) {
formId = rs.getInt("id");
}
return formId;
}
/**
* ,ID
*
* @param modeTable
* @return
*/
public static int getModeIdByTableName(String modeTable) {
int formModeId = -1;
RecordSet rs = new RecordSet();
rs.executeQuery("select id from modeinfo where formid =( select id from workflow_bill where tablename = ? ) and isdelete = 0 order by id", modeTable);
if (rs.next()) {
formModeId = rs.getInt("id");
}
return formModeId;
}
/**
*
*
* @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;
}
public static String insertTablesData(String targetTable, String sourceTable, String sourceId, String relatedField, int creator) {
RecordSet rs = new RecordSet();
String mainId = "";
rs.executeQuery("select * from uf_recruit_table where target_table = ? and source_table =? ", targetTable, sourceTable);
String mainTableId = "";
if (rs.next()) {
mainTableId = rs.getString("id");
}
if (StringUtils.isNotBlank(mainTableId)) {
// 查询配置的字段,更新或者插入数据
List<SyncTableField> fields = getSyncTableFields(mainTableId);
rs.executeQuery("select * from " + sourceTable + " where id = ? ", sourceId);
IgnoreCaseHashMap<String, String> buildDataMap = new IgnoreCaseHashMap<>();
if (rs.next()) {
for (SyncTableField field : fields) {
String value = RecruitUtil.parseBlankToNull(rs.getString(field.getSourceField()));
if (StringUtils.isNotBlank(value)) {
buildDataMap.put(field.getTargetField(), value);
}
}
// 新增
String uuid = UUID.randomUUID().toString();
buildDataMap.put("modeuuid", uuid);
int formModeId = RecruitCommon.getModeIdByTableName(targetTable);
buildDataMap.put("formmodeid", formModeId);
// 构建建模表基本数据
if (StringUtils.isNotBlank(relatedField)) {
// 设置关联字段
buildDataMap.put(relatedField, sourceId);
}
RecruitRecordSet.buildModeInsertFields(buildDataMap, creator);
RecruitRecordSet.insertData(buildDataMap, targetTable);
mainId = String.valueOf(RecruitRecordSet.refreshRight(uuid, targetTable, formModeId, creator));
}
}
return mainId;
}
public static void updateTablesData(String targetTable, String sourceTable, String sourceId, String targetId, String relatedField, int creator) {
RecordSet rs = new RecordSet();
rs.executeQuery("select * from uf_recruit_table where target_table = ? and source_table =? ", targetTable, sourceTable);
String mainTableId = "";
if (rs.next()) {
mainTableId = rs.getString("id");
}
if (StringUtils.isNotBlank(mainTableId)) {
// 查询配置的字段,更新或者插入数据
List<SyncTableField> fields = getSyncTableFields(mainTableId);
rs.executeQuery("select * from " + sourceTable + " where id = ? ", sourceId);
IgnoreCaseHashMap<String, String> buildDataMap = new IgnoreCaseHashMap<>();
if (rs.next()) {
for (SyncTableField field : fields) {
String value = RecruitUtil.parseBlankToNull(rs.getString(field.getSourceField()));
if (StringUtils.isNotBlank(value)) {
buildDataMap.put(field.getTargetField(), value);
}
}
if (StringUtils.isNotBlank(relatedField)) {
// 设置关联字段
buildDataMap.put(relatedField, sourceId);
}
// 更新
buildDataMap.put("id", targetId);
RecruitRecordSet.buildModeUpdateFields(buildDataMap, creator);
RecruitRecordSet.updateDataById(buildDataMap, targetTable);
}
}
}
private static void syncDetailTablesData(String targetTable, String sourceTable, String sourceId, RecordSet rs, String mainId) {
IgnoreCaseHashMap<String, String> buildDataMap;
String mainTableId;
rs.executeQuery("select * from uf_recruit_table where source_table like '" + sourceTable + "_dt%' and target_table like '" + targetTable + "_dt%' ");
while (rs.next()) {
mainTableId = rs.getString("id");
String sourceDetailTable = rs.getString("source_table");
String targetDetailTable = rs.getString("target_table");
List<SyncTableField> syncTableFields = getSyncTableFields(mainTableId);
// 删除明细表数据
RecordSet recordSet = new RecordSet();
recordSet.executeUpdate(" delete from " + targetDetailTable + " where mainid = ?", mainId);
recordSet.executeQuery("select * from " + sourceDetailTable + " where mainid = ? ", sourceId);
while (recordSet.next()) {
buildDataMap = new IgnoreCaseHashMap<>();
buildDataMap.put("mainid", mainId);
for (SyncTableField field : syncTableFields) {
String value = RecruitUtil.parseBlankToNull(recordSet.getString(field.getSourceField()));
if (StringUtils.isNotBlank(value)) {
buildDataMap.put(field.getTargetField(), value);
}
}
RecruitRecordSet.insertData(buildDataMap, targetDetailTable);
}
}
}
/**
*
*
* @param mainTableId
* @return
*/
public static List<SyncTableField> getSyncTableFields(String mainTableId) {
RecordSet rs = new RecordSet();
rs.executeQuery("select * from uf_recruit_table_dt1 where mainid = ? ", mainTableId);
List<SyncTableField> fields = new ArrayList<>();
while (rs.next()) {
fields.add(SyncTableField.builder().sourceField(rs.getString("source_field")).targetField(rs.getString("target_field")).build());
}
if (CollectionUtils.isEmpty(fields)) {
throw new CustomizeRunTimeException("数据同步配置异常,请检查配置");
}
return fields;
}
public static Set<String> getRoleUserIds(String roleName) {
Set<String> userSet = new HashSet<>();
RecordSet rs = new RecordSet();
String sql = "select id from hrmroles h where rolesmark like '% " + roleName + "`%' or rolesmark = '" + roleName + "'";
rs.executeQuery(sql);
while (rs.next()) {
String roleId = rs.getString("id");
HrmCommonService hrmCommonService = new HrmCommonServiceImpl();
String hrmIds = hrmCommonService.getRoleMemberIds(roleId, "0");
if (StringUtils.isNotBlank(hrmIds)) {
userSet.addAll(Arrays.asList(hrmIds.split(",")));
}
}
return userSet;
}
}

@ -0,0 +1,168 @@
package com.engine.mzg.conn;
import com.engine.mzg.exception.CustomizeRunTimeException;
import com.engine.mzg.util.RecruitUtil;
import org.apache.commons.lang3.StringUtils;
import weaver.common.DateUtil;
import weaver.conn.RecordSet;
import weaver.formmode.IgnoreCaseHashMap;
import weaver.formmode.setup.ModeRightInfo;
import weaver.general.Util;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2023/10/19
* @version: 1.0
*/
public class RecruitRecordSet {
/**
*
*
* @param rs RecordSet
* @return
*/
public static IgnoreCaseHashMap<String, Object> getSingleRecordMap(RecordSet rs) {
IgnoreCaseHashMap<String, Object> dataMap = new IgnoreCaseHashMap<>();
if (rs.next()) {
String[] columnNames = rs.getColumnName();
for (String columnName : columnNames) {
dataMap.put(columnName, RecruitUtil.parseBlankToNull(rs.getString(columnName)));
}
}
return dataMap;
}
public static List<Map<String, Object>> getRecordMapList(RecordSet rs) {
List<Map<String, Object>> list = new ArrayList<>();
while (rs.next()) {
String[] columnNames = rs.getColumnName();
Map<String, Object> dataMap = new IgnoreCaseHashMap<>();
for (String columnName : columnNames) {
dataMap.put(columnName.toLowerCase(), RecruitUtil.parseBlankToNull(rs.getString(columnName)));
}
list.add(dataMap);
}
return list;
}
/**
*
*
* @param dataMap
* @param tableName
*/
public static void insertData(Map<String, Object> dataMap, String tableName) {
List<String> fieldList = new ArrayList<>();
List<String> dataList = new ArrayList<>();
List<String> paramList = new ArrayList<>();
dataMap.forEach((key, value) -> {
if (null != value) {
String valueStr = String.valueOf(value);
if (StringUtils.isNotBlank(valueStr)) {
fieldList.add(key);
dataList.add(valueStr);
paramList.add("?");
}
}
});
String insertSql = " insert into " + tableName + "(" + StringUtils.join(fieldList, ",") + ") values (" + StringUtils.join(paramList, ",") + ")";
RecordSet rs = new RecordSet();
rs.executeUpdate(insertSql, dataList);
if (StringUtils.isNotBlank(rs.getExceptionMsg())) {
throw new CustomizeRunTimeException(rs.getExceptionMsg());
}
}
/**
* ID
*
* @param dataMap
* @param tableName
*/
public static void updateDataById(Map<String, Object> dataMap, String tableName) {
List<String> fieldList = new ArrayList<>();
List<Object> dataList = new ArrayList<>();
String id = Util.null2String(dataMap.get("id"));
dataMap.remove("id");
dataMap.forEach((key, value) -> {
fieldList.add(key + " = ? ");
dataList.add(value);
});
dataList.add(id);
String updateSql = "update " + tableName + " set " + StringUtils.join(fieldList, ",") + " where id = ? ";
RecordSet rs = new RecordSet();
rs.executeUpdate(updateSql, dataList);
if (StringUtils.isNotBlank(rs.getExceptionMsg())) {
throw new CustomizeRunTimeException(rs.getExceptionMsg());
}
}
/**
*
*
* @param deleteSql
*/
public static void deleteData(String deleteSql) {
RecordSet rs = new RecordSet();
rs.executeUpdate(deleteSql);
if (StringUtils.isNotBlank(rs.getExceptionMsg())) {
throw new CustomizeRunTimeException(rs.getExceptionMsg());
}
}
/**
*
*
* @param mainDataMap
*/
public static void buildModeInsertFields(Map<String, Object> mainDataMap, int userId) {
String dateTime = DateUtil.getFullDate();
String[] dateSplit = dateTime.split(" ");
mainDataMap.put("modedatacreater", userId);
mainDataMap.put("modedatacreatedate", dateSplit[0]);
mainDataMap.put("modedatacreatetime", dateSplit[1]);
mainDataMap.put("modedatacreatertype", "0");
}
/**
*
*
* @param mainDataMap
*/
public static void buildModeUpdateFields(Map<String, Object> mainDataMap, int userId) {
String dateTime = DateUtil.getFullDate();
mainDataMap.put("modedatamodifier", userId);
mainDataMap.put("modedatamodifydatetime", dateTime);
}
/**
*
*
* @param uuid
* @param modeTable
* @param formModeId
*/
public static int refreshRight(String uuid, String modeTable, int formModeId, int creator) {
RecordSet rs = new RecordSet();
rs.executeQuery("select id from " + modeTable + " where modeuuid='" + uuid + "'");
if (rs.next()) {
//建模数据的id
int bid = Util.getIntValue(rs.getString("id"));
ModeRightInfo modeRightInfo = new ModeRightInfo();
modeRightInfo.setNewRight(true);
//新建的时候添加共享
modeRightInfo.editModeDataShare(creator, formModeId, bid);
return bid;
}
return -1;
}
}

@ -0,0 +1,20 @@
package com.engine.mzg.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author:dxfeng
* @createTime: 2024/09/09
* @version: 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class SyncTableField {
private String sourceField;
private String targetField;
}

@ -0,0 +1,32 @@
package com.engine.mzg.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class WorkPlanCreateParams {
private String operateType;
private String billId;
private String workPlanType;
private String planName;
private String memberIds;
private String urgentLevel;
private String beginDateTime;
private String endDateTime;
private String workId;
}

@ -0,0 +1,58 @@
package com.engine.mzg.enums;
/**
*
*
* @author:dxfeng
* @createTime: 2023/09/13
* @version: 1.0
*/
public enum EmailTemplateEnum {
/**
*
*/
DISC(0, "性格测评"),
/**
*
*/
REGIST(1, "应聘登记"),
/**
*
*/
INTERVIEW_FIRST(2, "第一轮面试"),
INTERVIEW_SECOND(3, "第二轮面试"),
INTERVIEW_THIRD(4, "第三轮面试"),
/**
* offer
*/
OFFER(5, "offer"),
INTERVIEW_ADJUST(6, "面试调整"),
INTERVIEW_CANCEL(7, "面试取消");
EmailTemplateEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
private Integer value;
private String desc;
public Integer getValue() {
return value;
}
public void setValue(Integer value) {
this.value = value;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}

@ -0,0 +1,22 @@
package com.engine.mzg.exception;
/**
* @Author weaver_cl
* @Description:
* @Date 2023/2/21
* @Version V1.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);
}
}

@ -0,0 +1,13 @@
package com.engine.mzg.service;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2024/08/29
* @version: 1.0
*/
public interface RecruitDemandService {
Map<String, Object> getStaffNum(Map<String, Object> param);
}

@ -0,0 +1,29 @@
package com.engine.mzg.service;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2024/09/04
* @version: 1.0
*/
public interface RecruitMobileService {
/**
* DISC
*
* @param params
* @return
*/
Map<String, Object> submitDiscTest(Map<String, Object> params);
/**
*
*
* @param params
* @return
*/
Map<String, Object> submitRegist(Map<String, Object> params);
Map<String, Object> updateOfferStatus(Map<String, Object> params);
}

@ -0,0 +1,35 @@
package com.engine.mzg.service.impl;
import com.engine.core.impl.Service;
import com.engine.mzg.service.RecruitDemandService;
import weaver.conn.RecordSet;
import weaver.general.Util;
import java.util.HashMap;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2024/08/29
* @version: 1.0
*/
public class RecruitDemandServiceImpl extends Service implements RecruitDemandService {
@Override
public Map<String, Object> getStaffNum(Map<String, Object> param) {
Map<String, Object> returnMap = new HashMap<>();
RecordSet rs = new RecordSet();
String sqbm = Util.null2String(param.get("sqbm"));
String xqgw = Util.null2String(param.get("xqgw"));
rs.executeQuery("select a.staff_num, a.permanent_num from jcl_org_staff a inner join JCL_ORG_STAFFPLAN b on a.plan_id = b.id and b.forbidden_tag = 0 and b.delete_type = 0 where a.delete_type = 0 and a.ec_department = ? and a.job_id = ? order by a.id desc", sqbm, xqgw);
if(rs.next()) {
String staffNum = rs.getString("staff_num");
String permanentNum = rs.getString("permanent_num");
returnMap.put("staffNum", staffNum);
returnMap.put("permanentNum", permanentNum);
}
return returnMap;
}
}

@ -0,0 +1,327 @@
package com.engine.mzg.service.impl;
import com.engine.core.impl.Service;
import com.engine.mzg.conn.RecruitCommon;
import com.engine.mzg.conn.RecruitRecordSet;
import com.engine.mzg.entity.SyncTableField;
import com.engine.mzg.exception.CustomizeRunTimeException;
import com.engine.mzg.service.RecruitMobileService;
import com.engine.mzg.util.RecruitUtil;
import com.weaver.formmodel.data.manager.FormInfoManager;
import com.weaver.formmodel.data.model.Formfield;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.formmode.IgnoreCaseHashMap;
import weaver.formmode.mzg.modeexpand.disc.AddDiscExpand;
import weaver.general.Util;
import java.util.*;
import java.util.regex.Matcher;
import java.util.stream.Collectors;
/**
* @author:dxfeng
* @createTime: 2024/09/04
* @version: 1.0
*/
public class RecruitMobileServiceImpl extends Service implements RecruitMobileService {
@Override
public Map<String, Object> submitDiscTest(Map<String, Object> params) {
String billId = Util.null2String(params.get("billId"));
// 更新DISC表中统计各项汇总
RecordSet rs = new RecordSet();
rs.executeQuery("select * from uf_recruit_disc where id = ? ", billId);
if (rs.next()) {
int countD = 0;
int countI = 0;
int countS = 0;
int countC = 0;
String[] columnNames = rs.getColumnName();
for (String columnName : columnNames) {
Matcher matcher = AddDiscExpand.PATTERN.matcher(columnName);
if (matcher.matches()) {
String value = rs.getString(columnName);
if ("0".equals(value)) {
countD++;
} else if ("1".equals(value)) {
countI++;
} else if ("2".equals(value)) {
countS++;
} else if ("3".equals(value)) {
countC++;
}
}
}
rs.executeUpdate("update uf_recruit_disc set dxhj = ? ,ixhj = ?, sxhj = ?, cxhj = ? where id = ? ", countD, countI, countS, countC, billId);
} else {
throw new CustomizeRunTimeException("数据流转异常请联系HR确认");
}
return null;
}
@Override
public Map<String, Object> submitRegist(Map<String, Object> params) {
// 判断是否已经创建面试台账,未创建则插入数据,已创建则更新数据,发起面试流程后,不允许再次提交
String billId = Util.null2String(params.get("billId"));
String targetTable = Util.null2String(params.get("targetTable"));
String sourceTable = Util.null2String(params.get("sourceTable"));
if (StringUtils.isBlank(billId)) {
throw new CustomizeRunTimeException("数据流转异常请联系HR确认");
}
RecordSet rs = new RecordSet();
rs.executeQuery("select id,mslcid from uf_recruit_ms where ypdjid = ? ", billId);
String msId = "";
String mslcId = "";
if (rs.next()) {
msId = rs.getString("id");
mslcId = rs.getString("mslcid");
}
// 是否新增面试数据
boolean isAdd = StringUtils.isBlank(msId);
if (StringUtils.isNotBlank(mslcId)) {
throw new CustomizeRunTimeException("当前数据已登记结束,无法重复提交");
}
rs.executeQuery("select * from uf_recruit_table where target_table = ? and source_table =? ", targetTable, sourceTable);
String mainTableId = "";
if (rs.next()) {
mainTableId = rs.getString("id");
}
if (StringUtils.isNotBlank(mainTableId)) {
// 查询配置的字段,更新或者插入数据
List<SyncTableField> fields = RecruitCommon.getSyncTableFields(mainTableId);
rs.executeQuery("select * from " + sourceTable + " where id = ? ", billId);
IgnoreCaseHashMap<String, String> buildDataMap = new IgnoreCaseHashMap<>();
if (rs.next()) {
for (SyncTableField field : fields) {
String value = RecruitUtil.parseBlankToNull(rs.getString(field.getSourceField()));
if (StringUtils.isNotBlank(value)) {
buildDataMap.put(field.getTargetField(), value);
}
}
// 根据职位,设置部门的值
rs.executeQuery("select sqbm from uf_recruit_zpxqglb where id = ?", buildDataMap.get("sqzw"));
if (rs.next()) {
buildDataMap.put("bm", rs.getString("sqbm"));
}
if (isAdd) {
// 新增
String uuid = UUID.randomUUID().toString();
buildDataMap.put("modeuuid", uuid);
int formModeId = RecruitCommon.getModeIdByTableName(targetTable);
buildDataMap.put("formmodeid", formModeId);
// 构建建模表基本数据
buildDataMap.put("ypdjid", billId);
buildDataMap.put("mslx", "0");
buildDataMap.put("mszt", "0");
buildDataMap.put("msjg", "3");
RecruitRecordSet.buildModeInsertFields(buildDataMap, 1);
RecruitRecordSet.insertData(buildDataMap, targetTable);
msId = String.valueOf(RecruitRecordSet.refreshRight(uuid, targetTable, formModeId, 1));
} else {
// 更新
buildDataMap.put("id", msId);
RecruitRecordSet.buildModeUpdateFields(buildDataMap, 1);
RecruitRecordSet.updateDataById(buildDataMap, targetTable);
}
}
// 更新明细表,明细表删除后重新插入数据
rs.executeQuery("select * from uf_recruit_table where source_table like '" + sourceTable + "_dt%' and target_table like '" + targetTable + "_dt%' ");
while (rs.next()) {
mainTableId = rs.getString("id");
String sourceDetailTable = rs.getString("source_table");
String targetDetailTable = rs.getString("target_table");
List<SyncTableField> syncTableFields = RecruitCommon.getSyncTableFields(mainTableId);
// 删除明细表数据
RecordSet recordSet = new RecordSet();
recordSet.executeUpdate(" delete from " + targetDetailTable + " where mainid = ?", msId);
recordSet.executeQuery("select * from " + sourceDetailTable + " where mainid = ? ", billId);
while (recordSet.next()) {
buildDataMap = new IgnoreCaseHashMap<>();
buildDataMap.put("mainid", msId);
for (SyncTableField field : syncTableFields) {
String value = RecruitUtil.parseBlankToNull(recordSet.getString(field.getSourceField()));
if (StringUtils.isNotBlank(value)) {
buildDataMap.put(field.getTargetField(), value);
}
}
RecruitRecordSet.insertData(buildDataMap, targetDetailTable);
}
}
}
return null;
}
@Override
public Map<String, Object> updateOfferStatus(Map<String, Object> params) {
Map<String, Object> returnMap = new HashMap<>(3);
String status = Util.null2String(params.get("status"));
String uuid = Util.null2String(params.get("uuid"));
returnMap.put("type", "error");
returnMap.put("message", "反馈失败");
if (StringUtils.isBlank(status) || StringUtils.isBlank(uuid)) {
returnMap.put("description", "反馈失败,请直接点击邮件中的链接地址访问,请勿修改链接内容。");
return returnMap;
}
RecordSet rs = new RecordSet();
rs.executeQuery("select id,fkjg from uf_recruit_lytzs where modeuuid = ? ", uuid);
String fkjg = "";
String id = "";
if (rs.next()) {
fkjg = rs.getString("fkjg");
id = rs.getString("id");
} else {
returnMap.put("description", "反馈失败offer信息有误请联系相应HR确认");
return returnMap;
}
// 查询是否存在待入职台账
rs.executeQuery("select id from uf_recruit_drz where offerid = ?", id);
String entryDataId = "";
if (rs.next()) {
entryDataId = rs.getString("id");
}
returnMap.put("entryDataId", entryDataId);
if (StringUtils.isNotBlank(fkjg) && !"0".equals(fkjg)) {
returnMap.put("description", "您已成功反馈,无需重复反馈。");
returnMap.put("type", "info");
returnMap.put("message", "已反馈");
if (StringUtils.isNotBlank(entryDataId)) {
returnMap.put("description", "您已成功反馈,请勿重复反馈,请点击下方按钮完善入职信息");
}
return returnMap;
}
if ("1".equals(status)) {
returnMap.put("type", "success");
returnMap.put("message", "已接受offer");
returnMap.put("description", "您已接受offer期待您的加入请按期准备报道如有问题可以联系相应HR请点击下方按钮完善入职信息");
rs.executeUpdate("update uf_recruit_lytzs set fkjg = ? where modeuuid = ? ", status, uuid);
// 同步面试信息,创建待入职数据
entryDataId = createEntryData(params, id);
returnMap.put("entryDataId", entryDataId);
} else if ("2".equals(status)) {
returnMap.put("type", "info");
returnMap.put("message", "已拒绝offer");
returnMap.put("description", "您已拒绝offer感谢您的应聘。希望您能够找到真正适合自己的工作。");
rs.executeUpdate("update uf_recruit_lytzs set fkjg = ? where modeuuid = ? ", status, uuid);
}
return returnMap;
}
/**
*
*
* @param params
*/
private String createEntryData(Map<String, Object> params, String offerId) {
String mainId = "";
String targetTable = "uf_recruit_drz";
String sourceTable = "uf_recruit_ms";
if (StringUtils.isBlank(offerId)) {
throw new CustomizeRunTimeException("数据流转异常请联系HR确认");
}
RecordSet rs = new RecordSet();
rs.executeQuery("select xm from uf_recruit_lytzs where id = ?", offerId);
String msId = "";
if (rs.next()) {
msId = rs.getString("xm");
}
// 是否新增面试数据
rs.executeQuery("select * from uf_recruit_table where target_table = ? and source_table =? ", targetTable, sourceTable);
String mainTableId = "";
if (rs.next()) {
mainTableId = rs.getString("id");
}
if (StringUtils.isNotBlank(mainTableId)) {
// 查询配置的字段,更新或者插入数据
List<SyncTableField> fields = RecruitCommon.getSyncTableFields(mainTableId);
rs.executeQuery("select * from " + sourceTable + " where id = ? ", msId);
IgnoreCaseHashMap<String, String> buildDataMap = new IgnoreCaseHashMap<>();
if (rs.next()) {
for (SyncTableField field : fields) {
String value = RecruitUtil.parseBlankToNull(rs.getString(field.getSourceField()));
if (StringUtils.isNotBlank(value)) {
buildDataMap.put(field.getTargetField(), value);
}
}
// 新增
String uuid = UUID.randomUUID().toString();
buildDataMap.put("modeuuid", uuid);
int formModeId = RecruitCommon.getModeIdByTableName(targetTable);
buildDataMap.put("formmodeid", formModeId);
// 构建建模表基本数据
buildDataMap.put("offerid", offerId);
buildDataMap.put("msid", msId);
RecruitRecordSet.buildModeInsertFields(buildDataMap, 1);
RecruitRecordSet.insertData(buildDataMap, targetTable);
mainId = String.valueOf(RecruitRecordSet.refreshRight(uuid, targetTable, formModeId, 1));
// 发送消息
String roleNames = RecruitCommon.getSettingValue("OFFER_REMIND_ROLE");
if(StringUtils.isBlank(roleNames)){
roleNames="系统管理员";
}
if (StringUtils.isNotBlank(roleNames)) {
Set<String> remindUserSet = new HashSet<>();
// 根据角色名字,获取人员
String[] split = roleNames.split(",");
for (String roleName : split) {
Set<String> userIds = RecruitCommon.getRoleUserIds(roleName);
remindUserSet.addAll(userIds);
}
if (CollectionUtils.isNotEmpty(remindUserSet)) {
// 消息不为空,发送消息
List<Formfield> fieldList = FormInfoManager.getInstance().getAllField(formModeId);
Map<String, Formfield> fieldMap = fieldList.stream().collect(Collectors.toMap(Formfield::getFieldname, item -> item, (k1, k2) -> k1));
String msgContent = RecruitCommon.getSettingValue("OFFER_REMIND_CONTENT", fieldMap, buildDataMap);
String msgCenterId = RecruitCommon.getSettingValue("MSG_CENTER_ID");
RecruitUtil.messagePush(msgCenterId, "offer接受提醒", msgContent, remindUserSet, user.getUID());
}
}
}
// 更新明细表,明细表删除后重新插入数据
if (StringUtils.isNotBlank(mainId)) {
rs.executeQuery("select * from uf_recruit_table where source_table like '" + sourceTable + "_dt%' and target_table like '" + targetTable + "_dt%' ");
while (rs.next()) {
mainTableId = rs.getString("id");
String sourceDetailTable = rs.getString("source_table");
String targetDetailTable = rs.getString("target_table");
List<SyncTableField> syncTableFields = RecruitCommon.getSyncTableFields(mainTableId);
// 删除明细表数据
RecordSet recordSet = new RecordSet();
recordSet.executeUpdate(" delete from " + targetDetailTable + " where mainid = ?", mainId);
recordSet.executeQuery("select * from " + sourceDetailTable + " where mainid = ? ", msId);
while (recordSet.next()) {
buildDataMap = new IgnoreCaseHashMap<>();
buildDataMap.put("mainid", mainId);
for (SyncTableField field : syncTableFields) {
String value = RecruitUtil.parseBlankToNull(recordSet.getString(field.getSourceField()));
if (StringUtils.isNotBlank(value)) {
buildDataMap.put(field.getTargetField(), value);
}
}
RecruitRecordSet.insertData(buildDataMap, targetDetailTable);
}
}
}
}
return mainId;
}
}

@ -0,0 +1,20 @@
package com.engine.mzg.util;
/**
* @Author weaver_cl
* @Description:
* @Date 2023/2/21
* @Version V1.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 "";
}
}

@ -0,0 +1,329 @@
package com.engine.mzg.util;
import com.api.mobilemode.util.FieldHandler;
import com.cloudstore.dev.api.bean.MessageBean;
import com.cloudstore.dev.api.bean.MessageType;
import com.cloudstore.dev.api.util.Util_Message;
import com.engine.mzg.conn.RecruitCommon;
import com.engine.mzg.exception.CustomizeRunTimeException;
import com.weaver.formmodel.data.manager.FormInfoManager;
import com.weaver.formmodel.data.model.Formfield;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.util.IOUtils;
import weaver.common.MessageUtil;
import weaver.conn.RecordSet;
import weaver.docs.docs.*;
import weaver.email.EmailWorkRunnable;
import weaver.file.ImageFileManager;
import weaver.general.BaseBean;
import weaver.general.TimeUtil;
import weaver.general.Util;
import weaver.hrm.User;
import weaver.hrm.resource.ResourceComInfo;
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* @author:dxfeng
* @createTime: 2023/09/26
* @version: 1.0
*/
public class RecruitUtil {
/**
*
*/
private static final Pattern EMAIL_PATTERN = Pattern.compile(Pattern.quote("{") + "(.*?)" + Pattern.quote("}"));
/**
*
*/
private static final Pattern MSG_PATTERN = Pattern.compile(Pattern.quote("$") + "(.*?)" + Pattern.quote("$"));
public static boolean sendEmail(String sendTo, String emailTitle, String emailContent) {
boolean isSend = MessageUtil.sendEmail(sendTo, emailTitle, emailContent);
if (isSend) {
return true;
}
throw new CustomizeRunTimeException("邮件发送失败,请查看群发日志");
}
/**
* @param sendTo
* @param emailTitle
* @param emailContent
* @param imageFileIds imageFileid
* @return
*/
public static boolean sendEmailWithFile(String sendTo, String emailTitle, String emailContent, String imageFileIds) {
EmailWorkRunnable emailWorkRunnable = new EmailWorkRunnable(sendTo, Util.toHtmlMode(emailTitle), Util.toHtmlMode(emailContent));
emailWorkRunnable.setImagefileids(imageFileIds);
boolean isSend = emailWorkRunnable.emailCommonRemind();
if (isSend) {
return true;
}
throw new CustomizeRunTimeException("邮件发送失败,请查看群发日志");
}
/**
*
*
* @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) {
messagePush(messageType, title, context, userIdList, creater, "", "");
}
/**
* @param messageType
* @param title
* @param context
* @param userIdList ID
* @param creater
* @param linkUrl
* @param linkMobileUrl
*/
public static void messagePush(String messageType, String title, String context, Set<String> userIdList, Integer creater, String linkUrl, String linkMobileUrl) {
MessageType message = MessageType.newInstance(Integer.parseInt(messageType));
try {
MessageBean messageBean = Util_Message.createMessage(message, userIdList, title, context, linkUrl, linkMobileUrl);
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);
}
}
/**
* null
*
* @param str
* @return
*/
public static String parseBlankToNull(String str) {
return StringUtils.isBlank(str) ? null : str;
}
/**
* null
*
* @param obj
* @return
*/
public static String parseBlankToNull(Object obj) {
return Objects.isNull(obj) ? null : StringUtils.isBlank(obj.toString()) ? null : obj.toString();
}
/**
* ID
*
* @param inputStream
* @param filename
* @return
*/
public static int generateImageFileId(InputStream inputStream, String filename) {
int imageFileId;
try {
byte[] bytes = IOUtils.toByteArray(inputStream);
ImageFileManager ifm = new ImageFileManager();
ifm.setData(bytes);
ifm.setImagFileName(filename);
imageFileId = ifm.saveImageFile();
} catch (IOException e) {
throw new RuntimeException(e);
}
return imageFileId;
}
public static List<Formfield> getFieldList(String tableName) {
int formId = RecruitCommon.getFormIdByTableName(tableName);
return FormInfoManager.getInstance().getAllField(formId);
}
public static String getFieldShowName(Formfield formfield, String fieldValue) {
User user = new User(1);
return FieldHandler.getFieldValue(fieldValue, formfield, true, user);
}
public static String getReplaceContent(String content, Map<String, List<Formfield>> fieldMapList, Map<String, Object> paramsData) {
Matcher matcher = EMAIL_PATTERN.matcher(content);
// 指定要匹配的字符串
StringBuffer sb = new StringBuffer();
while (matcher.find()) {
String replace = matcher.group(1);
List<Formfield> formFieldList = fieldMapList.get(replace);
if (CollectionUtils.isEmpty(formFieldList)) {
continue;
}
// 多个相同名称的字段,只取第一个
Formfield formfield = formFieldList.get(0);
String replaceValue = Util.null2String(paramsData.get(formfield.getFieldname().toLowerCase()));
String fieldShowName = RecruitUtil.getFieldShowName(formfield, replaceValue).replaceAll("<[^>]*>", "");
matcher.appendReplacement(sb, Util.null2String(fieldShowName));
}
matcher.appendTail(sb);
return sb.toString();
}
/**
*
*
* @param content
* @param fieldMap
* @param paramsData
* @return
*/
public static String getMsgReplaceStr(String content, Map<String, Formfield> fieldMap, Map<String, Object> paramsData) {
Matcher matcher = MSG_PATTERN.matcher(content);
// 指定要匹配的字符串
StringBuffer sb = new StringBuffer();
while (matcher.find()) {
String replace = matcher.group(1);
Formfield formfield = fieldMap.get(replace);
String replaceValue = Util.null2String(paramsData.get(formfield.getFieldname().toLowerCase()));
String fieldShowName = RecruitUtil.getFieldShowName(formfield, replaceValue).replaceAll("<[^>]*>", "");
matcher.appendReplacement(sb, Util.null2String(fieldShowName));
}
matcher.appendTail(sb);
return sb.toString();
}
/**
* imageFieldIddocId
*
* @param secCategory
* @param imageFieldId
* @param user
* @return
* @throws Exception
*/
public static 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();
DocViewer DocViewer = new DocViewer();
DocViewer.setDocShareByDoc("" + docId);
DocComInfo dc = new DocComInfo();
dc.addDocInfoCache("" + docId);
return docId;
}
public static String getImageFileIdsByDocIds(String docId) {
if (StringUtils.isBlank(docId)) {
return "";
}
List<String> imageFileIds = new ArrayList<>();
String[] split = docId.split(",");
try {
for (String s : split) {
if (StringUtils.isBlank(s)) {
continue;
}
DocImageManager imgManger = new DocImageManager();
imgManger.setDocid(Integer.parseInt(s));
imgManger.selectDocImageInfo();
imgManger.next();
imageFileIds.add(imgManger.getImagefileid());
}
} catch (Exception e) {
throw new RuntimeException(e);
}
return StringUtils.join(imageFileIds, ",");
}
/**
*
*
* @param id
*/
public static String getEmailTitle(String id) {
RecordSet recordSet = new RecordSet();
String emailTitle = "";
recordSet.executeQuery("select yjzt from uf_jcl_yjtzmb where id = ?", id);
if (recordSet.next()) {
emailTitle = recordSet.getString("yjzt");
}
return emailTitle;
}
}

@ -0,0 +1,192 @@
package com.engine.mzg.util;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.engine.core.exception.ECException;
import com.engine.mzg.exception.CustomizeRunTimeException;
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;
/**
*
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: </p>
*
* @author qiantao
* @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("api_status", true);
return JSONObject.toJSONString(apidatas, SerializerFeature.DisableCircularReferenceDetect);
}
/**
*
*/
private String Ok(R r) {
Map<String, Object> apidatas = new HashMap<>();
apidatas.put("api_status", true);
apidatas.put("data", r);
String success = JSON.toJSONString(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("api_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("api_status", false);
apidatas.put("errormsg", message);
apidatas.put("error", e.getMessage());
return JSONObject.toJSONString(apidatas, SerializerFeature.DisableCircularReferenceDetect);
}
}

@ -0,0 +1,39 @@
package com.engine.mzg.web;
import com.engine.common.util.ParamUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.mzg.service.RecruitDemandService;
import com.engine.mzg.service.impl.RecruitDemandServiceImpl;
import com.engine.mzg.util.ResponseResult;
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: 2024/08/29
* @version: 1.0
*/
public class RecruitDemandController {
public RecruitDemandService getService(User user) {
return ServiceUtil.getService(RecruitDemandServiceImpl.class, user);
}
@GET
@Path("/getStaffNum")
@Produces(MediaType.APPLICATION_JSON)
public String getStaffNum(@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(getService(user)::getStaffNum, params);
}
}

@ -0,0 +1,59 @@
package com.engine.mzg.web;
import com.engine.common.util.ParamUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.mzg.service.RecruitMobileService;
import com.engine.mzg.service.impl.RecruitMobileServiceImpl;
import com.engine.mzg.util.ResponseResult;
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: 2024/09/05
* @version: 1.0
*/
public class RecruitMobileController {
public RecruitMobileService getService(User user) {
return ServiceUtil.getService(RecruitMobileServiceImpl.class, user);
}
@GET
@Path("/submitDiscTest")
@Produces(MediaType.APPLICATION_JSON)
public String submitDiscTest(@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(getService(user)::submitDiscTest, params);
}
@GET
@Path("/submitRegist")
@Produces(MediaType.APPLICATION_JSON)
public String submitRegist(@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(getService(user)::submitRegist, params);
}
@GET
@Path("/updateOfferStatus")
@Produces(MediaType.APPLICATION_JSON)
public String updateOfferStatus(@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(getService(user)::updateOfferStatus, params);
}
}

@ -0,0 +1,123 @@
package weaver.formmode.mzg.modeexpand.back;
import com.engine.mzg.conn.RecruitCommon;
import com.engine.mzg.conn.RecruitRecordSet;
import com.engine.mzg.exception.CustomizeRunTimeException;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.formmode.IgnoreCaseHashMap;
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.HashMap;
import java.util.Map;
import java.util.UUID;
/**
* offer
* <p>
*
*
* @author:dxfeng
* @createTime: 2024/09/19
* @version: 1.0
*/
public class FeedbackExpand extends AbstractModeExpandJavaCodeNew {
@Override
public Map<String, String> doModeExpand(Map<String, Object> param) {
Map<String, String> result = new HashMap<>();
RecordSet rs = new RecordSet();
try {
String recruitType = Util.null2String(param.get("recruitType"));
if (!"feedback".equals(recruitType)) {
return result;
}
RequestInfo requestInfo = (RequestInfo) param.get("RequestInfo");
if (requestInfo != null) {
User user = (User) param.get("user");
IgnoreCaseHashMap<String, String> mainDataMap = new IgnoreCaseHashMap<>();
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
Property[] properties = mainTableInfo.getProperty();
for (Property property : properties) {
mainDataMap.put(property.getName(), property.getValue());
}
String bbdr = Util.null2String(mainDataMap.get("bbdr"));
String bdjg = Util.null2String(mainDataMap.get("bdjg"));
if (StringUtils.isBlank(bdjg)) {
result.put("errmsg", "背调结果为空");
result.put("flag", "false");
return result;
}
rs.executeQuery("select id,mslcid ,sqzw from uf_recruit_ms where id = ?", bbdr);
String msId = "";
String sqzw = "";
String mslcid = "";
if (rs.next()) {
msId = rs.getString("id");
sqzw = rs.getString("sqzw");
mslcid = rs.getString("mslcid");
}
if (StringUtils.isAnyBlank(msId, sqzw, mslcid)) {
throw new CustomizeRunTimeException("面试数据异常,请联系管理员");
}
if ("0".equals(bdjg)) {
// 背调结果为“通过”生成offer台账数据
rs.executeQuery("select * from uf_recruit_zpxqglb where id = ?", sqzw);
IgnoreCaseHashMap<String, Object> recordMap = RecruitRecordSet.getSingleRecordMap(rs);
if (recordMap.isEmpty()) {
throw new CustomizeRunTimeException("未获取到招聘职位数据");
}
String xqgw = Util.null2String(recordMap.get("xqgw"));
String gzdd = Util.null2String(recordMap.get("gzdd"));
String qtgzdd = Util.null2String(recordMap.get("qtgzdd"));
int zpxqFormId = RecruitCommon.getModeIdByTableName("uf_recruit_zpxqglb");
String gzddStr = RecruitCommon.getSelectName(String.valueOf(zpxqFormId), "gzdd", gzdd);
if (StringUtils.isNotBlank(qtgzdd)) {
gzddStr = qtgzdd;
}
// 创建offer
String tableName = "uf_recruit_lytzs";
IgnoreCaseHashMap<String, Object> dataMap = new IgnoreCaseHashMap<>();
String uuid = UUID.randomUUID().toString();
dataMap.put("modeuuid", uuid);
int formModeId = RecruitCommon.getModeIdByTableName(tableName);
dataMap.put("formmodeid", formModeId);
// 构建建模表基本数据
RecruitRecordSet.buildModeInsertFields(dataMap, user.getUID());
// 姓名
dataMap.put("xm", bbdr);
// 岗位
dataMap.put("gw", xqgw);
// 工作地点
dataMap.put("gzdd", gzddStr);
// 插入数据
RecruitRecordSet.insertData(dataMap, tableName);
RecruitRecordSet.refreshRight(uuid, tableName, formModeId, user.getUID());
} else {
// 背调结果为“不通过”,招聘终止(逻辑同面试招聘终止)
// 更新流程、建模状态
rs.executeUpdate("update uf_recruit_ms set mszt = ? where id = ?", "2", msId);
// 获取流程表名
String flowTableInterview = RecruitCommon.getSettingValue("FLOW_TABLE_INTERVIEW");
rs.executeUpdate("update " + flowTableInterview + " set mszt = ? where requestId = ? ", "2", mslcid);
}
}
} catch (Exception e) {
rs.writeLog(e);
result.put("errmsg", e.getMessage());
result.put("flag", "false");
}
return result;
}
}

@ -0,0 +1,72 @@
package weaver.formmode.mzg.modeexpand.disc;
import weaver.conn.RecordSet;
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
import weaver.general.BaseBean;
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;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* @author:dxfeng
* @createTime: 2024/09/02
* @version: 1.0
*/
public class AddDiscExpand extends AbstractModeExpandJavaCodeNew {
public static final Pattern PATTERN = Pattern.compile("^q([1-9]|[1-3][0-9]|40)$");
@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) {
// 计算各个选项的值
int countD = 0;
int countI = 0;
int countS = 0;
int countC = 0;
RecordSet rs = new RecordSet();
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
Property[] properties = mainTableInfo.getProperty();
for (Property property : properties) {
String name = property.getName();
Matcher matcher = PATTERN.matcher(name);
if (!matcher.matches()) {
continue;
}
if ("0".equals(property.getValue())) {
countD++;
} else if ("1".equals(property.getValue())) {
countI++;
} else if ("2".equals(property.getValue())) {
countS++;
} else if ("3".equals(property.getValue())) {
countC++;
}
}
// 更新各个选项的个数
rs.executeUpdate("update uf_recruit_disc set dxhj = ? ,ixhj = ?, sxhj = ?, cxhj = ? where id = ? ", countD, countI, countS, countC, billId);
}
}
} catch (Exception e) {
new BaseBean().writeLog(e);
result.put("errmsg", "DISC数据统计异常");
result.put("flag", "false");
}
return result;
}
}

@ -0,0 +1,104 @@
package weaver.formmode.mzg.modeexpand.interview;
import com.engine.mzg.conn.RecruitCommon;
import com.engine.mzg.enums.EmailTemplateEnum;
import com.engine.mzg.exception.CustomizeRunTimeException;
import com.engine.mzg.util.RecruitUtil;
import com.weaver.formmodel.data.model.Formfield;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.formmode.IgnoreCaseHashMap;
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
import weaver.general.BaseBean;
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.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author:dxfeng
* @createTime: 2024/09/10
* @version: 1.0
*/
public class AdjustmentInterviewFlowExpand extends AbstractModeExpandJavaCodeNew {
@Override
public Map<String, String> doModeExpand(Map<String, Object> param) {
// 取消面试
Map<String, String> result = new HashMap<>();
try {
String billId;
String recruitType = Util.null2String(param.get("recruitType"));
if (!"adjustmentInterview".equals(recruitType)) {
return result;
}
RequestInfo requestInfo = (RequestInfo) param.get("RequestInfo");
if (requestInfo != null) {
billId = requestInfo.getRequestid();
RecordSet rs = new RecordSet();
IgnoreCaseHashMap<String, String> mainDataMap = new IgnoreCaseHashMap<>();
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
Property[] properties = mainTableInfo.getProperty();
for (Property property : properties) {
mainDataMap.put(property.getName(), property.getValue());
}
String mslx = Util.null2String(mainDataMap.get("mslx"));
String mslc = "";
String msrq = "";
String msfs = "";
String msdz = "";
Integer emailTemplateId;
if ("0".equals(mslx)) {
mslc = "dyl";
emailTemplateId = EmailTemplateEnum.INTERVIEW_FIRST.getValue();
} else if ("1".equals(mslx)) {
mslc = "del";
emailTemplateId = EmailTemplateEnum.INTERVIEW_SECOND.getValue();
} else if ("2".equals(mslx)) {
mslc = "dsl";
emailTemplateId = EmailTemplateEnum.INTERVIEW_THIRD.getValue();
} else {
result.put("errmsg", "面试类型匹配异常");
result.put("flag", "false");
return result;
}
msrq = Util.null2String(mainDataMap.get(mslc + "msrq"));
msfs = Util.null2String(mainDataMap.get(mslc + "msfs"));
msdz = Util.null2String(mainDataMap.get(mslc + "msdz"));
// 更新流程中的字段
String flowTableInterview = RecruitCommon.getSettingValue("FLOW_TABLE_INTERVIEW");
String requestId = Util.null2String(mainDataMap.get("mslcid"));
String sql = "update " + flowTableInterview + " set " + mslc + "msrq = ?," + mslc + "msfs=?," + mslc + "msdz=? where requestId = ? ";
rs.executeUpdate(sql, msrq, msfs, msdz, requestId);
// 发送调整面试邮件
String emailTitle = "";
String emailContent = "";
rs.executeQuery("select yjzt ,yjnr from uf_recruit_email where mblx =? ", emailTemplateId);
if (rs.next()) {
emailTitle = rs.getString("yjzt");
emailContent = rs.getString("yjnr");
}
if (StringUtils.isBlank(emailTitle) || StringUtils.isBlank(emailContent)) {
throw new CustomizeRunTimeException("请检查邮件模板设置");
}
List<Formfield> fieldList = RecruitUtil.getFieldList("uf_recruit_ms");
Map<String, List<Formfield>> fieldMapList = fieldList.stream().collect(Collectors.groupingBy(Formfield::getFieldname));
emailContent = RecruitUtil.getReplaceContent(emailContent, fieldMapList, mainDataMap);
String sendTo = Util.null2String(mainDataMap.get("dzyx"));
RecruitUtil.sendEmail(sendTo, emailTitle, emailContent);
}
} catch (Exception e) {
new BaseBean().writeLog(e);
result.put("errmsg", e.getMessage());
result.put("flag", "false");
}
return result;
}
}

@ -0,0 +1,80 @@
package weaver.formmode.mzg.modeexpand.interview;
import com.engine.mzg.conn.RecruitCommon;
import com.engine.mzg.enums.EmailTemplateEnum;
import com.engine.mzg.exception.CustomizeRunTimeException;
import com.engine.mzg.util.RecruitUtil;
import com.weaver.formmodel.data.model.Formfield;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.formmode.IgnoreCaseHashMap;
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
import weaver.general.BaseBean;
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.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author:dxfeng
* @createTime: 2024/09/10
* @version: 1.0
*/
public class CancelInterviewFlowExpand extends AbstractModeExpandJavaCodeNew {
@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();
RecordSet rs = new RecordSet();
IgnoreCaseHashMap<String, String> mainDataMap = new IgnoreCaseHashMap<>();
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
Property[] properties = mainTableInfo.getProperty();
for (Property property : properties) {
mainDataMap.put(property.getName(), property.getValue());
}
// 发送取消面试邮件
String emailTitle = "";
String emailContent = "";
rs.executeQuery("select yjzt ,yjnr from uf_recruit_email where mblx =? ", EmailTemplateEnum.INTERVIEW_CANCEL.getValue());
if (rs.next()) {
emailTitle = rs.getString("yjzt");
emailContent = rs.getString("yjnr");
}
if (StringUtils.isBlank(emailTitle) || StringUtils.isBlank(emailContent)) {
throw new CustomizeRunTimeException("请检查邮件模板设置");
}
List<Formfield> fieldList = RecruitUtil.getFieldList("uf_recruit_ms");
Map<String, List<Formfield>> fieldMapList = fieldList.stream().collect(Collectors.groupingBy(Formfield::getFieldname));
emailContent = RecruitUtil.getReplaceContent(emailContent, fieldMapList, mainDataMap);
String sendTo = Util.null2String(mainDataMap.get("dzyx"));
RecruitUtil.sendEmail(sendTo, emailTitle, emailContent);
// 更新流程、建模状态
rs.executeUpdate("update uf_recruit_ms set mszt = ? where id = ?", "2", billId);
// 获取流程表名
String flowTableInterview = RecruitCommon.getSettingValue("FLOW_TABLE_INTERVIEW");
String requestId = Util.null2String(mainDataMap.get("mslcid"));
rs.executeUpdate("update " + flowTableInterview + " set mszt = ? where requestId = ? ", "2", requestId);
}
} catch (Exception e) {
new BaseBean().writeLog(e);
result.put("errmsg", e.getMessage());
result.put("flag", "false");
}
return result;
}
}

@ -0,0 +1,93 @@
package weaver.formmode.mzg.modeexpand.offer;
import com.engine.mzg.conn.RecruitCommon;
import com.engine.mzg.enums.EmailTemplateEnum;
import com.engine.mzg.exception.CustomizeRunTimeException;
import com.engine.mzg.util.RecruitUtil;
import com.weaver.formmodel.data.model.Formfield;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.formmode.IgnoreCaseHashMap;
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.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author:dxfeng
* @createTime: 2024/09/20
* @version: 1.0
*/
public class SendOfferExpand extends AbstractModeExpandJavaCodeNew {
@Override
public Map<String, String> doModeExpand(Map<String, Object> param) {
RecordSet rs = new RecordSet();
Map<String, String> result = new HashMap<>();
try {
int billId;
RequestInfo requestInfo = (RequestInfo) param.get("RequestInfo");
if (requestInfo != null) {
billId = Util.getIntValue(requestInfo.getRequestid());
IgnoreCaseHashMap<String, String> mainDataMap = new IgnoreCaseHashMap<>();
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
Property[] properties = mainTableInfo.getProperty();
for (Property property : properties) {
mainDataMap.put(property.getName(), property.getValue());
}
String xm = Util.null2String(mainDataMap.get("xm"));
rs.executeQuery("select dzyx from uf_recruit_ms where id = ?", xm);
String sendTo = "";
if (rs.next()) {
sendTo = rs.getString("dzyx");
}
if (StringUtils.isBlank(sendTo)) {
throw new CustomizeRunTimeException("电子邮箱为空,邮件发送失败");
}
String emailTitle = "";
String emailContent = "";
rs.executeQuery("select yjzt ,yjnr from uf_recruit_email where mblx =? ", EmailTemplateEnum.OFFER.getValue());
if (rs.next()) {
emailTitle = rs.getString("yjzt");
emailContent = rs.getString("yjnr");
}
if (StringUtils.isBlank(emailTitle) || StringUtils.isBlank(emailContent)) {
throw new CustomizeRunTimeException("请检查邮件模板设置");
}
rs.executeQuery("select modeuuid from uf_recruit_lytzs where id = ? ", billId);
String uuid = "";
if (rs.next()) {
uuid = rs.getString("modeuuid");
}
String confirmUrl = RecruitCommon.getSettingValue("OFFER_FEEDBACK_URL") + "?uuid=" + uuid;
// 发送邮件
List<Formfield> fieldList = RecruitUtil.getFieldList("uf_recruit_lytzs");
Map<String, List<Formfield>> fieldMapList = fieldList.stream().collect(Collectors.groupingBy(Formfield::getFieldname));
emailContent = RecruitUtil.getReplaceContent(emailContent, fieldMapList, mainDataMap);
// 拼接反馈信息
emailContent += "<div style=\"border:3px solid silver;width:635px;height:55px;line-height:55px;font-family:'microsoft Yahei';font-size:18px;font-weight:bold;color:#333;padding-left:10px\">请您答复是否接受此Offer <a href=\"" + confirmUrl + "&status=1\" style=\"text-decoration:underline;color:#0000cc;margin-right:10px\">接受</a> <a href=\"" + confirmUrl + "&status=2\" style=\"text-decoration:underline;color:#0000cc;\">拒绝</a></div>";
// offer附件
String offerAttach = RecruitUtil.getImageFileIdsByDocIds(Util.null2String(mainDataMap.get("fj")));
RecruitUtil.sendEmailWithFile(sendTo, emailTitle, emailContent, offerAttach);
rs.executeUpdate("update uf_recruit_lytzs set fkjg = 0 where id = ?", billId);
}
} catch (Exception e) {
rs.writeLog(e);
result.put("errmsg", e.getMessage());
result.put("flag", "false");
}
return result;
}
}

@ -0,0 +1,47 @@
package weaver.formmode.mzg.modeexpand.resume;
import com.engine.mzg.conn.RecruitCommon;
import weaver.conn.RecordSet;
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
import weaver.hrm.User;
import weaver.soa.workflow.request.RequestInfo;
import java.util.HashMap;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2024/10/11
* @version: 1.0
*/
public class ArchiveTalentPoolExpand extends AbstractModeExpandJavaCodeNew {
@Override
public Map<String, String> doModeExpand(Map<String, Object> param) {
Map<String, String> result = new HashMap<>();
RecordSet rs = new RecordSet();
try {
String billId;
RequestInfo requestInfo = (RequestInfo) param.get("RequestInfo");
if (requestInfo != null) {
User user = (User) param.get("user");
billId = requestInfo.getRequestid();
// 查询人才库中是否有该数据
rs.executeQuery("select id from uf_recruit_rck where jlkid = ?", billId);
String rckId = "";
if (rs.next()) {
rckId = rs.getString("id");
// 更新人才库
RecruitCommon.updateTablesData("uf_recruit_rck", "uf_recruit_resume", billId, rckId, "jlkid", user.getUID());
} else {
// 插入人才库
RecruitCommon.insertTablesData("uf_recruit_rck", "uf_recruit_resume",billId,"jlkid",user.getUID());
}
}
} catch (Exception e) {
rs.writeLog(e);
result.put("errmsg", e.getMessage());
result.put("flag", "false");
}
return result;
}
}

@ -0,0 +1,118 @@
package weaver.formmode.mzg.modeexpand.resume;
import com.engine.mzg.conn.RecruitCommon;
import com.engine.mzg.conn.RecruitRecordSet;
import com.engine.mzg.enums.EmailTemplateEnum;
import com.engine.mzg.exception.CustomizeRunTimeException;
import com.engine.mzg.util.RecruitUtil;
import com.weaver.formmodel.data.model.Formfield;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.formmode.IgnoreCaseHashMap;
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
import weaver.general.BaseBean;
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.List;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;
/**
* DISC
*
* @author:dxfeng
* @createTime: 2024/09/05
* @version: 1.0
*/
public class SendDiscExpand extends AbstractModeExpandJavaCodeNew {
@Override
public Map<String, String> doModeExpand(Map<String, Object> param) {
Map<String, String> result = new HashMap<>();
try {
int billId;
RequestInfo requestInfo = (RequestInfo) param.get("RequestInfo");
if (requestInfo != null) {
billId = Util.getIntValue(requestInfo.getRequestid());
IgnoreCaseHashMap<String, String> mainDataMap = new IgnoreCaseHashMap<>();
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
Property[] properties = mainTableInfo.getProperty();
for (Property property : properties) {
mainDataMap.put(property.getName(), property.getValue());
}
RecordSet rs = new RecordSet();
String mobileAppidDisc = RecruitCommon.getSettingValue("MOBILE_APPID_DISC");
String mobileUrlDisc = RecruitCommon.getSettingValue("MOBILE_URL_DISC");
String httpUrl = RecruitCommon.getSettingValue("HTTP_URL");
rs.executeQuery("select noLoginUser from mobileappbaseinfo where id = ?", mobileAppidDisc);
int creator = -1;
if (rs.next()) {
creator = rs.getInt("noLoginUser");
}
if (-1 == creator) {
throw new CustomizeRunTimeException("未配置免登陆访问用户,请检查移动建模应用配置");
}
String sendTo = Util.null2String(mainDataMap.get("dzyx"));
if (StringUtils.isBlank(sendTo)) {
throw new CustomizeRunTimeException("电子邮箱为空,邮件发送失败");
}
String emailTitle = "";
String emailContent = "";
rs.executeQuery("select yjzt ,yjnr from uf_recruit_email where mblx =? ", EmailTemplateEnum.DISC.getValue());
if (rs.next()) {
emailTitle = rs.getString("yjzt");
emailContent = rs.getString("yjnr");
}
if (StringUtils.isBlank(emailTitle) || StringUtils.isBlank(emailContent)) {
throw new CustomizeRunTimeException("请检查邮件模板设置");
}
// 插入DISC测评表数据
IgnoreCaseHashMap<String, Object> dataMap = new IgnoreCaseHashMap<>();
String uuid = UUID.randomUUID().toString();
dataMap.put("modeuuid", uuid);
int formModeId = RecruitCommon.getModeIdByTableName("uf_recruit_disc");
dataMap.put("formmodeid", formModeId);
// 构建建模表基本数据
RecruitRecordSet.buildModeInsertFields(dataMap, creator);
dataMap.put("xm", billId);
dataMap.put("sqzw", mainDataMap.get("sqzw"));
dataMap.put("lxfs", mainDataMap.get("lxfs"));
dataMap.put("modedatastatus", "0");
// 插入数据
RecruitRecordSet.insertData(dataMap, "uf_recruit_disc");
int id = RecruitRecordSet.refreshRight(uuid, "uf_recruit_disc", formModeId, creator);
// 测评ID反写简历中心表,更新状态
rs.executeUpdate("update uf_recruit_resume set cpzt = ? ,cpglid = ? where id = ? ", 1, id, billId);
// 发送邮件
// 查询字段信息
List<Formfield> fieldList = RecruitUtil.getFieldList("uf_recruit_resume");
Map<String, List<Formfield>> fieldMapList = fieldList.stream().collect(Collectors.groupingBy(Formfield::getFieldname));
String url = httpUrl + mobileUrlDisc + "&billid=" + id;
if (StringUtils.isNotBlank(url)) {
url = "<span><a href='" + url + "' target='_blank'>链接地址</a></span>";
}
emailContent = emailContent.replace("{链接地址}", url);
emailContent = RecruitUtil.getReplaceContent(emailContent, fieldMapList, mainDataMap);
RecruitUtil.sendEmail(sendTo, emailTitle, emailContent);
}
} catch (Exception e) {
new BaseBean().writeLog(e);
result.put("errmsg", e.getMessage());
result.put("flag", "false");
}
return result;
}
}

@ -0,0 +1,119 @@
package weaver.formmode.mzg.modeexpand.resume;
import com.engine.mzg.conn.RecruitCommon;
import com.engine.mzg.conn.RecruitRecordSet;
import com.engine.mzg.enums.EmailTemplateEnum;
import com.engine.mzg.exception.CustomizeRunTimeException;
import com.engine.mzg.util.RecruitUtil;
import com.weaver.formmodel.data.model.Formfield;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.formmode.IgnoreCaseHashMap;
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
import weaver.general.BaseBean;
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.List;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;
/**
*
*
* @author:dxfeng
* @createTime: 2024/09/05
* @version: 1.0
*/
public class SendRegistExpand extends AbstractModeExpandJavaCodeNew {
@Override
public Map<String, String> doModeExpand(Map<String, Object> param) {
Map<String, String> result = new HashMap<>();
try {
int billId;
RequestInfo requestInfo = (RequestInfo) param.get("RequestInfo");
if (requestInfo != null) {
billId = Util.getIntValue(requestInfo.getRequestid());
IgnoreCaseHashMap<String, String> mainDataMap = new IgnoreCaseHashMap<>();
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
Property[] properties = mainTableInfo.getProperty();
for (Property property : properties) {
mainDataMap.put(property.getName(), property.getValue());
}
RecordSet rs = new RecordSet();
String mobileAppidRegist = RecruitCommon.getSettingValue("MOBILE_APPID_REGIST");
String mobileUrlRegist = RecruitCommon.getSettingValue("MOBILE_URL_REGIST");
String httpUrl = RecruitCommon.getSettingValue("HTTP_URL");
rs.executeQuery("select noLoginUser from mobileappbaseinfo where id = ?", mobileAppidRegist);
int creator = -1;
if (rs.next()) {
creator = rs.getInt("noLoginUser");
}
if (-1 == creator) {
throw new CustomizeRunTimeException("未配置免登陆访问用户,请检查移动建模应用配置");
}
String sendTo = Util.null2String(mainDataMap.get("dzyx"));
if (StringUtils.isBlank(sendTo)) {
throw new CustomizeRunTimeException("电子邮箱为空,邮件发送失败");
}
String emailTitle = "";
String emailContent = "";
rs.executeQuery("select yjzt ,yjnr from uf_recruit_email where mblx =? ", EmailTemplateEnum.REGIST.getValue());
if (rs.next()) {
emailTitle = rs.getString("yjzt");
emailContent = rs.getString("yjnr");
}
if (StringUtils.isBlank(emailTitle) || StringUtils.isBlank(emailContent)) {
throw new CustomizeRunTimeException("请检查邮件模板设置");
}
// 插入应聘登记数据
IgnoreCaseHashMap<String, Object> dataMap = new IgnoreCaseHashMap<>();
String uuid = UUID.randomUUID().toString();
dataMap.put("modeuuid", uuid);
int formModeId = RecruitCommon.getModeIdByTableName("uf_recruit_regist");
dataMap.put("formmodeid", formModeId);
// 构建建模表基本数据
RecruitRecordSet.buildModeInsertFields(dataMap, creator);
dataMap.put("xmzw", mainDataMap.get("xm"));
dataMap.put("sqzw", mainDataMap.get("sqzw"));
dataMap.put("lldh", mainDataMap.get("lxfs"));
//dataMap.put("modedatastatus", "0");
// 插入数据
RecruitRecordSet.insertData(dataMap, "uf_recruit_regist");
int id = RecruitRecordSet.refreshRight(uuid, "uf_recruit_regist", formModeId, creator);
// 测评ID反写简历中心表,更新状态
rs.executeUpdate("update uf_recruit_resume set xxcjzt = ? ,ypdjid = ? where id = ? ", 1, id, billId);
// 发送邮件
// 查询字段信息
List<Formfield> fieldList = RecruitUtil.getFieldList("uf_recruit_resume");
Map<String, List<Formfield>> fieldMapList = fieldList.stream().collect(Collectors.groupingBy(Formfield::getFieldname));
String url = httpUrl + mobileUrlRegist + "&billid=" + id;
if (StringUtils.isNotBlank(url)) {
url = "<span><a href='" + url + "' target='_blank'>链接地址</a></span>";
}
emailContent = emailContent.replace("{链接地址}", url);
emailContent = RecruitUtil.getReplaceContent(emailContent, fieldMapList, mainDataMap);
RecruitUtil.sendEmail(sendTo, emailTitle, emailContent);
}
} catch (Exception e) {
new BaseBean().writeLog(e);
result.put("errmsg", e.getMessage());
result.put("flag", "false");
}
return result;
}
}

@ -1,135 +0,0 @@
package weaver.interfaces.gsjrkg.action;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.general.Util;
import weaver.interfaces.workflow.action.Action;
import weaver.soa.workflow.request.MainTableInfo;
import weaver.soa.workflow.request.Property;
import weaver.soa.workflow.request.RequestInfo;
import java.util.*;
/**
* @Description:
* @author:dxfeng
* @createTime: 2023/02/20
* @version: 1.0
*/
public class SyncCertificateAction implements Action {
/**
*
*/
private String modeTableName;
/**
*
*/
private String params;
private String resourceFieldGroup;
@Override
public String execute(RequestInfo requestInfo) {
if (StringUtils.isBlank(params)) {
requestInfo.getRequestManager().setMessagecontent("自定义接口参数值配置错误");
return Action.FAILURE_AND_CONTINUE;
}
if (StringUtils.isBlank(resourceFieldGroup)) {
// -1:基本信息,1:个人信息,3:工作信息
resourceFieldGroup = "1";
}
Map<String, String> fieldMap = new HashMap<>();
String[] fieldsArray = params.split(";");
for (String fields : fieldsArray) {
String[] field = fields.split(":");
if (field.length == 2) {
fieldMap.put(field[0], field[1]);
}
}
if (fieldMap.size() != fieldsArray.length) {
requestInfo.getRequestManager().setMessagecontent("自定义接口参数值格式错误,请检查");
return Action.FAILURE_AND_CONTINUE;
}
Set<String> modeFields = fieldMap.keySet();
Map<String, Set<String>> modeMap = new HashMap<>();
RecordSet rs = new RecordSet();
String resourceId = "";
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
Property[] property = mainTableInfo.getProperty();
for (Property item : property) {
String name = item.getName();
String value = Util.null2String(item.getValue());
if (StringUtils.isNotBlank(name) && StringUtils.isNotBlank(value)) {
if ("xm".equals(name)) {
resourceId = value;
}
}
}
// 查询当前人员的所有数据
StringBuilder sqlBuilder = new StringBuilder("select ").append(StringUtils.join(modeFields, ",")).append(" from ").append(modeTableName).append(" where xm = ").append(resourceId).append(" order by id");
rs.executeQuery(sqlBuilder.toString());
while (rs.next()) {
appendIds(modeFields, rs, modeMap);
}
// 判断有无数据,没有的话插入数据
sqlBuilder = new StringBuilder("SELECT id FROM CUS_FIELDDATA where scope ='HrmCustomFieldByInfoType' and scopeid = '").append(resourceFieldGroup).append("' and id =? ");
rs.executeQuery(sqlBuilder.toString(), resourceId);
if (!rs.next()) {
// 插入人员信息数据
rs.executeUpdate("insert into cus_fielddata (scope,scopeid,id) values ('HrmCustomFieldByInfoType','" + resourceFieldGroup + "',?)", resourceId);
}
// 组装更新SQL语句
sqlBuilder = new StringBuilder("update cus_fielddata set ");
for (Map.Entry<String, String> entry : fieldMap.entrySet()) {
Set<String> valueSet = modeMap.get(entry.getKey());
String values = CollectionUtils.isEmpty(valueSet) ? "" : StringUtils.join(valueSet, ",");
sqlBuilder.append(" ").append(entry.getValue()).append(" = '").append(values).append("',");
}
sqlBuilder.deleteCharAt(sqlBuilder.length() - 1);
sqlBuilder.append(" where scope ='HrmCustomFieldByInfoType' and scopeid = ").append(resourceFieldGroup).append(" and id = ").append(resourceId);
rs.executeUpdate(sqlBuilder.toString());
return Action.SUCCESS;
}
private void appendIds(Set<String> modeFields, RecordSet rs, Map<String, Set<String>> modeMap) {
for (String modeField : modeFields) {
String ids = rs.getString(modeField);
if (StringUtils.isBlank(ids)) {
return;
}
if (CollectionUtils.isEmpty(modeMap.get(modeField))) {
modeMap.put(modeField, new HashSet<>());
}
modeMap.get(modeField).addAll(Arrays.asList(ids.split(",")));
}
}
public String getParams() {
return params;
}
public void setParams(String params) {
this.params = params;
}
public String getModeTableName() {
return modeTableName;
}
public void setModeTableName(String modeTableName) {
this.modeTableName = modeTableName;
}
public String getResourceFieldGroup() {
return resourceFieldGroup;
}
public void setResourceFieldGroup(String resourceFieldGroup) {
this.resourceFieldGroup = resourceFieldGroup;
}
}

@ -0,0 +1,126 @@
package weaver.interfaces.mzg.action.interview;
import com.engine.mzg.conn.RecruitCommon;
import com.engine.mzg.conn.RecruitRecordSet;
import com.engine.mzg.exception.CustomizeRunTimeException;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.formmode.IgnoreCaseHashMap;
import weaver.general.Util;
import weaver.hrm.User;
import weaver.interfaces.workflow.action.Action;
import weaver.soa.workflow.request.MainTableInfo;
import weaver.soa.workflow.request.Property;
import weaver.soa.workflow.request.RequestInfo;
import java.util.UUID;
/**
* 1
* <p>
* 2offer
*
* @author:dxfeng
* @createTime: 2024/09/14
* @version: 1.0
*/
public class InterviewCompletedAction implements Action {
@Override
public String execute(RequestInfo requestInfo) {
RecordSet rs = new RecordSet();
try {
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
int billId = requestInfo.getRequestManager().getBillid();
String billTableName = requestInfo.getRequestManager().getBillTableName();
int formId = requestInfo.getRequestManager().getFormid();
User user = requestInfo.getRequestManager().getUser();
int requestId = requestInfo.getRequestManager().getRequestid();
String msId = "";
rs.executeQuery("select id from uf_recruit_ms where mslcid = ?", requestId);
if (rs.next()) {
msId = rs.getString("id");
}
if (StringUtils.isBlank(msId)) {
throw new CustomizeRunTimeException("未获取到面试数据,请联系管理员");
}
IgnoreCaseHashMap<String, String> mainDataMap = new IgnoreCaseHashMap<>();
Property[] propertyArray = mainTableInfo.getProperty();
for (Property property : propertyArray) {
mainDataMap.put(property.getName(), property.getValue());
}
String sfxybd = Util.null2String(mainDataMap.get("sfxybd"));
if ("0".equals(sfxybd)) {
// 创建背调
String tableName = "uf_recruit_bd";
IgnoreCaseHashMap<String, Object> dataMap = new IgnoreCaseHashMap<>();
String uuid = UUID.randomUUID().toString();
dataMap.put("modeuuid", uuid);
int formModeId = RecruitCommon.getModeIdByTableName(tableName);
dataMap.put("formmodeid", formModeId);
// 构建建模表基本数据
RecruitRecordSet.buildModeInsertFields(dataMap, user.getUID());
// 负责人
dataMap.put("fzr", user.getUID());
// 负责人岗位
dataMap.put("fzrgw", user.getJobtitle());
// 负责人部门
dataMap.put("fzrbm", user.getUserDepartment());
// 被背调人
dataMap.put("bbdr", msId);
// 插入数据
RecruitRecordSet.insertData(dataMap, tableName);
RecruitRecordSet.refreshRight(uuid, tableName, formModeId, user.getUID());
} else {
String sqzw = Util.null2String(mainDataMap.get("sqzw"));
if (StringUtils.isBlank(sqzw)) {
throw new CustomizeRunTimeException("请检查面试流程中申请职位字段");
}
rs.executeQuery("select * from uf_recruit_zpxqglb where id = ? ", sqzw);
IgnoreCaseHashMap<String, Object> recordMap = RecruitRecordSet.getSingleRecordMap(rs);
if (recordMap.isEmpty()) {
throw new CustomizeRunTimeException("未获取到招聘职位数据");
}
String xqgw = Util.null2String(recordMap.get("xqgw"));
String gzdd = Util.null2String(recordMap.get("gzdd"));
String qtgzdd = Util.null2String(recordMap.get("qtgzdd"));
int zpxqFormId = RecruitCommon.getModeIdByTableName("uf_recruit_zpxqglb");
String gzddStr = RecruitCommon.getSelectName(String.valueOf(zpxqFormId), "gzdd", gzdd);
if (StringUtils.isNotBlank(qtgzdd)) {
gzddStr = qtgzdd;
}
// 创建offer
String tableName = "uf_recruit_lytzs";
IgnoreCaseHashMap<String, Object> dataMap = new IgnoreCaseHashMap<>();
String uuid = UUID.randomUUID().toString();
dataMap.put("modeuuid", uuid);
int formModeId = RecruitCommon.getModeIdByTableName(tableName);
dataMap.put("formmodeid", formModeId);
// 构建建模表基本数据
RecruitRecordSet.buildModeInsertFields(dataMap, user.getUID());
// 姓名
dataMap.put("xm", msId);
// 岗位
dataMap.put("gw", xqgw);
// 工作地点
dataMap.put("gzdd", gzddStr);
// 插入数据
RecruitRecordSet.insertData(dataMap, tableName);
RecruitRecordSet.refreshRight(uuid, tableName, formModeId, user.getUID());
}
return SUCCESS;
} catch (Exception e) {
rs.writeLog("InterviewCompletedAction error: ", e);
requestInfo.getRequestManager().setMessagecontent(e.getMessage());
return FAILURE_AND_CONTINUE;
}
}
}

@ -0,0 +1,228 @@
package weaver.interfaces.mzg.action.interview;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.engine.common.util.ServiceUtil;
import com.engine.mzg.conn.RecruitCommon;
import com.engine.mzg.enums.EmailTemplateEnum;
import com.engine.mzg.util.RecruitUtil;
import com.engine.workflowDesign.biz.AutoForecastBiz;
import com.engine.workplan.service.impl.WorkPlanBaseServiceImpl;
import com.weaver.formmodel.data.manager.FormInfoManager;
import com.weaver.formmodel.data.model.Formfield;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.formmode.IgnoreCaseHashMap;
import weaver.general.Util;
import weaver.hrm.User;
import weaver.interfaces.workflow.action.Action;
import weaver.soa.workflow.request.MainTableInfo;
import weaver.soa.workflow.request.Property;
import weaver.soa.workflow.request.RequestInfo;
import weaver.workflow.request.RequestNodeFlow;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author:dxfeng
* @createTime: 2024/09/11
* @version: 1.0
*/
public class SubmitInterviewAction implements Action {
private String interviewStep;
@Override
public String execute(RequestInfo requestInfo) {
RecordSet rs = new RecordSet();
try {
if (StringUtils.isBlank(interviewStep)) {
requestInfo.getRequestManager().setMessagecontent("面试流程配置异常,请检查");
return FAILURE_AND_CONTINUE;
}
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
int billId = requestInfo.getRequestManager().getBillid();
String billTableName = requestInfo.getRequestManager().getBillTableName();
int formId = requestInfo.getRequestManager().getFormid();
User user = requestInfo.getRequestManager().getUser();
int requestId = requestInfo.getRequestManager().getRequestid();
int nodeId = requestInfo.getRequestManager().getNodeid();
rs.executeQuery("select mszt from " + billTableName + " where id = ?", billId);
if (rs.next()) {
String mszt = rs.getString("mszt");
if ("2".equals(mszt)) {
requestInfo.getRequestManager().setMessagecontent("该面试已取消");
return FAILURE_AND_CONTINUE;
}
}
Set<String> userIdSet = new HashSet<>();
RequestNodeFlow flow = new AutoForecastBiz().getRequestNodeFlow(requestId, Util.getIntValue(nodeId), user);
flow.getNextNodes();
ArrayList operatorshts = flow.getOperatorshts();
if (CollectionUtils.isNotEmpty(operatorshts)) {
for (Object obj : operatorshts) {
JSONObject jsonObject = (JSONObject) JSON.toJSON(obj);
// 使用流式处理遍历 JSONObject 的所有键
jsonObject.keySet().stream().forEach(key -> {
JSONArray jsonArrayForKey = jsonObject.getJSONArray((String) key);
if (jsonArrayForKey.size() > 0) {
String stringValue = jsonArrayForKey.getString(0);
// 分割字符串并提取数字
String[] parts = stringValue.split("_");
if (parts.length > 0) {
userIdSet.add(parts[0]);
}
}
});
}
}
// 去除创建者
userIdSet.remove(String.valueOf(user.getUID()));
IgnoreCaseHashMap<String, String> mainDataMap = new IgnoreCaseHashMap<>();
Property[] propertyArray = mainTableInfo.getProperty();
for (Property property : propertyArray) {
mainDataMap.put(property.getName(), property.getValue());
}
Optional<String> userIdOptional = userIdSet.stream().findFirst();
String msg = null;
if (userIdOptional.isPresent()) {
msg = userIdOptional.get();
}
// 根据轮次
String msgKey;
String msgField;
String msrqField;
Integer emailTemplate;
if ("0".equals(interviewStep)) {
msgKey = "MSG_INTERVIEEW_FIRST";
msgField = "dylmsg";
msrqField = "dylmsrq";
emailTemplate = EmailTemplateEnum.INTERVIEW_FIRST.getValue();
} else if ("1".equals(interviewStep)) {
msgKey = "MSG_INTERVIEW_SECOND";
msgField = "delmsg";
msrqField = "delmsrq";
emailTemplate = EmailTemplateEnum.INTERVIEW_SECOND.getValue();
} else if ("2".equals(interviewStep)) {
msgKey = "MSG_INTERVIEW_THIRD";
msgField = "dslmsg";
msrqField = "dslmsrq";
emailTemplate = EmailTemplateEnum.INTERVIEW_THIRD.getValue();
} else {
return SUCCESS;
}
mainDataMap.put(msgField, msg);
// 更新表单字段
rs.executeUpdate("update " + billTableName + " set " + msgField + " = ? where id = ?", msg, billId);
List<Formfield> fieldList = FormInfoManager.getInstance().getAllField(formId);
Map<String, Formfield> fieldMap = fieldList.stream().collect(Collectors.toMap(Formfield::getFieldname, item -> item, (k1, k2) -> k1));
//userIdSet.add(Util.null2String(mainDataMap.get(msgField)));
String interviewDate = Util.null2String(mainDataMap.get(msrqField));
String msgContent = RecruitCommon.getSettingValue(msgKey, fieldMap, mainDataMap);
String msgCenterId = RecruitCommon.getSettingValue("MSG_CENTER_ID");
String planTitleInterview = RecruitCommon.getSettingValue("PLAN_TITLE_INTERVIEW", fieldMap, mainDataMap);
String planContentInterview = RecruitCommon.getSettingValue("PLAN_CONTENT_INTERVIEW", fieldMap, mainDataMap);
String msgTitleInterview = RecruitCommon.getSettingValue("MSG_TITLE_INTERVIEW", fieldMap, mainDataMap);
// 消息不为空,发送消息
RecruitUtil.messagePush(msgCenterId, msgTitleInterview, msgContent, userIdSet, user.getUID());
// 创建日程
Map<String, Object> maps = new HashMap<>(16);
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
LocalDateTime dateTime = LocalDateTime.parse(interviewDate, formatter);
LocalDateTime newDateTime = dateTime.plusHours(1);
// 日程类型
maps.put("workPlanType", "0");
// 工作计划名称
maps.put("planName", planTitleInterview);
// 系统参与人
maps.put("memberIDs", StringUtils.join(userIdSet, ","));
// 紧急程度
maps.put("urgentLevel", "1");
// 开始时间
maps.put("beginDateTime", interviewDate);
// 结束时间
maps.put("endDateTime", newDateTime.format(formatter));
// 内容
maps.put("description", planContentInterview);
// 相关文档
maps.put("docIDs", mainDataMap.get("zp"));
maps.put("requestIDs", requestId);
String workId = getPlanIdByRequestId(rs, requestId);
maps.put("workid", workId);
Map<String, Object> result = ServiceUtil.getService(WorkPlanBaseServiceImpl.class, user).addWorkPlan(maps);
Integer workplanId = (Integer) result.get("workplanid");
rs.executeUpdate("update " + billTableName + " set msrc = ? where id = ?", workplanId, billId);
// 发送邮件
//Map<String, List<Formfield>> fieldMapList = fieldList.stream().collect(Collectors.groupingBy(Formfield::getFieldname));
//String emailTitle = "";
//String emailContent = "";
//rs.executeQuery("select yjzt ,yjnr from uf_recruit_email where mblx =? ", emailTemplate);
//if (rs.next()) {
// emailTitle = rs.getString("yjzt");
// emailContent = rs.getString("yjnr");
//}
//emailContent = RecruitUtil.getReplaceContent(emailContent, fieldMapList, mainDataMap);
//RecruitUtil.sendEmail(Util.null2String(mainDataMap.get("dzyx")), emailTitle, emailContent);
return SUCCESS;
} catch (Exception e) {
rs.writeLog("InterviewAction error: ", e);
requestInfo.getRequestManager().setMessagecontent(e.getMessage());
return FAILURE_AND_CONTINUE;
}
}
/**
* ID
*
* @param rs
* @param requestId
* @return
*/
private String getPlanIdByRequestId(RecordSet rs, int requestId) {
if (requestId < 0) {
return "";
}
rs.executeQuery("select id from WorkPlan where requestid = ? ", requestId);
if (rs.next()) {
return rs.getString("id");
}
return "";
}
public String getInterviewStep() {
return interviewStep;
}
public void setInterviewStep(String interviewStep) {
this.interviewStep = interviewStep;
}
}

@ -0,0 +1,301 @@
package weaver.interfaces.mzg.cronjob;
import cn.hutool.core.convert.Convert;
import com.engine.mzg.conn.RecruitCommon;
import com.engine.mzg.conn.RecruitRecordSet;
import com.engine.mzg.exception.CustomizeRunTimeException;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.formmode.IgnoreCaseHashMap;
import weaver.general.Util;
import weaver.hrm.company.DepartmentComInfo;
import weaver.interfaces.schedule.BaseCronJob;
import java.util.UUID;
/**
*
*
* @author:dxfeng
* @createTime: 2024/10/14
* @version: 1.0
*/
public class RecruitReportJob extends BaseCronJob {
DepartmentComInfo departmentComInfo = new DepartmentComInfo();
/**
*
*/
String flowTableInterview;
/**
* ID
*/
String interviewFlowId;
@Override
public void execute() {
// 查询招聘需求建模表
RecordSet rs = new RecordSet();
try {
rs.writeLog("RecruitReportJob开始执行");
flowTableInterview = RecruitCommon.getSettingValue("FLOW_TABLE_INTERVIEW");
interviewFlowId = getWorkflowId();
if (StringUtils.isBlank(flowTableInterview) || StringUtils.isBlank(interviewFlowId)) {
throw new CustomizeRunTimeException("FLOW_TABLE_INTERVIEW或INTERVIEW_FLOW_ID为空,flowTableInterview=" + flowTableInterview + ",INTERVIEW_FLOW_ID=" + interviewFlowId);
}
// TODO 是否做时间或其他条件限制
rs.executeQuery("select * from uf_recruit_zpxqglb");
// 遍历所有岗位岗位
while (rs.next()) {
IgnoreCaseHashMap<String, Object> dataMap = combinationData(rs);
updateData(dataMap);
}
rs.writeLog("RecruitReportJob执行结束");
} catch (Exception e) {
rs.writeLog("RecruitReportJob执行异常", e);
}
}
/**
*
*
* @param rs
*/
private IgnoreCaseHashMap<String, Object> combinationData(RecordSet rs) {
// 中心
String zx = "";
String sqbm = rs.getString("sqbm");
if (StringUtils.isNotBlank(sqbm)) {
zx = departmentComInfo.getSubcompanyid1(sqbm);
}
// 招聘岗位名称
String zpgwmc = rs.getString("id");
// 招聘数量
String zpsl = rs.getString("sqzprs");
// 责任人
String zrr = rs.getString("zrr");
// 招聘紧急程度
String zpjjcd = rs.getString("zpjjcd");
// 需求提出时间
String xqtcsj = rs.getString("sqrq");
// 预计招聘完成时间
String yjzpwcsj = rs.getString("xydgrq");
// 到岗时间
String dgsj = "";
// 简历推荐数(简历中心该岗位的份数)
int jltjs = countResumeNum(zpgwmc);
// 预约面试数
int yymss = countInterviewNum(interviewFlowId, zpgwmc);
// 初试通过数
int cstgs = countFirstNum(interviewFlowId, zpgwmc);
// 复试通过数
int fstgs = countSecondNum(interviewFlowId, zpgwmc);
// 终试通过数
int zstgs = countThirdNum(interviewFlowId, zpgwmc);
// 尽调通过数
int jdtgs = countBackPassNum(zpgwmc);
// 候选人数
int hxrs = countAcceptOfferNum(zpgwmc);
// 岗位类别
String gwlb = rs.getString("gwlb");
IgnoreCaseHashMap<String, Object> dataMap = new IgnoreCaseHashMap<>();
dataMap.put("zx", zx);
dataMap.put("zpgwmc", zpgwmc);
dataMap.put("zpsl", zpsl);
dataMap.put("zpjjcd", zpjjcd);
dataMap.put("xqtcsj", xqtcsj);
dataMap.put("yjzpwcsj", yjzpwcsj);
dataMap.put("dgsj", dgsj);
dataMap.put("jltjs", jltjs);
dataMap.put("yymss", yymss);
dataMap.put("cstgs", cstgs);
dataMap.put("fstgs", fstgs);
dataMap.put("zstgs", zstgs);
dataMap.put("jdtgs", jdtgs);
dataMap.put("hxrs", hxrs);
dataMap.put("gwlb", gwlb);
dataMap.put("zrr", zrr);
return dataMap;
}
/**
*
*
* @param dataMap
* @return
*/
private int updateData(IgnoreCaseHashMap<String, Object> dataMap) {
RecordSet recordSet = new RecordSet();
String zpgwmc = Util.null2String(dataMap.get("zpgwmc"));
// 查询台账中是否有该职位,有则更新,没有则插入
int id = -1;
recordSet.executeQuery("select id from uf_recruit_report where zpgwmc = ?", zpgwmc);
if (recordSet.next()) {
id = recordSet.getInt("id");
}
if (id > 0) {
dataMap.put("id", id);
// 责任人不更新
dataMap.remove("zrr");
RecruitRecordSet.buildModeUpdateFields(dataMap, 1);
RecruitRecordSet.updateDataById(dataMap, "uf_recruit_report");
} else {
String uuid = UUID.randomUUID().toString();
dataMap.put("modeuuid", uuid);
int formModeId = RecruitCommon.getModeIdByTableName("uf_recruit_report");
dataMap.put("formmodeid", formModeId);
RecruitRecordSet.buildModeInsertFields(dataMap, 1);
RecruitRecordSet.insertData(dataMap, "uf_recruit_report");
id = RecruitRecordSet.refreshRight(uuid, "uf_recruit_report", formModeId, 1);
}
return id;
}
/**
*
*
* @param sqzwId
* @return
*/
private int countResumeNum(String sqzwId) {
RecordSet recordSet = new RecordSet();
String num = "";
recordSet.executeQuery("select count(id) as total_count from uf_recruit_resume where sqzw = ?", sqzwId);
if (recordSet.next()) {
num = recordSet.getString("total_count");
}
return Convert.toInt(num, 0);
}
/**
*
*
* @param sqzwId
* @return
*/
private int countBackPassNum(String sqzwId) {
RecordSet recordSet = new RecordSet();
String num = "";
recordSet.executeQuery("select count(a.id) as total_count from uf_recruit_bd a inner join uf_recruit_ms b on a.bbdr = b.id where a.bdjg = 0 and b.sqzw = ?", sqzwId);
if (recordSet.next()) {
num = recordSet.getString("total_count");
}
return Convert.toInt(num, 0);
}
/**
* offer
*
* @param sqzwId
* @return
*/
private int countAcceptOfferNum(String sqzwId) {
RecordSet recordSet = new RecordSet();
String num = "";
recordSet.executeQuery("select count(a.id) as total_count from uf_recruit_lytzs a inner join uf_recruit_ms b on a.xm = b.id where a.fkjg = 1 and b.sqzw = ?", sqzwId);
if (recordSet.next()) {
num = recordSet.getString("total_count");
}
return Convert.toInt(num, 0);
}
/**
*
*
* @param workflowId
* @param sqzwId
* @return
*/
private int countInterviewNum(String workflowId, String sqzwId) {
RecordSet recordSet = new RecordSet();
String num = "";
recordSet.executeQuery("select count(distinct a.requestid) as total_count from workflow_currentoperator a inner join workflow_nodebase b on a.nodeid = b.id inner join " + flowTableInterview + " c on a.requestid = c.requestid inner join uf_recruit_ms d on c.requestId = d.mslcid where a.workflowid = ? and b.nodename = ? and c.sqzw =?", workflowId, "第一轮面试", sqzwId);
if (recordSet.next()) {
num = recordSet.getString("total_count");
}
return Convert.toInt(num, 0);
}
/**
*
*
* @param workflowId
* @param sqzwId
* @return
*/
private int countFirstNum(String workflowId, String sqzwId) {
RecordSet recordSet = new RecordSet();
String num = "";
recordSet.executeQuery("select count(distinct a.requestid) as total_count from workflow_currentoperator a inner join workflow_nodebase b on a.nodeid = b.id inner join " + flowTableInterview + " c on a.requestid = c.requestid inner join uf_recruit_ms d on c.requestId = d.mslcid where a.workflowid = ? and b.nodename = ? and c.sqzw =?", workflowId, "hr面试安排1", sqzwId);
if (recordSet.next()) {
num = recordSet.getString("total_count");
}
return Convert.toInt(num, 0);
}
/**
*
*
* @param workflowId
* @param sqzwId
* @return
*/
private int countSecondNum(String workflowId, String sqzwId) {
RecordSet recordSet = new RecordSet();
String num = "";
recordSet.executeQuery("select count(distinct a.requestid) as total_count from workflow_currentoperator a inner join workflow_nodebase b on a.nodeid = b.id inner join " + flowTableInterview + " c on a.requestid = c.requestid inner join uf_recruit_ms d on c.requestId = d.mslcid where a.workflowid = ? and b.nodename = ? and c.sqzw =?", workflowId, "hr面试安排2", sqzwId);
if (recordSet.next()) {
num = recordSet.getString("total_count");
}
// 统计两轮面试的数据
recordSet.executeQuery("select count(*) as total_count from workflow_currentoperator a inner join workflow_nodebase b on a.nodeid = b.id inner join " + flowTableInterview + " c on a.requestid = c.requestid and c.mslc =0 inner join uf_recruit_ms d on c.requestId = d.mslcid where a.workflowid = ? and b.nodename = ? and c.sqzw =?", workflowId, "hr面试安排3", sqzwId);
if (recordSet.next()) {
num += Convert.toInt(recordSet.getString("total_count"), 0);
}
return Convert.toInt(num, 0);
}
/**
*
*
* @param workflowId
* @param sqzwId
* @return
*/
private int countThirdNum(String workflowId, String sqzwId) {
RecordSet recordSet = new RecordSet();
String num = "";
recordSet.executeQuery("select count(distinct a.requestid) as total_count from workflow_currentoperator a inner join workflow_nodebase b on a.nodeid = b.id inner join " + flowTableInterview + " c on a.requestid = c.requestid and c.mslc =1 inner join uf_recruit_ms d on c.requestId = d.mslcid where a.workflowid = ? and b.nodename = ? and c.sqzw =?", workflowId, "hr面试安排3", sqzwId);
if (recordSet.next()) {
num = recordSet.getString("total_count");
}
return Convert.toInt(num, 0);
}
/**
* ID
*
* @return
*/
private String getWorkflowId() {
RecordSet recordSet = new RecordSet();
String workflowId = "";
recordSet.executeQuery("SELECT a.id AS workflowid FROM workflow_base a WHERE a.formid = (SELECT id FROM workflow_bill WHERE tablename = ?)", flowTableInterview);
if (recordSet.next()) {
workflowId = recordSet.getString("workflowid");
}
return workflowId;
}
}
Loading…
Cancel
Save