diff --git a/src/com/api/recruit/controller/OfferController.java b/src/com/api/recruit/controller/OfferController.java new file mode 100644 index 0000000..8604e44 --- /dev/null +++ b/src/com/api/recruit/controller/OfferController.java @@ -0,0 +1,12 @@ +package com.api.recruit.controller; + +import javax.ws.rs.Path; + +/** + * @author:dxfeng + * @createTime: 2023/10/30 + * @version: 1.0 + */ +@Path("/jcl/recruit/offer") +public class OfferController extends com.engine.recruit.controller.OfferController{ +} diff --git a/src/com/engine/recruit/controller/OfferController.java b/src/com/engine/recruit/controller/OfferController.java new file mode 100644 index 0000000..874ef77 --- /dev/null +++ b/src/com/engine/recruit/controller/OfferController.java @@ -0,0 +1,46 @@ +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.OfferWrapper; +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/10/30 + * @version: 1.0 + */ +public class OfferController { + public OfferWrapper getOfferWrapper(User user) { + return ServiceUtil.getService(OfferWrapper.class, user); + } + + @POST + @Path("/getOfferContent") + @Produces(MediaType.APPLICATION_JSON) + public String getOfferContent(@Context HttpServletRequest request, @Context HttpServletResponse response) { + User user = HrmUserVarify.getUser(request, response); + Map params = ParamUtil.request2Map(request); + return new ResponseResult, Map>(user).run(getOfferWrapper(user)::getOfferContent, params); + } + + @POST + @Path("/updateOfferStatus") + @Produces(MediaType.APPLICATION_JSON) + public String updateOfferStatus(@Context HttpServletRequest request, @Context HttpServletResponse response) { + User user = HrmUserVarify.getUser(request, response); + Map params = ParamUtil.request2Map(request); + return new ResponseResult, Map>(user).run(getOfferWrapper(user)::updateOfferStatus, params); + } +} diff --git a/src/com/engine/recruit/service/OfferService.java b/src/com/engine/recruit/service/OfferService.java new file mode 100644 index 0000000..d81f127 --- /dev/null +++ b/src/com/engine/recruit/service/OfferService.java @@ -0,0 +1,35 @@ +package com.engine.recruit.service; + +import java.util.Map; + +/** + * @author:dxfeng + * @createTime: 2023/10/30 + * @version: 1.0 + */ +public interface OfferService { + /** + * 获取offer移动端地址 + * + * @param param + * @return + */ + Map getOfferMobileLink(Map param); + + + /** + * 获取邮件内容 + * + * @param param + * @return + */ + Map getOfferContent(Map param); + + /** + * 更新offer状态 + * + * @param param + * @return + */ + Map updateOfferStatus(Map param); +} diff --git a/src/com/engine/recruit/service/impl/InductionManageServiceImpl.java b/src/com/engine/recruit/service/impl/InductionManageServiceImpl.java index bac7397..ad0fea6 100644 --- a/src/com/engine/recruit/service/impl/InductionManageServiceImpl.java +++ b/src/com/engine/recruit/service/impl/InductionManageServiceImpl.java @@ -9,6 +9,7 @@ import com.engine.recruit.exception.CustomizeRunTimeException; import com.engine.recruit.service.InductionManageService; import com.engine.recruit.util.RecruitMessageUtils; import org.apache.commons.lang3.StringUtils; +import weaver.common.DateUtil; import weaver.conn.RecordSet; import weaver.formmode.recruit.modeexpand.util.RecruitModeUtil; import weaver.general.Util; @@ -103,18 +104,28 @@ public class InductionManageServiceImpl extends Service implements InductionMana HashMap map = new HashMap<>(2); String mobile = Util.null2String(param.get("mobile")); String pwd = Util.null2String(param.get("pwd")); - rs.executeQuery("select count(1) as sum from uf_jcl_rzgl where sjhm = ? and rzzt != 2",mobile); - rs.next(); - if (Util.getIntValue(rs.getString("sum")) == 0) { - map.put("message","当前链接已失效且不可操作"); - return map; + + // 校验当前链接的有效期 + rs.executeQuery("select * from uf_jcl_rzgl where sjhm = ? ", mobile); + if (rs.next()) { + // 当前关联入职已取消入职/已入职;点击提示当前链接已失效,且不可操作 + String entryStatus = rs.getString("rzzt"); + if ("1".equals(entryStatus) || "2".equals(entryStatus)) { + throw new CustomizeRunTimeException("当前链接已失效"); + } + // 当前信息采集链接的地址默认有效期为发出日期~预计入职日期 + String date = rs.getString("yjrzrq"); + int compDate = DateUtil.compDate(DateUtil.getCurrentDate(), date); + if (compDate < 0) { + throw new CustomizeRunTimeException("当前链接已失效"); + } } rs.executeQuery("select id from uf_jcl_xxcj where sjh = ? and mm = ?", mobile, pwd); if (rs.next()) { map.put("id", Util.getIntValue(rs.getString("id"))); - }else { - map.put("message","手机号或密码错误"); + } else { + throw new CustomizeRunTimeException("手机号或密码错误"); } return map; @@ -122,8 +133,8 @@ public class InductionManageServiceImpl extends Service implements InductionMana @Override public Map infoSubmit(String id) { - RecordSet rs = new RecordSet(); - rs.executeQuery("update uf_jcl_rzgl set xxcj = 2 where id = ?",id); + RecordSet rs = new RecordSet(); + rs.executeQuery("update uf_jcl_rzgl set xxcj = 2 where id = ?", id); return null; } diff --git a/src/com/engine/recruit/service/impl/NextStageServiceImpl.java b/src/com/engine/recruit/service/impl/NextStageServiceImpl.java index 85d575c..7e9cacb 100644 --- a/src/com/engine/recruit/service/impl/NextStageServiceImpl.java +++ b/src/com/engine/recruit/service/impl/NextStageServiceImpl.java @@ -62,10 +62,12 @@ public class NextStageServiceImpl extends Service implements RecruitButtonServic } } } - - - // 更新应聘者简历为下一阶段 - rs.executeUpdate("update uf_jcl_yppc set zpjd = ? where id = ?", target, billId); + rs.executeQuery("select jdlx from uf_jcl_zpjdsz where id = ?", target); + if (rs.next()) { + String jdlx = rs.getString("jdlx"); + // 更新应聘者简历为下一阶段 + rs.executeUpdate("update uf_jcl_yppc set zpjd = ?,dqypjd = ? where id = ?", target, jdlx, billId); + } return returnMap; diff --git a/src/com/engine/recruit/service/impl/OfferServiceImpl.java b/src/com/engine/recruit/service/impl/OfferServiceImpl.java new file mode 100644 index 0000000..2bee018 --- /dev/null +++ b/src/com/engine/recruit/service/impl/OfferServiceImpl.java @@ -0,0 +1,64 @@ +package com.engine.recruit.service.impl; + +import com.engine.core.impl.Service; +import com.engine.recruit.exception.CustomizeRunTimeException; +import com.engine.recruit.service.OfferService; +import org.apache.commons.lang3.StringUtils; +import weaver.conn.RecordSet; +import weaver.general.Util; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author:dxfeng + * @createTime: 2023/10/30 + * @version: 1.0 + */ +public class OfferServiceImpl extends Service implements OfferService { + @Override + public Map getOfferMobileLink(Map param) { + return null; + } + + @Override + public Map getOfferContent(Map param) { + Map returnMap = new HashMap<>(); + String billId = Util.null2String(param.get("billid")); + String email = Util.null2String(param.get("dzyx")); + RecordSet rs = new RecordSet(); + String offerContent = ""; + rs.executeQuery("select tznr from uf_jcl_offer where id = ? and dzyx = ?", billId, email); + if (rs.next()) { + offerContent = rs.getString("tznr"); + } + if (StringUtils.isAnyBlank(billId, email, offerContent)) { + throw new CustomizeRunTimeException("非法访问"); + } + returnMap.put("content", offerContent); + return returnMap; + } + + @Override + public Map updateOfferStatus(Map param) { + String status = Util.null2String(param.get("status")); + String email = Util.null2String(param.get("dzyx")); + String billId = Util.null2String(param.get("billid")); + if (StringUtils.isAnyBlank(billId, email, status) || !("2".equals(status) || "3".equals(status))) { + throw new CustomizeRunTimeException("非法操作"); + } + RecordSet rs = new RecordSet(); + // 判断是否已提交 + rs.executeQuery("select zt from uf_jcl_offer where id = ? and dzyx = ? ", billId, email); + if (rs.next()) { + String zt = rs.getString("zt"); + if ("2".equals(zt) || "3".equals(zt)) { + throw new CustomizeRunTimeException("此反馈已提交,请勿重复提交"); + } + } + + rs.executeUpdate("update uf_jcl_offer set zt = ? where id = ? and dzyx = ?", status, billId, email); + return null; + } + +} diff --git a/src/com/engine/recruit/wrapper/OfferWrapper.java b/src/com/engine/recruit/wrapper/OfferWrapper.java new file mode 100644 index 0000000..a95019c --- /dev/null +++ b/src/com/engine/recruit/wrapper/OfferWrapper.java @@ -0,0 +1,28 @@ +package com.engine.recruit.wrapper; + +import com.engine.common.util.ServiceUtil; +import com.engine.core.impl.Service; +import com.engine.recruit.service.OfferService; +import com.engine.recruit.service.impl.OfferServiceImpl; +import weaver.hrm.User; + +import java.util.Map; + +/** + * @author:dxfeng + * @createTime: 2023/10/30 + * @version: 1.0 + */ +public class OfferWrapper extends Service { + private OfferService getOfferService(User user) { + return ServiceUtil.getService(OfferServiceImpl.class, user); + } + + public Map getOfferContent(Map params) { + return getOfferService(user).getOfferContent(params); + } + + public Map updateOfferStatus(Map params) { + return getOfferService(user).updateOfferStatus(params); + } +}