2023-10-10 09:28:06 +08:00
|
|
|
|
package com.engine.recruit.service.impl;
|
|
|
|
|
|
|
2024-04-07 11:25:16 +08:00
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
|
import com.api.browser.bean.SearchConditionGroup;
|
|
|
|
|
|
import com.api.browser.bean.SearchConditionItem;
|
2023-10-10 09:28:06 +08:00
|
|
|
|
import com.engine.core.impl.Service;
|
|
|
|
|
|
import com.engine.recruit.exception.CustomizeRunTimeException;
|
|
|
|
|
|
import com.engine.recruit.service.RecruitPositionService;
|
2024-04-08 09:08:37 +08:00
|
|
|
|
import com.engine.recruit.util.RecruitFormItemUtil;
|
2024-04-07 11:25:16 +08:00
|
|
|
|
import com.weaver.rpa.sdk.clients.application.resume.ERPAResumeSDKClient;
|
|
|
|
|
|
import com.weaver.rpa.sdk.clients.application.resume.entity.ResumeJobDynamicField;
|
|
|
|
|
|
import com.weaver.rpa.sdk.clients.core.ERPASDKClients;
|
2023-10-10 09:28:06 +08:00
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
|
import weaver.conn.RecordSet;
|
|
|
|
|
|
import weaver.general.Util;
|
|
|
|
|
|
|
2024-04-07 11:25:16 +08:00
|
|
|
|
import java.util.ArrayList;
|
2023-10-10 09:28:06 +08:00
|
|
|
|
import java.util.HashMap;
|
2024-04-07 11:25:16 +08:00
|
|
|
|
import java.util.List;
|
2023-10-10 09:28:06 +08:00
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* @author:dxfeng
|
|
|
|
|
|
* @createTime: 2023/10/09
|
|
|
|
|
|
* @version: 1.0
|
|
|
|
|
|
*/
|
|
|
|
|
|
public class RecruitPositionServiceImpl extends Service implements RecruitPositionService {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public Map<String, Object> updatePostInfo(Map<String, Object> param) {
|
|
|
|
|
|
Map<String, Object> returnMap = new HashMap<>();
|
|
|
|
|
|
String zpzwfzr = Util.null2String(param.get("zpzwfzr"));
|
|
|
|
|
|
String zpxzr = Util.null2String(param.get("zpxzr"));
|
|
|
|
|
|
String ids = Util.null2String(param.get("ids"));
|
|
|
|
|
|
if (StringUtils.isBlank(ids)) {
|
|
|
|
|
|
throw new CustomizeRunTimeException("数据有误,请重试");
|
|
|
|
|
|
}
|
|
|
|
|
|
RecordSet rs = new RecordSet();
|
2023-11-16 10:01:27 +08:00
|
|
|
|
if (StringUtils.isNotBlank(zpzwfzr)) {
|
|
|
|
|
|
rs.executeUpdate(" update uf_jcl_zp_zpzw set zpzwfzr = ? where id in (" + ids + ")", zpzwfzr);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isNotBlank(zpxzr)) {
|
|
|
|
|
|
rs.executeUpdate(" update uf_jcl_zp_zpzw set zpxzr = ? where id in (" + ids + ")", zpxzr);
|
|
|
|
|
|
}
|
2023-10-10 09:28:06 +08:00
|
|
|
|
return returnMap;
|
|
|
|
|
|
}
|
2024-04-07 11:25:16 +08:00
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
public Map<String, Object> getFormCondition(Map<String, Object> param) {
|
|
|
|
|
|
Map<String, Object> apidatas = new HashMap<>();
|
|
|
|
|
|
apidatas.put("hasRight", true);
|
2024-04-16 17:13:16 +08:00
|
|
|
|
String conditionType = Util.null2String(param.get("conditionType"));
|
|
|
|
|
|
String selectValue = Util.null2String(param.get("selectValue"));
|
|
|
|
|
|
|
2024-04-07 11:25:16 +08:00
|
|
|
|
|
2024-04-08 09:08:37 +08:00
|
|
|
|
ERPAResumeSDKClient client = ERPASDKClients.getResumeSDKClient();
|
|
|
|
|
|
ResumeJobDynamicField resumeJobDynamicField = client.getResumeJobDynamicField();
|
2024-04-07 11:25:16 +08:00
|
|
|
|
|
2024-04-16 17:13:16 +08:00
|
|
|
|
// 获取职位类别表单
|
|
|
|
|
|
if ("positionType".equals(conditionType)) {
|
|
|
|
|
|
String dsfqd = Util.null2String(param.get("dsfqd"));
|
|
|
|
|
|
getPositionTypeForm(dsfqd, selectValue, apidatas, resumeJobDynamicField);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 前程无忧-发布城市
|
|
|
|
|
|
if ("job51City".equals(conditionType)) {
|
|
|
|
|
|
getJob51CityForm(selectValue, apidatas, resumeJobDynamicField);
|
|
|
|
|
|
}
|
|
|
|
|
|
return apidatas;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 获取职位类别表单
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param selectValue
|
|
|
|
|
|
* @param apidatas
|
|
|
|
|
|
* @param resumeJobDynamicField
|
|
|
|
|
|
*/
|
|
|
|
|
|
private void getPositionTypeForm(String dsfqd, String selectValue, Map<String, Object> apidatas, ResumeJobDynamicField resumeJobDynamicField) {
|
|
|
|
|
|
String[] split = selectValue.split("#");
|
|
|
|
|
|
Map<String, String> selectValueMap = new HashMap<>();
|
|
|
|
|
|
for (String s : split) {
|
|
|
|
|
|
String[] split1 = s.split(":");
|
|
|
|
|
|
if (split1.length == 2) {
|
|
|
|
|
|
selectValueMap.put(split1[0], split1[1]);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-04-07 11:25:16 +08:00
|
|
|
|
//输入框类
|
|
|
|
|
|
List<SearchConditionItem> inputItems = new ArrayList<>();
|
|
|
|
|
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
2024-04-16 17:13:16 +08:00
|
|
|
|
|
|
|
|
|
|
if (dsfqd.contains("0")) {
|
|
|
|
|
|
List<ResumeJobDynamicField.Item> boss_type = (List<ResumeJobDynamicField.Item>) resumeJobDynamicField.getBoss_type();
|
|
|
|
|
|
String bossType = convertPositionType(boss_type, selectValueMap.get("BOSS直聘"));
|
|
|
|
|
|
SearchConditionItem bossItem = RecruitFormItemUtil.cascaderItem(user, 1, 18, 3, "BOSS直聘", "boss");
|
|
|
|
|
|
bossItem.setRules("required");
|
|
|
|
|
|
bossItem.setViewAttr(3);
|
|
|
|
|
|
bossItem.setCompDef(JSON.parseObject(bossType));
|
|
|
|
|
|
inputItems.add(bossItem);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (dsfqd.contains("4")) {
|
|
|
|
|
|
List<ResumeJobDynamicField.Item> liepin_type = (List<ResumeJobDynamicField.Item>) resumeJobDynamicField.getLiepin_type();
|
|
|
|
|
|
String liepinType = convertPositionType(liepin_type, selectValueMap.get("猎聘"));
|
|
|
|
|
|
SearchConditionItem liepinItem = RecruitFormItemUtil.cascaderItem(user, 1, 18, 3, "猎聘", "liepin");
|
|
|
|
|
|
liepinItem.setCompDef(JSON.parseObject(liepinType));
|
|
|
|
|
|
liepinItem.setRules("required");
|
|
|
|
|
|
liepinItem.setViewAttr(3);
|
|
|
|
|
|
inputItems.add(liepinItem);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (dsfqd.contains("3")) {
|
|
|
|
|
|
List<ResumeJobDynamicField.Item> lagou_type = (List<ResumeJobDynamicField.Item>) resumeJobDynamicField.getLagou_type();
|
|
|
|
|
|
String lagouType = convertPositionType(lagou_type, selectValueMap.get("拉勾"));
|
|
|
|
|
|
SearchConditionItem lagouItem = RecruitFormItemUtil.cascaderItem(user, 1, 18, 3, "拉勾", "lagou");
|
|
|
|
|
|
lagouItem.setCompDef(JSON.parseObject(lagouType));
|
|
|
|
|
|
lagouItem.setRules("required");
|
|
|
|
|
|
lagouItem.setViewAttr(3);
|
|
|
|
|
|
inputItems.add(lagouItem);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (dsfqd.contains("2")) {
|
|
|
|
|
|
List<ResumeJobDynamicField.Item> job51_type = (List<ResumeJobDynamicField.Item>) resumeJobDynamicField.getJob51_type();
|
|
|
|
|
|
String job51Type = convertPositionType(job51_type, selectValueMap.get("前程无忧"));
|
|
|
|
|
|
SearchConditionItem job51Item = RecruitFormItemUtil.cascaderItem(user, 1, 18, 3, "前程无忧", "job51");
|
|
|
|
|
|
job51Item.setCompDef(JSON.parseObject(job51Type));
|
|
|
|
|
|
job51Item.setRules("required");
|
|
|
|
|
|
job51Item.setViewAttr(3);
|
|
|
|
|
|
inputItems.add(job51Item);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (dsfqd.contains("1")) {
|
|
|
|
|
|
List<ResumeJobDynamicField.Item> zhilian_type = (List<ResumeJobDynamicField.Item>) resumeJobDynamicField.getZhilian_type();
|
|
|
|
|
|
String zhilianType = convertPositionType(zhilian_type, selectValueMap.get("智联"));
|
|
|
|
|
|
SearchConditionItem zhilianItem = RecruitFormItemUtil.cascaderItem(user, 1, 18, 3, "智联", "zhilian");
|
|
|
|
|
|
zhilianItem.setCompDef(JSON.parseObject(zhilianType));
|
|
|
|
|
|
zhilianItem.setRules("required");
|
|
|
|
|
|
zhilianItem.setViewAttr(3);
|
|
|
|
|
|
inputItems.add(zhilianItem);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
addGroups.add(new SearchConditionGroup("职位类别", true, inputItems));
|
|
|
|
|
|
apidatas.put("condition", addGroups);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void getJob51CityForm(String selectValue, Map<String, Object> apidatas, ResumeJobDynamicField resumeJobDynamicField) {
|
|
|
|
|
|
String[] split = selectValue.split("#");
|
|
|
|
|
|
Map<String, String> selectValueMap = new HashMap<>();
|
|
|
|
|
|
for (String s : split) {
|
|
|
|
|
|
String[] split1 = s.split(":");
|
|
|
|
|
|
if (split1.length == 2) {
|
|
|
|
|
|
selectValueMap.put(split1[0], split1[1]);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//输入框类
|
|
|
|
|
|
List<SearchConditionItem> inputItems = new ArrayList<>();
|
|
|
|
|
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-08 09:08:37 +08:00
|
|
|
|
List<ResumeJobDynamicField.Item> boss_type = (List<ResumeJobDynamicField.Item>) resumeJobDynamicField.getBoss_type();
|
2024-04-16 17:13:16 +08:00
|
|
|
|
String bossType = convertPositionType(boss_type, selectValueMap.get("BOSS直聘"));
|
|
|
|
|
|
SearchConditionItem bossItem = RecruitFormItemUtil.cascaderItem(user, 1, 18, 3, "前程无忧", "job51City");
|
2024-04-08 09:08:37 +08:00
|
|
|
|
bossItem.setRules("required");
|
|
|
|
|
|
bossItem.setViewAttr(3);
|
|
|
|
|
|
bossItem.setCompDef(JSON.parseObject(bossType));
|
|
|
|
|
|
inputItems.add(bossItem);
|
|
|
|
|
|
|
|
|
|
|
|
addGroups.add(new SearchConditionGroup("职位类别", true, inputItems));
|
|
|
|
|
|
apidatas.put("condition", addGroups);
|
|
|
|
|
|
}
|
2024-04-07 11:25:16 +08:00
|
|
|
|
|
2024-04-08 09:08:37 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 构建职位类型,级联组件数据
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param typeList
|
|
|
|
|
|
* @return
|
|
|
|
|
|
*/
|
2024-04-16 17:13:16 +08:00
|
|
|
|
private String convertPositionType(List<ResumeJobDynamicField.Item> typeList, String selectValue) {
|
|
|
|
|
|
String[] split = Util.null2String(selectValue).split("-");
|
|
|
|
|
|
String first = "";
|
|
|
|
|
|
String second = "";
|
|
|
|
|
|
String third = "";
|
|
|
|
|
|
if (split.length == 3) {
|
|
|
|
|
|
first = split[0];
|
|
|
|
|
|
second = split[1];
|
|
|
|
|
|
third = split[2];
|
|
|
|
|
|
}
|
2024-04-08 09:08:37 +08:00
|
|
|
|
StringBuffer sb = new StringBuffer();
|
2024-04-07 11:25:16 +08:00
|
|
|
|
sb.append("{\n" +
|
|
|
|
|
|
" type: 'select',\n" +
|
2024-04-08 09:08:37 +08:00
|
|
|
|
" customProps: {'*':{viewAttr:3,rules:'required'}},\n" +
|
2024-04-07 11:25:16 +08:00
|
|
|
|
|
2024-04-08 09:08:37 +08:00
|
|
|
|
" key: 'one',\n" +
|
|
|
|
|
|
//" viewAttr: 3,\n" +
|
|
|
|
|
|
" style: {\n" +
|
|
|
|
|
|
" 'width': '120px'\n" +
|
|
|
|
|
|
" },\n" +
|
|
|
|
|
|
" options: [\n");
|
|
|
|
|
|
for (ResumeJobDynamicField.Item item : typeList) {
|
|
|
|
|
|
String j_typeId = item.getValue();
|
|
|
|
|
|
String j_typeName = item.getLabel();
|
|
|
|
|
|
sb.append(" {\n" +
|
|
|
|
|
|
" key: \"" + j_typeId + "\",\n" +
|
2024-04-16 17:13:16 +08:00
|
|
|
|
//" selected: false,\n" +
|
|
|
|
|
|
" selected: " + first.equals(j_typeName) + ",\n" +
|
2024-04-08 09:08:37 +08:00
|
|
|
|
" showname: \"" + j_typeName + "\"\n" +
|
|
|
|
|
|
" },\n");
|
|
|
|
|
|
}
|
|
|
|
|
|
sb.append(
|
|
|
|
|
|
" ],\n" +
|
|
|
|
|
|
" subChildren: {\n");
|
|
|
|
|
|
for (ResumeJobDynamicField.Item item : typeList) {
|
|
|
|
|
|
String j_type = item.getValue();
|
|
|
|
|
|
sb.append(" \"" + j_type + "\": {\n" +
|
|
|
|
|
|
" type: 'select',\n" +
|
|
|
|
|
|
" key: 'two',\n" +
|
|
|
|
|
|
" style: {\n" +
|
|
|
|
|
|
" 'width': '120px'\n" +
|
|
|
|
|
|
" },\n" +
|
|
|
|
|
|
" options: [\n");
|
|
|
|
|
|
List<ResumeJobDynamicField.Item> childrenList = (List<ResumeJobDynamicField.Item>) item.getChildren();
|
|
|
|
|
|
for (ResumeJobDynamicField.Item child : childrenList) {
|
|
|
|
|
|
String j_typeId = child.getValue();
|
|
|
|
|
|
String j_typeName = child.getLabel();
|
|
|
|
|
|
sb.append(" {\n" +
|
|
|
|
|
|
" key: \"" + j_typeId + "\",\n" +
|
|
|
|
|
|
" selected: false,\n" +
|
2024-04-16 17:13:16 +08:00
|
|
|
|
" selected: " + second.equals(j_typeName) + ",\n" +
|
2024-04-08 09:08:37 +08:00
|
|
|
|
" showname: \"" + j_typeName + "\"\n" +
|
|
|
|
|
|
" },\n");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sb.append("],\n subChildren:{\n");
|
|
|
|
|
|
for (ResumeJobDynamicField.Item child : childrenList) {
|
|
|
|
|
|
sb.append(" \"" + child.getValue() + "\": {\n");
|
|
|
|
|
|
sb.append("type:'select',\n");
|
|
|
|
|
|
sb.append("key:'three',\n");
|
|
|
|
|
|
sb.append("style:{ 'width': '120px' },\n");
|
|
|
|
|
|
sb.append("options: [\n");
|
|
|
|
|
|
List<ResumeJobDynamicField.Item> childChildren = (List<ResumeJobDynamicField.Item>) child.getChildren();
|
|
|
|
|
|
for (ResumeJobDynamicField.Item childChild : childChildren) {
|
|
|
|
|
|
String j_typeId = childChild.getValue();
|
|
|
|
|
|
String j_typeName = childChild.getLabel();
|
|
|
|
|
|
sb.append(" {\n" +
|
|
|
|
|
|
" key: \"" + j_typeId + "\",\n" +
|
2024-04-16 17:13:16 +08:00
|
|
|
|
//" selected: false,\n" +
|
|
|
|
|
|
" selected: " + third.equals(j_typeName) + ",\n" +
|
2024-04-08 09:08:37 +08:00
|
|
|
|
" showname: \"" + j_typeName + "\"\n" +
|
|
|
|
|
|
" },\n");
|
|
|
|
|
|
}
|
|
|
|
|
|
sb.append("],\n");
|
|
|
|
|
|
//sb.append("multiple: 'false'\n");
|
|
|
|
|
|
sb.append("},");
|
|
|
|
|
|
}
|
|
|
|
|
|
sb.append(" }\n");
|
|
|
|
|
|
sb.append(" } ,\n");
|
|
|
|
|
|
}
|
|
|
|
|
|
sb.append(" }\n" +
|
|
|
|
|
|
" }");
|
|
|
|
|
|
return sb.toString();
|
2024-04-07 11:25:16 +08:00
|
|
|
|
}
|
2023-10-10 09:28:06 +08:00
|
|
|
|
}
|