generated from dxfeng/secondev-chapanda-feishu
offer发送、信息采集
This commit is contained in:
parent
96704f8bb9
commit
c630aaa4bc
|
|
@ -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{
|
||||
}
|
||||
|
|
@ -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<String, Object> params = ParamUtil.request2Map(request);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(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<String, Object> params = ParamUtil.request2Map(request);
|
||||
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getOfferWrapper(user)::updateOfferStatus, params);
|
||||
}
|
||||
}
|
||||
|
|
@ -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<String, Object> getOfferMobileLink(Map<String, Object> param);
|
||||
|
||||
|
||||
/**
|
||||
* 获取邮件内容
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> getOfferContent(Map<String, Object> param);
|
||||
|
||||
/**
|
||||
* 更新offer状态
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> updateOfferStatus(Map<String, Object> param);
|
||||
}
|
||||
|
|
@ -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<String, Object> 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<String, Object> 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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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<String, Object> getOfferMobileLink(Map<String, Object> param) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getOfferContent(Map<String, Object> param) {
|
||||
Map<String, Object> 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<String, Object> updateOfferStatus(Map<String, Object> 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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -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<String, Object> getOfferContent(Map<String, Object> params) {
|
||||
return getOfferService(user).getOfferContent(params);
|
||||
}
|
||||
|
||||
public Map<String, Object> updateOfferStatus(Map<String, Object> params) {
|
||||
return getOfferService(user).updateOfferStatus(params);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue