|
@@ -1,34 +1,41 @@
|
|
package com.jpsoft.employment.modules.mobile.controller;
|
|
package com.jpsoft.employment.modules.mobile.controller;
|
|
|
|
|
|
-import cn.hutool.core.lang.Assert;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.HashMap;
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
+
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestAttribute;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
+
|
|
import com.github.pagehelper.Page;
|
|
import com.github.pagehelper.Page;
|
|
import com.jpsoft.employment.modules.common.dto.MessageResult;
|
|
import com.jpsoft.employment.modules.common.dto.MessageResult;
|
|
import com.jpsoft.employment.modules.common.dto.MessageResultBuilder;
|
|
import com.jpsoft.employment.modules.common.dto.MessageResultBuilder;
|
|
|
|
+import com.jpsoft.employment.modules.common.dto.MessageResultSimple;
|
|
import com.jpsoft.employment.modules.common.dto.Sort;
|
|
import com.jpsoft.employment.modules.common.dto.Sort;
|
|
import com.jpsoft.employment.modules.common.utils.MapUtils;
|
|
import com.jpsoft.employment.modules.common.utils.MapUtils;
|
|
import com.jpsoft.employment.modules.common.utils.PojoUtils;
|
|
import com.jpsoft.employment.modules.common.utils.PojoUtils;
|
|
import com.jpsoft.employment.modules.job.entity.RecruitmentVO;
|
|
import com.jpsoft.employment.modules.job.entity.RecruitmentVO;
|
|
-import com.jpsoft.employment.modules.job.entity.ResumeVO;
|
|
|
|
|
|
+import com.jpsoft.employment.modules.job.service.JobUserService;
|
|
import com.jpsoft.employment.modules.job.service.RecruitmentCollectionService;
|
|
import com.jpsoft.employment.modules.job.service.RecruitmentCollectionService;
|
|
import com.jpsoft.employment.modules.job.service.RecruitmentService;
|
|
import com.jpsoft.employment.modules.job.service.RecruitmentService;
|
|
|
|
+import com.jpsoft.employment.modules.job.service.ResumeService;
|
|
import com.jpsoft.employment.modules.job.service.UserBrowseHrService;
|
|
import com.jpsoft.employment.modules.job.service.UserBrowseHrService;
|
|
import com.jpsoft.employment.modules.sys.entity.UserVO;
|
|
import com.jpsoft.employment.modules.sys.entity.UserVO;
|
|
import com.jpsoft.employment.modules.sys.service.UserService;
|
|
import com.jpsoft.employment.modules.sys.service.UserService;
|
|
|
|
+
|
|
|
|
+import cn.hutool.core.lang.Assert;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
|
-import org.slf4j.Logger;
|
|
|
|
-import org.slf4j.LoggerFactory;
|
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
|
-import java.util.HashMap;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Map;
|
|
|
|
|
|
|
|
@Slf4j
|
|
@Slf4j
|
|
@RestController
|
|
@RestController
|
|
@@ -36,8 +43,7 @@ import java.util.Map;
|
|
@Api(tags = "移动端接口:招聘方相关接口")
|
|
@Api(tags = "移动端接口:招聘方相关接口")
|
|
public class RecruiterApiController {
|
|
public class RecruiterApiController {
|
|
|
|
|
|
- private Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
|
-
|
|
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private RecruitmentService recruitmentService;
|
|
private RecruitmentService recruitmentService;
|
|
|
|
|
|
@@ -50,10 +56,16 @@ public class RecruiterApiController {
|
|
@Autowired
|
|
@Autowired
|
|
private UserBrowseHrService userBrowseHrService;
|
|
private UserBrowseHrService userBrowseHrService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private JobUserService jobUserService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private ResumeService resumeService;
|
|
|
|
+
|
|
|
|
|
|
@PostMapping("getAboutMe")
|
|
@PostMapping("getAboutMe")
|
|
@ApiOperation(value = "招聘方['我的'主页]")
|
|
@ApiOperation(value = "招聘方['我的'主页]")
|
|
- public MessageResult<Map> getAboutMe(@RequestAttribute String subject){
|
|
|
|
|
|
+ public MessageResult<Map<String,Object>> getAboutMe(@RequestAttribute String subject){
|
|
try{
|
|
try{
|
|
//包含两部分信息:个人信息,统计信息
|
|
//包含两部分信息:个人信息,统计信息
|
|
Assert.state(StringUtils.isNoneEmpty(subject),"缺少用户参数");
|
|
Assert.state(StringUtils.isNoneEmpty(subject),"缺少用户参数");
|
|
@@ -80,7 +92,7 @@ public class RecruiterApiController {
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParam(name = "status", value = "招聘信息状态(publish:招聘中;approve:审核中;close:已下架)", required = true, paramType = "form")
|
|
@ApiImplicitParam(name = "status", value = "招聘信息状态(publish:招聘中;approve:审核中;close:已下架)", required = true, paramType = "form")
|
|
})
|
|
})
|
|
- public MessageResult<Map> loadOwnRecruitments(@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
|
|
|
+ public MessageResultSimple loadOwnRecruitments(@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
@RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
@RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
@RequestParam(value="status",defaultValue="publish") String status,
|
|
@RequestParam(value="status",defaultValue="publish") String status,
|
|
@RequestAttribute String subject
|
|
@RequestAttribute String subject
|
|
@@ -90,11 +102,33 @@ public class RecruiterApiController {
|
|
List<Sort> sortList = new ArrayList<>();
|
|
List<Sort> sortList = new ArrayList<>();
|
|
sortList.add(new Sort("updateTime","desc"));
|
|
sortList.add(new Sort("updateTime","desc"));
|
|
Page<RecruitmentVO> page = recruitmentService.loadForRecruiter(MapUtils.builder("recruiter",subject,"status",status),pageIndex,pageSize,true,sortList);
|
|
Page<RecruitmentVO> page = recruitmentService.loadForRecruiter(MapUtils.builder("recruiter",subject,"status",status),pageIndex,pageSize,true,sortList);
|
|
- return MessageResultBuilder.ok(PojoUtils.pageWrapper(page));
|
|
|
|
|
|
+ return MessageResultBuilder.success(PojoUtils.pageWrapper(page));
|
|
}
|
|
}
|
|
catch(Exception ex){
|
|
catch(Exception ex){
|
|
log.error(ex.getMessage());
|
|
log.error(ex.getMessage());
|
|
- return MessageResultBuilder.error(ex.getMessage());
|
|
|
|
|
|
+ return MessageResultBuilder.failed(ex.getMessage());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @PostMapping("publishRecruitment")
|
|
|
|
+ @ApiOperation(value = "招聘方[职位管理上下架操作]")
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
+ @ApiImplicitParam(name = "recruitmentId", value = "招聘记录ID", required = true, paramType = "form"),
|
|
|
|
+ @ApiImplicitParam(name = "publishTag", value = "上下架操作[1:上架,0:下架]", required = true, paramType = "form")
|
|
|
|
+ })
|
|
|
|
+ public MessageResultSimple publishRecruitment(@RequestParam(value="recruitmentId",required = true) String recruitmentId,
|
|
|
|
+ @RequestParam(value="publishTag",required = true) String publishTag,
|
|
|
|
+ @RequestAttribute String subject
|
|
|
|
+ ){
|
|
|
|
+ try{
|
|
|
|
+ Assert.state(StringUtils.isNotEmpty(recruitmentId),"缺少招聘记录参数");
|
|
|
|
+ Assert.state("1".equals(publishTag)||"0".equals(publishTag),"未选择上下架操作");
|
|
|
|
+
|
|
|
|
+ return recruitmentService.updateForPublish(recruitmentId, publishTag,subject)?MessageResultBuilder.success("success"): MessageResultBuilder.failed("操作失败");
|
|
|
|
+ }
|
|
|
|
+ catch(Exception ex){
|
|
|
|
+ log.error(ex.getMessage());
|
|
|
|
+ return MessageResultBuilder.failed(ex.getMessage());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -102,11 +136,21 @@ public class RecruiterApiController {
|
|
@PostMapping("loadCollectResumes")
|
|
@PostMapping("loadCollectResumes")
|
|
@ApiOperation(value = "招聘方[收藏简历]")
|
|
@ApiOperation(value = "招聘方[收藏简历]")
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
- @ApiImplicitParam(name = "positionName", value = "职位名称关键字", required = false, paramType = "form")
|
|
|
|
|
|
+ @ApiImplicitParam(name = "positionName", value = "职位名称关键字", required = false, paramType = "form"),
|
|
|
|
+ @ApiImplicitParam(name = "positionId", value = "职位类别id值", required = false, paramType = "form"),
|
|
|
|
+ @ApiImplicitParam(name = "education", value = "学历编码值", required = false, paramType = "form"),
|
|
|
|
+ @ApiImplicitParam(name = "workExp", value = "工作经验编码值", required = false, paramType = "form"),
|
|
|
|
+ @ApiImplicitParam(name = "dreamMoney", value = "期望月薪编码值", required = false, paramType = "form"),
|
|
|
|
+ @ApiImplicitParam(name = "jobStatus", value = "工作状态编码值", required = false, paramType = "form")
|
|
})
|
|
})
|
|
- public MessageResult<Map> loadCollectResumes(@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
|
|
|
+ public MessageResultSimple loadCollectResumes(@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
@RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
@RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
@RequestParam(value="positionName",required = false) String positionName,
|
|
@RequestParam(value="positionName",required = false) String positionName,
|
|
|
|
+ @RequestParam(value="positionId",required = false) String positionId,
|
|
|
|
+ @RequestParam(value="education",required = false) String education,
|
|
|
|
+ @RequestParam(value="workExp",required = false) String workExp,
|
|
|
|
+ @RequestParam(value="dreamMoney",required = false) String dreamMoney,
|
|
|
|
+ @RequestParam(value="jobStatus",required = false) String jobStatus,
|
|
@RequestAttribute String subject
|
|
@RequestAttribute String subject
|
|
) {
|
|
) {
|
|
|
|
|
|
@@ -114,12 +158,137 @@ public class RecruiterApiController {
|
|
List<Sort> sortList = new ArrayList<>();
|
|
List<Sort> sortList = new ArrayList<>();
|
|
sortList.add(new Sort("collectionTime","desc"));
|
|
sortList.add(new Sort("collectionTime","desc"));
|
|
positionName=StringUtils.isEmpty(positionName)?null:("%"+positionName+"%");
|
|
positionName=StringUtils.isEmpty(positionName)?null:("%"+positionName+"%");
|
|
- Page<ResumeVO> page = recruitmentCollectionService.pagedLoad(MapUtils.builder("recruiterId",subject,"positionName",positionName),pageIndex,pageSize,true,sortList);
|
|
|
|
- return MessageResultBuilder.ok(PojoUtils.pageWrapper(page));
|
|
|
|
|
|
+ Map<String,Object> args=MapUtils.builder("recruiterId",subject,"positionId",positionId,"positionName",positionName,"education",education,"workExp",workExp,"dreamMoney",dreamMoney,"jobStatus",jobStatus);
|
|
|
|
+ Page<Map<String,Object>> page = recruitmentCollectionService.pagedLoadCollectResumes(args,pageIndex,pageSize,true,sortList);
|
|
|
|
+ return MessageResultBuilder.success(PojoUtils.pageWrapper(page));
|
|
}
|
|
}
|
|
catch(Exception ex){
|
|
catch(Exception ex){
|
|
log.error(ex.getMessage());
|
|
log.error(ex.getMessage());
|
|
- return MessageResultBuilder.error(ex.getMessage());
|
|
|
|
|
|
+ return MessageResultBuilder.failed(ex.getMessage());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @PostMapping("cancelCollectResume")
|
|
|
|
+ @ApiOperation(value = "招聘方[收藏简历] 取消收藏")
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
+ @ApiImplicitParam(name = "resumeId", value = "简历记录主键", required = true, paramType = "form")
|
|
|
|
+ })
|
|
|
|
+ public MessageResultSimple cancelCollectResume(@RequestParam(value="resumeId",required = true) String resumeId, @RequestAttribute String subject) {
|
|
|
|
+ try{
|
|
|
|
+ Assert.state(StringUtils.isNoneEmpty(subject),"缺少登录信息");
|
|
|
|
+ recruitmentCollectionService.updateCancelCollect(resumeId,subject);
|
|
|
|
+ return MessageResultBuilder.success("success");
|
|
|
|
+ }
|
|
|
|
+ catch(Exception ex){
|
|
|
|
+ log.error(ex.getMessage());
|
|
|
|
+ return MessageResultBuilder.failed(ex.getMessage());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @PostMapping("loadAllResumes")
|
|
|
|
+ @ApiOperation(value = "招聘方[招聘主页]")
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
+ @ApiImplicitParam(name = "positionName", value = "职位名称关键字", required = false, paramType = "form"),
|
|
|
|
+ @ApiImplicitParam(name = "positionId", value = "职位类别id值", required = false, paramType = "form"),
|
|
|
|
+ @ApiImplicitParam(name = "education", value = "学历编码值", required = false, paramType = "form"),
|
|
|
|
+ @ApiImplicitParam(name = "workExp", value = "工作经验编码值", required = false, paramType = "form"),
|
|
|
|
+ @ApiImplicitParam(name = "dreamMoney", value = "期望月薪编码值", required = false, paramType = "form"),
|
|
|
|
+ @ApiImplicitParam(name = "jobStatus", value = "工作状态编码值", required = false, paramType = "form"),
|
|
|
|
+ @ApiImplicitParam(name = "orderType", value = "排序类别[new:最新,hot:最热]", required = false, paramType = "form")
|
|
|
|
+ })
|
|
|
|
+ public MessageResultSimple loadAllResumes(@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
|
+ @RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
|
|
+ @RequestParam(value="orderType",defaultValue="new") String orderType,
|
|
|
|
+ @RequestParam(value="positionName",required = false) String positionName,
|
|
|
|
+ @RequestParam(value="positionId",required = false) String positionId,
|
|
|
|
+ @RequestParam(value="education",required = false) String education,
|
|
|
|
+ @RequestParam(value="workExp",required = false) String workExp,
|
|
|
|
+ @RequestParam(value="dreamMoney",required = false) String dreamMoney,
|
|
|
|
+ @RequestParam(value="jobStatus",required = false) String jobStatus
|
|
|
|
+ ) {
|
|
|
|
+
|
|
|
|
+ try{
|
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
|
+ if("hot".equalsIgnoreCase(orderType)){
|
|
|
|
+ sortList.add(new Sort("browse_count","desc"));
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ sortList.add(new Sort("update_time","desc"));
|
|
|
|
+ }
|
|
|
|
+ positionName=StringUtils.isEmpty(positionName)?null:("%"+positionName+"%");
|
|
|
|
+ Map<String,Object> args=MapUtils.builder("positionId",positionId,"positionName",positionName,"education",education,"workExp",workExp,"dreamMoney",dreamMoney,"jobStatus",jobStatus);
|
|
|
|
+
|
|
|
|
+ Page<Map<String,Object>> page = recruitmentCollectionService.pagedLoadAllResumes(args,pageIndex,pageSize,true,sortList);
|
|
|
|
+ return MessageResultBuilder.success(PojoUtils.pageWrapper(page));
|
|
|
|
+ }
|
|
|
|
+ catch(Exception ex){
|
|
|
|
+ log.error(ex.getMessage());
|
|
|
|
+ return MessageResultBuilder.failed(ex.getMessage());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @PostMapping("loadInterestList")
|
|
|
|
+ @ApiOperation(value = "招聘方[对您感兴趣]")
|
|
|
|
+ public MessageResult<Map> loadInterestList(
|
|
|
|
+ String id,String token,
|
|
|
|
+ @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
|
+ @RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
|
|
+ @RequestAttribute String subject) {
|
|
|
|
+ System.out.println(subject);
|
|
|
|
+
|
|
|
|
+ MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
|
+
|
|
|
|
+ Map<String,Object> searchParams = new HashMap<>();
|
|
|
|
+
|
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
|
+ sortList.add(new Sort("jub.create_time","desc"));
|
|
|
|
+
|
|
|
|
+ if (StringUtils.isNotEmpty(id)) {
|
|
|
|
+ searchParams.put("id","%" + id + "%");
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ Page<Map> page = jobUserService.foundInterestList(searchParams,pageIndex,pageSize,true,sortList);
|
|
|
|
+
|
|
|
|
+ msgResult.setResult(true);
|
|
|
|
+ msgResult.setData(PojoUtils.pageWrapper(page));
|
|
|
|
+
|
|
|
|
+ return msgResult;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @PostMapping("loadJobManagement")
|
|
|
|
+ @ApiOperation(value = "招聘方[求职管理]")
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
+ @ApiImplicitParam(name = "type", value = "类型(1:已投递,2:邀沟通,3:邀面试,4:邀入职,5:已入职,6:不合适)", required = false, paramType = "query")
|
|
|
|
+ })
|
|
|
|
+ public MessageResult<Map> loadJobManagement(
|
|
|
|
+ String id,String token,String type,
|
|
|
|
+ @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
|
+ @RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
|
|
+ @RequestAttribute String subject) {
|
|
|
|
+ System.out.println(subject);
|
|
|
|
+
|
|
|
|
+ MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
|
+
|
|
|
|
+ Map<String,Object> searchParams = new HashMap<>();
|
|
|
|
+
|
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
|
+ sortList.add(new Sort("jrd.create_time","desc"));
|
|
|
|
+
|
|
|
|
+ if (StringUtils.isNotEmpty(id)) {
|
|
|
|
+ searchParams.put("id","%" + id + "%");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ searchParams.put("type",type);
|
|
|
|
+
|
|
|
|
+ Page<Map> page = resumeService.foundJobManagement(searchParams,pageIndex,pageSize,true,sortList);
|
|
|
|
+
|
|
|
|
+ msgResult.setResult(true);
|
|
|
|
+ msgResult.setData(PojoUtils.pageWrapper(page));
|
|
|
|
+
|
|
|
|
+ return msgResult;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|