generated from dxfeng/secondev-chapanda-feishu
江苏新视云 BOSS直聘,职位类别
This commit is contained in:
parent
130ef4b117
commit
3d22e13a29
|
|
@ -9,6 +9,7 @@ import weaver.hrm.User;
|
|||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
|
|
@ -34,4 +35,13 @@ public class RecruitPositionController {
|
|||
Map<String, Object> param = ParamUtil.request2Map(request);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getRecruitPositionWrapper(user)::updatePostInfo, param);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/createPositionType")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String createPositionType(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> param = ParamUtil.request2Map(request);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getRecruitPositionWrapper(user)::createPositionType, param);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,4 +17,12 @@ public interface RecruitPositionService {
|
|||
*/
|
||||
Map<String, Object> updatePostInfo(Map<String, Object> param);
|
||||
|
||||
|
||||
/**
|
||||
* 生成职位类型
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> createPositionType(Map<String, Object> param);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,22 @@
|
|||
package com.engine.recruit.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.recruit.conn.RecruitDataMap;
|
||||
import com.engine.recruit.conn.RecruitRecordSet;
|
||||
import com.engine.recruit.exception.CustomizeRunTimeException;
|
||||
import com.engine.recruit.service.RecruitPositionService;
|
||||
import com.weaver.formmodel.util.DateHelper;
|
||||
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;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
|
|
@ -35,4 +43,87 @@ public class RecruitPositionServiceImpl extends Service implements RecruitPositi
|
|||
}
|
||||
return returnMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> createPositionType(Map<String, Object> param) {
|
||||
RecordSet rs = new RecordSet();
|
||||
ERPAResumeSDKClient client = ERPASDKClients.getResumeSDKClient();
|
||||
ResumeJobDynamicField resumeJobDynamicField = client.getResumeJobDynamicField();
|
||||
List<ResumeJobDynamicField.Item> boss_type = (List<ResumeJobDynamicField.Item>) resumeJobDynamicField.getBoss_type();
|
||||
|
||||
String currentDate = DateHelper.getCurrentDate();
|
||||
String currentTime = DateHelper.getCurrentTime();
|
||||
String currentDateTime = DateHelper.getCurDateTime();
|
||||
// 插入主表数据
|
||||
Map<String, Object> mainDataMap = new RecruitDataMap<>();
|
||||
mainDataMap.put("SELECTITEMNAME", "BOSS直聘职位类别");
|
||||
mainDataMap.put("CREATER", "1");
|
||||
mainDataMap.put("CREATEDATE", currentDate);
|
||||
mainDataMap.put("CREATETIME", currentTime);
|
||||
mainDataMap.put("APPID", 0);
|
||||
mainDataMap.put("UUID", UUID.randomUUID().toString());
|
||||
mainDataMap.put("OPERATETIME", currentDateTime);
|
||||
RecruitRecordSet.insertData(mainDataMap, "mode_selectitempage");
|
||||
rs.executeQuery("select max(id) as id from mode_selectitempage ");
|
||||
String mainId = "";
|
||||
if (rs.next()) {
|
||||
mainId = rs.getString("id");
|
||||
}
|
||||
if (StringUtils.isBlank(mainId)) {
|
||||
throw new CustomizeRunTimeException("BOSS直聘职位类别,数据插入异常");
|
||||
}
|
||||
|
||||
for (ResumeJobDynamicField.Item topItem : boss_type) {
|
||||
// 插入第一层数据
|
||||
RecruitDataMap<Object> topMap = buildPageDetailMap(mainId, "0", topItem.getLabel(), 1);
|
||||
RecruitRecordSet.insertData(topMap, "mode_selectitempagedetail");
|
||||
rs.executeQuery("select max(id) as id from mode_selectitempagedetail ");
|
||||
String topId = "";
|
||||
if (rs.next()) {
|
||||
topId = rs.getString("id");
|
||||
}
|
||||
if (StringUtils.isBlank(topId)) {
|
||||
throw new CustomizeRunTimeException("BOSS直聘职位类别,一级数据插入异常");
|
||||
}
|
||||
|
||||
List<ResumeJobDynamicField.Item> secondItemList = (List<ResumeJobDynamicField.Item>) topItem.getChildren();
|
||||
for (ResumeJobDynamicField.Item secondItem : secondItemList) {
|
||||
// 插入第二层数据
|
||||
RecruitDataMap<Object> secondMap = buildPageDetailMap(mainId, topId, secondItem.getLabel(), 2);
|
||||
RecruitRecordSet.insertData(secondMap, "mode_selectitempagedetail");
|
||||
rs.executeQuery("select max(id) as id from mode_selectitempagedetail ");
|
||||
String secondId = "";
|
||||
if (rs.next()) {
|
||||
secondId = rs.getString("id");
|
||||
}
|
||||
if (StringUtils.isBlank(secondId)) {
|
||||
throw new CustomizeRunTimeException("BOSS直聘职位类别,二级数据插入异常");
|
||||
}
|
||||
|
||||
List<ResumeJobDynamicField.Item> thirdItemList = (List<ResumeJobDynamicField.Item>) secondItem.getChildren();
|
||||
for (ResumeJobDynamicField.Item thirdItem : thirdItemList) {
|
||||
// 插入第三层数据
|
||||
RecruitDataMap<Object> thirdMap = buildPageDetailMap(mainId, secondId, thirdItem.getLabel(), 3);
|
||||
RecruitRecordSet.insertData(thirdMap, "mode_selectitempagedetail");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private RecruitDataMap<Object> buildPageDetailMap(String mainId, String pId, String name, int stateLev) {
|
||||
RecruitDataMap<Object> map = new RecruitDataMap<>();
|
||||
map.put("MAINID", mainId);
|
||||
map.put("NAME", name);
|
||||
map.put("DISORDER", 0);
|
||||
map.put("MAINCATEGORY", "-1,-1,-1");
|
||||
map.put("ISACCORDTOSUBCOM", 0);
|
||||
map.put("PID", pId);
|
||||
map.put("STATELEV", stateLev);
|
||||
map.put("CANCEL", 0);
|
||||
map.put("UUID", UUID.randomUUID().toString());
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,4 +21,8 @@ public class RecruitPositionWrapper extends Service {
|
|||
public Map<String, Object> updatePostInfo(Map<String, Object> param) {
|
||||
return getRecruitPositionService(user).updatePostInfo(param);
|
||||
}
|
||||
|
||||
public Map<String, Object> createPositionType(Map<String, Object> param) {
|
||||
return getRecruitPositionService(user).createPositionType(param);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue