提交 b257382a authored 作者: wangmenglong's avatar wangmenglong

招聘小程序

上级 198c2bb1
...@@ -31,7 +31,7 @@ public class Objective extends IdentityObj { ...@@ -31,7 +31,7 @@ public class Objective extends IdentityObj {
* 薪资要求-结束 * 薪资要求-结束
**/ **/
@TableField("salary_max") @TableField("salary_max")
private String salaryMax; private Integer salaryMax;
/** /**
* 工作性质 * 工作性质
......
...@@ -27,4 +27,10 @@ public class ObjectiveIndustry extends IdentityObj { ...@@ -27,4 +27,10 @@ public class ObjectiveIndustry extends IdentityObj {
@TableField("industry_id") @TableField("industry_id")
private String industryId; private String industryId;
/**
* 行业名
**/
@TableField(exist = false)
private String name;
} }
...@@ -14,5 +14,10 @@ import lombok.Data; ...@@ -14,5 +14,10 @@ import lombok.Data;
@TableName(value = "tb_org") @TableName(value = "tb_org")
public class Org extends NameObj { public class Org extends NameObj {
/**
* logo
**/
@TableField("logo")
private String logo;
} }
...@@ -107,4 +107,28 @@ public class Recruit extends NameObj { ...@@ -107,4 +107,28 @@ public class Recruit extends NameObj {
@TableField("times") @TableField("times")
private Integer times; private Integer times;
/**
* 企业id
**/
@TableField("org_id")
private String orgId;
/**
* 企业名
**/
@TableField("org_name")
private String orgName;
/**
* 员工
**/
@TableField(exist = false)
private Person person;
/**
* 员工
**/
@TableField(exist = false)
private String personId;
} }
...@@ -187,6 +187,12 @@ ...@@ -187,6 +187,12 @@
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>com.alipay.sdk</groupId>
<artifactId>alipay-sdk-java</artifactId>
<version>4.38.0.ALL</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
package com.jfb.recruit.controller;
import base.controller.BaseController;
import base.result.BaseResult;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import com.jfb.recruit.bean.auth.UserContext;
import com.jfb.recruit.service.CollectService;
import com.jfb.recruit.service.RecruitService;
import com.jfb.recruit.util.auth.UserUtils;
import data.recruit.Collect;
import data.recruit.Recruit;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* @author wangmenglong
* @description: 收藏管理
* @date 2023/12/11 11:35
*/
@RestController
@RequestMapping("/collect")
public class CollectController extends BaseController {
@Resource
CollectService collectService;
@Resource
RecruitService recruitService;
/**
* @description: 获取收藏列表
* @author: wangmenglong
* @date; 2023/12/7 10:07
* @param: [req]
* @return: com.github.pagehelper.PageInfo
**/
@GetMapping("/l")
public BaseResult list(HttpServletRequest req){
PageInit(req);
UserContext userContext = UserUtils.getUserContext();
List<Recruit> list = recruitService.listByCollect(pageNum,pageSize,userContext.getUserId());
PageInfo<Recruit> pageInfo = new PageInfo<Recruit>(list);
return BaseResult.success(pageInfo);
}
/**
* @description: 新增收藏
* @author: wangmenglong
* @param: [collect]
* @return: base.result.BaseResult
**/
@PostMapping("/c")
public BaseResult create(@RequestBody Collect collect){
UserContext userContext = UserUtils.getUserContext();
collect.setUserId(userContext.getUserId());
collect.setPersonId(userContext.getUserId());
//判断是否重复
if(collectService.isHave(collect.getRecruitId(),collect.getPersonId())){
collectService.del(collect.getRecruitId(),collect.getPersonId());
}else {
collectService.create(collect);
}
return BaseResult.success("normal_001");
}
}
package com.jfb.recruit.controller;
import base.controller.BaseController;
import base.result.BaseResult;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import com.jfb.recruit.bean.auth.UserContext;
import com.jfb.recruit.service.IndustryService;
import com.jfb.recruit.util.auth.UserUtils;
import data.recruit.Industry;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* @author wangmenglong
* @description: 行业管理
* @date 2023/12/11 11:35
*/
@RestController
@RequestMapping("/industry")
public class IndustryController extends BaseController {
@Resource
IndustryService industryService;
/**
* @description: 获取行业列表
* @author: wangmenglong
* @date; 2023/12/7 10:07
* @param: [req]
* @return: com.github.pagehelper.PageInfo
**/
@GetMapping("/l")
public BaseResult list(HttpServletRequest req,Industry industry){
PageInit(req);
UserContext userContext = UserUtils.getUserContext();
industry.setBaseCode(userContext.getBaseCode());
List<Industry> list = industryService.list(pageNum,pageSize,industry);
PageInfo<Industry> pageInfo = new PageInfo<Industry>(list);
return BaseResult.success(pageInfo);
}
/**
* @description: 获取行业列表
* @author: wangmenglong
* @date; 2023/12/7 10:07
* @param: [req]
* @return: com.github.pagehelper.PageInfo
**/
@GetMapping("/l/all")
public BaseResult listAll(HttpServletRequest req,Industry industry){
UserContext userContext = UserUtils.getUserContext();
industry.setBaseCode(userContext.getBaseCode());
List<Industry> list = industryService.list(pageNum,pageSize,industry);
return BaseResult.success(list);
}
/**
* @description: 新增行业
* @author: wangmenglong
* @param: [industry]
* @return: base.result.BaseResult
**/
@PostMapping("/c")
public BaseResult create(@RequestBody Industry industry){
//判断是否重复
if(industryService.isHave(industry.getName(),industry.getId())){
return BaseResult.error("error_006");
}
return industryService.create(industry)?BaseResult.success("normal_001"):BaseResult.error("error_001");
}
/**
* @description: 编辑行业
* @author: wangmenglong
* @param: [industry]
* @return: base.result.BaseResult
**/
@PostMapping("/u")
public BaseResult update(@RequestBody Industry industry){
//判断是否重复
if(industryService.isHave(industry.getName(),industry.getId())){
return BaseResult.error("error_006");
}
return industryService.update(industry)?BaseResult.success("normal_002"):BaseResult.error("error_002");
}
/**
* @description: 删除行业
* @author: wangmenglong
* @date; 2023/12/7 11:08
* @param: [id]
* @return: base.result.BaseResult
**/
@PostMapping("/d")
public BaseResult del(@RequestBody JSONObject jsonObject){
String id = jsonObject.getString("id");
return industryService.del(id)?BaseResult.success("normal_002"):BaseResult.error("error_002");
}
/**
* @author: wangmenglong
* @date; 2024/3/24 17:18
* @description: 获取行业详情
* @param: [id]
* @return: base.result.BaseResult
**/
@GetMapping("/details")
public BaseResult details(@RequestParam("id")String id){
Industry industry = industryService.getDetails(id);
return BaseResult.success(industry);
}
/**
* @author: wangmenglong
* @date; 2024/3/24 17:18
* @description: 获取行业详情
* @param: [id]
* @return: base.result.BaseResult
**/
@GetMapping("/industry/details")
public BaseResult details(){
UserContext userContext = UserUtils.getUserContext();
Industry industry = industryService.getDetails(userContext.getUserId());
return BaseResult.success(industry);
}
}
package com.jfb.recruit.controller;
import base.controller.BaseController;
import base.result.BaseResult;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import com.jfb.recruit.bean.auth.UserContext;
import com.jfb.recruit.service.ObjectiveService;
import com.jfb.recruit.util.auth.UserUtils;
import data.recruit.Objective;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* @author wangmenglong
* @description: 求职意向管理
* @date 2023/12/11 11:35
*/
@RestController
@RequestMapping("/objective")
public class ObjectiveController extends BaseController {
@Resource
ObjectiveService objectiveService;
/**
* @description: 获取求职意向列表
* @author: wangmenglong
* @date; 2023/12/7 10:07
* @param: [req]
* @return: com.github.pagehelper.PageInfo
**/
@GetMapping("/l")
public BaseResult list(HttpServletRequest req,Objective objective){
PageInit(req);
UserContext userContext = UserUtils.getUserContext();
objective.setBaseCode(userContext.getBaseCode());
List<Objective> list = objectiveService.list(pageNum,pageSize,objective);
PageInfo<Objective> pageInfo = new PageInfo<Objective>(list);
return BaseResult.success(pageInfo);
}
/**
* @description: 新增求职意向
* @author: wangmenglong
* @param: [objective]
* @return: base.result.BaseResult
**/
@PostMapping("/c")
public BaseResult create(@RequestBody Objective objective){
return objectiveService.create(objective)?BaseResult.success("normal_001"):BaseResult.error("error_001");
}
/**
* @description: 编辑求职意向
* @author: wangmenglong
* @param: [objective]
* @return: base.result.BaseResult
**/
@PostMapping("/u")
public BaseResult update(@RequestBody Objective objective){
return objectiveService.update(objective)?BaseResult.success("normal_002"):BaseResult.error("error_002");
}
/**
* @description: 删除求职意向
* @author: wangmenglong
* @date; 2023/12/7 11:08
* @param: [id]
* @return: base.result.BaseResult
**/
@PostMapping("/d")
public BaseResult del(@RequestBody JSONObject jsonObject){
String id = jsonObject.getString("id");
return objectiveService.del(id)?BaseResult.success("normal_002"):BaseResult.error("error_002");
}
/**
* @author: wangmenglong
* @date; 2024/3/24 17:18
* @description: 获取求职意向详情
* @param: [id]
* @return: base.result.BaseResult
**/
@GetMapping("/details")
public BaseResult details(@RequestParam("id")String id){
Objective objective = objectiveService.getDetails(id);
return BaseResult.success(objective);
}
}
package com.jfb.recruit.controller;
import base.controller.BaseController;
import base.result.BaseResult;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import com.jfb.recruit.bean.auth.UserContext;
import com.jfb.recruit.service.ObjectiveIndustryService;
import com.jfb.recruit.util.auth.UserUtils;
import data.recruit.ObjectiveIndustry;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* @author wangmenglong
* @description: 意向行业管理
* @date 2023/12/11 11:35
*/
@RestController
@RequestMapping("/objectiveIndustry")
public class ObjectiveIndustryController extends BaseController {
@Resource
ObjectiveIndustryService objectiveIndustryService;
/**
* @description: 获取意向行业列表
* @author: wangmenglong
* @date; 2023/12/7 10:07
* @param: [req]
* @return: com.github.pagehelper.PageInfo
**/
@GetMapping("/l/all")
public BaseResult listAll(HttpServletRequest req,ObjectiveIndustry objectiveIndustry){
PageInit(req);
UserContext userContext = UserUtils.getUserContext();
objectiveIndustry.setBaseCode(userContext.getBaseCode());
List<ObjectiveIndustry> list = objectiveIndustryService.listAll(objectiveIndustry);
PageInfo<ObjectiveIndustry> pageInfo = new PageInfo<ObjectiveIndustry>(list);
return BaseResult.success(pageInfo);
}
/**
* @description: 新增意向行业
* @author: wangmenglong
* @param: [objectiveIndustry]
* @return: base.result.BaseResult
**/
@PostMapping("/c")
public BaseResult create(@RequestBody ObjectiveIndustry objectiveIndustry){
//判断是否重复
if(objectiveIndustryService.isHave(objectiveIndustry.getPersonId(),objectiveIndustry.getIndustryId())){
return BaseResult.error("error_007");
}
return objectiveIndustryService.create(objectiveIndustry)?BaseResult.success("normal_001"):BaseResult.error("error_001");
}
/**
* @description: 删除意向行业
* @author: wangmenglong
* @date; 2023/12/7 11:08
* @param: [id]
* @return: base.result.BaseResult
**/
@PostMapping("/d")
public BaseResult del(@RequestBody JSONObject jsonObject){
String id = jsonObject.getString("id");
return objectiveIndustryService.del(id)?BaseResult.success("normal_002"):BaseResult.error("error_002");
}
}
...@@ -47,24 +47,30 @@ public class OrgController extends BaseController { ...@@ -47,24 +47,30 @@ public class OrgController extends BaseController {
/** /**
* @description: 新增企业 * @description: 新增企业
* @author: wangmenglong * @author: wangmenglong
* @date; 2023/12/11 16:50
* @param: [org] * @param: [org]
* @return: base.result.BaseResult * @return: base.result.BaseResult
**/ **/
@PostMapping("/c") @PostMapping("/c")
public BaseResult create(@RequestBody Org org){ public BaseResult create(@RequestBody Org org){
//判断是否重复
if(orgService.isHave(org.getName(),org.getId())){
return BaseResult.error("error_004");
}
return orgService.create(org)?BaseResult.success("normal_001"):BaseResult.error("error_001"); return orgService.create(org)?BaseResult.success("normal_001"):BaseResult.error("error_001");
} }
/** /**
* @description: 编辑企业 * @description: 编辑企业
* @author: wangmenglong * @author: wangmenglong
* @date; 2023/12/7 11:05
* @param: [org] * @param: [org]
* @return: base.result.BaseResult * @return: base.result.BaseResult
**/ **/
@PostMapping("/u") @PostMapping("/u")
public BaseResult update(@RequestBody Org org){ public BaseResult update(@RequestBody Org org){
//判断是否重复
if(orgService.isHave(org.getName(),org.getId())){
return BaseResult.error("error_004");
}
return orgService.update(org)?BaseResult.success("normal_002"):BaseResult.error("error_002"); return orgService.update(org)?BaseResult.success("normal_002"):BaseResult.error("error_002");
} }
......
package com.jfb.recruit.controller;
import base.controller.BaseController;
import base.result.BaseResult;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import com.jfb.recruit.bean.auth.UserContext;
import com.jfb.recruit.service.PersonService;
import com.jfb.recruit.util.auth.UserUtils;
import data.recruit.Person;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* @author wangmenglong
* @description: 人员管理
* @date 2023/12/11 11:35
*/
@RestController
@RequestMapping("/person")
public class PersonController extends BaseController {
@Resource
PersonService personService;
/**
* @description: 获取人员列表
* @author: wangmenglong
* @date; 2023/12/7 10:07
* @param: [req]
* @return: com.github.pagehelper.PageInfo
**/
@GetMapping("/l")
public BaseResult list(HttpServletRequest req,Person person){
PageInit(req);
UserContext userContext = UserUtils.getUserContext();
person.setBaseCode(userContext.getBaseCode());
List<Person> list = personService.list(pageNum,pageSize,person);
PageInfo<Person> pageInfo = new PageInfo<Person>(list);
return BaseResult.success(pageInfo);
}
/**
* @description: 新增人员
* @author: wangmenglong
* @param: [person]
* @return: base.result.BaseResult
**/
@PostMapping("/c")
public BaseResult create(@RequestBody Person person){
//判断是否重复
if(personService.isHave(person.getOpenId(),person.getId())){
return BaseResult.error("error_005");
}
return personService.create(person)?BaseResult.success("normal_001"):BaseResult.error("error_001");
}
/**
* @description: 编辑人员
* @author: wangmenglong
* @param: [person]
* @return: base.result.BaseResult
**/
@PostMapping("/u")
public BaseResult update(@RequestBody Person person){
//判断是否重复
if(personService.isHave(person.getOpenId(),person.getId())){
return BaseResult.error("error_005");
}
return personService.update(person)?BaseResult.success("normal_002"):BaseResult.error("error_002");
}
/**
* @description: 删除人员
* @author: wangmenglong
* @date; 2023/12/7 11:08
* @param: [id]
* @return: base.result.BaseResult
**/
@PostMapping("/d")
public BaseResult del(@RequestBody JSONObject jsonObject){
String id = jsonObject.getString("id");
return personService.del(id)?BaseResult.success("normal_002"):BaseResult.error("error_002");
}
/**
* @author: wangmenglong
* @date; 2024/3/24 17:18
* @description: 获取人员详情
* @param: [id]
* @return: base.result.BaseResult
**/
@GetMapping("/details")
public BaseResult details(@RequestParam("id")String id){
Person person = personService.getDetails(id);
return BaseResult.success(person);
}
/**
* @author: wangmenglong
* @date; 2024/3/24 17:18
* @description: 获取人员详情
* @param: [id]
* @return: base.result.BaseResult
**/
@GetMapping("/person/details")
public BaseResult details(){
UserContext userContext = UserUtils.getUserContext();
Person person = personService.getDetails(userContext.getUserId());
return BaseResult.success(person);
}
}
package com.jfb.recruit.controller;
import base.controller.BaseController;
import base.result.BaseResult;
import com.github.pagehelper.PageInfo;
import com.jfb.recruit.bean.auth.UserContext;
import com.jfb.recruit.service.SignRecordService;
import com.jfb.recruit.service.RecruitService;
import com.jfb.recruit.util.auth.UserUtils;
import data.recruit.SignRecord;
import data.recruit.Recruit;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* @author wangmenglong
* @description: 报名管理
* @date 2023/12/11 11:35
*/
@RestController
@RequestMapping("/signRecord")
public class SignRecordController extends BaseController {
@Resource
SignRecordService signRecordService;
@Resource
RecruitService recruitService;
/**
* @description: 获取报名列表
* @author: wangmenglong
* @date; 2023/12/7 10:07
* @param: [req]
* @return: com.github.pagehelper.PageInfo
**/
@GetMapping("/l")
public BaseResult list(HttpServletRequest req){
PageInit(req);
UserContext userContext = UserUtils.getUserContext();
List<Recruit> list = recruitService.listBySignRecord(pageNum,pageSize,userContext.getUserId());
PageInfo<Recruit> pageInfo = new PageInfo<Recruit>(list);
return BaseResult.success(pageInfo);
}
/**
* @description: 获取报名列表
* @author: wangmenglong
* @date; 2023/12/7 10:07
* @param: [req]
* @return: com.github.pagehelper.PageInfo
**/
@GetMapping("/admin/list")
public BaseResult adminList(HttpServletRequest req){
PageInit(req);
List<Recruit> list = recruitService.listBySignRecordAdmin(pageNum,pageSize);
PageInfo<Recruit> pageInfo = new PageInfo<Recruit>(list);
return BaseResult.success(pageInfo);
}
/**
* @description: 新增报名
* @author: wangmenglong
* @param: [signRecord]
* @return: base.result.BaseResult
**/
@PostMapping("/c")
public BaseResult create(@RequestBody SignRecord signRecord){
UserContext userContext = UserUtils.getUserContext();
signRecord.setUserId(userContext.getUserId());
signRecord.setPersonId(userContext.getUserId());
//判断是否重复
if(signRecordService.isHave(signRecord.getRecruitId(),signRecord.getPersonId())){
signRecordService.del(signRecord.getRecruitId(),signRecord.getPersonId());
}else {
signRecordService.create(signRecord);
}
return BaseResult.success("normal_001");
}
}
package com.jfb.recruit.controller.api;
import base.controller.BaseController;
import base.result.BaseResult;
import com.alibaba.fastjson.JSONObject;
import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayClient;
import com.alipay.api.AlipayConfig;
import com.alipay.api.DefaultAlipayClient;
import com.alipay.api.internal.util.AlipayEncrypt;
import com.alipay.api.internal.util.AlipaySignature;
import com.alipay.api.request.AlipaySystemOauthTokenRequest;
import com.alipay.api.response.AlipaySystemOauthTokenResponse;
import data.recruit.Person;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
/**
* @author wangmenglong
* @description: 阿里调用
* @date 2023/12/11 11:35
*/
@RestController
@RequestMapping("/public/ali")
public class ApiAliController extends BaseController {
public static String appId = "2021005184646262";
public static String privateKey = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC/aljGWqc80Fx82woJVQ1sIhe8+//6h4Bmec1L6C4Ubrz/XoHfH0Ih61kX5mVHiaGBLGdYJdv3AzZxim/vns0upfo+Nx9adVvT6iZBixbIcJuakaTF2xtcPhh6N3OjEzWUg2LwB4u2xTp1px3PPQrXTK/WbmYWrunE5Qn5A/38VwQszz++A9FvDKeFxrTiNuhmyee+wakoJVrd5NhiGRkZwEZYM0Ggj63OD4Jjw58cwv4sdE/BIzQG5YK1Tw+1VzYHcY3a2oLshe3ad5HQdwb8RGTMaqRVk3UuInUZ80BeUfR6k2KOI/u7vXzxVns56n8V8mHAyKLYBpGqS/oZhvDzAgMBAAECggEATUJLWqQ0ZCNlcS+nuWSO6lpIYosEIsaWWMZIyp6IGs8nkZs/qCMhujcX2sGvl1RBz7VwcO+2/NhbHTDXRUw/XNi5TGtLSGOeEMatcj8FjxmEdLrcWs+5F14o2wuOrP+P3MW7JU6mYbrxgZNWQNNOkN/vCQm+QuGOkV4wzEWEOljhACXU9VOVGF24yfBdp+SI0RhSCEVQDWesGRRYM0CDY4nOXcltzOqqoIBeE08ecJWO9Wt8a5/E0oOBWnuO9Vn3VL5Ss/nmW0kMClo1+iWNjqFYbmDCLR7eGP+Kl6AfoWUWRNronZ8UOHWCyzhpLxXOgAuUMPGwyKNGYVFiZ3pv4QKBgQD4ZYbhJSWiqsbUHlqcXIhuOwR2pBcMu/pzrRs+Y0JDz/x1B65WIEvAA0YDf8XQVk++g0O/M0+lXrsRcaCJ7ZmJue/61RggdGBXDwtCLOqKZbs4lvwmPAfsAyCnMgtpYZRUlXLTh8yC/kJv1WdOiyrlAopuyuT1R37M4IZVA615ZQKBgQDFRk6NfC1m5igpWNsCLt5vH1V1H9wyjwK+nQ9FJLsg+Ah5P+ANFHzW4gYX1+bfnhzZR02UoJmGMheXVl7g+d0Pw/KeHEidLvLsCx7id/bKquilB8dyUDIemJ9dVyzerRqc+Q1h19obBhZA3AdxXKaeFXnym2busZbqGba+Ww7HdwKBgCJvCJSbbq0vGWL8VjlIxozpV4QO2Tcls+FnRNiQL/ZwlaGvj+ZWkcmraoA/rS9lV6akUbbmqQrWp/4SD1wveNJT2UWfVrnhCB3pcvkYeub2lU6R96BhQAPipxsmX9ia81IKaaGTOLGMB6+zGKAVwLuAb6pOLBEoeRZzpYuRd/HVAoGBAMATfnRfzcz8l2n6q/LqM4U6mvhZNwq7F88EGVQXOWQWXBnCSaIyqoKGu6wHeTGNP0WHGVB3NkPlDfc6D1M5tTWeceHkZAc3KSsOgNm8ODyIP9A/TMBOuR31OGWndXayUNE55P+5LRFW0eAA2/ZSYaBWBNBk4snRe8EfnECnZDJtAoGBAMLZzmrQ5knaT0HID05axZwts+BM9aYkyHPkzfOlLnLTsS7w7e0mJhyihnJXQStzl0ihOSY+8ox8u+A9qYjiEROnc3MUFe7UAqk9lSSHd2D16sqT1MOhhXmwJ9/Ftb2GjYzfRK2Gi1V46UWnLpWIihWxT1Eh9AUgagqbcFRaResy";
public static String alipayPublicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjTYSicJWsQC+D4yqZdhs8Ew1gepk56+pK5zgF3I+Z/OoaiEZ1gKdeC37c1d4Xzh9tK4+74JRN6LVSSK+83zsUBZfJPOf9vssV/uDvbxniQ+SHHgNZEkfpgOTbWpckJJlHDTQNS9gwVF+uLDa2++9mHx+fUpC6iQBljsY42JpJ2kW0HGbkHnjNwkJMmJeqbEJcLynKkAxOKhkoOIIuGLhJtnsW3RlpRB6z9kZHhi26p5GYT3j8RhEKYUGnuav2T5W/eq074jD4oInDT2vnWZT6Q3ardhUJzeQZCMX6Gxa9wphNEFHixp3CYV4dUOkQ4nsdAYN8tdTG4oWQLLbJQcDPQIDAQAB";
public static String decryptKey = "+RWPnjKz2WzhE2pa7lx4Ag==";
/**
* @description: 获取openId
* @author: wangmenglong
* @date; 2023/12/7 10:07
* @param: [req]
* @return: com.github.pagehelper.PageInfo
**/
@GetMapping("/getopenId")
public BaseResult getopenId(HttpServletRequest req)throws AlipayApiException{
String code = req.getParameter("code");
// 初始化SDK
AlipayClient alipayClient = new DefaultAlipayClient(getAlipayConfig());
// 构造请求参数以调用接口
AlipaySystemOauthTokenRequest request = new AlipaySystemOauthTokenRequest();
// 设置刷新令牌
//request.setRefreshToken("201208134b203fe6c11548bcabd8da5bb087a83b");
// 设置授权码
request.setCode(code);
// 设置授权方式
request.setGrantType("authorization_code");
AlipaySystemOauthTokenResponse response = alipayClient.execute(request);
System.out.println(response.getBody());
if (response.isSuccess()) {
System.out.println("调用成功");
} else {
System.out.println("调用失败");
}
return BaseResult.success(response.getBody());
}
/**
* @description: 获取手机号
* @author: wangmenglong
* @date; 2023/12/7 10:07
* @param: [req]
* @return: com.github.pagehelper.PageInfo
**/
@PostMapping("/getPhone")
public BaseResult getPhone(@RequestBody JSONObject jsonObject)throws Exception{
String sign = jsonObject.getString("sign");
String content = jsonObject.getString("response");
//1. 获取验签和解密所需要的参数
String signType = "RSA2";
String charset = "UTF-8";
String encryptType = "AES";
//判断是否为加密内容
boolean isDataEncrypted = !content.startsWith("{");
boolean signCheckPass = false;
//2. 验签
String signContent = content;
String signVeriKey = alipayPublicKey;
//String decryptKey = decryptKey;
if (isDataEncrypted) {
signContent = "\"" + signContent + "\"";
} try {
signCheckPass = AlipaySignature.rsaCheck(signContent, sign, signVeriKey, charset, signType);
} catch (AlipayApiException e) {
// 验签异常, 日志
} if (!signCheckPass) {
//验签不通过(异常或者报文被篡改),终止流程(不需要做解密)
throw new Exception("验签失败");
}
//3. 解密
String plainData = null;
if (isDataEncrypted) {
try {
plainData = AlipayEncrypt.decryptContent(content, encryptType, decryptKey, charset);
} catch (AlipayApiException e) {
//解密异常, 记录日志
throw new Exception("解密异常");
}
} else {
plainData = content;
}
return BaseResult.success(plainData);
}
private static AlipayConfig getAlipayConfig() {
AlipayConfig alipayConfig = new AlipayConfig();
alipayConfig.setServerUrl("https://openapi.alipay.com/gateway.do");
alipayConfig.setAppId(appId);
alipayConfig.setPrivateKey(privateKey);
alipayConfig.setFormat("json");
alipayConfig.setAlipayPublicKey(alipayPublicKey);
alipayConfig.setCharset("UTF-8");
alipayConfig.setSignType("RSA2");
return alipayConfig;
}
}
package com.jfb.recruit.controller.api;
import base.controller.BaseController;
import base.result.BaseResult;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import com.jfb.recruit.bean.auth.UserContext;
import com.jfb.recruit.service.IndustryService;
import com.jfb.recruit.util.auth.UserUtils;
import data.recruit.Industry;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* @author wangmenglong
* @description: 行业管理
* @date 2023/12/11 11:35
*/
@RestController
@RequestMapping("/public/industry")
public class ApiIndustryController extends BaseController {
@Resource
IndustryService industryService;
/**
* @description: 获取行业列表
* @author: wangmenglong
* @date; 2023/12/7 10:07
* @param: [req]
* @return: com.github.pagehelper.PageInfo
**/
@GetMapping("/l/all")
public BaseResult listAll(HttpServletRequest req,Industry industry){
List<Industry> list = industryService.listAll(industry);
return BaseResult.success(list);
}
}
package com.jfb.recruit.controller.api;
import base.controller.BaseController;
import base.result.BaseResult;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import com.jfb.recruit.bean.auth.UserContext;
import com.jfb.recruit.service.PersonService;
import com.jfb.recruit.util.auth.UserUtils;
import data.recruit.Person;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* @author wangmenglong
* @description: 人员管理
* @date 2023/12/11 11:35
*/
@RestController
@RequestMapping("/public/person")
public class ApiPersonController extends BaseController {
@Resource
PersonService personService;
/**
* @description: 新增人员
* @author: wangmenglong
* @param: [person]
* @return: base.result.BaseResult
**/
@PostMapping("/c")
public BaseResult create(@RequestBody Person person){
//判断是否重复
if(personService.isHave(person.getOpenId(),person.getId())){
return BaseResult.success("normal_001");
}
return personService.create(person)?BaseResult.success("normal_001"):BaseResult.error("error_001");
}
/**
* @description: 编辑人员
* @author: wangmenglong
* @param: [person]
* @return: base.result.BaseResult
**/
@PostMapping("/u")
public BaseResult update(@RequestBody Person person){
//判断是否重复
if(personService.isHave(person.getOpenId(),person.getId())){
return BaseResult.success("normal_001");
}
return personService.update(person)?BaseResult.success("normal_002"):BaseResult.error("error_002");
}
}
...@@ -76,9 +76,10 @@ public class JWTAuthenticationTokenFilter extends BasicAuthenticationFilter { ...@@ -76,9 +76,10 @@ public class JWTAuthenticationTokenFilter extends BasicAuthenticationFilter {
// 获取用户名 // 获取用户名
String username = claims.getSubject(); String username = claims.getSubject();
String userId = claims.getId(); String userId = claims.getId();
String openId = (String) claims.get("openId");
//查询当前账号的状态,如果是禁用直接返回 //查询当前账号的状态,如果是禁用直接返回
//if("manage".equals(claims.get("type"))){ if(StringUtils.isBlank(openId)){
User user = userService.getDetailsByLoginAccount(username); User user = userService.getDetailsByLoginAccount(username);
...@@ -92,7 +93,7 @@ public class JWTAuthenticationTokenFilter extends BasicAuthenticationFilter { ...@@ -92,7 +93,7 @@ public class JWTAuthenticationTokenFilter extends BasicAuthenticationFilter {
// 账号被禁用 // 账号被禁用
throw new LockedException("账号被禁用"); throw new LockedException("账号被禁用");
} }
//} }
if (!StringUtils.isEmpty(username) && !StringUtils.isEmpty(userId)) { if (!StringUtils.isEmpty(username) && !StringUtils.isEmpty(userId)) {
// 获取角色 // 获取角色
......
...@@ -4,10 +4,38 @@ package com.jfb.recruit.mapper; ...@@ -4,10 +4,38 @@ package com.jfb.recruit.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import data.recruit.Objective; import data.recruit.Objective;
import data.recruit.ObjectiveIndustry; import data.recruit.ObjectiveIndustry;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/** /**
* @Author: wml * @Author: wml
* @Date 2025/5/9 10:21 * @Date 2025/5/9 10:21
*/ */
public interface ObjectiveIndustryMapper extends BaseMapper<ObjectiveIndustry> { public interface ObjectiveIndustryMapper extends BaseMapper<ObjectiveIndustry> {
/**
* 根据basecode查询员工意向行业列表
* @param baseCode 基础编码参数
* @return 员工意向行业列表
* @Author: wml
* @Date 2025/9/9 10:47
*/
@Select("<script>" +
"SELECT a.*,b.name from tb_objective_industry a " +
"left join tb_industry as b on b.id = a.industry_id where a.del = 0 "+
"<if test='baseCode != null and baseCode != \"\"'>" +
" and a.base_code = #{baseCode}" +
"</if>" +
"<if test='personId != null and personId != \"\"'>" +
" and a.person_id = #{personId}" +
"</if>" +
"<if test='industryId != null and industryId != \"\"'>" +
" and a.industry_id = #{industryId}" +
"</if>" +
"</script>")
List<ObjectiveIndustry> listAll(@Param("baseCode") String baseCode,@Param("personId") String personId,@Param("industryId") String industryId);
} }
...@@ -2,12 +2,42 @@ package com.jfb.recruit.mapper; ...@@ -2,12 +2,42 @@ package com.jfb.recruit.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import data.recruit.Industry;
import data.recruit.Recruit; import data.recruit.Recruit;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/** /**
* @Author: wml * @Author: wml
* @Date 2025/5/9 10:21 * @Date 2025/5/9 10:21
*/ */
public interface RecruitMapper extends BaseMapper<Recruit> { public interface RecruitMapper extends BaseMapper<Recruit> {
@Select("<script>" +
"SELECT r.* " +
"FROM tb_recruit r " +
"RIGHT JOIN tb_collect rt ON r.id = rt.recruit_id " +
"WHERE r.del = 0 and rt.del = 0 " +
"<if test='personId != null and personId != \"\"'>" +
" AND rt.person_id = #{personId}" +
"</if>" +
"ORDER BY rt.create_time DESC" +
"</script>")
List<Recruit> listByCollect(@Param("personId") String personId);
@Select("<script>" +
"SELECT r.*,rt.person_id as personId " +
"FROM tb_recruit r " +
"RIGHT JOIN tb_sign_record rt ON r.id = rt.recruit_id " +
"WHERE r.del = 0 and rt.del = 0 " +
"<if test='personId != null and personId != \"\"'>" +
" AND rt.person_id = #{personId}" +
"</if>" +
"ORDER BY rt.create_time DESC" +
"</script>")
List<Recruit> listBySignRecord(@Param("personId") String personId);
} }
package com.jfb.recruit.service;
import data.recruit.Collect;
import java.util.List;
/**
*
* @return: 收藏管理
* @Author: wml
* @Date 2025/5/9 10:20
*/
public interface CollectService {
List<Collect> list(int pageNum, int pageSize, Collect collect);
boolean create(Collect collect);
boolean update(Collect collect);
boolean del(String recruitId,String personId);
Collect getDetails(String id);
boolean isHave(String openId, String id);
}
package com.jfb.recruit.service;
import data.recruit.Industry;
import java.util.List;
/**
*
* @return: 行业管理
* @Author: wml
* @Date 2025/5/9 10:20
*/
public interface IndustryService {
List<Industry> list(int pageNum, int pageSize, Industry industry);
List<Industry> listAll(Industry industry);
boolean create(Industry industry);
boolean update(Industry industry);
boolean del(String id);
Industry getDetails(String id);
boolean isHave(String openId, String id);
}
package com.jfb.recruit.service;
import data.recruit.ObjectiveIndustry;
import java.util.List;
/**
*
* @return: 意向行业管理
* @Author: wml
* @Date 2025/5/9 10:20
*/
public interface ObjectiveIndustryService {
List<ObjectiveIndustry> listAll(ObjectiveIndustry objectiveIndustry);
boolean create(ObjectiveIndustry objectiveIndustry);
boolean update(ObjectiveIndustry objectiveIndustry);
boolean del(String id);
ObjectiveIndustry getDetails(String id);
boolean isHave(String openId, String id);
}
package com.jfb.recruit.service;
import data.recruit.Objective;
import java.util.List;
/**
*
* @return: 求职意向管理
* @Author: wml
* @Date 2025/5/9 10:20
*/
public interface ObjectiveService {
List<Objective> list(int pageNum, int pageSize, Objective objective);
boolean create(Objective objective);
boolean update(Objective objective);
boolean del(String id);
Objective getDetails(String id);
}
...@@ -23,4 +23,6 @@ public interface OrgService { ...@@ -23,4 +23,6 @@ public interface OrgService {
Org getDetails(String id); Org getDetails(String id);
boolean isHave(String name, String id);
} }
package com.jfb.recruit.service;
import data.recruit.Person;
import data.user.User;
import java.util.List;
/**
*
* @return: 报名员工管理
* @Author: wml
* @Date 2025/5/9 10:20
*/
public interface PersonService {
List<Person> list(int pageNum, int pageSize, Person person);
boolean create(Person person);
boolean update(Person person);
boolean del(String id);
Person getDetails(String id);
boolean isHave(String openId, String id);
Person getDetailsByLoginOpenId(String openId);
}
package com.jfb.recruit.service; package com.jfb.recruit.service;
import base.result.BaseResult;
import data.recruit.Recruit; import data.recruit.Recruit;
import java.util.List; import java.util.List;
...@@ -14,6 +13,12 @@ import java.util.List; ...@@ -14,6 +13,12 @@ import java.util.List;
public interface RecruitService { public interface RecruitService {
List<Recruit> listByCollect(int pageNum, int pageSize, String personId);
List<Recruit> listBySignRecord(int pageNum, int pageSize, String personId);
List<Recruit> listBySignRecordAdmin(int pageNum, int pageSize);
List<Recruit> list(int pageNum, int pageSize, Recruit recruit); List<Recruit> list(int pageNum, int pageSize, Recruit recruit);
boolean create(Recruit recruit); boolean create(Recruit recruit);
......
package com.jfb.recruit.service;
import data.recruit.SignRecord;
import java.util.List;
/**
*
* @return: 报名记录
* @Author: wml
* @Date 2025/5/9 10:20
*/
public interface SignRecordService {
boolean create(SignRecord signRecord);
boolean del(String recruitId,String personId);
boolean isHave(String openId, String id);
}
package com.jfb.recruit.service.auth; package com.jfb.recruit.service.auth;
import com.jfb.recruit.bean.auth.SelfUserEntity; import com.jfb.recruit.bean.auth.SelfUserEntity;
import com.jfb.recruit.service.PersonService;
import com.jfb.recruit.service.UserService; import com.jfb.recruit.service.UserService;
import data.recruit.Person;
import data.user.User; import data.user.User;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.LockedException; import org.springframework.security.authentication.LockedException;
import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UserDetailsService;
...@@ -22,6 +25,9 @@ public class SelfUserDetailsService implements UserDetailsService { ...@@ -22,6 +25,9 @@ public class SelfUserDetailsService implements UserDetailsService {
@Autowired @Autowired
private UserService userService; private UserService userService;
@Autowired
private PersonService personService;
/** /**
* 查询用户信息 * 查询用户信息
* @param username * @param username
...@@ -32,27 +38,44 @@ public class SelfUserDetailsService implements UserDetailsService { ...@@ -32,27 +38,44 @@ public class SelfUserDetailsService implements UserDetailsService {
@Override @Override
public SelfUserEntity loadUserByUsername(String username) throws UsernameNotFoundException { public SelfUserEntity loadUserByUsername(String username) throws UsernameNotFoundException {
HttpServletRequest req = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); HttpServletRequest req = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String wxType = req.getParameter("wxType");
SelfUserEntity sysUserEntity = new SelfUserEntity(); SelfUserEntity sysUserEntity = new SelfUserEntity();
User user = userService.getDetailsByLoginAccount(username); if(StringUtils.isNotBlank(wxType)&&wxType.equals("wx")){
Person user = personService.getDetailsByLoginOpenId(username);
if (user == null) { if (user == null) {
throw new UsernameNotFoundException("账号不存在"); throw new UsernameNotFoundException("账号不存在");
} }
Object state = user.getState();
if (!Objects.equals(state, "normal")) {
// 账号被禁用
log.error("登录失败, 账号被禁用, jsonObject={}", user);
throw new LockedException("账号被禁用");
}
sysUserEntity.setUsername(user.getAccount()); sysUserEntity.setUsername(user.getOpenId());
sysUserEntity.setPassword(user.getPassword()); sysUserEntity.setPassword("");
sysUserEntity.setUserId(user.getId()); sysUserEntity.setUserId(user.getId());
sysUserEntity.setBaseCode(user.getBaseCode()== null ? "" : user.getBaseCode()); sysUserEntity.setBaseCode(user.getBaseCode()== null ? "" : user.getBaseCode());
sysUserEntity.setName(user.getName()); sysUserEntity.setName(user.getName());
sysUserEntity.setType(user.getType()); sysUserEntity.setOpenId(user.getOpenId());
}else {
User user = userService.getDetailsByLoginAccount(username);
if (user == null) {
throw new UsernameNotFoundException("账号不存在");
}
Object state = user.getState();
if (!Objects.equals(state, "normal")) {
// 账号被禁用
log.error("登录失败, 账号被禁用, jsonObject={}", user);
throw new LockedException("账号被禁用");
}
sysUserEntity.setUsername(user.getAccount());
sysUserEntity.setPassword(user.getPassword());
sysUserEntity.setUserId(user.getId());
sysUserEntity.setBaseCode(user.getBaseCode()== null ? "" : user.getBaseCode());
sysUserEntity.setName(user.getName());
sysUserEntity.setType(user.getType());
}
return sysUserEntity; return sysUserEntity;
} }
} }
\ No newline at end of file
...@@ -10,6 +10,7 @@ import org.springframework.security.core.Authentication; ...@@ -10,6 +10,7 @@ import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException; import org.springframework.security.core.AuthenticationException;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.DigestUtils; import org.springframework.util.DigestUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes; import org.springframework.web.context.request.ServletRequestAttributes;
...@@ -24,17 +25,27 @@ public class UserAuthenticationProvider implements AuthenticationProvider { ...@@ -24,17 +25,27 @@ public class UserAuthenticationProvider implements AuthenticationProvider {
@Override @Override
public Authentication authenticate(Authentication authentication) throws AuthenticationException { public Authentication authenticate(Authentication authentication) throws AuthenticationException {
HttpServletRequest req = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); HttpServletRequest req = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String wxType = req.getParameter("wxType");
SelfUserEntity sysUserEntity = new SelfUserEntity();
// 获取表单输入中返回的用户名 // 获取表单输入中返回的用户名
// String username = (String) authentication.getPrincipal(); // String username = (String) authentication.getPrincipal();
String username = authentication.getName(); String username = authentication.getName();
// 获取表单中输入的密码 // 获取表单中输入的密码
String password = DigestUtils.md5DigestAsHex(authentication.getCredentials().toString().getBytes()); String password = DigestUtils.md5DigestAsHex(authentication.getCredentials().toString().getBytes());
// 查询用户是否存在 // 查询用户是否存在
SelfUserEntity userInfo = selfUserDetailsService.loadUserByUsername(username); SelfUserEntity userInfo = selfUserDetailsService.loadUserByUsername(username);
//验证密码是否正确
if (!userInfo.getPassword().equals(password)) { if(org.apache.commons.lang3.StringUtils.isNotBlank(wxType)&&wxType.equals("wx")){
throw new BadCredentialsException("密码不正确");
}else{
//验证密码是否正确
if (!userInfo.getPassword().equals(password)) {
throw new BadCredentialsException("密码不正确");
}
} }
return new UsernamePasswordAuthenticationToken(userInfo, password, userInfo.getAuthorities()); return new UsernamePasswordAuthenticationToken(userInfo, password, userInfo.getAuthorities());
} }
......
package com.jfb.recruit.service.impl;
import cn.hutool.core.date.DateUtil;
import com.alibaba.cloud.commons.lang.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.jfb.recruit.bean.auth.UserContext;
import com.jfb.recruit.mapper.CollectMapper;
import com.jfb.recruit.service.CollectService;
import com.jfb.recruit.util.auth.UserUtils;
import com.jfb.recruit.xsnowflake.SnowFlakeFactory;
import data.recruit.Collect;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
*
* @return: 收藏管理
* @Author: wml
* @Date 2025/5/9 10:22
*/
@Service
@Transactional
public class CollectServiceImpl extends ServiceImpl<CollectMapper, Collect> implements CollectService {
@Autowired
SnowFlakeFactory snowFlakeFactory;
/**
* @description: 获取收藏列表
* @author: wangmenglong
* @date; 2023/12/11 16:46
* @param: [pageNum, pageSize]
* @return: java.util.List<data.collect.Collect>
**/
@Override
public List<Collect> list(int pageNum, int pageSize, Collect collect) {
//启动分页工具
PageHelper.startPage(pageNum, pageSize);
//创建查询条件
LambdaQueryWrapper<Collect> qw = new LambdaQueryWrapper<>();
qw.like(StringUtils.isNotBlank(collect.getPersonId()),Collect::getPersonId,collect.getPersonId())
.eq(Collect::getDel,false)
.eq(StringUtils.isNotBlank(collect.getBaseCode()),Collect::getBaseCode, collect.getBaseCode())
.orderByDesc(Collect::getCreateTime);
List<Collect> collectList = super.list(qw);
//返回查询结果
return collectList;
}
/**
* @description: 新增收藏
* @author: wangmenglong
* @date; 2023/12/11 16:51
* @param: [collect]
* @return: boolean
**/
@Override
public boolean create(Collect collect) {
UserContext userContext = UserUtils.getUserContext();
String baseCode = userContext.getBaseCode();
collect.setId(snowFlakeFactory.nextId());
collect.setBaseCode(baseCode);
collect.setDel(false);
collect.setCreateTime(DateUtil.now());
return super.save(collect);
}
/**
* @description: 编辑收藏
* @author: wangmenglong
* @date; 2023/12/11 16:55
* @param: [collect]
* @return: boolean
**/
@Override
public boolean update(Collect collect) {
collect.setUpdateTime(DateUtil.now());
//判断是否传入id
if(StringUtils.isBlank(collect.getId())){
return false;
}
return super.saveOrUpdate(collect);
}
/**
* @description: 删除收藏
* @author: wangmenglong
* @date; 2023/12/11 17:06
* @param: [id]
* @return: boolean
**/
@Override
public boolean del(String recruitId,String personId) {
if(StringUtils.isBlank(recruitId)||StringUtils.isBlank(personId)){
return false;
}
LambdaUpdateWrapper<Collect> qw = new LambdaUpdateWrapper<>();
qw.eq(Collect::getRecruitId,recruitId).eq(Collect::getPersonId,personId)
.set(Collect::getDel,true)
.set(Collect::getDelTime, DateUtil.now());
return super.update(qw);
}
/**
* @author: wangmenglong
* @date; 2024/3/24 17:19
* @description: 获取收藏详情
* @param: [id]
* @return: data.collect.Collect
**/
@Override
public Collect getDetails(String id) {
return super.getById(id);
}
/**
* @author: wangmenglong
* @date; 2024/1/2 14:30
* @description: 判断是否存在
* @param: [account, id]
* @return: boolean
**/
@Override
public boolean isHave(String recruitId, String personId) {
LambdaQueryWrapper<Collect> qw = new LambdaQueryWrapper<>();
qw.eq(Collect::getDel,false)
.eq(Collect::getRecruitId, recruitId)
.eq(Collect::getPersonId, personId);
return super.count(qw)>0;
}
}
package com.jfb.recruit.service.impl;
import cn.hutool.core.date.DateUtil;
import com.alibaba.cloud.commons.lang.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.jfb.recruit.bean.auth.UserContext;
import com.jfb.recruit.mapper.IndustryMapper;
import com.jfb.recruit.service.IndustryService;
import com.jfb.recruit.util.auth.UserUtils;
import com.jfb.recruit.xsnowflake.SnowFlakeFactory;
import data.recruit.Industry;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
*
* @return: 行业管理
* @Author: wml
* @Date 2025/5/9 10:22
*/
@Service
@Transactional
public class IndustryServiceImpl extends ServiceImpl<IndustryMapper, Industry> implements IndustryService {
@Autowired
SnowFlakeFactory snowFlakeFactory;
/**
* @description: 获取行业列表
* @author: wangmenglong
* @date; 2023/12/11 16:46
* @param: [pageNum, pageSize]
* @return: java.util.List<data.industry.Industry>
**/
@Override
public List<Industry> list(int pageNum, int pageSize, Industry industry) {
//启动分页工具
PageHelper.startPage(pageNum, pageSize);
//创建查询条件
LambdaQueryWrapper<Industry> qw = new LambdaQueryWrapper<>();
qw.like(StringUtils.isNotBlank(industry.getName()),Industry::getName,industry.getName())
.eq(Industry::getDel,false)
.eq(StringUtils.isNotBlank(industry.getBaseCode()),Industry::getBaseCode, industry.getBaseCode())
.orderByDesc(Industry::getCreateTime);
List<Industry> industryList = super.list(qw);
//返回查询结果
return industryList;
}
/**
* @description: 获取行业列表
* @author: wangmenglong
* @date; 2023/12/11 16:46
* @param: [pageNum, pageSize]
* @return: java.util.List<data.industry.Industry>
**/
@Override
public List<Industry> listAll(Industry industry) {
//创建查询条件
LambdaQueryWrapper<Industry> qw = new LambdaQueryWrapper<>();
qw.like(StringUtils.isNotBlank(industry.getName()),Industry::getName,industry.getName())
.eq(Industry::getDel,false)
.eq(StringUtils.isNotBlank(industry.getBaseCode()),Industry::getBaseCode, industry.getBaseCode())
.orderByDesc(Industry::getCreateTime);
List<Industry> industryList = super.list(qw);
//返回查询结果
return industryList;
}
/**
* @description: 新增行业
* @author: wangmenglong
* @date; 2023/12/11 16:51
* @param: [industry]
* @return: boolean
**/
@Override
public boolean create(Industry industry) {
UserContext userContext = UserUtils.getUserContext();
String baseCode = userContext.getBaseCode();
industry.setId(snowFlakeFactory.nextId());
industry.setBaseCode(baseCode);
industry.setDel(false);
industry.setCreateTime(DateUtil.now());
return super.save(industry);
}
/**
* @description: 编辑行业
* @author: wangmenglong
* @date; 2023/12/11 16:55
* @param: [industry]
* @return: boolean
**/
@Override
public boolean update(Industry industry) {
industry.setUpdateTime(DateUtil.now());
//判断是否传入id
if(StringUtils.isBlank(industry.getId())){
return false;
}
return super.saveOrUpdate(industry);
}
/**
* @description: 删除行业
* @author: wangmenglong
* @date; 2023/12/11 17:06
* @param: [id]
* @return: boolean
**/
@Override
public boolean del(String id) {
if(StringUtils.isBlank(id)){
return false;
}
LambdaUpdateWrapper<Industry> qw = new LambdaUpdateWrapper<>();
qw.eq(Industry::getId,id)
.set(Industry::getDel,true)
.set(Industry::getDelTime, DateUtil.now());
return super.update(qw);
}
/**
* @author: wangmenglong
* @date; 2024/3/24 17:19
* @description: 获取行业详情
* @param: [id]
* @return: data.industry.Industry
**/
@Override
public Industry getDetails(String id) {
return super.getById(id);
}
/**
* @author: wangmenglong
* @date; 2024/1/2 14:30
* @description: 判断是否存在
* @param: [account, id]
* @return: boolean
**/
@Override
public boolean isHave(String name, String id) {
LambdaQueryWrapper<Industry> qw = new LambdaQueryWrapper<>();
qw.eq(Industry::getDel,false)
.eq(Industry::getName, name);
//如果传了id就是编辑,编辑的时候要加个条件,不能把名字跟别人重复
if(StringUtils.isNotBlank(id)){
qw.ne(Industry::getId,id);
}
return super.count(qw)>0;
}
}
package com.jfb.recruit.service.impl;
import cn.hutool.core.date.DateUtil;
import com.alibaba.cloud.commons.lang.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.jfb.recruit.bean.auth.UserContext;
import com.jfb.recruit.mapper.ObjectiveIndustryMapper;
import com.jfb.recruit.service.ObjectiveIndustryService;
import com.jfb.recruit.util.auth.UserUtils;
import com.jfb.recruit.xsnowflake.SnowFlakeFactory;
import data.recruit.ObjectiveIndustry;
import data.user.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
/**
*
* @return: 意向行业管理
* @Author: wml
* @Date 2025/5/9 10:22
*/
@Service
@Transactional
public class ObjectiveIndustryServiceImpl extends ServiceImpl<ObjectiveIndustryMapper, ObjectiveIndustry> implements ObjectiveIndustryService {
@Autowired
SnowFlakeFactory snowFlakeFactory;
@Resource
public ObjectiveIndustryMapper objectiveIndustryMapper;
/**
* @description: 获取意向行业列表
* @author: wangmenglong
* @date; 2023/12/11 16:46
* @param: [pageNum, pageSize]
* @return: java.util.List<data.objectiveIndustry.ObjectiveIndustry>
**/
@Override
public List<ObjectiveIndustry> listAll(ObjectiveIndustry objectiveIndustry) {
//返回查询结果
return objectiveIndustryMapper.listAll(objectiveIndustry.getBaseCode(),objectiveIndustry.getPersonId(),objectiveIndustry.getIndustryId());
}
/**
* @description: 新增意向行业
* @author: wangmenglong
* @date; 2023/12/11 16:51
* @param: [objectiveIndustry]
* @return: boolean
**/
@Override
public boolean create(ObjectiveIndustry objectiveIndustry) {
UserContext userContext = UserUtils.getUserContext();
String baseCode = userContext.getBaseCode();
objectiveIndustry.setId(snowFlakeFactory.nextId());
objectiveIndustry.setBaseCode(baseCode);
objectiveIndustry.setDel(false);
objectiveIndustry.setCreateTime(DateUtil.now());
return super.save(objectiveIndustry);
}
/**
* @description: 编辑意向行业
* @author: wangmenglong
* @date; 2023/12/11 16:55
* @param: [objectiveIndustry]
* @return: boolean
**/
@Override
public boolean update(ObjectiveIndustry objectiveIndustry) {
objectiveIndustry.setUpdateTime(DateUtil.now());
//判断是否传入id
if(StringUtils.isBlank(objectiveIndustry.getId())){
return false;
}
return super.saveOrUpdate(objectiveIndustry);
}
/**
* @description: 删除意向行业
* @author: wangmenglong
* @date; 2023/12/11 17:06
* @param: [id]
* @return: boolean
**/
@Override
public boolean del(String id) {
if(StringUtils.isBlank(id)){
return false;
}
LambdaUpdateWrapper<ObjectiveIndustry> qw = new LambdaUpdateWrapper<>();
qw.eq(ObjectiveIndustry::getId,id)
.set(ObjectiveIndustry::getDel,true)
.set(ObjectiveIndustry::getDelTime, DateUtil.now());
return super.update(qw);
}
/**
* @author: wangmenglong
* @date; 2024/3/24 17:19
* @description: 获取意向行业详情
* @param: [id]
* @return: data.objectiveIndustry.ObjectiveIndustry
**/
@Override
public ObjectiveIndustry getDetails(String id) {
return super.getById(id);
}
/**
* @author: wangmenglong
* @date; 2024/1/2 14:30
* @description: 判断是否存在
* @param: [account, id]
* @return: boolean
**/
@Override
public boolean isHave(String personId, String industryId) {
LambdaQueryWrapper<ObjectiveIndustry> qw = new LambdaQueryWrapper<>();
qw.eq(ObjectiveIndustry::getDel,false)
.eq(ObjectiveIndustry::getPersonId, personId)
.eq(ObjectiveIndustry::getIndustryId, industryId);
return super.count(qw)>0;
}
}
package com.jfb.recruit.service.impl;
import cn.hutool.core.date.DateUtil;
import com.alibaba.cloud.commons.lang.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.jfb.recruit.bean.auth.UserContext;
import com.jfb.recruit.mapper.ObjectiveMapper;
import com.jfb.recruit.service.ObjectiveService;
import com.jfb.recruit.util.auth.UserUtils;
import com.jfb.recruit.xsnowflake.SnowFlakeFactory;
import data.recruit.Objective;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
*
* @return: 求职意向管理
* @Author: wml
* @Date 2025/5/9 10:22
*/
@Service
@Transactional
public class ObjectiveServiceImpl extends ServiceImpl<ObjectiveMapper, Objective> implements ObjectiveService {
@Autowired
SnowFlakeFactory snowFlakeFactory;
/**
* @description: 获取求职意向列表
* @author: wangmenglong
* @date; 2023/12/11 16:46
* @param: [pageNum, pageSize]
* @return: java.util.List<data.objective.Objective>
**/
@Override
public List<Objective> list(int pageNum, int pageSize, Objective objective) {
//启动分页工具
PageHelper.startPage(pageNum, pageSize);
//创建查询条件
LambdaQueryWrapper<Objective> qw = new LambdaQueryWrapper<>();
qw.eq(Objective::getDel,false)
.eq(StringUtils.isNotBlank(objective.getBaseCode()),Objective::getBaseCode, objective.getBaseCode())
.eq(StringUtils.isNotBlank(objective.getPersonId()),Objective::getPersonId, objective.getPersonId())
.orderByDesc(Objective::getCreateTime);
List<Objective> objectiveList = super.list(qw);
//返回查询结果
return objectiveList;
}
/**
* @description: 新增求职意向
* @author: wangmenglong
* @date; 2023/12/11 16:51
* @param: [objective]
* @return: boolean
**/
@Override
public boolean create(Objective objective) {
UserContext userContext = UserUtils.getUserContext();
String baseCode = userContext.getBaseCode();
objective.setId(snowFlakeFactory.nextId());
objective.setBaseCode(baseCode);
objective.setDel(false);
objective.setCreateTime(DateUtil.now());
return super.save(objective);
}
/**
* @description: 编辑求职意向
* @author: wangmenglong
* @date; 2023/12/11 16:55
* @param: [objective]
* @return: boolean
**/
@Override
public boolean update(Objective objective) {
objective.setUpdateTime(DateUtil.now());
//判断是否传入id
if(StringUtils.isBlank(objective.getId())){
return false;
}
return super.saveOrUpdate(objective);
}
/**
* @description: 删除求职意向
* @author: wangmenglong
* @date; 2023/12/11 17:06
* @param: [id]
* @return: boolean
**/
@Override
public boolean del(String id) {
if(StringUtils.isBlank(id)){
return false;
}
LambdaUpdateWrapper<Objective> qw = new LambdaUpdateWrapper<>();
qw.eq(Objective::getId,id)
.set(Objective::getDel,true)
.set(Objective::getDelTime, DateUtil.now());
return super.update(qw);
}
/**
* @author: wangmenglong
* @date; 2024/3/24 17:19
* @description: 获取求职意向详情
* @param: [id]
* @return: data.objective.Objective
**/
@Override
public Objective getDetails(String id) {
return super.getById(id);
}
}
...@@ -12,6 +12,7 @@ import com.jfb.recruit.service.OrgService; ...@@ -12,6 +12,7 @@ import com.jfb.recruit.service.OrgService;
import com.jfb.recruit.util.auth.UserUtils; import com.jfb.recruit.util.auth.UserUtils;
import com.jfb.recruit.xsnowflake.SnowFlakeFactory; import com.jfb.recruit.xsnowflake.SnowFlakeFactory;
import data.recruit.Org; import data.recruit.Org;
import data.user.User;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -126,4 +127,24 @@ public class OrgServiceImpl extends ServiceImpl<OrgMapper, Org> implements OrgSe ...@@ -126,4 +127,24 @@ public class OrgServiceImpl extends ServiceImpl<OrgMapper, Org> implements OrgSe
return super.getById(id); return super.getById(id);
} }
/**
* @author: wangmenglong
* @date; 2024/1/2 14:30
* @description: 判断是否存在
* @param: [account, id]
* @return: boolean
**/
@Override
public boolean isHave(String name, String id) {
LambdaQueryWrapper<Org> qw = new LambdaQueryWrapper<>();
qw.eq(Org::getDel,false)
.eq(Org::getName, name);
//如果传了id就是编辑,编辑的时候要加个条件,不能把名字跟别人重复
if(StringUtils.isNotBlank(id)){
qw.ne(Org::getId,id);
}
return super.count(qw)>0;
}
} }
package com.jfb.recruit.service.impl;
import cn.hutool.core.date.DateUtil;
import com.alibaba.cloud.commons.lang.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.jfb.recruit.bean.auth.UserContext;
import com.jfb.recruit.mapper.PersonMapper;
import com.jfb.recruit.service.PersonService;
import com.jfb.recruit.util.auth.UserUtils;
import com.jfb.recruit.xsnowflake.SnowFlakeFactory;
import data.recruit.Person;
import data.user.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
*
* @return: 报名员工管理
* @Author: wml
* @Date 2025/5/9 10:22
*/
@Service
@Transactional
public class PersonServiceImpl extends ServiceImpl<PersonMapper, Person> implements PersonService {
@Autowired
SnowFlakeFactory snowFlakeFactory;
/**
* @description: 获取报名员工列表
* @author: wangmenglong
* @date; 2023/12/11 16:46
* @param: [pageNum, pageSize]
* @return: java.util.List<data.person.Person>
**/
@Override
public List<Person> list(int pageNum, int pageSize, Person person) {
//启动分页工具
PageHelper.startPage(pageNum, pageSize);
//创建查询条件
LambdaQueryWrapper<Person> qw = new LambdaQueryWrapper<>();
qw.like(StringUtils.isNotBlank(person.getName()),Person::getName,person.getName())
.eq(Person::getDel,false)
.eq(StringUtils.isNotBlank(person.getBaseCode()),Person::getBaseCode, person.getBaseCode())
.orderByDesc(Person::getCreateTime);
List<Person> personList = super.list(qw);
//返回查询结果
return personList;
}
/**
* @description: 新增报名员工
* @author: wangmenglong
* @date; 2023/12/11 16:51
* @param: [person]
* @return: boolean
**/
@Override
public boolean create(Person person) {
UserContext userContext = UserUtils.getUserContext();
String baseCode = userContext.getBaseCode();
person.setId(snowFlakeFactory.nextId());
person.setBaseCode(baseCode);
person.setDel(false);
person.setCreateTime(DateUtil.now());
return super.save(person);
}
/**
* @description: 编辑报名员工
* @author: wangmenglong
* @date; 2023/12/11 16:55
* @param: [person]
* @return: boolean
**/
@Override
public boolean update(Person person) {
person.setUpdateTime(DateUtil.now());
//判断是否传入id
if(StringUtils.isBlank(person.getId())){
return false;
}
return super.saveOrUpdate(person);
}
/**
* @description: 删除报名员工
* @author: wangmenglong
* @date; 2023/12/11 17:06
* @param: [id]
* @return: boolean
**/
@Override
public boolean del(String id) {
if(StringUtils.isBlank(id)){
return false;
}
LambdaUpdateWrapper<Person> qw = new LambdaUpdateWrapper<>();
qw.eq(Person::getId,id)
.set(Person::getDel,true)
.set(Person::getDelTime, DateUtil.now());
return super.update(qw);
}
/**
* @author: wangmenglong
* @date; 2024/3/24 17:19
* @description: 获取报名员工详情
* @param: [id]
* @return: data.person.Person
**/
@Override
public Person getDetails(String id) {
return super.getById(id);
}
/**
* @author: wangmenglong
* @date; 2024/1/2 14:30
* @description: 判断是否存在
* @param: [account, id]
* @return: boolean
**/
@Override
public boolean isHave(String openId, String id) {
LambdaQueryWrapper<Person> qw = new LambdaQueryWrapper<>();
qw.eq(Person::getDel,false)
.eq(Person::getOpenId, openId);
//如果传了id就是编辑,编辑的时候要加个条件,不能把名字跟别人重复
if(StringUtils.isNotBlank(id)){
qw.ne(Person::getId,id);
}
return super.count(qw)>0;
}
/**
* @author: wangmenglong
* @date; 2025/5/9 10:22
* @description: 获取用户详情,登陆用
* @param: [id]
* @return: data.user.User
**/
@Override
public Person getDetailsByLoginOpenId(String openId) {
//创建查询条件
LambdaQueryWrapper<Person> qw = new LambdaQueryWrapper<>();
qw.eq(Person::getOpenId,openId)
.eq(Person::getDel,false);
return super.getOne(qw);
}
}
package com.jfb.recruit.service.impl; package com.jfb.recruit.service.impl;
import base.result.BaseResult;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.cloud.commons.lang.StringUtils; import com.alibaba.cloud.commons.lang.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
...@@ -10,6 +8,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -10,6 +8,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.jfb.recruit.bean.auth.UserContext; import com.jfb.recruit.bean.auth.UserContext;
import com.jfb.recruit.mapper.RecruitMapper; import com.jfb.recruit.mapper.RecruitMapper;
import com.jfb.recruit.service.PersonService;
import com.jfb.recruit.service.RecruitService; import com.jfb.recruit.service.RecruitService;
import com.jfb.recruit.util.auth.UserUtils; import com.jfb.recruit.util.auth.UserUtils;
import com.jfb.recruit.xsnowflake.SnowFlakeFactory; import com.jfb.recruit.xsnowflake.SnowFlakeFactory;
...@@ -17,8 +16,8 @@ import data.recruit.Recruit; ...@@ -17,8 +16,8 @@ import data.recruit.Recruit;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.DigestUtils;
import javax.annotation.Resource;
import java.util.List; import java.util.List;
/** /**
...@@ -34,6 +33,64 @@ public class RecruitServiceImpl extends ServiceImpl<RecruitMapper, Recruit> impl ...@@ -34,6 +33,64 @@ public class RecruitServiceImpl extends ServiceImpl<RecruitMapper, Recruit> impl
@Autowired @Autowired
SnowFlakeFactory snowFlakeFactory; SnowFlakeFactory snowFlakeFactory;
@Resource
private RecruitMapper recruitMapper;
@Resource
private PersonService personService;
/**
* @description: 获取招聘列表
* @author: wangmenglong
* @date; 2023/12/11 16:46
* @param: [pageNum, pageSize]
* @return: java.util.List<data.recruit.Recruit>
**/
@Override
public List<Recruit> listBySignRecordAdmin(int pageNum, int pageSize) {
//启动分页工具
PageHelper.startPage(pageNum, pageSize);
List<Recruit> orgList = recruitMapper.listBySignRecord(null);
orgList.stream().forEach(recruit -> {
recruit.setPerson(personService.getDetails(recruit.getPersonId()));
});
//返回查询结果
return orgList;
}
/**
* @description: 获取招聘列表
* @author: wangmenglong
* @date; 2023/12/11 16:46
* @param: [pageNum, pageSize]
* @return: java.util.List<data.recruit.Recruit>
**/
@Override
public List<Recruit> listBySignRecord(int pageNum, int pageSize, String personId) {
//启动分页工具
PageHelper.startPage(pageNum, pageSize);
List<Recruit> orgList = recruitMapper.listBySignRecord(personId);
//返回查询结果
return orgList;
}
/**
* @description: 获取招聘列表
* @author: wangmenglong
* @date; 2023/12/11 16:46
* @param: [pageNum, pageSize]
* @return: java.util.List<data.recruit.Recruit>
**/
@Override
public List<Recruit> listByCollect(int pageNum, int pageSize, String personId) {
//启动分页工具
PageHelper.startPage(pageNum, pageSize);
List<Recruit> orgList = recruitMapper.listByCollect(personId);
//返回查询结果
return orgList;
}
/** /**
* @description: 获取招聘列表 * @description: 获取招聘列表
......
package com.jfb.recruit.service.impl;
import cn.hutool.core.date.DateUtil;
import com.alibaba.cloud.commons.lang.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.jfb.recruit.bean.auth.UserContext;
import com.jfb.recruit.mapper.SignRecordMapper;
import com.jfb.recruit.service.SignRecordService;
import com.jfb.recruit.util.auth.UserUtils;
import com.jfb.recruit.xsnowflake.SnowFlakeFactory;
import data.recruit.SignRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
*
* @return: 报名管理
* @Author: wml
* @Date 2025/5/9 10:22
*/
@Service
@Transactional
public class SignRecordServiceImpl extends ServiceImpl<SignRecordMapper, SignRecord> implements SignRecordService {
@Autowired
SnowFlakeFactory snowFlakeFactory;
/**
* @description: 新增报名
* @author: wangmenglong
* @date; 2023/12/11 16:51
* @param: [signRecord]
* @return: boolean
**/
@Override
public boolean create(SignRecord signRecord) {
UserContext userContext = UserUtils.getUserContext();
String baseCode = userContext.getBaseCode();
signRecord.setId(snowFlakeFactory.nextId());
signRecord.setBaseCode(baseCode);
signRecord.setDel(false);
signRecord.setCreateTime(DateUtil.now());
return super.save(signRecord);
}
/**
* @description: 删除报名
* @author: wangmenglong
* @date; 2023/12/11 17:06
* @param: [id]
* @return: boolean
**/
@Override
public boolean del(String recruitId,String personId) {
if(StringUtils.isBlank(recruitId)||StringUtils.isBlank(personId)){
return false;
}
LambdaUpdateWrapper<SignRecord> qw = new LambdaUpdateWrapper<>();
qw.eq(SignRecord::getRecruitId,recruitId).eq(SignRecord::getPersonId,personId)
.set(SignRecord::getDel,true)
.set(SignRecord::getDelTime, DateUtil.now());
return super.update(qw);
}
/**
* @author: wangmenglong
* @date; 2024/1/2 14:30
* @description: 判断是否存在
* @param: [account, id]
* @return: boolean
**/
@Override
public boolean isHave(String recruitId, String personId) {
LambdaQueryWrapper<SignRecord> qw = new LambdaQueryWrapper<>();
qw.eq(SignRecord::getDel,false)
.eq(SignRecord::getRecruitId, recruitId)
.eq(SignRecord::getPersonId, personId);
return super.count(qw)>0;
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论