generated from dxfeng/secondev-chapanda-feishu
Merge pull request 'feature/dxf' (#3) from feature/dxf into develop
Reviewed-on: http://221.226.25.34:3000/dxfeng/weaver-hrm-recruit/pulls/3
This commit is contained in:
commit
d32ee933c2
|
|
@ -1,10 +1,15 @@
|
|||
#\u805A\u624D\u6797\u62DB\u8058\u6D88\u606F\u63D0\u9192\uFF0C\u6D88\u606F\u6765\u6E90
|
||||
RECRUIT_MESSAGE_TYPE=2022061063
|
||||
#\u9762\u8BD5\u76F8\u5173\u6D88\u606F\u63D0\u9192\uFF0C\u6D88\u606F\u6765\u6E90
|
||||
INTERVIEW_MESSAGE_TYPE=85
|
||||
#\u6DFB\u52A0\u9762\u8BD5\u6D88\u606F\u63D0\u9192\u8868\u5F1F
|
||||
INTERVIEW_MESSAGE_TYPE=2022061063
|
||||
#\u6DFB\u52A0\u9762\u8BD5\u6D88\u606F\u63D0\u9192\u6807\u9898
|
||||
INTERVIEW_ADD_MESSAGE_TITLE=\u9762\u8BD5\u5B89\u6392\u63D0\u9192
|
||||
#\u53D6\u6D88\u9762\u8BD5\u6D88\u606F\u63D0\u9192\u8868\u5F1F
|
||||
#\u53D6\u6D88\u9762\u8BD5\u6D88\u606F\u63D0\u9192\u6807\u9898
|
||||
INTERVIEW_CANCEL_MESSAGE_TITLE=\u53D6\u6D88\u9762\u8BD5\u63D0\u9192
|
||||
|
||||
#\u9762\u8BD5\u8BC4\u4EF7\u6D88\u606F\u63D0\u9192\u6807\u9898
|
||||
INTERVIEW_EVALUATE_MESSAGE_TITLE=\u9762\u8BD5\u8BC4\u4EF7\u63D0\u9192
|
||||
#\u4EBA\u624D\u9ED1\u540D\u5355\u901A\u77E5
|
||||
JOIN_BLACKLIST_MESSAGE_TITLE=\u4EBA\u624D\u9ED1\u540D\u5355\u901A\u77E5
|
||||
|
||||
#\u5E94\u8058\u8005\u7B80\u5386\u5B58\u653E\u76EE\u5F55ID
|
||||
APPLICANTS_RESUMES_CATEGORY=110
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.engine.recruit.conn;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* 聚才林数据集合
|
||||
* </p>
|
||||
* key忽略大小写
|
||||
*
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/10/19
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class RecruitDataMap<V> extends HashMap<String, V> {
|
||||
@Override
|
||||
public V get(Object key) {
|
||||
if (key instanceof String) {
|
||||
// 将键转为小写形式再进行查找
|
||||
return super.get(((String) key).toLowerCase());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public V put(String key, V value) {
|
||||
// 将键转为小写形式后作为真正的键
|
||||
return super.put(key.toLowerCase(), value);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
package com.engine.recruit.conn;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.common.DateUtil;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.formmode.recruit.modeexpand.util.RecruitModeUtil;
|
||||
|
||||
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 Map<String, Object> getSingleRecordMap(RecordSet rs) {
|
||||
Map<String, Object> dataMap = new RecruitDataMap<>();
|
||||
if (rs.next()) {
|
||||
String[] columnNames = rs.getColumnName();
|
||||
for (String columnName : columnNames) {
|
||||
dataMap.put(columnName.toLowerCase(), RecruitModeUtil.parseBlankToNull(rs.getString(columnName)));
|
||||
}
|
||||
}
|
||||
return dataMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 插入数据
|
||||
*
|
||||
* @param dataMap 数据集合
|
||||
* @param tableName 表名
|
||||
*/
|
||||
public static void insertData(Map<String, Object> dataMap, String tableName) {
|
||||
List<String> fieldList = new ArrayList<>();
|
||||
List<Object> dataList = new ArrayList<>();
|
||||
List<String> paramList = new ArrayList<>();
|
||||
|
||||
dataMap.forEach((key, value) -> {
|
||||
fieldList.add(key);
|
||||
dataList.add(value);
|
||||
paramList.add("?");
|
||||
});
|
||||
String insertSql = " insert into " + tableName + "(" + StringUtils.join(fieldList, ",") + ") values (" + StringUtils.join(paramList, ",") + ")";
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeUpdate(insertSql, dataList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建建模表基本数据
|
||||
*
|
||||
* @param mainDataMap 参数集合
|
||||
*/
|
||||
public static void buildModeBaseFields(Map<String, Object> mainDataMap, Object 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("modedatamodifier", userId);
|
||||
mainDataMap.put("modedatamodifydatetime", dateTime);
|
||||
mainDataMap.put("modedatacreatertype", "0");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
package com.engine.recruit.constant;
|
||||
|
||||
/**
|
||||
* 聚才林招聘,建模表
|
||||
*
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/10/17
|
||||
* @version: 1.0
|
||||
|
|
@ -11,6 +13,15 @@ public class ModeTable {
|
|||
*/
|
||||
public static final String UF_JCL_YPPC = "uf_jcl_yppc";
|
||||
|
||||
/**
|
||||
* JCL_招聘阶段设置
|
||||
*/
|
||||
public static final String UF_JCL_ZPJDSZ = "uf_jcl_zpjdsz";
|
||||
/**
|
||||
* JCL_招聘流程
|
||||
*/
|
||||
public static final String UF_JCL_ZPLC = "uf_jcl_zplc";
|
||||
|
||||
|
||||
/**
|
||||
* 获取明细表表名
|
||||
|
|
|
|||
|
|
@ -12,7 +12,10 @@ public enum ApplicantOperateEnum {
|
|||
*/
|
||||
ELIMINATE("eliminate", "淘汰"),
|
||||
REFERRAL("referral", "转推其他职位"),
|
||||
TRANSFER("transfer", "转移阶段");
|
||||
TRANSFER("transfer", "转移阶段"),
|
||||
ASSIGN("assign", "分配职位"),
|
||||
ARCHIVE("archive", "归档人才库"),
|
||||
;
|
||||
|
||||
ApplicantOperateEnum(String operateType, String operateDesc) {
|
||||
this.operateType = operateType;
|
||||
|
|
|
|||
|
|
@ -2,19 +2,19 @@ package com.engine.recruit.service.impl;
|
|||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.recruit.conn.RecruitDataMap;
|
||||
import com.engine.recruit.conn.RecruitRecordSet;
|
||||
import com.engine.recruit.enums.ApplicantOperateEnum;
|
||||
import com.engine.recruit.enums.ApplicationStatusEnum;
|
||||
import com.engine.recruit.service.ApplicantResumeService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.formmode.recruit.modeexpand.util.RecruitModeUtil;
|
||||
import weaver.formmode.setup.ModeRightInfo;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.resource.ResourceComInfo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
|
|
@ -148,15 +148,87 @@ public class ApplicantResumeServiceImpl extends Service implements ApplicantResu
|
|||
String operateType = Util.null2String(params.get("operateType"));
|
||||
RecordSet rs = new RecordSet();
|
||||
if (ApplicantOperateEnum.ELIMINATE.getOperateType().equals(operateType)) {
|
||||
// 淘汰
|
||||
String ids = Util.null2String(params.get("ids"));
|
||||
rs.executeUpdate("update uf_jcl_yppc set zt = ? where id in (" + ids + ")", ApplicationStatusEnum.OBSOLETE.getValue());
|
||||
}
|
||||
if (ApplicantOperateEnum.TRANSFER.getOperateType().equals(operateType)) {
|
||||
// TODO
|
||||
returnMap.put("msg", "操作成功");
|
||||
} else if (ApplicantOperateEnum.TRANSFER.getOperateType().equals(operateType)) {
|
||||
// 转移阶段
|
||||
String dqypjd = Util.null2String(params.get("dqypjd"));
|
||||
String billid = Util.null2String(params.get("billid"));
|
||||
// rs.executeUpdate("update uf_jcl_yppc set dqypjd = ? where id = ?", dqypjd, billid);
|
||||
rs.executeUpdate("update uf_jcl_yppc set zpjd = ? where id = ?", dqypjd, billid);
|
||||
returnMap.put("msg", "操作成功");
|
||||
} else if (ApplicantOperateEnum.ASSIGN.getOperateType().equals(operateType)) {
|
||||
// 分配职位
|
||||
String billid = Util.null2String(params.get("billid"));
|
||||
String ypzw = Util.null2String(params.get("ypzw"));
|
||||
rs.executeUpdate("update uf_jcl_yppc set ypzw = ? where id = ?", ypzw, billid);
|
||||
returnMap.put("msg", "操作成功");
|
||||
} else if (ApplicantOperateEnum.ARCHIVE.getOperateType().equals(operateType)) {
|
||||
// 归档人才库
|
||||
String gdyy = Util.null2String(params.get("gdyy"));
|
||||
String gdxxyy = Util.null2String(params.get("gdxxyy"));
|
||||
String ids = Util.null2String(params.get("ids"));
|
||||
if (StringUtils.isNotBlank(ids)) {
|
||||
String[] split = ids.split(",");
|
||||
for (String id : split) {
|
||||
rs.executeUpdate("update uf_jcl_yppc set gdyy = ?,gdxxyy = ? where id = ? ", gdyy, gdxxyy, id);
|
||||
// 建模推送建模
|
||||
archiveTalentPool(id, false);
|
||||
// 更新应聘状态为已归档
|
||||
rs.executeUpdate("update uf_jcl_yppc set zt = ? where id = ? ", ApplicationStatusEnum.ARCHIVED.getValue(), id);
|
||||
}
|
||||
} else {
|
||||
returnMap.put("msg", "请至少选择一条数据");
|
||||
}
|
||||
} else if (ApplicantOperateEnum.REFERRAL.getOperateType().equals(operateType)) {
|
||||
// 转推其他职位
|
||||
String sourceId = Util.null2String(params.get("sourceId"));
|
||||
String ypzw = Util.null2String(params.get("ypzw"));
|
||||
String zplc = null;
|
||||
rs.executeQuery("select zplc from uf_jcl_zp_zpzw where id = ?", ypzw);
|
||||
if (rs.next()) {
|
||||
zplc = rs.getString("zplc");
|
||||
}
|
||||
|
||||
rs.executeQuery("select * from uf_jcl_yppc where id = ?", sourceId);
|
||||
Map<String, Object> mainDataMap = RecruitRecordSet.getSingleRecordMap(rs);
|
||||
// 构建新数据
|
||||
mainDataMap.put("ypzw", ypzw);
|
||||
mainDataMap.put("zplc", zplc);
|
||||
mainDataMap.put("zpjd", null);
|
||||
mainDataMap.put("dqypjd", null);
|
||||
mainDataMap.put("zt", ApplicationStatusEnum.CANDIDATE.getValue());
|
||||
RecruitRecordSet.buildModeBaseFields(mainDataMap, user.getUID());
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
mainDataMap.put("modeuuid", uuid);
|
||||
// 移除不需要插入的字段
|
||||
mainDataMap.remove("id");
|
||||
mainDataMap.remove("requestId");
|
||||
mainDataMap.remove("form_biz_id");
|
||||
|
||||
// 插入数据
|
||||
RecruitRecordSet.insertData(mainDataMap, "uf_jcl_yppc");
|
||||
// 权限重构
|
||||
rs.executeQuery("select id,formmodeid from uf_jcl_yppc where modeuuid='" + uuid + "'");
|
||||
if (rs.next()) {
|
||||
//建模数据的id
|
||||
int targetId = Util.getIntValue(rs.getString("id"));
|
||||
int formModeId = Util.getIntValue(rs.getString("formmodeid"));
|
||||
ModeRightInfo modeRightInfo = new ModeRightInfo();
|
||||
modeRightInfo.setNewRight(true);
|
||||
//新建的时候添加共享
|
||||
modeRightInfo.editModeDataShare(1, formModeId, targetId);
|
||||
|
||||
// 复制明细表数据
|
||||
rs.executeUpdate("insert into uf_jcl_yppc_dt1 (mainid,xxmc,xl,zy,kssj,jssj) select ?,xxmc,xl,zy,kssj,jssj from uf_jcl_yppc_dt1 where mainid = ?", targetId, sourceId);
|
||||
rs.executeUpdate("insert into uf_jcl_yppc_dt2 (mainid,gsmc,kssj,jssj,gw,sqyxk,lzyy,gzzz) select ?,gsmc,kssj,jssj,gw,sqyxk,lzyy,gzzz from uf_jcl_yppc_dt2 where mainid = ?", targetId, sourceId);
|
||||
rs.executeUpdate("insert into uf_jcl_yppc_dt3 (mainid,xmmc,kssj,jssj,drjs,xmms) select ?,xmmc,kssj,jssj,drjs,xmms from uf_jcl_yppc_dt3 where mainid = ?", targetId, sourceId);
|
||||
rs.executeUpdate("insert into uf_jcl_yppc_dt4 (mainid,yylx,zwcd) select ?,yylx,zwcd from uf_jcl_yppc_dt4 where mainid = ?", targetId, sourceId);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return returnMap;
|
||||
}
|
||||
|
|
@ -170,7 +242,7 @@ public class ApplicantResumeServiceImpl extends Service implements ApplicantResu
|
|||
try {
|
||||
int docId = RecruitModeUtil.createDocId(secCategory, imageFileId, user);
|
||||
// 更新原始简历信息,设置应聘状态未待分配
|
||||
rs.executeUpdate("update uf_jcl_yppc set ysjl=?,zt=? where id = ?", docId, 0, resumeId);
|
||||
rs.executeUpdate("update uf_jcl_yppc set ysjl=?,zt=? where id = ?", docId, ApplicationStatusEnum.DISTRIBUTION.getValue(), resumeId);
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
|
|
@ -270,4 +342,187 @@ public class ApplicantResumeServiceImpl extends Service implements ApplicantResu
|
|||
return browserMap;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 归档人才库
|
||||
*
|
||||
* @param applicantId 应聘者ID
|
||||
* @param joinBlacklist 是否加入黑名单
|
||||
*/
|
||||
public void archiveTalentPool(String applicantId, boolean joinBlacklist) {
|
||||
RecordSet rs = new RecordSet();
|
||||
String name = "";
|
||||
String mobile = "";
|
||||
String talentPoolId = "";
|
||||
rs.executeQuery("select xm,sjhm from uf_jcl_yppc where id = ?", applicantId);
|
||||
if (rs.next()) {
|
||||
name = rs.getString("xm");
|
||||
mobile = rs.getString("sjhm");
|
||||
}
|
||||
|
||||
rs.executeQuery("select id from uf_jcl_rck where xm = ? and sjhm = ?", name, mobile);
|
||||
if (rs.next()) {
|
||||
talentPoolId = rs.getString("id");
|
||||
}
|
||||
|
||||
// 推送建模主表数据
|
||||
Map<String, Object> dataMap = new RecruitDataMap<>();
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
dataMap.put("modeuuid", uuid);
|
||||
int formModeId = -1;
|
||||
rs.executeQuery("select id from modeinfo where formid =( select id from workflow_bill where tablename = 'uf_jcl_rck' )");
|
||||
if (rs.next()) {
|
||||
formModeId = rs.getInt("id");
|
||||
}
|
||||
dataMap.put("formmodeid", formModeId);
|
||||
// 构建建模表基本数据
|
||||
RecruitRecordSet.buildModeBaseFields(dataMap, user.getUID());
|
||||
rs.executeQuery("select * from uf_jcl_yppc where id = ?", applicantId);
|
||||
if (rs.next()) {
|
||||
dataMap.put("sfz", RecruitModeUtil.parseBlankToNull(rs.getString("sfz")));
|
||||
dataMap.put("jlzp", RecruitModeUtil.parseBlankToNull(rs.getString("jlzp")));
|
||||
dataMap.put("zhypzw", RecruitModeUtil.parseBlankToNull(rs.getString("ypzw")));
|
||||
dataMap.put("ysjl", RecruitModeUtil.parseBlankToNull(rs.getString("ysjl")));
|
||||
dataMap.put("jlly", RecruitModeUtil.parseBlankToNull(rs.getString("jlly")));
|
||||
dataMap.put("xm", RecruitModeUtil.parseBlankToNull(rs.getString("xm")));
|
||||
dataMap.put("xb", RecruitModeUtil.parseBlankToNull(rs.getString("xb")));
|
||||
dataMap.put("sjhm", RecruitModeUtil.parseBlankToNull(rs.getString("sjhm")));
|
||||
dataMap.put("dzyx", RecruitModeUtil.parseBlankToNull(rs.getString("dzyx")));
|
||||
dataMap.put("csrq", RecruitModeUtil.parseBlankToNull(rs.getString("csrq")));
|
||||
dataMap.put("nl", RecruitModeUtil.parseBlankToNull(rs.getString("nl")));
|
||||
dataMap.put("zgxl", RecruitModeUtil.parseBlankToNull(rs.getString("zgxl")));
|
||||
dataMap.put("zgxw", RecruitModeUtil.parseBlankToNull(rs.getString("zgxw")));
|
||||
dataMap.put("byyx", RecruitModeUtil.parseBlankToNull(rs.getString("byyx")));
|
||||
dataMap.put("zy", RecruitModeUtil.parseBlankToNull(rs.getString("zy")));
|
||||
dataMap.put("hyzk", RecruitModeUtil.parseBlankToNull(rs.getString("hyzk")));
|
||||
dataMap.put("gzjy", RecruitModeUtil.parseBlankToNull(rs.getString("gzjy")));
|
||||
dataMap.put("zzzt", RecruitModeUtil.parseBlankToNull(rs.getString("zzzt")));
|
||||
dataMap.put("dqszd", RecruitModeUtil.parseBlankToNull(rs.getString("dqszd")));
|
||||
dataMap.put("zhtdsj", RecruitModeUtil.parseBlankToNull(rs.getString("tdsj")));
|
||||
dataMap.put("cjr", RecruitModeUtil.parseBlankToNull(rs.getString("cjr")));
|
||||
dataMap.put("zwpj", RecruitModeUtil.parseBlankToNull(rs.getString("zwpj")));
|
||||
dataMap.put("mz", RecruitModeUtil.parseBlankToNull(rs.getString("mz")));
|
||||
dataMap.put("jg", RecruitModeUtil.parseBlankToNull(rs.getString("jg")));
|
||||
dataMap.put("zzmm", RecruitModeUtil.parseBlankToNull(rs.getString("zzmm")));
|
||||
dataMap.put("sgcm", RecruitModeUtil.parseBlankToNull(rs.getString("sgcm")));
|
||||
dataMap.put("tzkg", RecruitModeUtil.parseBlankToNull(rs.getString("tzkg")));
|
||||
// 归档阶段
|
||||
dataMap.put("gdjd", null);
|
||||
dataMap.put("gdyy", RecruitModeUtil.parseBlankToNull(rs.getString("gdyy")));
|
||||
dataMap.put("gdxxyy", RecruitModeUtil.parseBlankToNull(rs.getString("gdxxyy")));
|
||||
}
|
||||
// 历史投递次数
|
||||
rs.executeQuery("select count(id) as num from uf_jcl_yppc where xm=? and sjhm =?", rs.getString("xm"), rs.getString("sjhm"));
|
||||
if (rs.next()) {
|
||||
dataMap.put("lstdcs", rs.getInt("num"));
|
||||
}
|
||||
// 是否加入黑名单
|
||||
if (joinBlacklist) {
|
||||
dataMap.put("sfjrhmd", 0);
|
||||
// 归档原因黑名单
|
||||
dataMap.put("gdyy", 16);
|
||||
} else {
|
||||
dataMap.put("sfjrhmd", 1);
|
||||
}
|
||||
|
||||
RecruitRecordSet.insertData(dataMap, "uf_jcl_rck");
|
||||
refreshRight(uuid, formModeId, applicantId);
|
||||
|
||||
|
||||
// 删除人才库原来的数据
|
||||
rs.executeUpdate("delete from uf_jcl_rck where id = ? ", talentPoolId);
|
||||
rs.executeUpdate("delete from uf_jcl_rck_dt1 where mainid = ? ", talentPoolId);
|
||||
rs.executeUpdate("delete from uf_jcl_rck_dt2 where mainid = ? ", talentPoolId);
|
||||
rs.executeUpdate("delete from uf_jcl_rck_dt3 where mainid = ? ", talentPoolId);
|
||||
rs.executeUpdate("delete from uf_jcl_rck_dt4 where mainid = ? ", talentPoolId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 权限重构
|
||||
*
|
||||
* @param uuid UUID
|
||||
* @param formModeId 建模ID
|
||||
* @param applicantId 应聘者ID
|
||||
*/
|
||||
private void refreshRight(String uuid, int formModeId, String applicantId) {
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select id from uf_jcl_rck where modeuuid='" + uuid + "'");
|
||||
if (rs.next()) {
|
||||
//建模数据的id
|
||||
int bid = Util.getIntValue(rs.getString("id"));
|
||||
ModeRightInfo modeRightInfo = new ModeRightInfo();
|
||||
modeRightInfo.setNewRight(true);
|
||||
//新建的时候添加共享
|
||||
modeRightInfo.editModeDataShare(1, formModeId, bid);
|
||||
|
||||
// 插入明细表数据
|
||||
rs.executeQuery("select * from uf_jcl_yppc_dt1 where mainid = ? ", applicantId);
|
||||
List<List<Object>> insertList = new ArrayList<>();
|
||||
while (rs.next()) {
|
||||
List<Object> paramList = new ArrayList<>();
|
||||
// mainid
|
||||
paramList.add(bid);
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("xxmc")));
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("xl")));
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("zy")));
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("kssj")));
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("jssj")));
|
||||
insertList.add(paramList);
|
||||
}
|
||||
for (List<Object> list : insertList) {
|
||||
rs.executeUpdate("insert into uf_jcl_rck_dt1 (mainid, xxmc, xl, zy, kssj, jssj) values (?, ?, ?, ?, ?, ?)", list);
|
||||
}
|
||||
|
||||
rs.executeQuery("select * from uf_jcl_yppc_dt2 where mainid = ? ", applicantId);
|
||||
insertList = new ArrayList<>();
|
||||
while (rs.next()) {
|
||||
List<Object> paramList = new ArrayList<>();
|
||||
// mainid
|
||||
paramList.add(bid);
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("gsmc")));
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("kssj")));
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("jssj")));
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("gw")));
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("gzzz")));
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("sqyxk")));
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("lzyy")));
|
||||
insertList.add(paramList);
|
||||
}
|
||||
for (List<Object> list : insertList) {
|
||||
rs.executeUpdate("insert into uf_jcl_rck_dt2 (mainid, gsmc, kssj, jssj, gw, gzzz, sqyxk, lzyy) values (?, ?, ?, ?, ?, ?, ?, ?)", list);
|
||||
}
|
||||
|
||||
rs.executeQuery("select * from uf_jcl_yppc_dt3 where mainid = ? ", applicantId);
|
||||
insertList = new ArrayList<>();
|
||||
while (rs.next()) {
|
||||
List<Object> paramList = new ArrayList<>();
|
||||
// mainid
|
||||
paramList.add(bid);
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("xmmc")));
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("kssj")));
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("jssj")));
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("drjs")));
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("xmms")));
|
||||
insertList.add(paramList);
|
||||
}
|
||||
for (List<Object> list : insertList) {
|
||||
rs.executeUpdate("insert into uf_jcl_rck_dt3 (mainid, xmmc, kssj, jssj, drjs, xmms) values (?, ?, ?, ?, ?, ?)", list);
|
||||
}
|
||||
|
||||
rs.executeQuery("select * from uf_jcl_yppc_dt4 where mainid = ? ", applicantId);
|
||||
insertList = new ArrayList<>();
|
||||
while (rs.next()) {
|
||||
List<Object> paramList = new ArrayList<>();
|
||||
// mainid
|
||||
paramList.add(bid);
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("yylx")));
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("zwcd")));
|
||||
insertList.add(paramList);
|
||||
}
|
||||
for (List<Object> list : insertList) {
|
||||
rs.executeUpdate("insert into uf_jcl_rck_dt4 (mainid, yylx, zwcd) values (?, ?, ?)", list);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,18 @@
|
|||
package com.engine.recruit.service.impl;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.recruit.enums.ApplicationStatusEnum;
|
||||
import com.engine.recruit.service.RecruitButtonService;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.formmode.recruit.modeexpand.util.ApplicantCommonInfo;
|
||||
import weaver.formmode.recruit.modeexpand.util.RecruitModeUtil;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>聚才林招聘</p>
|
||||
|
|
@ -16,6 +25,47 @@ import java.util.Map;
|
|||
public class JoinBlacklistServiceImpl extends Service implements RecruitButtonService {
|
||||
@Override
|
||||
public Map<String, Object> execute(Map<String, Object> params) {
|
||||
// 当前应聘者ID
|
||||
String billId = Util.null2String(params.get("billId"));
|
||||
RecordSet rs = new RecordSet();
|
||||
|
||||
// 推人才表,建模推建模(更新人才表数据),是否加入黑名单字段值变更为“是”
|
||||
ServiceUtil.getService(ApplicantResumeServiceImpl.class, user).archiveTalentPool(billId, true);
|
||||
|
||||
// 更新当前应聘者关联的所有简历状态为已淘汰
|
||||
String name = "";
|
||||
String mobile = "";
|
||||
String positionId = "";
|
||||
rs.executeQuery("select xm, sjhm, ypzw from uf_jcl_yppc where id = ? ", billId);
|
||||
if (rs.next()) {
|
||||
name = rs.getString("xm");
|
||||
mobile = rs.getString("sjhm");
|
||||
positionId = rs.getString("ypzw");
|
||||
}
|
||||
// 更新当前应聘者关联的所有简历状态为已淘汰
|
||||
rs.executeUpdate("update uf_jcl_yppc set zt = ? where xm = ? and sjhm = ?", ApplicationStatusEnum.OBSOLETE.getValue(), name, mobile);
|
||||
|
||||
// 消息提醒当前人员简历的跟进者(应聘职位的负责人/协助人)
|
||||
String messageType = RecruitModeUtil.getRecruitPropValue("RECRUIT_MESSAGE_TYPE");
|
||||
String messageTitle = RecruitModeUtil.getRecruitPropValue("JOIN_BLACKLIST_MESSAGE_TITLE");
|
||||
String applicantName = ApplicantCommonInfo.getApplicantName(billId);
|
||||
String operatorName = RecruitModeUtil.getResourceNames(String.valueOf(user.getUID()));
|
||||
String messageContent = "应聘者:【" + applicantName + "】,已被【" + operatorName + "】加入黑名单,相关投递已自动淘汰,请知悉。";
|
||||
|
||||
// 消息提醒当前人员简历的跟进者(应聘职位的负责人/协助人)
|
||||
String zpzwfzr = "";
|
||||
String zpxzr = "";
|
||||
rs.executeQuery("select zpzwfzr , zpxzr from uf_jcl_zp_zpzw where id = ?", positionId);
|
||||
if (rs.next()) {
|
||||
zpzwfzr = rs.getString("zpzwfzr");
|
||||
zpxzr = rs.getString("zpxzr");
|
||||
}
|
||||
Set<String> userIdSet = new HashSet<>();
|
||||
userIdSet.addAll(Arrays.asList(zpzwfzr.split(",")));
|
||||
userIdSet.addAll(Arrays.asList(zpxzr.split(",")));
|
||||
RecruitModeUtil.messagePush(messageType, messageTitle, messageContent, userIdSet, user.getUID());
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,28 @@
|
|||
package weaver.formmode.recruit.browser;
|
||||
|
||||
import weaver.formmode.customjavacode.AbstractCustomSqlConditionJavaCode;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/10/18
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class RecruitStageBrowser extends AbstractCustomSqlConditionJavaCode {
|
||||
@Override
|
||||
public String generateSqlCondition(Map<String, Object> param) throws Exception {
|
||||
User user = (User)param.get("user");
|
||||
Object extensionParam = param.get("extensionParam");//其他参数
|
||||
HashMap<String,Object> extensionMap = (HashMap<String,Object>)extensionParam;
|
||||
|
||||
//获取参数示例 "min" 只是示例 需要根据自己传入的参数名获取
|
||||
//String min = (String)extensionMap.get("min");
|
||||
|
||||
String sqlCondition = "";
|
||||
|
||||
return sqlCondition;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
package weaver.formmode.recruit.modeexpand.entrymanager;
|
||||
|
||||
import com.engine.recruit.enums.EntryStatusEnum;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
|
||||
import weaver.general.Util;
|
||||
|
|
@ -52,11 +51,11 @@ public class AddEntryModeExpand extends AbstractModeExpandJavaCodeNew {
|
|||
return result;
|
||||
}
|
||||
}
|
||||
// 更新应聘者当前应聘阶段
|
||||
String dqypjd = Util.null2String(param.get("dqypjd"));
|
||||
if (StringUtils.isNotBlank(dqypjd)) {
|
||||
rs.executeUpdate("update uf_jcl_yppc set dqypjd = ? where id = ?", dqypjd, pcid);
|
||||
}
|
||||
//// 更新应聘者当前应聘阶段
|
||||
//String dqypjd = Util.null2String(param.get("dqypjd"));
|
||||
//if (StringUtils.isNotBlank(dqypjd)) {
|
||||
// rs.executeUpdate("update uf_jcl_yppc set dqypjd = ? where id = ?", dqypjd, pcid);
|
||||
//}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ public class BatchAddInterviewResultModeExpand extends AbstractModeExpandJavaCod
|
|||
|
||||
public BatchAddInterviewResultModeExpand() throws UnsupportedEncodingException {
|
||||
super();
|
||||
messageType = RecruitModeUtil.getRecruitPropValue("INTERVIEW_MESSAGE_TYPE");
|
||||
messageType = RecruitModeUtil.getRecruitPropValue("RECRUIT_MESSAGE_TYPE");
|
||||
title = RecruitModeUtil.getRecruitPropValue("INTERVIEW_ADD_MESSAGE_TITLE");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public class CreateInterviewModeExpand extends AbstractModeExpandJavaCodeNew {
|
|||
InterviewOperateTypeEnum operateTypeEnum = InterviewOperateTypeEnum.getOperateType(operateType);
|
||||
switch (operateTypeEnum) {
|
||||
case ARRANGE:
|
||||
messageType = RecruitModeUtil.getRecruitPropValue("INTERVIEW_MESSAGE_TYPE");
|
||||
messageType = RecruitModeUtil.getRecruitPropValue("RECRUIT_MESSAGE_TYPE");
|
||||
title = RecruitModeUtil.getRecruitPropValue("INTERVIEW_ADD_MESSAGE_TITLE");
|
||||
arrangeInterview(user, mainDataMap);
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -63,13 +63,13 @@ public class UpdateInterviewModeExpand extends AbstractModeExpandJavaCodeNew {
|
|||
switch (operateTypeEnum) {
|
||||
case EVALUATE:
|
||||
// 面试评价
|
||||
messageType = RecruitModeUtil.getRecruitPropValue("INTERVIEW_MESSAGE_TYPE");
|
||||
messageType = RecruitModeUtil.getRecruitPropValue("RECRUIT_MESSAGE_TYPE");
|
||||
title = RecruitModeUtil.getRecruitPropValue("INTERVIEW_EVALUATE_MESSAGE_TITLE");
|
||||
evaluateInterview(params, requestInfo.getCreatorid(), mainDataMap);
|
||||
break;
|
||||
case CANCEL:
|
||||
// 面试取消
|
||||
messageType = RecruitModeUtil.getRecruitPropValue("INTERVIEW_MESSAGE_TYPE");
|
||||
messageType = RecruitModeUtil.getRecruitPropValue("RECRUIT_MESSAGE_TYPE");
|
||||
title = RecruitModeUtil.getRecruitPropValue("INTERVIEW_CANCEL_MESSAGE_TITLE");
|
||||
cancelInterView(params, requestInfo, billId, mainDataMap);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,68 @@
|
|||
package weaver.formmode.recruit.modeexpand.position;
|
||||
|
||||
import com.engine.recruit.constant.ModeTable;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
|
||||
import weaver.formmode.recruit.modeexpand.process.StageDataInsert;
|
||||
import weaver.general.BaseBean;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 应聘职位关联招聘流程对应的招聘阶段
|
||||
*
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/10/18
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class PositionRelatedStageExpand 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();
|
||||
// 获取表单名称
|
||||
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
|
||||
Property[] properties = mainTableInfo.getProperty();
|
||||
Map<String, String> mainDataMap = new HashMap<>();
|
||||
for (Property property : properties) {
|
||||
mainDataMap.put(property.getName(), property.getValue());
|
||||
}
|
||||
// 招聘流程
|
||||
String zplc = mainDataMap.get("zplc");
|
||||
if (StringUtils.isBlank(zplc)) {
|
||||
// 未配置招聘流程,不做任何处理
|
||||
return result;
|
||||
}
|
||||
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select ksjd, gcjd, jsjd from " + ModeTable.UF_JCL_ZPLC + " where id = ? ", zplc);
|
||||
if (rs.next()) {
|
||||
// 开始阶段
|
||||
String ksjd = mainDataMap.get("ksjd");
|
||||
// 过程阶段
|
||||
String gcjd = mainDataMap.get("gcjd");
|
||||
// 结束阶段
|
||||
String jsjd = mainDataMap.get("jsjd");
|
||||
// 查询所有的操作阶段信息
|
||||
User user = (User) param.get("user");
|
||||
StageDataInsert.relatedStageData(user.getUID(), billId, "ypzw", ksjd, gcjd, jsjd);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
new BaseBean().writeLog(e);
|
||||
result.put("errmsg", e.getMessage());
|
||||
result.put("flag", "false");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
@ -2,6 +2,7 @@ package weaver.formmode.recruit.modeexpand.position;
|
|||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.engine.recruit.constant.ModeTable;
|
||||
import com.engine.recruit.enums.ApplicationStatusEnum;
|
||||
import com.engine.recruit.enums.CommonBrowserTypeEnum;
|
||||
import com.engine.recruit.enums.HighestDegreeEnum;
|
||||
import com.weaver.rpa.sdk.clients.application.resume.ERPAResumeSDKClient;
|
||||
|
|
@ -78,7 +79,7 @@ public class ResumeSavedThread extends LocalRunnable {
|
|||
// 千里聆简历ID
|
||||
params.put("qlljl", resumeId);
|
||||
// 状态,指定待分配
|
||||
params.put("zt", "0");
|
||||
params.put("zt", ApplicationStatusEnum.DISTRIBUTION.getValue());
|
||||
|
||||
// 填充建模数据基本信息
|
||||
int formModeId = ApplicantCommonInfo.getModeIdByTableName(ModeTable.UF_JCL_YPPC);
|
||||
|
|
|
|||
|
|
@ -1,19 +1,14 @@
|
|||
package weaver.formmode.recruit.modeexpand.process;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.common.DateUtil;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
|
||||
import weaver.formmode.recruit.modeexpand.util.RecruitModeUtil;
|
||||
import weaver.formmode.setup.ModeRightInfo;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
import weaver.soa.workflow.request.MainTableInfo;
|
||||
import weaver.soa.workflow.request.Property;
|
||||
import weaver.soa.workflow.request.RequestInfo;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>聚才林招聘</p>
|
||||
|
|
@ -25,9 +20,6 @@ import java.util.*;
|
|||
* @version: 1.0
|
||||
*/
|
||||
public class RelatedStageModeExpand extends AbstractModeExpandJavaCodeNew {
|
||||
private static final String MODE_TABLE_NAME = "uf_jcl_zpjdsz";
|
||||
private static final String MODE_TABLE_NAME_DT1 = "uf_jcl_zpjdsz_dt1";
|
||||
private static final String MODE_TABLE_NAME_DT2 = "uf_jcl_zpjdsz_dt2";
|
||||
|
||||
@Override
|
||||
public Map<String, String> doModeExpand(Map<String, Object> param) {
|
||||
|
|
@ -52,131 +44,13 @@ public class RelatedStageModeExpand extends AbstractModeExpandJavaCodeNew {
|
|||
String jsjd = mainDataMap.get("jsjd");
|
||||
// 查询所有的操作阶段信息
|
||||
User user = (User) param.get("user");
|
||||
relatedStageData(user.getUID(), billId, ksjd, gcjd, jsjd);
|
||||
StageDataInsert.relatedStageData(user.getUID(), billId, "zplc", ksjd, gcjd, jsjd);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
new BaseBean().writeLog(e);
|
||||
result.put("errmsg", "完成需求操作失败");
|
||||
result.put("errmsg", e.getMessage());
|
||||
result.put("flag", "false");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成关联的招聘阶段数据
|
||||
*
|
||||
* @param creator 创建者ID
|
||||
* @param billId 当前数据ID
|
||||
* @param processIds 路程表单所选阶段ID
|
||||
*/
|
||||
private void relatedStageData(int creator, String billId, String... processIds) {
|
||||
String dateTime = DateUtil.getFullDate();
|
||||
String[] dateSplit = dateTime.split(" ");
|
||||
|
||||
List<Object> paramsList = new ArrayList<>();
|
||||
// modedatacreater
|
||||
paramsList.add(creator);
|
||||
// modedatacreatedate
|
||||
paramsList.add(dateSplit[0]);
|
||||
// modedatacreatetime
|
||||
paramsList.add(dateSplit[1]);
|
||||
// modedatamodifier
|
||||
paramsList.add(creator);
|
||||
// modedatamodifydatetime
|
||||
paramsList.add(dateTime);
|
||||
// modedatacreatertype
|
||||
paramsList.add("0");
|
||||
|
||||
String processIdsStr = StringUtils.join(Arrays.asList(processIds), ",");
|
||||
String insertSql = "insert into " + MODE_TABLE_NAME + " (modeuuid, modedatacreater, modedatacreatedate, modedatacreatetime, modedatamodifier, modedatamodifydatetime, modedatacreatertype, formmodeid, jdmc, jdms, jdlx, hj, sfqy, zssx, zpjd, zplc) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
|
||||
if (StringUtils.isNotBlank(processIdsStr)) {
|
||||
insertMainTableData(billId, processIdsStr, insertSql, paramsList);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 插入主表数据
|
||||
*
|
||||
* @param billId 招聘流程表单ID
|
||||
* @param processIdsStr 招聘阶段ID
|
||||
* @param insertSql 插入SQL语句
|
||||
* @param paramsList 待插入参数集合
|
||||
*/
|
||||
private void insertMainTableData(String billId, String processIdsStr, String insertSql, List<Object> paramsList) {
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select * from uf_jcl_zpjdsz where id in (" + processIdsStr + ") order by hj,zssx");
|
||||
while (rs.next()) {
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
ArrayList<Object> insertList = new ArrayList<>(paramsList);
|
||||
insertList.add(0, uuid);
|
||||
String formModeId = rs.getString("formmodeid");
|
||||
insertList.add(formModeId);
|
||||
insertList.add(RecruitModeUtil.parseBlankToNull(rs.getString("jdmc")));
|
||||
insertList.add(RecruitModeUtil.parseBlankToNull(rs.getString("jdms")));
|
||||
insertList.add(RecruitModeUtil.parseBlankToNull(rs.getString("jdlx")));
|
||||
insertList.add(RecruitModeUtil.parseBlankToNull(rs.getString("hj")));
|
||||
insertList.add(RecruitModeUtil.parseBlankToNull(rs.getString("sfqy")));
|
||||
insertList.add(RecruitModeUtil.parseBlankToNull(rs.getString("zssx")));
|
||||
// zpjd
|
||||
insertList.add(RecruitModeUtil.parseBlankToNull(rs.getString("id")));
|
||||
// zplc
|
||||
insertList.add(RecruitModeUtil.parseBlankToNull(billId));
|
||||
// 插入主表数据
|
||||
rs.executeUpdate(insertSql, insertList);
|
||||
refreshRight(uuid, formModeId, rs.getString("id"));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 权限重构,插入明细表数据
|
||||
*
|
||||
* @param uuid UUID
|
||||
* @param formModeId formModeId
|
||||
*/
|
||||
private void refreshRight(String uuid, String formModeId, String processId) {
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select id from " + MODE_TABLE_NAME + " where modeuuid='" + uuid + "'");
|
||||
if (rs.next()) {
|
||||
//建模数据的id
|
||||
String bid = rs.getString("id");
|
||||
ModeRightInfo modeRightInfo = new ModeRightInfo();
|
||||
modeRightInfo.setNewRight(true);
|
||||
//新建的时候添加共享
|
||||
modeRightInfo.editModeDataShare(1, Util.getIntValue(formModeId), Util.getIntValue(bid));
|
||||
|
||||
// 插入明细表数据
|
||||
rs.executeQuery("select * from " + MODE_TABLE_NAME_DT1 + " where mainid = ? ", processId);
|
||||
List<List<Object>> insertList = new ArrayList<>();
|
||||
while (rs.next()) {
|
||||
List<Object> paramList = new ArrayList<>();
|
||||
// mainid
|
||||
paramList.add(bid);
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("czan")));
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("zdyxsmc")));
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("sfqy")));
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("tzymbt")));
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("tzymdz")));
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("zssx")));
|
||||
insertList.add(paramList);
|
||||
}
|
||||
for (List<Object> list : insertList) {
|
||||
rs.executeUpdate("insert into " + MODE_TABLE_NAME_DT1 + " (mainid, czan, zdyxsmc, sfqy, tzymbt, tzymdz, zssx) values (?, ?, ?, ?, ?, ?, ?)", list);
|
||||
}
|
||||
|
||||
insertList = new ArrayList<>();
|
||||
rs.executeQuery("select * from " + MODE_TABLE_NAME_DT2 + " where mainid = ? ", processId);
|
||||
while (rs.next()) {
|
||||
List<Object> paramList = new ArrayList<>();
|
||||
// mainid
|
||||
paramList.add(bid);
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("ymbt")));
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("ymdz")));
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("zssx")));
|
||||
insertList.add(paramList);
|
||||
}
|
||||
for (List<Object> list : insertList) {
|
||||
rs.executeUpdate("insert into " + MODE_TABLE_NAME_DT2 + " (mainid, ymbt, ymdz, zssx) values (?, ?, ?, ?)", list);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,139 @@
|
|||
package weaver.formmode.recruit.modeexpand.process;
|
||||
|
||||
import com.engine.recruit.constant.ModeTable;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.common.DateUtil;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.formmode.recruit.modeexpand.util.RecruitModeUtil;
|
||||
import weaver.formmode.setup.ModeRightInfo;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/10/18
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class StageDataInsert {
|
||||
/**
|
||||
* 生成关联的招聘阶段数据
|
||||
*
|
||||
* @param creator 创建者ID
|
||||
* @param billId 当前数据ID
|
||||
* @param processIds 路程表单所选阶段ID
|
||||
*/
|
||||
public static void relatedStageData(int creator, String billId, String relateField, String... processIds) {
|
||||
String dateTime = DateUtil.getFullDate();
|
||||
String[] dateSplit = dateTime.split(" ");
|
||||
|
||||
List<Object> paramsList = new ArrayList<>();
|
||||
// modedatacreater
|
||||
paramsList.add(creator);
|
||||
// modedatacreatedate
|
||||
paramsList.add(dateSplit[0]);
|
||||
// modedatacreatetime
|
||||
paramsList.add(dateSplit[1]);
|
||||
// modedatamodifier
|
||||
paramsList.add(creator);
|
||||
// modedatamodifydatetime
|
||||
paramsList.add(dateTime);
|
||||
// modedatacreatertype
|
||||
paramsList.add("0");
|
||||
|
||||
String processIdsStr = StringUtils.join(Arrays.asList(processIds), ",");
|
||||
String insertSql = "insert into " + ModeTable.UF_JCL_ZPJDSZ + " (modeuuid, modedatacreater, modedatacreatedate, modedatacreatetime, modedatamodifier, modedatamodifydatetime, modedatacreatertype, formmodeid, jdmc, jdms, jdlx, hj, sfqy, zssx, zpjd, " + relateField + ") values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
|
||||
if (StringUtils.isNotBlank(processIdsStr)) {
|
||||
insertMainTableData(billId, processIdsStr, insertSql, paramsList);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 插入主表数据
|
||||
*
|
||||
* @param billId 招聘流程表单ID
|
||||
* @param processIdsStr 招聘阶段ID
|
||||
* @param insertSql 插入SQL语句
|
||||
* @param paramsList 待插入参数集合
|
||||
*/
|
||||
private static void insertMainTableData(String billId, String processIdsStr, String insertSql, List<Object> paramsList) {
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select * from uf_jcl_zpjdsz where id in (" + processIdsStr + ") order by hj,zssx");
|
||||
while (rs.next()) {
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
ArrayList<Object> insertList = new ArrayList<>(paramsList);
|
||||
insertList.add(0, uuid);
|
||||
String formModeId = rs.getString("formmodeid");
|
||||
insertList.add(formModeId);
|
||||
insertList.add(RecruitModeUtil.parseBlankToNull(rs.getString("jdmc")));
|
||||
insertList.add(RecruitModeUtil.parseBlankToNull(rs.getString("jdms")));
|
||||
insertList.add(RecruitModeUtil.parseBlankToNull(rs.getString("jdlx")));
|
||||
insertList.add(RecruitModeUtil.parseBlankToNull(rs.getString("hj")));
|
||||
insertList.add(RecruitModeUtil.parseBlankToNull(rs.getString("sfqy")));
|
||||
insertList.add(RecruitModeUtil.parseBlankToNull(rs.getString("zssx")));
|
||||
// zpjd
|
||||
insertList.add(RecruitModeUtil.parseBlankToNull(rs.getString("id")));
|
||||
// zplc
|
||||
insertList.add(RecruitModeUtil.parseBlankToNull(billId));
|
||||
// 插入主表数据
|
||||
rs.executeUpdate(insertSql, insertList);
|
||||
refreshRight(uuid, formModeId, rs.getString("id"));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 权限重构,插入明细表数据
|
||||
*
|
||||
* @param uuid UUID
|
||||
* @param formModeId formModeId
|
||||
*/
|
||||
private static void refreshRight(String uuid, String formModeId, String processId) {
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select id from " + ModeTable.UF_JCL_ZPJDSZ + " where modeuuid='" + uuid + "'");
|
||||
if (rs.next()) {
|
||||
//建模数据的id
|
||||
String bid = rs.getString("id");
|
||||
ModeRightInfo modeRightInfo = new ModeRightInfo();
|
||||
modeRightInfo.setNewRight(true);
|
||||
//新建的时候添加共享
|
||||
modeRightInfo.editModeDataShare(1, Util.getIntValue(formModeId), Util.getIntValue(bid));
|
||||
|
||||
// 插入明细表数据
|
||||
rs.executeQuery("select * from " + ModeTable.getDetailTableName(ModeTable.UF_JCL_ZPJDSZ, 1) + " where mainid = ? ", processId);
|
||||
List<List<Object>> insertList = new ArrayList<>();
|
||||
while (rs.next()) {
|
||||
List<Object> paramList = new ArrayList<>();
|
||||
// mainid
|
||||
paramList.add(bid);
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("czan")));
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("zdyxsmc")));
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("sfqy")));
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("tzymbt")));
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("tzymdz")));
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("zssx")));
|
||||
insertList.add(paramList);
|
||||
}
|
||||
for (List<Object> list : insertList) {
|
||||
rs.executeUpdate("insert into " + ModeTable.getDetailTableName(ModeTable.UF_JCL_ZPJDSZ, 1) + " (mainid, czan, zdyxsmc, sfqy, tzymbt, tzymdz, zssx) values (?, ?, ?, ?, ?, ?, ?)", list);
|
||||
}
|
||||
|
||||
insertList = new ArrayList<>();
|
||||
rs.executeQuery("select * from " + ModeTable.getDetailTableName(ModeTable.UF_JCL_ZPJDSZ, 2) + " where mainid = ? ", processId);
|
||||
while (rs.next()) {
|
||||
List<Object> paramList = new ArrayList<>();
|
||||
// mainid
|
||||
paramList.add(bid);
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("ymbt")));
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("ymdz")));
|
||||
paramList.add(RecruitModeUtil.parseBlankToNull(rs.getString("zssx")));
|
||||
insertList.add(paramList);
|
||||
}
|
||||
for (List<Object> list : insertList) {
|
||||
rs.executeUpdate("insert into " + ModeTable.getDetailTableName(ModeTable.UF_JCL_ZPJDSZ, 2) + " (mainid, ymbt, ymdz, zssx) values (?, ?, ?, ?)", list);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue