Commit 6be33ddf by 284718418@qq.com

1.检测用户是否关注并且注册 8小时企业管理 微信公众号

parent eede9e4a
package cn.timer.api.controller.zpgl;
import cn.timer.api.bean.qyzx.QyzxEmpLogin;
import cn.timer.api.bean.zpgl.ZpglWxgzptEmpRcxx;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.config.exception.CustomException;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.transaction.Transactional;
/**
* 招聘管理
*
* @author wuqingjun
* @email 284718418@qq.com
* @date 2022-04-25 15:14:40
*/
@Api(tags = "招聘管理")
@Transactional(rollbackOn = Exception.class)
@RestController
@RequestMapping(value = "/zpgl", produces = {"application/json"})
@Slf4j
public class ZpglWxgzptEmpRcxxController {
/**
* 招聘-检测用户是否关注并且注册 8小时企业管理 微信公众号
*
* @param
* @return
*/
@GetMapping(value = "/check_user_wechat")
@ApiOperation(value = "1.检测用户是否关注并且注册 8小时企业管理 微信公众号", httpMethod = "GET", notes = "招聘列表")
@ApiOperationSupport(order = 1)
public Result<Object> checkUserWechat(@CurrentUser UserBean userBean,
@ApiParam("面试官ID") @RequestParam(required = false) Integer interviewerId,
@ApiParam("面试者手机号") @RequestParam(required = false) String mobile) {
try {
int interviewer = 0,interviewee=0;
ZpglWxgzptEmpRcxx zpglWxgzptEmpRcxx = ZpglWxgzptEmpRcxx.builder().build().selectOne(
new QueryWrapper<ZpglWxgzptEmpRcxx>().select("openid").lambda().eq(ZpglWxgzptEmpRcxx::getMobile,mobile)
);
// 面试者已绑定
if(!StringUtils.isEmpty(zpglWxgzptEmpRcxx) && !StringUtils.isEmpty(zpglWxgzptEmpRcxx.getOpenid()) && zpglWxgzptEmpRcxx.getOpenid().length()>0){
interviewee = 1;
}
QyzxEmpLogin qyzxEmpLogin = QyzxEmpLogin.builder().id(interviewerId).build().selectById();
ZpglWxgzptEmpRcxx zpglWxgzptEmpRcxxee = ZpglWxgzptEmpRcxx.builder().build().selectOne(
new QueryWrapper<ZpglWxgzptEmpRcxx>().select("openid").lambda().eq(ZpglWxgzptEmpRcxx::getMobile,qyzxEmpLogin.getPhone())
);
// 面试官已绑定
if(!StringUtils.isEmpty(zpglWxgzptEmpRcxxee) && !StringUtils.isEmpty(zpglWxgzptEmpRcxxee.getOpenid()) && zpglWxgzptEmpRcxxee.getOpenid().length()>0){
interviewer = 1;
}
if(interviewer==0 && interviewee==0){
return ResultUtil.data(1,"面试官和候选人未绑定公众号,请提醒面试官、候选人关注8小时企业管理公众号!");
}
if(interviewer==0){
return ResultUtil.data(1,"面试官未绑定公众号,请提醒面试官关注8小时企业管理公众号!");
}
if(interviewee==0){
return ResultUtil.data(1,"候选人未绑定公众号,请提醒候选人关注8小时企业管理公众号!");
}
return ResultUtil.data(0,"都绑定了");
} catch (Exception e) {
e.printStackTrace();
throw new CustomException("招聘-检测失败");
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment