新增-前段菜单链接更新功能

This commit is contained in:
dxfeng 2024-01-08 11:31:27 +08:00
parent 46d5b57424
commit da197e3bcf
1 changed files with 143 additions and 4 deletions

View File

@ -10,11 +10,9 @@ import com.engine.recruit.service.InitRecruitDataService;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.formmode.recruit.modeexpand.process.StageDataInsert;
import weaver.general.BaseBean;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -42,6 +40,8 @@ public class InitRecruitDataServiceImpl extends Service implements InitRecruitDa
rs.executeUpdate("delete from uf_jcl_zpjdsz_dt1;");
rs.executeUpdate("delete from uf_jcl_zpjdsz_dt2;");
rs.executeUpdate("delete from uf_jcl_lcczan;");
// 刷新页面菜单
refreshMenuUrl();
// 插入操作按钮数据
int buttonModeId = ApplicantCommonInfo.getModeIdByTableName("uf_jcl_lcczan");
@ -61,6 +61,145 @@ public class InitRecruitDataServiceImpl extends Service implements InitRecruitDa
return null;
}
/**
* 更新招聘管理相关菜单地址
*/
private void refreshMenuUrl() {
Map<String, String> searchCodeMap = new HashMap<>();
searchCodeMap.put("招聘需求管理", "b129634bf72d46b8bed0291f84efd2e0");
searchCodeMap.put("招聘职位", "c024e527c964437bb568bebbb48d89a5");
searchCodeMap.put("应聘者", "1d48211cd1634b19bdc6f7df40cd1337");
searchCodeMap.put("筛选反馈", "b746e3cf80454289a3ade2b17147e297");
searchCodeMap.put("笔试结果", "1b56a7492fb84f2b9e5ae022fde333f0");
searchCodeMap.put("面试", "496ecc32a87045888f224ad3151e635b");
searchCodeMap.put("薪酬谈判", "ffe1bafcef5942f5853e68b76e5098d2");
searchCodeMap.put("背调", "33be832e81eb4cf5a5686213918e769b");
searchCodeMap.put("offer", "4d4d8f9761474333907bacb81d98fc3c");
searchCodeMap.put("人才库", "bdeb379900e5475c87306862dfb9d0b9");
searchCodeMap.put("简历库", "9bc41dbc69ee43a1976910008d7fdfe3");
searchCodeMap.put("工作地点", "af9c9eee65a84e82bf3a423506ef1f38");
searchCodeMap.put("数据字典类型名称", "034d7bcea5634e458854a1c70580ca6d");
searchCodeMap.put("邮件通知模板", "ea3b7ae0e3134c65be740eee629070af");
searchCodeMap.put("千里聆邮箱配置", "a97c0154ea5b43c8b17fc7a1dfdb195f");
searchCodeMap.put("我参与的面试", "b8c509d648124c068f11fca338b2eea2");
searchCodeMap.put("招聘流程列表", "32cea1924ceb45d8aa8622dbdf935a58");
searchCodeMap.put("招聘阶段列表", "06443dd4afa84831ae9d9c1b76450313");
searchCodeMap.put("操作按钮列表", "e14a2ce232d844239c00a0b3ead1af04");
Map<String, String> customPageMap = new HashMap<>();
customPageMap.put("入职管理", "126b5994-68d0-11ee-b71a-000c2989f365");
Map<String, String> customTreeMap = new HashMap<>();
customTreeMap.put("数据字典树", "31717568fca8435f9e55eb08c1fbed4b");
List<String> menuSqlList = new ArrayList<>();
// 招聘需求
menuSqlList.add("update LeftMenuInfo set fullrouteurl = '/spa/cube/index.html#/main/cube/search?customid=" + getCustomSearchId(searchCodeMap.get("招聘需求管理")) + "' where id = " + 100189);
// 招聘职位
menuSqlList.add("update LeftMenuInfo set fullrouteurl = '/spa/cube/index.html#/main/cube/search?customid=" + getCustomSearchId(searchCodeMap.get("招聘职位")) + "' where id = " + 100190);
// 应聘者
menuSqlList.add("update LeftMenuInfo set fullrouteurl = '/spa/cube/index.html#/main/cube/search?customid=" + getCustomSearchId(searchCodeMap.get("应聘者")) + "' where id = " + 100192);
// 部门筛选
menuSqlList.add("update LeftMenuInfo set fullrouteurl = '/spa/cube/index.html#/main/cube/search?customid=" + getCustomSearchId(searchCodeMap.get("筛选反馈")) + "' where id = " + 100193);
// 笔试
menuSqlList.add("update LeftMenuInfo set fullrouteurl = '/spa/cube/index.html#/main/cube/search?customid=" + getCustomSearchId(searchCodeMap.get("笔试结果")) + "' where id = " + 100194);
// 面试
menuSqlList.add("update LeftMenuInfo set fullrouteurl = '/spa/cube/index.html#/main/cube/search?customid=" + getCustomSearchId(searchCodeMap.get("面试")) + "' where id = " + 100195);
// 薪酬谈判
menuSqlList.add("update LeftMenuInfo set fullrouteurl = '/spa/cube/index.html#/main/cube/search?customid=" + getCustomSearchId(searchCodeMap.get("薪酬谈判")) + "' where id = " + 100196);
// 背调
menuSqlList.add("update LeftMenuInfo set fullrouteurl = '/spa/cube/index.html#/main/cube/search?customid=" + getCustomSearchId(searchCodeMap.get("背调")) + "' where id = " + 100197);
// offer
menuSqlList.add("update LeftMenuInfo set fullrouteurl = '/spa/cube/index.html#/main/cube/search?customid=" + getCustomSearchId(searchCodeMap.get("offer")) + "' where id = " + 100198);
// 人才库
menuSqlList.add("update LeftMenuInfo set fullrouteurl = '/spa/cube/index.html#/main/cube/search?customid=" + getCustomSearchId(searchCodeMap.get("人才库")) + "' where id = " + 100200);
// 简历库
menuSqlList.add("update LeftMenuInfo set fullrouteurl = '/spa/cube/index.html#/main/cube/search?customid=" + getCustomSearchId(searchCodeMap.get("简历库")) + "' where id = " + 100201);
// 工作地点
menuSqlList.add("update LeftMenuInfo set fullrouteurl = '/spa/cube/index.html#/main/cube/search?customid=" + getCustomSearchId(searchCodeMap.get("工作地点")) + "' where id = " + 100203);
// 字段类型名称
menuSqlList.add("update LeftMenuInfo set fullrouteurl = '/spa/cube/index.html#/main/cube/search?customid=" + getCustomSearchId(searchCodeMap.get("数据字典类型名称")) + "' where id = " + 100205);
// 邮件通知模板
menuSqlList.add("update LeftMenuInfo set fullrouteurl = '/spa/cube/index.html#/main/cube/search?customid=" + getCustomSearchId(searchCodeMap.get("邮件通知模板")) + "' where id = " + 100206);
// 千里聆邮箱配置
menuSqlList.add("update LeftMenuInfo set fullrouteurl = '/spa/cube/index.html#/main/cube/search?customid=" + getCustomSearchId(searchCodeMap.get("千里聆邮箱配置")) + "' where id = " + 100207);
// 招聘需求
menuSqlList.add("update LeftMenuInfo set fullrouteurl = '/spa/cube/index.html#/main/cube/search?customid=" + getCustomSearchId(searchCodeMap.get("招聘需求管理")) + "' where id = " + 100209);
// 我的筛选
menuSqlList.add("update LeftMenuInfo set fullrouteurl = '/spa/cube/index.html#/main/cube/search?customid=" + getCustomSearchId(searchCodeMap.get("筛选反馈")) + "' where id = " + 100210);
// 我的面试
menuSqlList.add("update LeftMenuInfo set fullrouteurl = '/spa/cube/index.html#/main/cube/search?customid=" + getCustomSearchId(searchCodeMap.get("我参与的面试")) + "' where id = " + 100211);
// 招聘流程
menuSqlList.add("update LeftMenuInfo set fullrouteurl = '/spa/cube/index.html#/main/cube/search?customid=" + getCustomSearchId(searchCodeMap.get("招聘流程列表")) + "' where id = " + 100213);
// 招聘阶段
menuSqlList.add("update LeftMenuInfo set fullrouteurl = '/spa/cube/index.html#/main/cube/search?customid=" + getCustomSearchId(searchCodeMap.get("招聘阶段列表")) + "' where id = " + 100214);
// 操作按钮
menuSqlList.add("update LeftMenuInfo set fullrouteurl = '/spa/cube/index.html#/main/cube/search?customid=" + getCustomSearchId(searchCodeMap.get("操作按钮列表")) + "' where id = " + 100215);
// 入职管理
menuSqlList.add("update LeftMenuInfo set fullrouteurl= '/spa/cube/index.html#/main/cube/viewCustomPage?id=" + getCustomPageId(customPageMap.get("入职管理")) + "&noTitleShow=1' where id = " + 100199);
// 数据字典
menuSqlList.add("update LeftMenuInfo set fullrouteurl= '/spa/cube/index.html#/main/cube/tree?id=" + getCustomTreeId(customTreeMap.get("数据字典树")) + "&noTitleShow=1' where id = " + 100204);
RecordSet rs = new RecordSet();
for (String sql : menuSqlList) {
new BaseBean().writeLog("招聘目录初始化SQL==" + sql);
rs.executeUpdate(sql);
}
}
/**
* 获取建模查询列表ID
*
* @param customSearchCode
* @return
*/
private String getCustomSearchId(String customSearchCode) {
RecordSet rs = new RecordSet();
rs.executeQuery("select id from mode_customsearch where customsearchcode = ? ", customSearchCode);
if (rs.next()) {
return rs.getString("id");
}
throw new CustomizeRunTimeException("招聘管理菜单初始化失败,请检查建模引擎查询列表配置[" + customSearchCode + "]");
}
/**
* 获取建模自定义页面ID
*
* @param cubeUuid
* @return
*/
private String getCustomPageId(String cubeUuid) {
RecordSet rs = new RecordSet();
rs.executeQuery("select id from mode_custompage where cubeuuid =? ", cubeUuid);
if (rs.next()) {
return rs.getString("id");
}
throw new CustomizeRunTimeException("招聘管理菜单初始化失败,请检查建模引擎自定义页面配置[" + cubeUuid + "]");
}
/**
* 获取建模树ID
*
* @param treeCode
* @return
*/
private String getCustomTreeId(String treeCode) {
RecordSet rs = new RecordSet();
rs.executeQuery("select id from mode_customtree where treecode =? ", treeCode);
if (rs.next()) {
return rs.getString("id");
}
throw new CustomizeRunTimeException("招聘管理菜单初始化失败,请检查建模引擎树配置[" + treeCode + "]");
}
/**
* 插入初始化流程数据
*
* @param baseMap
* @param modeId
*/
private void insertFlowData(Map<String, Object> baseMap, int modeId) {
OperateFlowPo flowPo = OperateFlowPo.builder()
.lcmc("默认流程")