|
|
@@ -1,35 +1,34 @@
|
|
|
package com.jpsoft.employment.modules.mobile.controller;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.github.pagehelper.Page;
|
|
|
-import com.jpsoft.employment.config.OSSConfig;
|
|
|
+import com.jpsoft.employment.modules.base.entity.ResumeApprove;
|
|
|
+import com.jpsoft.employment.modules.base.service.ResumeApproveService;
|
|
|
import com.jpsoft.employment.modules.common.dto.MessageResult;
|
|
|
import com.jpsoft.employment.modules.common.dto.Sort;
|
|
|
import com.jpsoft.employment.modules.common.utils.*;
|
|
|
+import com.jpsoft.employment.modules.job.dto.EducationExpDTO;
|
|
|
+import com.jpsoft.employment.modules.job.dto.ExpJsonDTO;
|
|
|
+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.SysLog;
|
|
|
import com.jpsoft.employment.modules.sys.service.DataDictionaryService;
|
|
|
-import com.jpsoft.employment.modules.sys.service.SysLogService;
|
|
|
+
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.joda.time.DateTime;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
-import org.springframework.data.redis.core.ValueOperations;
|
|
|
+import org.springframework.format.annotation.DateTimeFormat;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
-import org.springframework.web.multipart.MultipartFile;
|
|
|
-import sun.misc.BASE64Decoder;
|
|
|
|
|
|
-import java.io.ByteArrayInputStream;
|
|
|
import java.util.*;
|
|
|
-import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping("/mobile/resumeApi")
|
|
|
@@ -66,6 +65,9 @@ public class ResumeApiController {
|
|
|
@Autowired
|
|
|
private ResumeDeliverRecordService resumeDeliverRecordService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ResumeApproveService resumeApproveService;
|
|
|
+
|
|
|
|
|
|
private Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
|
|
|
@@ -96,12 +98,13 @@ public class ResumeApiController {
|
|
|
@PostMapping("collectResume")
|
|
|
@ApiOperation(value = "收藏简历")
|
|
|
@ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "recruitmentId", value = "岗位ID", required = true, paramType = "form"),
|
|
|
- @ApiImplicitParam(name = "status", value = "状态(收藏1,取消0),默认1收藏", paramType = "form"),
|
|
|
+ @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<>();
|
|
|
|
|
|
@@ -151,12 +154,13 @@ public class ResumeApiController {
|
|
|
@PostMapping("deliverResume")
|
|
|
@ApiOperation(value = "投递简历")
|
|
|
@ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "recruitmentId", value = "岗位ID", required = true, paramType = "form"),
|
|
|
- @ApiImplicitParam(name = "resumeId", value = "简历ID,不传则默认查当前简历", paramType = "form"),
|
|
|
+ @ApiImplicitParam(name = "recruitmentId", value = "岗位ID", required = true, paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "resumeId", value = "简历ID,不传则默认查当前简历", paramType = "query"),
|
|
|
})
|
|
|
public MessageResult<String> deliverResume(
|
|
|
String recruitmentId,
|
|
|
@RequestParam(value="resumeId",defaultValue="") String resumeId,
|
|
|
+ String token,
|
|
|
@RequestAttribute String subject) {
|
|
|
MessageResult<String> messageResult = new MessageResult<>();
|
|
|
|
|
|
@@ -221,10 +225,11 @@ public class ResumeApiController {
|
|
|
@PostMapping("myResumeDetail")
|
|
|
@ApiOperation(value = "我的简历-详情")
|
|
|
@ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "resumeId", value = "简历ID,不传则默认查当前简历", paramType = "form"),
|
|
|
+ @ApiImplicitParam(name = "resumeId", value = "简历ID,不传则默认查当前简历", paramType = "query"),
|
|
|
})
|
|
|
public MessageResult<Map> myResumeDetail(
|
|
|
- @RequestParam(value="resumeId",defaultValue="") String resumeId,
|
|
|
+ String resumeId,
|
|
|
+ String token,
|
|
|
@RequestAttribute String subject) {
|
|
|
MessageResult<Map> messageResult = new MessageResult<>();
|
|
|
|
|
|
@@ -244,7 +249,9 @@ public class ResumeApiController {
|
|
|
return messageResult;
|
|
|
}
|
|
|
|
|
|
+ //教育经验
|
|
|
List<ResumeEducationExperience> rexList = resumeEducationExperienceService.findByResumeId(resume.getId());
|
|
|
+ //工作经验
|
|
|
List<ResumeWorkExperience> rweList = resumeWorkExperienceService.findByResumeId(resume.getId());
|
|
|
|
|
|
|
|
|
@@ -273,6 +280,7 @@ public class ResumeApiController {
|
|
|
public MessageResult<Map> deliveryRecord(
|
|
|
@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
@RequestParam(value="pageSize",defaultValue="10") int pageSize,
|
|
|
+ String token,
|
|
|
@RequestAttribute String subject) {
|
|
|
MessageResult<Map> messageResult = new MessageResult<>();
|
|
|
|
|
|
@@ -286,6 +294,10 @@ public class ResumeApiController {
|
|
|
Page<ResumeDeliver> page = resumeDeliverService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
|
for(ResumeDeliver rd : page.getResult()){
|
|
|
Recruitment recruitment = recruitmentService.get(rd.getJobRecruitmentId());
|
|
|
+ String wageTypeName = dataDictionaryService.getName(recruitment.getWageType());
|
|
|
+ String workYearName = dataDictionaryService.getName(recruitment.getWorkYear());
|
|
|
+ recruitment.setWageTypeName(wageTypeName);
|
|
|
+ recruitment.setWorkYearName(workYearName);
|
|
|
rd.setJobRecruitment(recruitment);
|
|
|
}
|
|
|
|
|
|
@@ -299,4 +311,238 @@ public class ResumeApiController {
|
|
|
|
|
|
return messageResult;
|
|
|
}
|
|
|
+
|
|
|
+ @PostMapping("submitResume")
|
|
|
+ @ApiOperation(value = "保存简历")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "resumeId", value = "简历ID,不传则默认查当前简历", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "categoryId", value = "应聘职位", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "sex", value = "性别", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "dreamMoney", value = "期望工资", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "workExp", value = "工作经验", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "education", value = "学历", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "jobStatus", value = "工作状态(是否上班)", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "birthday", value = "出生年月", paramType = "query",dataType = "Date"),
|
|
|
+ @ApiImplicitParam(name = "dreamAdd", value = "期望工作地点", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "introduction", value = "自我介绍", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "status", value = "开启状态,不传默认关闭(1开启,0关闭)", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "expJson", value = "经历-json", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "resumeUrls", value = "简历附件,多文件逗号分割", paramType = "query"),
|
|
|
+
|
|
|
+ })
|
|
|
+ public MessageResult<String> submitResume(
|
|
|
+ @RequestParam(value="resumeId",defaultValue="") String resumeId,
|
|
|
+ @RequestParam(value="categoryId",defaultValue="") String categoryId,
|
|
|
+ @RequestParam(value="sex",defaultValue="") String sex,
|
|
|
+ @RequestParam(value="dreamMoney",defaultValue="") String dreamMoney,
|
|
|
+ @RequestParam(value="workExp",defaultValue="") String workExp,
|
|
|
+ @RequestParam(value="education",defaultValue="") String education,
|
|
|
+ @RequestParam(value="jobStatus",defaultValue="") String jobStatus,
|
|
|
+ @DateTimeFormat(pattern = "yyyy-MM-dd") Date birthday,
|
|
|
+ @RequestParam(value="dreamAdd",defaultValue="") String dreamAdd,
|
|
|
+ @RequestParam(value="introduction",defaultValue="") String introduction,
|
|
|
+ @RequestParam(value="status",defaultValue="0") String status,
|
|
|
+ @RequestParam(value="expJson",defaultValue="") String expJson,
|
|
|
+ @RequestParam(value="resumeUrls",defaultValue="") String resumeUrls,
|
|
|
+ String token,
|
|
|
+ @RequestAttribute String subject) {
|
|
|
+ MessageResult<String> messageResult = new MessageResult<>();
|
|
|
+
|
|
|
+ try {
|
|
|
+ //JobUser jobUser = jobUserService.get(subject);
|
|
|
+ Resume resume = null;
|
|
|
+ if(StringUtils.isNotEmpty(resumeId)) {
|
|
|
+ resume = resumeService.get(resumeId);
|
|
|
+ }else{
|
|
|
+ resume = resumeService.findByUserId(subject);
|
|
|
+ }
|
|
|
+
|
|
|
+ //String workExpJson = "{\"workExp\":[{\"id\":\"123\",\"name\":\"标题一\",\"timeS\":\"2020\",\"timeE\":\"2021\",\"remark\":\"工作1\",\"content\":\"内容\"},{\"id\":\"223\",\"name\":\"标题二\",\"timeS\":\"2022\",\"timeE\":\"至今\",\"remark\":\"工作2\",\"content\":\"内容2\"}],\"educationExp\":[{\"id\":\"323\",\"name\":\"标题一\",\"timeS\":\"2025\",\"timeE\":\"2026\",\"remark\":\"教育1\",\"content\":\"内容1\"},{\"id\":\"423\",\"name\":\"标题一\",\"timeS\":\"1\",\"timeE\":\"2\",\"remark\":\"教育2\",\"content\":\"内容2\"}]}";
|
|
|
+ if(resume == null){
|
|
|
+ //创建简历
|
|
|
+ resume = new Resume();
|
|
|
+ resume.setId(UUID.randomUUID().toString());
|
|
|
+ resume.setCreateBy(subject);
|
|
|
+ resume.setCreateTime(new Date());
|
|
|
+ resume.setDelFlag(false);
|
|
|
+ resume.setBirthday(birthday);
|
|
|
+ resume.setDreamAdd(dreamAdd);
|
|
|
+ resume.setDreamMoney(dreamMoney);
|
|
|
+ resume.setWorkExp(workExp);
|
|
|
+ resume.setEducation(education);
|
|
|
+ resume.setIntroduction(introduction);
|
|
|
+ resume.setJobStatus(jobStatus);
|
|
|
+ resume.setJobUserId(subject);
|
|
|
+ resume.setPositionCategoryId(categoryId);
|
|
|
+ resume.setSex(sex);
|
|
|
+ resume.setStatus(status);
|
|
|
+ resume.setResumeUrls(resumeUrls);
|
|
|
+
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(expJson);
|
|
|
+ ExpJsonDTO expJsonDTO = JSON.toJavaObject(jsonObject,ExpJsonDTO.class );
|
|
|
+ if(expJsonDTO != null){
|
|
|
+ List<EducationExpDTO> educationExpList = expJsonDTO.getEducationExp();
|
|
|
+ if(educationExpList.size() > 0){
|
|
|
+ updateEducationExp(resume.getId(),educationExpList,subject);
|
|
|
+ }
|
|
|
+
|
|
|
+ List<WorkExpDTO> workExpDTOList = expJsonDTO.getWorkExp();
|
|
|
+ if(workExpDTOList.size() > 0){
|
|
|
+ updateWorkExp(resume.getId(),workExpDTOList,subject);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ resume.setApproveStatus("2");//审批中
|
|
|
+
|
|
|
+ resumeService.insert(resume);
|
|
|
+
|
|
|
+ }else{
|
|
|
+ //修改简历
|
|
|
+ resume.setUpdateBy(subject);
|
|
|
+ resume.setUpdateTime(new Date());
|
|
|
+ resume.setDelFlag(false);
|
|
|
+ resume.setBirthday(birthday);
|
|
|
+ resume.setDreamAdd(dreamAdd);
|
|
|
+ resume.setDreamMoney(dreamMoney);
|
|
|
+ resume.setWorkExp(workExp);
|
|
|
+ resume.setEducation(education);
|
|
|
+ resume.setIntroduction(introduction);
|
|
|
+ resume.setJobStatus(jobStatus);
|
|
|
+ resume.setJobUserId(subject);
|
|
|
+ resume.setPositionCategoryId(categoryId);
|
|
|
+ resume.setSex(sex);
|
|
|
+ resume.setStatus(status);
|
|
|
+ resume.setResumeUrls(resumeUrls);
|
|
|
+
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(expJson);
|
|
|
+ ExpJsonDTO expJsonDTO = JSON.toJavaObject(jsonObject,ExpJsonDTO.class );
|
|
|
+ if(expJsonDTO != null){
|
|
|
+ List<EducationExpDTO> educationExpList = expJsonDTO.getEducationExp();
|
|
|
+ if(educationExpList.size() > 0){
|
|
|
+ updateEducationExp(resume.getId(),educationExpList,subject);
|
|
|
+ }
|
|
|
+
|
|
|
+ List<WorkExpDTO> workExpDTOList = expJsonDTO.getWorkExp();
|
|
|
+ if(workExpDTOList.size() > 0){
|
|
|
+ updateWorkExp(resume.getId(),workExpDTOList,subject);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ resume.setApproveStatus("2");//审批中
|
|
|
+ resumeService.update(resume);
|
|
|
+ }
|
|
|
+
|
|
|
+ //创建简历审批信息
|
|
|
+ ResumeApprove ra = new ResumeApprove();
|
|
|
+ ra.setId(UUID.randomUUID().toString());
|
|
|
+ ra.setCreateBy(subject);
|
|
|
+ ra.setCreateTime(new Date());
|
|
|
+ ra.setDelFlag(false);
|
|
|
+ ra.setJobResumeId(resume.getId());
|
|
|
+ ra.setApprovalStatus("2");//简历审批中
|
|
|
+ resumeApproveService.insert(ra);
|
|
|
+
|
|
|
+
|
|
|
+ messageResult.setResult(true);
|
|
|
+ messageResult.setData("保存成功,请等待审批");
|
|
|
+ } catch (Exception ex) {
|
|
|
+ ex.printStackTrace();
|
|
|
+ log.error(ex.getMessage());
|
|
|
+ messageResult.setResult(false);
|
|
|
+ messageResult.setMessage(ex.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return messageResult;
|
|
|
+ }
|
|
|
+
|
|
|
+ public int updateEducationExp(String resumeId,List<EducationExpDTO> educationExpList,String subject) {
|
|
|
+ int updateCount = 0;
|
|
|
+ try {
|
|
|
+ int i = 0;
|
|
|
+ for(EducationExpDTO expDTO:educationExpList){
|
|
|
+ i++;
|
|
|
+ if(StringUtils.isNotEmpty(expDTO.getId())){
|
|
|
+ ResumeEducationExperience ree = resumeEducationExperienceService.get(expDTO.getId());
|
|
|
+ ree.setUpdateBy(subject);
|
|
|
+ ree.setUpdateTime(new Date());
|
|
|
+ ree.setDelFlag(false);
|
|
|
+ ree.setResumeId(resumeId);
|
|
|
+ ree.setSchoolName(expDTO.getName());
|
|
|
+ ree.setMajor(expDTO.getContent());
|
|
|
+ ree.setEducation(expDTO.getRemark());
|
|
|
+ ree.setStartTime(expDTO.getTimeS());
|
|
|
+ ree.setEndTime(expDTO.getTimeE());
|
|
|
+ ree.setSortNo(i);
|
|
|
+ updateCount += resumeEducationExperienceService.update(ree);
|
|
|
+ }else{
|
|
|
+ ResumeEducationExperience ree = new ResumeEducationExperience();
|
|
|
+ ree.setId(UUID.randomUUID().toString());
|
|
|
+ ree.setCreateBy(subject);
|
|
|
+ ree.setCreateTime(new Date());
|
|
|
+ ree.setDelFlag(false);
|
|
|
+ ree.setResumeId(resumeId);
|
|
|
+ ree.setSchoolName(expDTO.getName());
|
|
|
+ ree.setMajor(expDTO.getContent());
|
|
|
+ ree.setEducation(expDTO.getRemark());
|
|
|
+ ree.setStartTime(expDTO.getTimeS());
|
|
|
+ ree.setEndTime(expDTO.getTimeE());
|
|
|
+ ree.setSortNo(i);
|
|
|
+ updateCount += resumeEducationExperienceService.insert(ree);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (Exception ex) {
|
|
|
+ log.error(ex.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return updateCount;
|
|
|
+ }
|
|
|
+
|
|
|
+ public int updateWorkExp(String resumeId,List<WorkExpDTO> WorkExpList,String subject) {
|
|
|
+ int updateCount = 0;
|
|
|
+ try {
|
|
|
+ int i = 0;
|
|
|
+ for(WorkExpDTO expDTO:WorkExpList){
|
|
|
+ i++;
|
|
|
+ if(StringUtils.isNotEmpty(expDTO.getId())){
|
|
|
+ ResumeWorkExperience rwe = resumeWorkExperienceService.get(expDTO.getId());
|
|
|
+ rwe.setUpdateBy(subject);
|
|
|
+ rwe.setUpdateTime(new Date());
|
|
|
+ rwe.setDelFlag(false);
|
|
|
+ rwe.setResumeId(resumeId);
|
|
|
+ rwe.setCompanyName(expDTO.getName());
|
|
|
+ rwe.setContent(expDTO.getContent());
|
|
|
+ rwe.setJob(expDTO.getRemark());
|
|
|
+ rwe.setStartTime(expDTO.getTimeS());
|
|
|
+ rwe.setEndTime(expDTO.getTimeE());
|
|
|
+ rwe.setSortNo(i);
|
|
|
+ updateCount += resumeWorkExperienceService.update(rwe);
|
|
|
+ }else{
|
|
|
+ ResumeWorkExperience rwe = new ResumeWorkExperience();
|
|
|
+ rwe.setId(UUID.randomUUID().toString());
|
|
|
+ rwe.setCreateBy(subject);
|
|
|
+ rwe.setCreateTime(new Date());
|
|
|
+ rwe.setDelFlag(false);
|
|
|
+ rwe.setResumeId(resumeId);
|
|
|
+ rwe.setCompanyName(expDTO.getName());
|
|
|
+ rwe.setContent(expDTO.getContent());
|
|
|
+ rwe.setJob(expDTO.getRemark());
|
|
|
+ rwe.setStartTime(expDTO.getTimeS());
|
|
|
+ rwe.setEndTime(expDTO.getTimeE());
|
|
|
+ rwe.setSortNo(i);
|
|
|
+ updateCount += resumeWorkExperienceService.insert(rwe);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (Exception ex) {
|
|
|
+ log.error(ex.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
+ return updateCount;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void main(String[] args) {
|
|
|
+ String workExpJson = "{\"workExp\":[{\"id\":\"123\",\"name\":\"标题一\",\"timeS\":\"2020\",\"timeE\":\"2021\",\"remark\":\"工作1\",\"content\":\"内容\"},{\"id\":\"223\",\"name\":\"标题二\",\"timeS\":\"2022\",\"timeE\":\"至今\",\"remark\":\"工作2\",\"content\":\"内容2\"}],\"educationExp\":[{\"id\":\"323\",\"name\":\"标题一\",\"timeS\":\"2025\",\"timeE\":\"2026\",\"remark\":\"教育1\",\"content\":\"内容1\"},{\"id\":\"423\",\"name\":\"标题一\",\"timeS\":\"1\",\"timeE\":\"2\",\"remark\":\"教育2\",\"content\":\"内容2\"}]}";
|
|
|
+
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(workExpJson);
|
|
|
+ ExpJsonDTO share = JSON.toJavaObject(jsonObject,ExpJsonDTO.class );
|
|
|
+ System.out.println("aaaaa");
|
|
|
+
|
|
|
+ }
|
|
|
}
|