generated from dxfeng/secondev-chapanda-feishu
招聘阶段获取关联按钮接口
This commit is contained in:
parent
e60894828d
commit
31e67ea021
|
|
@ -0,0 +1,12 @@
|
|||
package com.api.recruit.controller;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/09/20
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Path("/jcl/recruit/recruitflow")
|
||||
public class RecruitFlowController extends com.engine.recruit.controller.RecruitFlowController{
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.engine.recruit.controller;
|
||||
|
||||
import com.engine.common.util.ParamUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.recruit.util.ResponseResult;
|
||||
import com.engine.recruit.wrapper.RecruitFlowWrapper;
|
||||
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/09/20
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class RecruitFlowController {
|
||||
public RecruitFlowWrapper getRecruitFlowWrapper(User user) {
|
||||
return ServiceUtil.getService(RecruitFlowWrapper.class, user);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/getButtonList")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getButtonList(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> params = ParamUtil.request2Map(request);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getRecruitFlowWrapper(user)::getButtonList, params);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package com.engine.recruit.entity.recruitflow.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 招聘流程按钮实体类
|
||||
*
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/09/25
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class RecruitButton {
|
||||
private String buttonName;
|
||||
private String tabName;
|
||||
private String tabLink;
|
||||
private String buttonKey;
|
||||
private String buttonAction;
|
||||
private Integer orderNum;
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.engine.recruit.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>聚才林招聘</p>
|
||||
* 招聘流程接口
|
||||
*
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/09/22
|
||||
* @version: 1.0
|
||||
*/
|
||||
public interface RecruitFlowService {
|
||||
/**
|
||||
* 获取当前阶段操作按钮
|
||||
*
|
||||
* @param params 参数
|
||||
* @return 操作按钮
|
||||
*/
|
||||
Map<String, Object> getButtonList(Map<String, Object> params);
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.engine.recruit.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.recruit.entity.recruitflow.po.RecruitButton;
|
||||
import com.engine.recruit.service.RecruitFlowService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/09/22
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class RecruitFlowServiceImpl extends Service implements RecruitFlowService {
|
||||
@Override
|
||||
public Map<String, Object> getButtonList(Map<String, Object> params) {
|
||||
Map<String, Object> returnMap = new HashMap<>();
|
||||
String modeId = Util.null2String(params.get("modeId"));
|
||||
String formId = Util.null2String(params.get("formId"));
|
||||
String billId = Util.null2String(params.get("billId"));
|
||||
|
||||
// 当前阶段
|
||||
String stageId = Util.null2String(params.get("stageId"));
|
||||
|
||||
//TODO 查询对应的招聘流程
|
||||
int zplcId = 2;
|
||||
List<RecruitButton> buttonList = new ArrayList<>();
|
||||
RecordSet rs = new RecordSet();
|
||||
if (StringUtils.isBlank(stageId)) {
|
||||
// 查询开始环节
|
||||
rs.executeQuery("select id from uf_jcl_zpjdsz where zplc = ? and hj = 0", zplcId);
|
||||
if (rs.next()) {
|
||||
stageId = rs.getString("id");
|
||||
}
|
||||
if (StringUtils.isBlank(stageId)) {
|
||||
throw new RuntimeException("未找到对应招聘阶段");
|
||||
}
|
||||
}
|
||||
rs.executeQuery("select a.zdyxsmc as buttonName, a.tzymbt as tabName, a.tzymdz as tabLink, a.zssx as orderNum, b.anbs as buttonKey, b.andz as buttonAction from uf_jcl_zpjdsz_dt1 a inner join uf_jcl_lcczan b on a.czan = b.id where a.sfqy = 0 and mainid = ? order by zssx", stageId);
|
||||
while (rs.next()) {
|
||||
buttonList.add(RecruitButton.builder()
|
||||
.buttonName(rs.getString("buttonName"))
|
||||
.tabName(rs.getString("tabName"))
|
||||
.tabLink(rs.getString("tabLink"))
|
||||
.buttonKey(rs.getString("buttonKey"))
|
||||
.buttonAction(rs.getString("buttonAction"))
|
||||
.orderNum(rs.getInt("orderNum"))
|
||||
.build());
|
||||
}
|
||||
|
||||
// 当前阶段所有按钮信息
|
||||
returnMap.put("buttonList", buttonList);
|
||||
return returnMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.engine.recruit.wrapper;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.recruit.service.RecruitFlowService;
|
||||
import com.engine.recruit.service.impl.RecruitFlowServiceImpl;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/09/20
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class RecruitFlowWrapper extends Service {
|
||||
private RecruitFlowService getRecruitFlowService(User user) {
|
||||
return ServiceUtil.getService(RecruitFlowServiceImpl.class, user);
|
||||
}
|
||||
|
||||
public Map<String, Object> getButtonList(Map<String, Object> params) {
|
||||
return getRecruitFlowService(user).getButtonList(params);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue