generated from dxfeng/secondev-chapanda-feishu
招聘流程数据初始化
This commit is contained in:
parent
f9c54c103a
commit
acae0cc3e9
|
|
@ -0,0 +1,8 @@
|
|||
<%@ page contentType="text/html; charset=UTF-8" %>
|
||||
<%
|
||||
|
||||
out.println("招聘数据正在初始化,请稍后...");
|
||||
|
||||
|
||||
out.println("招聘数据初始化完成");
|
||||
%>
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package com.api.recruit.controller;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/11/23
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Path("/jcl/recruit/init")
|
||||
public class InitRecruitDataController extends com.engine.recruit.controller.InitRecruitDataController {
|
||||
}
|
||||
|
|
@ -102,6 +102,57 @@ public class ApplicantCommonInfo {
|
|||
return formModeId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定模块下的布局ID
|
||||
*
|
||||
* @param modeId
|
||||
* @param layoutName
|
||||
* @return
|
||||
*/
|
||||
public static int getLayoutId(int modeId, String layoutName) {
|
||||
int layoutId = -1;
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select id from modehtmllayout where modeid = ? and layoutname =?", modeId, layoutName);
|
||||
if (rs.next()) {
|
||||
layoutId = rs.getInt("id");
|
||||
}
|
||||
return layoutId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取字段ID
|
||||
*
|
||||
* @param billId
|
||||
* @param fieldName
|
||||
* @return
|
||||
*/
|
||||
public static int getFieldId(int billId, String fieldName) {
|
||||
int fieldId = -1;
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select id from workflow_billfield where billid =? and fieldname = ?", billId, fieldName);
|
||||
if (rs.next()) {
|
||||
fieldId = rs.getInt("id");
|
||||
}
|
||||
return fieldId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取查询ID
|
||||
*
|
||||
* @param modeId
|
||||
* @param customName
|
||||
* @return
|
||||
*/
|
||||
public static int getCustomId(int modeId, String customName) {
|
||||
int customId = -1;
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select id from mode_customsearch where modeid = ? and customname = ? ", modeId, customName);
|
||||
if (rs.next()) {
|
||||
customId = rs.getInt("id");
|
||||
}
|
||||
return customId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据表名,获取表单ID
|
||||
*
|
||||
|
|
|
|||
|
|
@ -0,0 +1,43 @@
|
|||
package com.engine.recruit.controller;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.recruit.util.ResponseResult;
|
||||
import com.engine.recruit.wrapper.InitRecruitDataWrapper;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/11/23
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class InitRecruitDataController {
|
||||
public InitRecruitDataWrapper getInitRecruitDataWrapper(User user) {
|
||||
return ServiceUtil.getService(InitRecruitDataWrapper.class, user);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/checkInitStatus")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String checkInitStatus(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getInitRecruitDataWrapper(user)::checkInitStatus);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/initRecruitData")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String initRecruitData(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getInitRecruitDataWrapper(user)::initRecruitData);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.engine.recruit.entity.init.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/11/22
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class OperateButtonPo {
|
||||
private Integer id;
|
||||
private String buttonName;
|
||||
private String buttonKey;
|
||||
private String buttonAction;
|
||||
private String buttonOrder;
|
||||
|
||||
private String linkUrl;
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.engine.recruit.entity.init.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/11/23
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class OperateFlowPo {
|
||||
private String lcmc;
|
||||
private Integer lczt;
|
||||
private String ksjd;
|
||||
private String gcjd;
|
||||
private String jsjd;
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.engine.recruit.entity.init.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/11/22
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class OperateStageDt1 {
|
||||
private Integer czan;
|
||||
private String zdyxsmc;
|
||||
private String tzymdz;
|
||||
private Integer zssx;
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.engine.recruit.entity.init.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/11/22
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class OperateStageDt2 {
|
||||
private String ymbt;
|
||||
private String ymdz;
|
||||
private Integer zssx;
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.engine.recruit.entity.init.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/11/22
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class OperateStagePo {
|
||||
private Integer id;
|
||||
private String jdmc;
|
||||
private String jdms;
|
||||
private Integer jdlx;
|
||||
private Integer hj;
|
||||
|
||||
private List<OperateStageDt1> dt1;
|
||||
private List<OperateStageDt2> dt2;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.engine.recruit.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/11/22
|
||||
* @version: 1.0
|
||||
*/
|
||||
public interface InitRecruitDataService {
|
||||
|
||||
/**
|
||||
* 校验初始化状态
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> checkInitStatus();
|
||||
|
||||
/**
|
||||
* 初始化招聘数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> initRecruitData();
|
||||
}
|
||||
|
|
@ -0,0 +1,443 @@
|
|||
package com.engine.recruit.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.recruit.conn.ApplicantCommonInfo;
|
||||
import com.engine.recruit.conn.RecruitDataMap;
|
||||
import com.engine.recruit.conn.RecruitRecordSet;
|
||||
import com.engine.recruit.entity.init.po.*;
|
||||
import com.engine.recruit.exception.CustomizeRunTimeException;
|
||||
import com.engine.recruit.service.InitRecruitDataService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.formmode.recruit.modeexpand.process.StageDataInsert;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/11/22
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class InitRecruitDataServiceImpl extends Service implements InitRecruitDataService {
|
||||
@Override
|
||||
public Map<String, Object> checkInitStatus() {
|
||||
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select id from uf_jcl_zplc");
|
||||
if (rs.next()) {
|
||||
throw new CustomizeRunTimeException("当前已存在招聘流程数据,无需重复初始化");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> initRecruitData() {
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeUpdate("delete from uf_jcl_zplc;");
|
||||
rs.executeUpdate("delete from uf_jcl_zpjdsz;");
|
||||
rs.executeUpdate("delete from uf_jcl_zpjdsz_dt1;");
|
||||
rs.executeUpdate("delete from uf_jcl_zpjdsz_dt2;");
|
||||
rs.executeUpdate("delete from uf_jcl_lcczan;");
|
||||
|
||||
// 插入操作按钮数据,
|
||||
int buttonModeId = ApplicantCommonInfo.getModeIdByTableName("uf_jcl_lcczan");
|
||||
Map<String, Object> baseMap = new RecruitDataMap<>();
|
||||
RecruitRecordSet.buildModeInsertFields(baseMap, 1);
|
||||
List<OperateButtonPo> operateButtonList = insertButtonData(baseMap, buttonModeId);
|
||||
Map<String, OperateButtonPo> operateButtonMap = operateButtonList.stream().collect(Collectors.toMap(OperateButtonPo::getButtonName, item -> item, (k1, k2) -> k1));
|
||||
|
||||
// 插入招聘阶段数据
|
||||
int stageModeId = ApplicantCommonInfo.getModeIdByTableName("uf_jcl_zpjdsz");
|
||||
insertStageData(baseMap, stageModeId, operateButtonMap);
|
||||
|
||||
// 创建内置流程
|
||||
int flowModeId = ApplicantCommonInfo.getModeIdByTableName("uf_jcl_zplc");
|
||||
insertFlowData(baseMap, flowModeId);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private void insertFlowData(Map<String, Object> baseMap, int modeId) {
|
||||
OperateFlowPo flowPo = OperateFlowPo.builder()
|
||||
.lcmc("默认流程")
|
||||
.lczt(0)
|
||||
.ksjd(getStageIdByName("筛选"))
|
||||
.gcjd(getStageIdByName("面试"))
|
||||
.jsjd(getStageIdByName("offer"))
|
||||
.build();
|
||||
|
||||
RecruitDataMap<Object> flowDataMap = new RecruitDataMap<>();
|
||||
flowDataMap.putAll(baseMap);
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
flowDataMap.put("modeuuid", uuid);
|
||||
flowDataMap.put("formmodeid", modeId);
|
||||
flowDataMap.put("lcmc", flowPo.getLcmc());
|
||||
flowDataMap.put("lczt", flowPo.getLczt());
|
||||
flowDataMap.put("ksjd", flowPo.getKsjd());
|
||||
flowDataMap.put("gcjd", flowPo.getGcjd());
|
||||
flowDataMap.put("jsjd", flowPo.getJsjd());
|
||||
|
||||
RecruitRecordSet.insertData(flowDataMap, "uf_jcl_zplc");
|
||||
int billId = RecruitRecordSet.refreshRight(uuid, "uf_jcl_zplc", modeId, 1);
|
||||
// 流程关联招聘阶段
|
||||
StageDataInsert.relatedStageData(1, String.valueOf(billId), "zplc", flowPo.getKsjd(), flowPo.getGcjd(), flowPo.getJsjd());
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 插入招聘阶段设置数据
|
||||
*
|
||||
* @param baseMap
|
||||
* @param modeId
|
||||
* @param operateButtonMap
|
||||
*/
|
||||
private void insertStageData(Map<String, Object> baseMap, int modeId, Map<String, OperateButtonPo> operateButtonMap) {
|
||||
List<OperateStagePo> stageList = buildOperateStageList(operateButtonMap);
|
||||
List<OperateStageDt2> dt2List = buildStageDt2Data();
|
||||
for (OperateStagePo stage : stageList) {
|
||||
RecruitDataMap<Object> stageDataMap = new RecruitDataMap<>();
|
||||
stageDataMap.putAll(baseMap);
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
stageDataMap.put("modeuuid", uuid);
|
||||
stageDataMap.put("formmodeid", modeId);
|
||||
stageDataMap.put("jdmc", stage.getJdmc());
|
||||
stageDataMap.put("jdms", stage.getJdms());
|
||||
stageDataMap.put("jdlx", stage.getJdlx());
|
||||
stageDataMap.put("hj", stage.getHj());
|
||||
stageDataMap.put("sfqy", 0);
|
||||
stageDataMap.put("zplc", -1);
|
||||
RecruitRecordSet.insertData(stageDataMap, "uf_jcl_zpjdsz");
|
||||
int id = RecruitRecordSet.refreshRight(uuid, "uf_jcl_zpjdsz", modeId, 1);
|
||||
stage.setId(id);
|
||||
|
||||
// 插入明细表1
|
||||
List<OperateStageDt1> dt1 = stage.getDt1();
|
||||
for (OperateStageDt1 stageDt1 : dt1) {
|
||||
Map<String, Object> dt1Map = new RecruitDataMap<>();
|
||||
dt1Map.put("mainid", id);
|
||||
dt1Map.put("czan", stageDt1.getCzan());
|
||||
dt1Map.put("zdyxsmc", stageDt1.getZdyxsmc());
|
||||
dt1Map.put("tzymdz", stageDt1.getTzymdz());
|
||||
dt1Map.put("sfqy", 0);
|
||||
dt1Map.put("zssx", stageDt1.getZssx());
|
||||
RecruitRecordSet.insertData(dt1Map, "uf_jcl_zpjdsz_dt1");
|
||||
}
|
||||
|
||||
// 插入明细表2
|
||||
for (OperateStageDt2 stageDt2 : dt2List) {
|
||||
Map<String, Object> dt2Map = new RecruitDataMap<>();
|
||||
dt2Map.put("mainid", id);
|
||||
dt2Map.put("ymbt", stageDt2.getYmbt());
|
||||
dt2Map.put("ymdz", stageDt2.getYmdz());
|
||||
dt2Map.put("zssx", stageDt2.getZssx());
|
||||
RecruitRecordSet.insertData(dt2Map, "uf_jcl_zpjdsz_dt2");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建招聘阶段设置,明细表2数据集合
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private List<OperateStageDt2> buildStageDt2Data() {
|
||||
List<OperateStageDt2> dt2List = new ArrayList<>();
|
||||
dt2List.add(OperateStageDt2.builder()
|
||||
.ymbt("基本信息")
|
||||
.ymdz(getModeLink("/spa/cube/index.html#/main/cube/card?type=0&modeId={modeId}&formId={formId}&billid=$parentid$&opentype=0&isRecruitCard=true", "uf_jcl_yppc", "", ""))
|
||||
.zssx(10)
|
||||
.build());
|
||||
|
||||
dt2List.add(OperateStageDt2.builder()
|
||||
.ymbt("部门筛选反馈")
|
||||
.ymdz(getModeSearchUrl("/spa/cube/index.html#/main/cube/search?pcid=$parentid$&isRecruitCard=true&customid={customid}", "uf_jcl_bmsxfk", "筛选反馈-简历卡片"))
|
||||
.zssx(20)
|
||||
.build());
|
||||
|
||||
dt2List.add(OperateStageDt2.builder()
|
||||
.ymbt("笔试")
|
||||
.ymdz(getModeSearchUrl("/spa/cube/index.html#/main/cube/search?pcid=$parentid$&isRecruitCard=true&customid={customid}", "uf_jcl_bs", "笔试-简历卡片"))
|
||||
.zssx(30)
|
||||
.build());
|
||||
|
||||
dt2List.add(OperateStageDt2.builder()
|
||||
.ymbt("面试")
|
||||
.ymdz(getModeSearchUrl("/spa/cube/index.html#/main/cube/search?pcid=$parentid$&isRecruitCard=true&customid={customid}", "uf_jcl_ms", "面试-简历卡片"))
|
||||
.zssx(40)
|
||||
.build());
|
||||
|
||||
dt2List.add(OperateStageDt2.builder()
|
||||
.ymbt("背调")
|
||||
.ymdz(getModeSearchUrl("/spa/cube/index.html#/main/cube/search?pcid=$parentid$&isRecruitCard=true&customid={customid}", "uf_jcl_bd", "背调-简历卡片"))
|
||||
.zssx(50)
|
||||
.build());
|
||||
|
||||
dt2List.add(OperateStageDt2.builder()
|
||||
.ymbt("薪酬谈判")
|
||||
.ymdz(getModeSearchUrl("/spa/cube/index.html#/main/cube/search?pcid=$parentid$&isRecruitCard=true&customid={customid}", "uf_jcl_xctp", "薪酬谈判-简历卡片"))
|
||||
.zssx(60)
|
||||
.build());
|
||||
|
||||
dt2List.add(OperateStageDt2.builder()
|
||||
.ymbt("历史投递记录")
|
||||
.ymdz(getModeSearchUrl("/spa/cube/index.html#/main/cube/search?pcid=$parentid$&xm=$xm$&sjhm=$sjhm$&isRecruitCard=true&customid={customid}", "uf_jcl_yppc", "相关历史投递记录"))
|
||||
.zssx(70)
|
||||
.build());
|
||||
|
||||
dt2List.add(OperateStageDt2.builder()
|
||||
.ymbt("备注")
|
||||
.ymdz(getModeSearchUrl("/spa/cube/index.html#/main/cube/search?pcid=$parentid$&isRecruitCard=true&customid={customid}", "uf_jcl_bz", "备注-简历卡片"))
|
||||
.zssx(80)
|
||||
.build());
|
||||
|
||||
dt2List.add(OperateStageDt2.builder()
|
||||
.ymbt("应聘过程")
|
||||
.ymdz(getModeSearchUrl("/spa/cube/index.html#/main/cube/search?pcid=$parentid$&isRecruitCard=true&customid={customid}", "uf_jcl_ypgc", "应聘过程-简历卡片"))
|
||||
.zssx(90)
|
||||
.build());
|
||||
|
||||
return dt2List;
|
||||
|
||||
}
|
||||
|
||||
|
||||
private List<OperateStagePo> buildOperateStageList(Map<String, OperateButtonPo> operateButtonMap) {
|
||||
List<OperateStagePo> stageList = new ArrayList<>();
|
||||
stageList.add(buildStagePo(OperateStagePo.builder().jdmc("筛选").jdms("筛选").jdlx(0).hj(0).build(),
|
||||
operateButtonMap,
|
||||
"进入下一阶段", "部门筛选", "淘汰", "转移阶段", "转推其他职位", "归档人才库", "添加备注", "加入黑名单"));
|
||||
|
||||
stageList.add(buildStagePo(OperateStagePo.builder().jdmc("笔试").jdms("笔试").jdlx(1).hj(1).build(),
|
||||
operateButtonMap,
|
||||
"进入下一阶段", "安排笔试", "笔试结果登记", "转移阶段", "淘汰", "转推其他职位", "归档人才库", "添加备注", "加入黑名单"));
|
||||
|
||||
stageList.add(buildStagePo(OperateStagePo.builder().jdmc("面试").jdms("面试").jdlx(2).hj(1).build(),
|
||||
operateButtonMap,
|
||||
"进入下一阶段", "安排面试", "淘汰", "转移阶段", "转推其他职位", "归档人才库", "添加备注", "加入黑名单"));
|
||||
|
||||
stageList.add(buildStagePo(OperateStagePo.builder().jdmc("背调").jdms("背调").jdlx(5).hj(1).build(),
|
||||
operateButtonMap,
|
||||
"进入下一阶段", "背调结果登记", "淘汰", "转移阶段", "转推其他职位", "归档人才库", "添加备注", "加入黑名单"));
|
||||
|
||||
stageList.add(buildStagePo(OperateStagePo.builder().jdmc("薪酬谈判").jdms("薪酬谈判").jdlx(4).hj(1).build(),
|
||||
operateButtonMap,
|
||||
"进入下一阶段", "谈判记录登记", "淘汰", "转移阶段", "转推其他职位", "归档人才库", "添加备注", "加入黑名单"));
|
||||
|
||||
stageList.add(buildStagePo(OperateStagePo.builder().jdmc("offer").jdms("offer").jdlx(6).hj(2).build(),
|
||||
operateButtonMap,
|
||||
"创建offer", "转为待入职", "转移阶段", "淘汰", "转推其他职位", "归档人才库", "添加备注", "加入黑名单"));
|
||||
return stageList;
|
||||
}
|
||||
|
||||
private OperateStagePo buildStagePo(OperateStagePo stagePo, Map<String, OperateButtonPo> operateButtonMap, String... buttonNames) {
|
||||
List<OperateStageDt1> dt1 = new ArrayList<>();
|
||||
int index = 10;
|
||||
for (String buttonName : buttonNames) {
|
||||
OperateButtonPo operateButtonPo = operateButtonMap.get(buttonName);
|
||||
dt1.add(OperateStageDt1.builder()
|
||||
.czan(operateButtonPo.getId())
|
||||
.zdyxsmc(operateButtonPo.getButtonName())
|
||||
.tzymdz(operateButtonPo.getLinkUrl())
|
||||
.zssx(index)
|
||||
.build());
|
||||
index += 10;
|
||||
}
|
||||
stagePo.setDt1(dt1);
|
||||
return stagePo;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 插入操作按钮数据
|
||||
*
|
||||
* @param baseMap
|
||||
* @param modeId
|
||||
* @return
|
||||
*/
|
||||
private List<OperateButtonPo> insertButtonData(Map<String, Object> baseMap, int modeId) {
|
||||
List<OperateButtonPo> buttonList = buildButtonList();
|
||||
for (OperateButtonPo button : buttonList) {
|
||||
RecruitDataMap<Object> buttonDataMap = new RecruitDataMap<>();
|
||||
buttonDataMap.putAll(baseMap);
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
buttonDataMap.put("modeuuid", uuid);
|
||||
buttonDataMap.put("formmodeid", modeId);
|
||||
buttonDataMap.put("anmc", button.getButtonName());
|
||||
buttonDataMap.put("sfqy", "0");
|
||||
buttonDataMap.put("anbs", button.getButtonKey());
|
||||
buttonDataMap.put("andz", button.getButtonAction());
|
||||
|
||||
RecruitRecordSet.insertData(buttonDataMap, "uf_jcl_lcczan");
|
||||
int id = RecruitRecordSet.refreshRight(uuid, "uf_jcl_lcczan", modeId, 1);
|
||||
button.setId(id);
|
||||
}
|
||||
return buttonList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建操作按钮基础信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private List<OperateButtonPo> buildButtonList() {
|
||||
List<OperateButtonPo> buttonList = new ArrayList<>();
|
||||
buttonList.add(OperateButtonPo.builder().buttonName("进入下一阶段").buttonAction("postAndReload")
|
||||
.buttonKey("com.engine.recruit.service.impl.NextStageServiceImpl")
|
||||
.build());
|
||||
|
||||
buttonList.add(OperateButtonPo.builder().buttonName("部门筛选").buttonAction("openDialog")
|
||||
.linkUrl(getModeLink("/spa/cube/index.html#/main/cube/card?type=1&modeId={modeId}&formId={formId}&{ypz}=$parentid$", "uf_jcl_bmsx", "", "ypz"))
|
||||
.build());
|
||||
|
||||
buttonList.add(OperateButtonPo.builder().buttonName("淘汰").buttonAction("confirmAndReload")
|
||||
.buttonKey("com.engine.recruit.service.impl.EliminateServiceImpl")
|
||||
.build());
|
||||
|
||||
buttonList.add(OperateButtonPo.builder().buttonName("转推其他职位").buttonAction("openDialog")
|
||||
.linkUrl(getModeLink("/spa/cube/index.html#/main/cube/card?type=1&modeId={modeId}&formId={formId}&layoutid={layoutid}&guid=card&sourceId=$parentid$", "uf_jcl_yppc", "转推其他职位-新建一个投递", ""))
|
||||
.build());
|
||||
|
||||
buttonList.add(OperateButtonPo.builder().buttonName("归档人才库").buttonAction("openDialog")
|
||||
.linkUrl(getModeLink("/spa/cube/index.html#/main/cube/card?type=1&modeId={modeId}&formId={formId}&layoutid={layoutid}&guid=card&ids=$parentid$", "uf_jcl_yppc", "归档人才库-新建模板-新建一个投递", ""))
|
||||
.build());
|
||||
|
||||
buttonList.add(OperateButtonPo.builder().buttonName("加入黑名单").buttonAction("confirmAndReload")
|
||||
.buttonKey("com.engine.recruit.service.impl.JoinBlacklistServiceImpl")
|
||||
.build());
|
||||
|
||||
buttonList.add(OperateButtonPo.builder().buttonName("安排笔试").buttonAction("openDialog")
|
||||
.linkUrl(getModeLink("/spa/cube/index.html#/main/cube/card?modeId={modeId}&formId={formId}&type=1&layoutid={layoutid}&{ypz}=$parentid$", "uf_jcl_bs", "笔试安排-新建模板", "ypz"))
|
||||
.build());
|
||||
|
||||
buttonList.add(OperateButtonPo.builder().buttonName("笔试结果登记").buttonAction("openDialog")
|
||||
.linkUrl(getModeLink("/spa/cube/index.html#/main/cube/card?modeId={modeId}&formId={formId}&type=1&layoutid={layoutid}&{ypz}=$parentid$", "uf_jcl_bs", "笔试结果-编辑模板", "ypz"))
|
||||
.build());
|
||||
|
||||
buttonList.add(OperateButtonPo.builder().buttonName("安排面试").buttonAction("openDialog")
|
||||
.linkUrl(getModeLink("/spa/cube/index.html#/main/cube/card?type=1&modeId={modeId}&formId={formId}&{ypz}=$parentid$", "uf_jcl_ms", "", "ypz"))
|
||||
.build());
|
||||
|
||||
buttonList.add(OperateButtonPo.builder().buttonName("背调结果登记").buttonAction("openDialog")
|
||||
.linkUrl(getModeLink("/spa/cube/index.html#/main/cube/card?type=1&modeId={modeId}&formId={formId}&{ypz}=6&recordType=addBackTone", "uf_jcl_bd", "", "ypz"))
|
||||
.build());
|
||||
|
||||
buttonList.add(OperateButtonPo.builder().buttonName("谈判记录登记").buttonAction("openDialog")
|
||||
.linkUrl(getModeLink("/spa/cube/index.html#/main/cube/card?type=1&modeId={modeId}&formId={formId}&{ypz}=$parentid$&recordType=addSalaryNegotiation", "uf_jcl_xctp", "", "ypz"))
|
||||
.build());
|
||||
|
||||
buttonList.add(OperateButtonPo.builder().buttonName("创建offer").buttonAction("openDialog")
|
||||
.linkUrl(getWorkFlowLink("/spa/workflow/index_form.jsp#/main/workflow/req?iscreate=1&workflowid={workflowid}&{xm}=$parentid$", "jcl_offer审批", "xm"))
|
||||
.build());
|
||||
|
||||
|
||||
buttonList.add(OperateButtonPo.builder().buttonName("转为待入职").buttonAction("openDialog")
|
||||
.linkUrl(getModeLink("/spa/cube/index.html#/main/cube/card?type=1&modeId={modeId}&formId={formId}&pcid=$parentid$", "uf_jcl_rzgl", "", ""))
|
||||
.build());
|
||||
|
||||
buttonList.add(OperateButtonPo.builder().buttonName("转移阶段").buttonAction("openDialog")
|
||||
.linkUrl(getModeLink("/spa/cube/index.html#/main/cube/card?billid=$parentid$&type=2&modeId={modeId}&formId={formId}&layoutid={layoutid}&guid=card&id=$parentid$", "uf_jcl_yppc", "转移阶段", ""))
|
||||
.build());
|
||||
|
||||
buttonList.add(OperateButtonPo.builder().buttonName("添加备注").buttonAction("openDialog")
|
||||
.linkUrl(getModeLink("/spa/cube/index.html#/main/cube/card?type=1&modeId={modeId}&formId={formId}&{ypz}=$parentid$", "uf_jcl_bz", "", "ypz"))
|
||||
.build());
|
||||
|
||||
return buttonList;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取阶段ID
|
||||
*
|
||||
* @param stageName
|
||||
* @return
|
||||
*/
|
||||
private String getStageIdByName(String stageName) {
|
||||
String stageId = null;
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select id from uf_jcl_zpjdsz where zplc =-1 and jdmc = ? ", stageName);
|
||||
if (rs.next()) {
|
||||
stageId = rs.getString("id");
|
||||
}
|
||||
return stageId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 完善查询相关URL
|
||||
*
|
||||
* @param url
|
||||
* @param tableName
|
||||
* @param customName
|
||||
* @return
|
||||
*/
|
||||
private String getModeSearchUrl(String url, String tableName, String customName) {
|
||||
String searchUrl = url;
|
||||
int modeId = ApplicantCommonInfo.getModeIdByTableName(tableName);
|
||||
int customId = ApplicantCommonInfo.getCustomId(modeId, customName);
|
||||
|
||||
searchUrl = searchUrl.replace("{customid}", String.valueOf(customId));
|
||||
|
||||
return searchUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* 动态完善建模相关URL
|
||||
*
|
||||
* @param url
|
||||
* @param tableName
|
||||
* @param layoutName
|
||||
* @param fieldName
|
||||
* @return
|
||||
*/
|
||||
private String getModeLink(String url, String tableName, String layoutName, String fieldName) {
|
||||
String modeLink = url;
|
||||
int modeId = ApplicantCommonInfo.getModeIdByTableName(tableName);
|
||||
int formId = ApplicantCommonInfo.getFormIdByTableName(tableName);
|
||||
modeLink = modeLink.replace("{modeId}", String.valueOf(modeId));
|
||||
modeLink = modeLink.replace("{formId}", String.valueOf(formId));
|
||||
|
||||
if (StringUtils.isNotBlank(layoutName)) {
|
||||
int layoutId = ApplicantCommonInfo.getLayoutId(modeId, layoutName);
|
||||
modeLink = modeLink.replace("{layoutid}", String.valueOf(layoutId));
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(fieldName)) {
|
||||
int fieldId = ApplicantCommonInfo.getFieldId(formId, fieldName);
|
||||
modeLink = modeLink.replace("{" + fieldName + "}", "field" + fieldId);
|
||||
}
|
||||
return modeLink;
|
||||
}
|
||||
|
||||
/**
|
||||
* 动态完善流程相关URL
|
||||
*
|
||||
* @param url
|
||||
* @param workflowName
|
||||
* @param fieldName
|
||||
* @return
|
||||
*/
|
||||
private String getWorkFlowLink(String url, String workflowName, String fieldName) {
|
||||
String workFlowLink = url;
|
||||
String workflowId = "";
|
||||
int formId = -1;
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select id,formid from workflow_base where workflowname = ? ", workflowName);
|
||||
if (rs.next()) {
|
||||
workflowId = rs.getString("id");
|
||||
formId = rs.getInt("formid");
|
||||
}
|
||||
workFlowLink = workFlowLink.replace("{workflowid}", workflowId);
|
||||
if (StringUtils.isNotBlank(fieldName)) {
|
||||
int fieldId = ApplicantCommonInfo.getFieldId(formId, fieldName);
|
||||
workFlowLink = workFlowLink.replace("{" + fieldName + "}", "field" + fieldId);
|
||||
}
|
||||
return workFlowLink;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package com.engine.recruit.wrapper;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.recruit.service.InitRecruitDataService;
|
||||
import com.engine.recruit.service.impl.InitRecruitDataServiceImpl;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/11/23
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class InitRecruitDataWrapper extends Service {
|
||||
private InitRecruitDataService getInitRecruitDataService(User user) {
|
||||
return ServiceUtil.getService(InitRecruitDataServiceImpl.class, user);
|
||||
}
|
||||
|
||||
public Map<String, Object> checkInitStatus() {
|
||||
return getInitRecruitDataService(user).checkInitStatus();
|
||||
}
|
||||
|
||||
public Map<String, Object> initRecruitData() {
|
||||
return getInitRecruitDataService(user).initRecruitData();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue