|
@@ -4,12 +4,9 @@ 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.Sort;
|
|
import com.jpsoft.employment.modules.common.dto.Sort;
|
|
import com.jpsoft.employment.modules.common.utils.PojoUtils;
|
|
import com.jpsoft.employment.modules.common.utils.PojoUtils;
|
|
-import com.jpsoft.employment.modules.job.entity.JobUser;
|
|
|
|
-import com.jpsoft.employment.modules.job.entity.Resume;
|
|
|
|
-import com.jpsoft.employment.modules.job.entity.WorkCategory;
|
|
|
|
-import com.jpsoft.employment.modules.job.service.JobUserService;
|
|
|
|
-import com.jpsoft.employment.modules.job.service.ResumeService;
|
|
|
|
-import com.jpsoft.employment.modules.job.service.WorkCategoryService;
|
|
|
|
|
|
+import com.jpsoft.employment.modules.job.dto.WorkStepDTO;
|
|
|
|
+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.DataDictionary;
|
|
import com.jpsoft.employment.modules.sys.service.DataDictionaryService;
|
|
import com.jpsoft.employment.modules.sys.service.DataDictionaryService;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
@@ -36,6 +33,10 @@ public class ResumeController {
|
|
private WorkCategoryService workCategoryService;
|
|
private WorkCategoryService workCategoryService;
|
|
@Autowired
|
|
@Autowired
|
|
private DataDictionaryService dataDictionaryService;
|
|
private DataDictionaryService dataDictionaryService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ResumeWorkExperienceService resumeWorkExperienceService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ResumeEducationExperienceService resumeEducationExperienceService;
|
|
|
|
|
|
@ApiOperation(value="添加信息")
|
|
@ApiOperation(value="添加信息")
|
|
@PostMapping("add")
|
|
@PostMapping("add")
|
|
@@ -73,6 +74,52 @@ public class ResumeController {
|
|
try {
|
|
try {
|
|
Resume resume = resumeService.get(id);
|
|
Resume resume = resumeService.get(id);
|
|
|
|
|
|
|
|
+ //数据填充
|
|
|
|
+ List<ResumeWorkExperience> workList = resumeWorkExperienceService.findByResumeId(resume.getId());
|
|
|
|
+ List<ResumeEducationExperience> educationList = resumeEducationExperienceService.findByResumeId(resume.getId());
|
|
|
|
+ resume.setSexName(dataDictionaryService.getName(resume.getSex()));
|
|
|
|
+ resume.setJobStatusName(dataDictionaryService.getName(resume.getJobStatus()));
|
|
|
|
+ resume.setJobStatusName(dataDictionaryService.getName(resume.getJobStatus()));
|
|
|
|
+ resume.setUserAge(String.valueOf(getAge(resume.getBirthday())));
|
|
|
|
+ resume.setPositionCategoryName(workCategoryService.get(resume.getPositionCategoryId()).getName());
|
|
|
|
+ resume.setEducationName(dataDictionaryService.getName(resume.getEducation()));
|
|
|
|
+ resume.setWorkExpName(dataDictionaryService.getName(resume.getWorkExp()));
|
|
|
|
+ resume.setDreamMoneyName(dataDictionaryService.getName(resume.getDreamMoney()));
|
|
|
|
+ resume.setWorkList(workList);
|
|
|
|
+ resume.setEducateList(educationList);
|
|
|
|
+ //人员就业轨迹
|
|
|
|
+ Integer sortNo = 0;
|
|
|
|
+ List<WorkStepDTO> workStepList = new ArrayList<>();
|
|
|
|
+ if(educationList.size() > 0) {
|
|
|
|
+ WorkStepDTO workStepTop = new WorkStepDTO();
|
|
|
|
+ workStepTop.setSortNo(++sortNo);
|
|
|
|
+ workStepTop.setText(educationList.get(0).getSchoolName() + " 毕业");
|
|
|
|
+ workStepTop.setDate(educationList.get(0).getEndTime());
|
|
|
|
+ workStepList.add(workStepTop);
|
|
|
|
+ }
|
|
|
|
+ for(ResumeWorkExperience resumeWorkExperience : workList){
|
|
|
|
+ WorkStepDTO workStepStart = new WorkStepDTO();
|
|
|
|
+ workStepStart.setSortNo(++sortNo);
|
|
|
|
+ workStepStart.setText(resumeWorkExperience.getCompanyName() + "入职");
|
|
|
|
+ workStepStart.setDate(resumeWorkExperience.getStartTime());
|
|
|
|
+ workStepList.add(workStepStart);
|
|
|
|
+
|
|
|
|
+ if(StringUtils.isEmpty(resumeWorkExperience.getEndTime()) || resumeWorkExperience.getEndTime().equals("至今")){
|
|
|
|
+ WorkStepDTO workStepEnd = new WorkStepDTO();
|
|
|
|
+ workStepEnd.setSortNo(++sortNo);
|
|
|
|
+ workStepEnd.setText("至今");
|
|
|
|
+ workStepList.add(workStepEnd);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ WorkStepDTO workStepEnd = new WorkStepDTO();
|
|
|
|
+ workStepEnd.setSortNo(++sortNo);
|
|
|
|
+ workStepEnd.setText(resumeWorkExperience.getCompanyName() + "离职");
|
|
|
|
+ workStepEnd.setDate(resumeWorkExperience.getEndTime());
|
|
|
|
+ workStepList.add(workStepEnd);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ resume.setWorkStepList(workStepList);
|
|
|
|
+
|
|
if (resume != null) {
|
|
if (resume != null) {
|
|
msgResult.setResult(true);
|
|
msgResult.setResult(true);
|
|
msgResult.setData(resume);
|
|
msgResult.setData(resume);
|
|
@@ -183,13 +230,6 @@ public class ResumeController {
|
|
|
|
|
|
Page<Resume> page = resumeService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
Page<Resume> page = resumeService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
for(Resume resume : page.getResult()){
|
|
for(Resume resume : page.getResult()){
|
|
-// JobUser jobUser = jobUserService.get(resume.getJobUserId());
|
|
|
|
-// if(jobUser != null) {
|
|
|
|
-// resume.setUserPhoto(jobUser.getHeadImageUrl());
|
|
|
|
-// resume.setUserName(jobUser.getRealName());
|
|
|
|
-// resume.setUserIsAuthentication(jobUser.getIsAuthentication());
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
WorkCategory workCategory = workCategoryService.get(resume.getPositionCategoryId());
|
|
WorkCategory workCategory = workCategoryService.get(resume.getPositionCategoryId());
|
|
if(workCategory != null) resume.setPositionCategoryName(workCategory.getName());
|
|
if(workCategory != null) resume.setPositionCategoryName(workCategory.getName());
|
|
resume.setSexName(dataDictionaryService.getName(resume.getSex()));
|
|
resume.setSexName(dataDictionaryService.getName(resume.getSex()));
|
|
@@ -236,4 +276,30 @@ public class ResumeController {
|
|
|
|
|
|
return msgResult;
|
|
return msgResult;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private int getAge(Date birthDay) throws Exception {
|
|
|
|
+ Calendar cal = Calendar.getInstance();
|
|
|
|
+ if (cal.before(birthDay)) {
|
|
|
|
+ throw new IllegalArgumentException("The birthDay is before Now.It's unbelievable!");
|
|
|
|
+ }
|
|
|
|
+ int yearNow = cal.get(Calendar.YEAR);
|
|
|
|
+ int monthNow = cal.get(Calendar.MONTH);
|
|
|
|
+ int dayOfMonthNow = cal.get(Calendar.DAY_OF_MONTH);
|
|
|
|
+ cal.setTime(birthDay);
|
|
|
|
+
|
|
|
|
+ int yearBirth = cal.get(Calendar.YEAR);
|
|
|
|
+ int monthBirth = cal.get(Calendar.MONTH);
|
|
|
|
+ int dayOfMonthBirth = cal.get(Calendar.DAY_OF_MONTH);
|
|
|
|
+
|
|
|
|
+ int age = yearNow - yearBirth;
|
|
|
|
+
|
|
|
|
+ if (monthNow <= monthBirth) {
|
|
|
|
+ if (monthNow == monthBirth) {
|
|
|
|
+ if (dayOfMonthNow < dayOfMonthBirth) age--;
|
|
|
|
+ }else{
|
|
|
|
+ age--;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return age;
|
|
|
|
+ }
|
|
}
|
|
}
|