generated from dxfeng/secondev-chapanda-feishu
招聘流程,页面布局,按钮实践接口开发
This commit is contained in:
parent
fee1614a53
commit
95c755a0ce
|
|
@ -17,4 +17,5 @@ import lombok.NoArgsConstructor;
|
|||
public class RecruitStepPo {
|
||||
private int key;
|
||||
private String description;
|
||||
private String type;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,9 +29,6 @@ public class RecruitTabPo {
|
|||
private String billId;
|
||||
|
||||
public String getUrl() {
|
||||
if (StringUtils.isNotBlank(url)) {
|
||||
url = url.replaceAll("\\$parentid\\$", billId);
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
package com.engine.recruit.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.recruit.enums.ApplicationStatusEnum;
|
||||
import com.engine.recruit.service.RecruitButtonService;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
|
@ -16,6 +19,9 @@ import java.util.Map;
|
|||
public class EliminateServiceImpl extends Service implements RecruitButtonService {
|
||||
@Override
|
||||
public Map<String, Object> execute(Map<String, Object> params) {
|
||||
String billId = Util.null2String(params.get("billId"));
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeUpdate("update uf_jcl_yppc set zt = ? where id = ? ", ApplicationStatusEnum.OBSOLETE.getValue(), billId);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,16 @@
|
|||
package com.engine.recruit.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.recruit.entity.recruitflow.po.RecruitStepPo;
|
||||
import com.engine.recruit.exception.CustomizeRunTimeException;
|
||||
import com.engine.recruit.service.RecruitButtonService;
|
||||
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;
|
||||
|
||||
/**
|
||||
|
|
@ -16,6 +24,50 @@ import java.util.Map;
|
|||
public class NextStageServiceImpl extends Service implements RecruitButtonService {
|
||||
@Override
|
||||
public Map<String, Object> execute(Map<String, Object> params) {
|
||||
return null;
|
||||
Map<String, Object> returnMap = new HashMap<>();
|
||||
String billId = Util.null2String(params.get("billId"));
|
||||
// 招聘阶段ID
|
||||
String stageId = null;
|
||||
// 招聘流程ID
|
||||
int recruitFlowId = -1;
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select zplc,zpjd from uf_jcl_yppc where id = ?", billId);
|
||||
if (rs.next()) {
|
||||
recruitFlowId = rs.getInt("zplc");
|
||||
stageId = rs.getString("zpjd");
|
||||
}
|
||||
if (-1 == recruitFlowId) {
|
||||
throw new CustomizeRunTimeException("未设置对应招聘流程");
|
||||
}
|
||||
rs.executeQuery("select id,jdmc,hj from uf_jcl_zpjdsz where sfqy = 0 and zplc = ? order by zssx", recruitFlowId);
|
||||
List<RecruitStepPo> stepList = new ArrayList<>();
|
||||
while (rs.next()) {
|
||||
stepList.add(RecruitStepPo.builder().key(rs.getInt("id")).description(rs.getString("jdmc")).type(rs.getString("hj")).build());
|
||||
}
|
||||
boolean found = false;
|
||||
Integer target = null;
|
||||
if (StringUtils.isBlank(stageId)) {
|
||||
stageId = String.valueOf(stepList.get(0).getKey());
|
||||
}
|
||||
for (RecruitStepPo recruitStepPo : stepList) {
|
||||
if (found) {
|
||||
target = recruitStepPo.getKey();
|
||||
break;
|
||||
}
|
||||
|
||||
if (recruitStepPo.getKey() == Integer.parseInt(stageId)) {
|
||||
found = true;
|
||||
if ("2".equals(recruitStepPo.getType())) {
|
||||
target = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 更新应聘者简历为下一阶段
|
||||
rs.executeUpdate("update uf_jcl_yppc set zpjd = ? where id = ?", target, billId);
|
||||
|
||||
|
||||
return returnMap;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.engine.recruit.entity.recruitflow.po.RecruitStepPo;
|
|||
import com.engine.recruit.entity.recruitflow.po.RecruitTabPo;
|
||||
import com.engine.recruit.exception.CustomizeRunTimeException;
|
||||
import com.engine.recruit.service.RecruitFlowService;
|
||||
import com.engine.recruit.util.RecruitFlowUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.Util;
|
||||
|
|
@ -52,7 +53,7 @@ public class RecruitFlowServiceImpl extends Service implements RecruitFlowServic
|
|||
throw new RuntimeException("未找到对应招聘阶段");
|
||||
}
|
||||
}
|
||||
rs.executeQuery("select a.id,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);
|
||||
rs.executeQuery("select a.id,a.zdyxsmc as buttonName, a.tzymbt as tabName, a.tzymdz as tabLink, a.zssx as orderNum, b.anbs as buttonKey, b.andz as buttonType 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);
|
||||
|
||||
List<RecruitButton> buttonList = new ArrayList<>();
|
||||
List<RecruitTabPo> tabList = new ArrayList<>();
|
||||
|
|
@ -61,21 +62,21 @@ public class RecruitFlowServiceImpl extends Service implements RecruitFlowServic
|
|||
.key(rs.getString("id"))
|
||||
.buttonName(rs.getString("buttonName"))
|
||||
.buttonKey(rs.getString("buttonKey"))
|
||||
.buttonAction(rs.getString("buttonAction"))
|
||||
.tabName(rs.getString("tabName"))
|
||||
.tabLink(RecruitFlowUtil.replaceURL(rs.getString("tabLink"), billId))
|
||||
.buttonType(rs.getString("buttonType"))
|
||||
.orderNum(rs.getInt("orderNum"))
|
||||
.build());
|
||||
}
|
||||
|
||||
rs.executeQuery("select tzymbt as title,tzymdz as url,zssx as orderNum from uf_jcl_zpjdsz_dt1 where sfqy = 0 and tzymbt !='' and tzymdz !='' and mainid = ? " +
|
||||
" union " +
|
||||
"select ymbt as title,ymdz as url,zssx as orderNum from uf_jcl_zpjdsz_dt2 where mainid = ? order by orderNum", stageId, stageId);
|
||||
rs.executeQuery("select ymbt as title,ymdz as url,zssx as orderNum from uf_jcl_zpjdsz_dt2 where mainid = ? order by orderNum", stageId);
|
||||
int tabIndex = 0;
|
||||
while (rs.next()) {
|
||||
tabList.add(RecruitTabPo.builder()
|
||||
.key(String.valueOf(tabIndex))
|
||||
.viewcondition(String.valueOf(tabIndex))
|
||||
.title(rs.getString("title"))
|
||||
.url(rs.getString("url"))
|
||||
.url(RecruitFlowUtil.replaceURL(rs.getString("url"), billId))
|
||||
.billId(billId)
|
||||
.build());
|
||||
tabIndex++;
|
||||
|
|
@ -94,7 +95,7 @@ public class RecruitFlowServiceImpl extends Service implements RecruitFlowServic
|
|||
|
||||
String billId = Util.null2String(param.get("billId"));
|
||||
// 招聘阶段ID
|
||||
String stageId = "0";
|
||||
String stageId = "";
|
||||
int currentStageId = 0;
|
||||
// 招聘流程ID
|
||||
int recruitFlowId = -1;
|
||||
|
|
@ -118,6 +119,9 @@ public class RecruitFlowServiceImpl extends Service implements RecruitFlowServic
|
|||
stepList.add(RecruitStepPo.builder().key(stepIndex).description(rs.getString("jdmc")).build());
|
||||
stepIndex++;
|
||||
}
|
||||
if ("-1".equals(stageId)) {
|
||||
currentStageId = stepList.size();
|
||||
}
|
||||
|
||||
returnMap.put("stepList", stepList);
|
||||
returnMap.put("currentStageId", currentStageId);
|
||||
|
|
|
|||
|
|
@ -43,4 +43,15 @@ public class RecruitFlowUtil {
|
|||
|
||||
return params;
|
||||
}
|
||||
|
||||
/**
|
||||
* 替换URL中Id字段
|
||||
*
|
||||
* @param urlString
|
||||
* @param billId
|
||||
* @return
|
||||
*/
|
||||
public static String replaceURL(String urlString, String billId) {
|
||||
return urlString.replaceAll("\\$parentid\\$", billId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public class RecruitButtonWrapper extends Service {
|
|||
*/
|
||||
public Map<String, Object> execute(Map<String, Object> params) {
|
||||
// 获取实现类全路径
|
||||
String classPath = Util.null2String(params.get("classPath"));
|
||||
return getRecruitButtonService(user, classPath).execute(params);
|
||||
String buttonKey = Util.null2String(params.get("buttonKey"));
|
||||
return getRecruitButtonService(user, buttonKey).execute(params);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue