소스 검색

人力资源库

jz.kai 3 년 전
부모
커밋
dc939d7f93

+ 12 - 0
common/src/main/java/com/jpsoft/employment/modules/job/dto/WorkStepDTO.java

@@ -0,0 +1,12 @@
+package com.jpsoft.employment.modules.job.dto;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class WorkStepDTO {
+    private Integer sortNo;
+    private String text;
+    private String date;
+}

+ 16 - 0
common/src/main/java/com/jpsoft/employment/modules/job/entity/Resume.java

@@ -4,7 +4,9 @@ import java.io.Serializable;
 import java.util.Date;
 import java.util.Date;
 import java.text.SimpleDateFormat;
 import java.text.SimpleDateFormat;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
+import java.util.List;
 
 
+import com.jpsoft.employment.modules.job.dto.WorkStepDTO;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.Data;
 import org.springframework.format.annotation.DateTimeFormat;
 import org.springframework.format.annotation.DateTimeFormat;
@@ -94,4 +96,18 @@ public class Resume {
 	@ApiModelProperty(value = "实名制状态-is_authentication")
 	@ApiModelProperty(value = "实名制状态-is_authentication")
 	private String userIsAuthentication;
 	private String userIsAuthentication;
 	private String userIsAuthenticationName;
 	private String userIsAuthenticationName;
+	@ApiModelProperty(value = "身份证号")
+	private String userIdCard;
+	@ApiModelProperty(value = "年龄")
+	private String userAge;
+	@ApiModelProperty(value = "地址")
+	private String userAddress;
+	@ApiModelProperty(value = "联系方式")
+	private String userTel;
+	@ApiModelProperty(value = "工作经历")
+	private List<ResumeWorkExperience> workList;
+	@ApiModelProperty(value = "教育经历")
+	private List<ResumeEducationExperience> educateList;
+	@ApiModelProperty(value = "教育经历")
+	private List<WorkStepDTO> workStepList;
 }
 }

+ 5 - 1
common/src/main/resources/mapper/job/Resume.xml

@@ -27,6 +27,9 @@
 		<result property="userPhoto" column="head_image_url" />
 		<result property="userPhoto" column="head_image_url" />
 		<result property="userName" column="real_name" />
 		<result property="userName" column="real_name" />
 		<result property="userIsAuthentication" column="is_authentication" />
 		<result property="userIsAuthentication" column="is_authentication" />
+		<result property="userIdCard" column="id_card" />
+		<result property="userAddress" column="address_" />
+		<result property="userTel" column="tel_" />
 	</resultMap>
 	</resultMap>
 	<insert id="insert" parameterType="com.jpsoft.employment.modules.job.entity.Resume">
 	<insert id="insert" parameterType="com.jpsoft.employment.modules.job.entity.Resume">
 	<!--
 	<!--
@@ -126,7 +129,8 @@
 	where id_=#{id}
 	where id_=#{id}
 	</update>
 	</update>
 	<select id="get" parameterType="string" resultMap="ResumeMap">
 	<select id="get" parameterType="string" resultMap="ResumeMap">
-		select * from job_resume where id_=#{0}
+		SELECT a.*,b.head_image_url,b.real_name,b.is_authentication,b.id_card,b.address_,b.tel_ FROM job_resume a
+		LEFT JOIN job_jobuser b ON a.job_user_id = b.id_ where a.del_flag = 0 AND a.id_ = #{0}
 	</select>
 	</select>
 	<select id="exist" parameterType="string" resultType="int">
 	<select id="exist" parameterType="string" resultType="int">
 		select count(*) from job_resume where id_=#{0}
 		select count(*) from job_resume where id_=#{0}

+ 79 - 13
web/src/main/java/com/jpsoft/employment/modules/job/controller/ResumeController.java

@@ -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;
+    }
 }
 }