From 95c755a0cea876059a7f8effb867b7e0d8b1f149 Mon Sep 17 00:00:00 2001 From: dxfeng Date: Thu, 12 Oct 2023 16:57:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=9B=E8=81=98=E6=B5=81=E7=A8=8B=EF=BC=8C?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=B8=83=E5=B1=80,=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E5=AE=9E=E8=B7=B5=E6=8E=A5=E5=8F=A3=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/recruitflow/po/RecruitStepPo.java | 1 + .../entity/recruitflow/po/RecruitTabPo.java | 3 -- .../service/impl/EliminateServiceImpl.java | 6 +++ .../service/impl/NextStageServiceImpl.java | 54 ++++++++++++++++++- .../service/impl/RecruitFlowServiceImpl.java | 18 ++++--- .../engine/recruit/util/RecruitFlowUtil.java | 11 ++++ .../recruit/wrapper/RecruitButtonWrapper.java | 4 +- 7 files changed, 84 insertions(+), 13 deletions(-) diff --git a/src/com/engine/recruit/entity/recruitflow/po/RecruitStepPo.java b/src/com/engine/recruit/entity/recruitflow/po/RecruitStepPo.java index 0e15e28..2750544 100644 --- a/src/com/engine/recruit/entity/recruitflow/po/RecruitStepPo.java +++ b/src/com/engine/recruit/entity/recruitflow/po/RecruitStepPo.java @@ -17,4 +17,5 @@ import lombok.NoArgsConstructor; public class RecruitStepPo { private int key; private String description; + private String type; } diff --git a/src/com/engine/recruit/entity/recruitflow/po/RecruitTabPo.java b/src/com/engine/recruit/entity/recruitflow/po/RecruitTabPo.java index 77074ae..b45d5a4 100644 --- a/src/com/engine/recruit/entity/recruitflow/po/RecruitTabPo.java +++ b/src/com/engine/recruit/entity/recruitflow/po/RecruitTabPo.java @@ -29,9 +29,6 @@ public class RecruitTabPo { private String billId; public String getUrl() { - if (StringUtils.isNotBlank(url)) { - url = url.replaceAll("\\$parentid\\$", billId); - } return url; } diff --git a/src/com/engine/recruit/service/impl/EliminateServiceImpl.java b/src/com/engine/recruit/service/impl/EliminateServiceImpl.java index 26df3fc..6bd3bb9 100644 --- a/src/com/engine/recruit/service/impl/EliminateServiceImpl.java +++ b/src/com/engine/recruit/service/impl/EliminateServiceImpl.java @@ -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 execute(Map 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; } } diff --git a/src/com/engine/recruit/service/impl/NextStageServiceImpl.java b/src/com/engine/recruit/service/impl/NextStageServiceImpl.java index d7e9252..85d575c 100644 --- a/src/com/engine/recruit/service/impl/NextStageServiceImpl.java +++ b/src/com/engine/recruit/service/impl/NextStageServiceImpl.java @@ -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 execute(Map params) { - return null; + Map 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 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; } } diff --git a/src/com/engine/recruit/service/impl/RecruitFlowServiceImpl.java b/src/com/engine/recruit/service/impl/RecruitFlowServiceImpl.java index b56dac8..5a3f84b 100644 --- a/src/com/engine/recruit/service/impl/RecruitFlowServiceImpl.java +++ b/src/com/engine/recruit/service/impl/RecruitFlowServiceImpl.java @@ -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 buttonList = new ArrayList<>(); List 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); diff --git a/src/com/engine/recruit/util/RecruitFlowUtil.java b/src/com/engine/recruit/util/RecruitFlowUtil.java index cbdb0a7..5eaed3e 100644 --- a/src/com/engine/recruit/util/RecruitFlowUtil.java +++ b/src/com/engine/recruit/util/RecruitFlowUtil.java @@ -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); + } } diff --git a/src/com/engine/recruit/wrapper/RecruitButtonWrapper.java b/src/com/engine/recruit/wrapper/RecruitButtonWrapper.java index f44659b..27ed00d 100644 --- a/src/com/engine/recruit/wrapper/RecruitButtonWrapper.java +++ b/src/com/engine/recruit/wrapper/RecruitButtonWrapper.java @@ -37,7 +37,7 @@ public class RecruitButtonWrapper extends Service { */ public Map execute(Map 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); } }