|
|
@@ -19,8 +19,10 @@ import com.jpsoft.employment.modules.job.dto.WorkExpDTO;
|
|
|
import com.jpsoft.employment.modules.job.entity.*;
|
|
|
import com.jpsoft.employment.modules.job.service.*;
|
|
|
import com.jpsoft.employment.modules.sys.entity.DataDictionary;
|
|
|
+import com.jpsoft.employment.modules.sys.entity.User;
|
|
|
import com.jpsoft.employment.modules.sys.service.DataDictionaryService;
|
|
|
|
|
|
+import com.jpsoft.employment.modules.sys.service.UserService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
|
@@ -83,6 +85,12 @@ public class ResumeApiController {
|
|
|
@Autowired
|
|
|
private WorkCategoryService workCategoryService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private UserService userService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private UserBrowseHrService userBrowseHrService;
|
|
|
+
|
|
|
|
|
|
private Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
|
|
|
@@ -110,61 +118,6 @@ public class ResumeApiController {
|
|
|
return messageResult;
|
|
|
}
|
|
|
|
|
|
- @PostMapping("collectResume")
|
|
|
- @ApiOperation(value = "收藏简历")
|
|
|
- @ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "recruitmentId", value = "岗位ID", required = true, paramType = "query"),
|
|
|
- @ApiImplicitParam(name = "status", value = "状态(收藏1,取消0),默认1收藏", paramType = "query"),
|
|
|
- })
|
|
|
- public MessageResult<String> collectResume(
|
|
|
- String recruitmentId,
|
|
|
- @RequestParam(value="status",defaultValue="1") String status,
|
|
|
- String token,
|
|
|
- @RequestAttribute String subject) {
|
|
|
- MessageResult<String> messageResult = new MessageResult<>();
|
|
|
-
|
|
|
- try {
|
|
|
- UserCollection uc = userCollectionService.findByUserIdAndRId(subject,recruitmentId);
|
|
|
- if("1".equals(status)){
|
|
|
- if(uc == null){
|
|
|
- uc = new UserCollection();
|
|
|
- uc.setId(UUID.randomUUID().toString());
|
|
|
- uc.setCreateBy(subject);
|
|
|
- uc.setCreateTime(new Date());
|
|
|
- uc.setJobRecruitmentId(recruitmentId);
|
|
|
- uc.setJobUserId(subject);
|
|
|
- uc.setDelFlag(false);
|
|
|
-
|
|
|
- userCollectionService.insert(uc);
|
|
|
- }else{
|
|
|
- uc.setUpdateBy(subject);
|
|
|
- uc.setUpdateTime(new Date());
|
|
|
- uc.setDelFlag(false);
|
|
|
-
|
|
|
- userCollectionService.update(uc);
|
|
|
- }
|
|
|
- }else{
|
|
|
- if(uc != null){
|
|
|
- uc.setUpdateBy(subject);
|
|
|
- uc.setUpdateTime(new Date());
|
|
|
- uc.setDelFlag(true);
|
|
|
-
|
|
|
- userCollectionService.update(uc);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- messageResult.setData("操作成功");
|
|
|
- messageResult.setResult(true);
|
|
|
- messageResult.setCode(200);
|
|
|
- } catch (Exception ex) {
|
|
|
- log.error(ex.getMessage());
|
|
|
- messageResult.setResult(false);
|
|
|
- messageResult.setMessage(ex.getMessage());
|
|
|
- }
|
|
|
-
|
|
|
- return messageResult;
|
|
|
- }
|
|
|
|
|
|
@PostMapping("deliverResume")
|
|
|
@ApiOperation(value = "投递简历")
|
|
|
@@ -268,6 +221,7 @@ public class ResumeApiController {
|
|
|
JobUser jobUser = jobUserService.get(resume.getJobUserId());
|
|
|
if(jobUser != null) {
|
|
|
resume.setUserName(jobUser.getRealName());
|
|
|
+ resume.setUserTel(jobUser.getTel());
|
|
|
}
|
|
|
resume.setSexName(dataDictionaryService.findNameByCatalogNameAndValue("性别",resume.getSex()));
|
|
|
resume.setDreamMoneyName(dataDictionaryService.getName(resume.getDreamMoney()));
|
|
|
@@ -284,6 +238,7 @@ public class ResumeApiController {
|
|
|
resume.setUserIsAuthenticationName("未实名");
|
|
|
resume.setStatusName(dataDictionaryService.getName(resume.getStatus()));
|
|
|
|
|
|
+
|
|
|
//教育经验
|
|
|
List<ResumeEducationExperience> rexList = resumeEducationExperienceService.findByResumeId(resume.getId());
|
|
|
//工作经验
|
|
|
@@ -309,6 +264,94 @@ public class ResumeApiController {
|
|
|
return messageResult;
|
|
|
}
|
|
|
|
|
|
+ @PostMapping("resumeDetail")
|
|
|
+ @ApiOperation(value = "查看简历-详情")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "resumeId", value = "简历ID,不传则默认查当前简历", paramType = "query"),
|
|
|
+ })
|
|
|
+ public MessageResult<Map> resumeDetail(
|
|
|
+ String resumeId,
|
|
|
+ String token,
|
|
|
+ @RequestAttribute String subject) {
|
|
|
+ MessageResult<Map> messageResult = new MessageResult<>();
|
|
|
+
|
|
|
+ try {
|
|
|
+ Resume resume = null;
|
|
|
+ if(StringUtils.isNotEmpty(resumeId)) {
|
|
|
+ resume = resumeService.get(resumeId);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(resume == null){
|
|
|
+ messageResult.setMessage("简历有误");
|
|
|
+ messageResult.setResult(false);
|
|
|
+ messageResult.setCode(400);
|
|
|
+ return messageResult;
|
|
|
+ }
|
|
|
+
|
|
|
+ //添加简历热度
|
|
|
+ int readingTimes = resume.getReadingTimes();
|
|
|
+ if(readingTimes < 0){
|
|
|
+ readingTimes = 0;
|
|
|
+ }
|
|
|
+ resume.setReadingTimes(readingTimes++);
|
|
|
+ resumeService.update(resume);
|
|
|
+
|
|
|
+ JobUser jobUser = jobUserService.get(resume.getJobUserId());
|
|
|
+ if(jobUser != null) {
|
|
|
+ resume.setUserName(jobUser.getRealName());
|
|
|
+ resume.setUserTel(jobUser.getTel());
|
|
|
+ }
|
|
|
+ resume.setSexName(dataDictionaryService.findNameByCatalogNameAndValue("性别",resume.getSex()));
|
|
|
+ resume.setDreamMoneyName(dataDictionaryService.getName(resume.getDreamMoney()));
|
|
|
+ resume.setWorkExpName(dataDictionaryService.getName(resume.getWorkExp()));
|
|
|
+ resume.setEducationName(dataDictionaryService.getName(resume.getEducation()));
|
|
|
+ resume.setJobStatusName(dataDictionaryService.getName(resume.getJobStatus()));
|
|
|
+ WorkCategory workCategory = workCategoryService.get(resume.getPositionCategoryId());
|
|
|
+ if(workCategory != null) {
|
|
|
+ resume.setPositionCategoryName(workCategory.getName());
|
|
|
+ }
|
|
|
+ if(resume.getUserIsAuthentication() == "1")
|
|
|
+ resume.setUserIsAuthenticationName("已实名");
|
|
|
+ else
|
|
|
+ resume.setUserIsAuthenticationName("未实名");
|
|
|
+ resume.setStatusName(dataDictionaryService.getName(resume.getStatus()));
|
|
|
+
|
|
|
+ //教育经验
|
|
|
+ List<ResumeEducationExperience> rexList = resumeEducationExperienceService.findByResumeId(resume.getId());
|
|
|
+ //工作经验
|
|
|
+ List<ResumeWorkExperience> rweList = resumeWorkExperienceService.findByResumeId(resume.getId());
|
|
|
+
|
|
|
+
|
|
|
+ Map<String, Object> dataMap = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ dataMap.put("resume", resume);
|
|
|
+ dataMap.put("educationExperienceList", rexList);
|
|
|
+ dataMap.put("workExpList", rweList);
|
|
|
+
|
|
|
+
|
|
|
+ //添加浏览记录
|
|
|
+ //User sysUser = userService.get(subject);
|
|
|
+ UserBrowseHr ubh = new UserBrowseHr();
|
|
|
+ ubh.setId(UUID.randomUUID().toString());
|
|
|
+ ubh.setCreateBy(subject);
|
|
|
+ ubh.setCreateTime(new Date());
|
|
|
+ ubh.setDelFlag(false);
|
|
|
+ ubh.setSysUserId(subject);
|
|
|
+ ubh.setJobResumeId(resumeId);
|
|
|
+ userBrowseHrService.insert(ubh);
|
|
|
+
|
|
|
+ messageResult.setData(dataMap);
|
|
|
+ messageResult.setResult(true);
|
|
|
+ messageResult.setCode(200);
|
|
|
+ return messageResult;
|
|
|
+ } catch (Exception ex) {
|
|
|
+ log.error(ex.getMessage());
|
|
|
+ messageResult.setResult(false);
|
|
|
+ messageResult.setMessage(ex.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return messageResult;
|
|
|
+ }
|
|
|
|
|
|
@PostMapping("deliveryRecord")
|
|
|
@ApiOperation(value = "投递记录")
|