diff --git a/src/com/api/recruit/controller/RecruitFlowController.java b/src/com/api/recruit/controller/RecruitFlowController.java new file mode 100644 index 0000000..c1778b9 --- /dev/null +++ b/src/com/api/recruit/controller/RecruitFlowController.java @@ -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{ +} diff --git a/src/com/engine/recruit/controller/RecruitFlowController.java b/src/com/engine/recruit/controller/RecruitFlowController.java new file mode 100644 index 0000000..3342856 --- /dev/null +++ b/src/com/engine/recruit/controller/RecruitFlowController.java @@ -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 params = ParamUtil.request2Map(request); + return new ResponseResult, Map>(user).run(getRecruitFlowWrapper(user)::getButtonList, params); + } +} diff --git a/src/com/engine/recruit/entity/recruitflow/po/RecruitButton.java b/src/com/engine/recruit/entity/recruitflow/po/RecruitButton.java new file mode 100644 index 0000000..1556f2a --- /dev/null +++ b/src/com/engine/recruit/entity/recruitflow/po/RecruitButton.java @@ -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; +} diff --git a/src/com/engine/recruit/service/RecruitFlowService.java b/src/com/engine/recruit/service/RecruitFlowService.java new file mode 100644 index 0000000..0463e0f --- /dev/null +++ b/src/com/engine/recruit/service/RecruitFlowService.java @@ -0,0 +1,21 @@ +package com.engine.recruit.service; + +import java.util.Map; + +/** + *

聚才林招聘

+ * 招聘流程接口 + * + * @author:dxfeng + * @createTime: 2023/09/22 + * @version: 1.0 + */ +public interface RecruitFlowService { + /** + * 获取当前阶段操作按钮 + * + * @param params 参数 + * @return 操作按钮 + */ + Map getButtonList(Map params); +} diff --git a/src/com/engine/recruit/service/impl/RecruitFlowServiceImpl.java b/src/com/engine/recruit/service/impl/RecruitFlowServiceImpl.java new file mode 100644 index 0000000..147d8c3 --- /dev/null +++ b/src/com/engine/recruit/service/impl/RecruitFlowServiceImpl.java @@ -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 getButtonList(Map params) { + Map 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 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; + } +} diff --git a/src/com/engine/recruit/wrapper/RecruitFlowWrapper.java b/src/com/engine/recruit/wrapper/RecruitFlowWrapper.java new file mode 100644 index 0000000..7393ca3 --- /dev/null +++ b/src/com/engine/recruit/wrapper/RecruitFlowWrapper.java @@ -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 getButtonList(Map params) { + return getRecruitFlowService(user).getButtonList(params); + } +}