This commit is contained in:
parent
8656146a7e
commit
e6406e7234
|
@ -4,13 +4,17 @@ import com.yzdx.AiInterviewer.comment.R;
|
||||||
import com.yzdx.AiInterviewer.entity.Company;
|
import com.yzdx.AiInterviewer.entity.Company;
|
||||||
import com.yzdx.AiInterviewer.entity.JobEntity;
|
import com.yzdx.AiInterviewer.entity.JobEntity;
|
||||||
import com.yzdx.AiInterviewer.entity.dto.JobDto;
|
import com.yzdx.AiInterviewer.entity.dto.JobDto;
|
||||||
|
import com.yzdx.AiInterviewer.entity.dto.JobPostingDto;
|
||||||
import com.yzdx.AiInterviewer.entity.dto.JobSettingDto;
|
import com.yzdx.AiInterviewer.entity.dto.JobSettingDto;
|
||||||
import com.yzdx.AiInterviewer.service.CompanyService;
|
import com.yzdx.AiInterviewer.service.CompanyService;
|
||||||
import com.yzdx.AiInterviewer.service.InterviewSettingService;
|
import com.yzdx.AiInterviewer.service.InterviewSettingService;
|
||||||
import com.yzdx.AiInterviewer.service.JobListService;
|
import com.yzdx.AiInterviewer.service.JobListService;
|
||||||
|
import com.yzdx.AiInterviewer.service.JobPostingService;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,6 +28,8 @@ public class RecruitmentController {
|
||||||
private InterviewSettingService interviewSettingService;
|
private InterviewSettingService interviewSettingService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private CompanyService companyService;
|
private CompanyService companyService;
|
||||||
|
@Autowired
|
||||||
|
private JobPostingService jobPostingService;
|
||||||
|
|
||||||
|
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
|
@ -48,17 +54,17 @@ public class RecruitmentController {
|
||||||
public R addJob(@RequestBody Map<String,Object> addInfo){
|
public R addJob(@RequestBody Map<String,Object> addInfo){
|
||||||
List<String> address=(List<String>) addInfo.get("address");
|
List<String> address=(List<String>) addInfo.get("address");
|
||||||
String encoding=(String) addInfo.get("encoding");
|
String encoding=(String) addInfo.get("encoding");
|
||||||
String address_detail=(String) addInfo.get("address_detail");
|
String address_detail=(String) addInfo.get("addressDetail");
|
||||||
Integer jobType=(Integer) addInfo.get("jobType");
|
Integer jobType=(Integer) addInfo.get("jobType");
|
||||||
Integer userId=(Integer) addInfo.get("userId");
|
Integer userId=(Integer) addInfo.get("userId");
|
||||||
String details=(String) addInfo.get("details");
|
String details=(String) addInfo.get("details");
|
||||||
String jobName=(String) addInfo.get("jobName");
|
String jobName=(String) addInfo.get("jobName");
|
||||||
String startTime=(String) addInfo.get("startTime");
|
String startTime=(String) addInfo.get("startTime");
|
||||||
String endTime=(String) addInfo.get("endTime");
|
String endTime=(String) addInfo.get("endTime");
|
||||||
String min_salary=(String) addInfo.get("min_salary");
|
String min_salary=(String) addInfo.get("minSalary");
|
||||||
String max_salary=(String) addInfo.get("max_salary");
|
String max_salary=(String) addInfo.get("maxSalary");
|
||||||
String min_number=(String) addInfo.get("min_number");
|
String min_number=(String) addInfo.get("minNumber");
|
||||||
String max_number=(String) addInfo.get("max_number");
|
String max_number=(String) addInfo.get("maxNumber");
|
||||||
List<String> jobTips=(List<String>) addInfo.get("jobTips");
|
List<String> jobTips=(List<String>) addInfo.get("jobTips");
|
||||||
Integer requirement=(Integer) addInfo.get("requirement");
|
Integer requirement=(Integer) addInfo.get("requirement");
|
||||||
|
|
||||||
|
@ -359,5 +365,68 @@ public class RecruitmentController {
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@PostMapping("/add_jobPosting")
|
||||||
|
public R addJobPosting(@RequestBody Map<String,Object> addInfo){
|
||||||
|
|
||||||
|
String name=(String)addInfo.get("name");
|
||||||
|
String startTime=(String)addInfo.get("startTime");
|
||||||
|
String endTime=(String)addInfo.get("endTime");
|
||||||
|
String checkList=(String)addInfo.get("checkList");
|
||||||
|
Integer userId=(Integer)addInfo.get("userId");
|
||||||
|
String encoding=(String)addInfo.get("encoding");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Integer rows= jobPostingService.addJobPosting(name,startTime,endTime,checkList,userId,encoding);
|
||||||
|
|
||||||
|
if(rows!=1){
|
||||||
|
return R.error("发布失败");
|
||||||
|
}
|
||||||
|
return R.success("发布成功");
|
||||||
|
|
||||||
|
}
|
||||||
|
@PostMapping("/update_jobPosting")
|
||||||
|
public R updateJobPosting(@RequestBody Map<String,Object> updateInfo){
|
||||||
|
|
||||||
|
Integer id=(Integer) updateInfo.get("id");
|
||||||
|
String name=(String)updateInfo.get("name");
|
||||||
|
String startTime=(String)updateInfo.get("startTime");
|
||||||
|
String endTime=(String)updateInfo.get("endTime");
|
||||||
|
String checkList=(String)updateInfo.get("checkList");
|
||||||
|
Integer userId=(Integer)updateInfo.get("userId");
|
||||||
|
Integer status=(Integer)updateInfo.get("status");
|
||||||
|
|
||||||
|
|
||||||
|
Integer rows= jobPostingService.updateJobPosting(id,name,startTime,endTime,checkList,userId,status);
|
||||||
|
|
||||||
|
if(rows!=1){
|
||||||
|
return R.error("修改失败");
|
||||||
|
}
|
||||||
|
return R.success("修改成功");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete_jobPosting")
|
||||||
|
public R deleteJobPosting(Integer id){
|
||||||
|
|
||||||
|
Integer rows= jobPostingService.deleteJobPosting(id);
|
||||||
|
|
||||||
|
if(rows!=1){
|
||||||
|
return R.error("删除失败");
|
||||||
|
}
|
||||||
|
return R.success("删除成功");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get_jobPostingList")
|
||||||
|
public R getJobPostingList(String encoding){
|
||||||
|
|
||||||
|
List<JobPostingDto> jobPostingDtos=jobPostingService.getJobPostingList(encoding);
|
||||||
|
|
||||||
|
return R.success(jobPostingDtos);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,7 +116,7 @@ public class VxJobController {
|
||||||
@GetMapping("/getSuggestList")
|
@GetMapping("/getSuggestList")
|
||||||
public R getSuggestList(Integer userId){
|
public R getSuggestList(Integer userId){
|
||||||
|
|
||||||
Map<String,Object> result= jobListService.getSuggestJob(userId);
|
List<Map<String,Object>> result= jobListService.getSuggestJob(userId);
|
||||||
|
|
||||||
return R.success(result);
|
return R.success(result);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package com.yzdx.AiInterviewer.controller.VxController;
|
package com.yzdx.AiInterviewer.controller.VxController;
|
||||||
|
|
||||||
import com.yzdx.AiInterviewer.comment.R;
|
import com.yzdx.AiInterviewer.comment.R;
|
||||||
import com.yzdx.AiInterviewer.entity.JobExpectation;
|
|
||||||
import com.yzdx.AiInterviewer.entity.Resume;
|
import com.yzdx.AiInterviewer.entity.Resume;
|
||||||
import com.yzdx.AiInterviewer.entity.VxEntityDto.VxCompanyLikeDto;
|
import com.yzdx.AiInterviewer.entity.VxEntityDto.VxCompanyLikeDto;
|
||||||
import com.yzdx.AiInterviewer.entity.vxEntity.VxFeedBack;
|
import com.yzdx.AiInterviewer.entity.vxEntity.VxFeedBack;
|
||||||
|
@ -16,12 +15,12 @@ import com.yzdx.AiInterviewer.utiles.WechatUtils;
|
||||||
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 io.swagger.annotations.ApiParam;
|
|
||||||
import org.apache.commons.codec.binary.Base64;
|
import org.apache.commons.codec.binary.Base64;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
|
@ -67,7 +66,6 @@ public class VxUserController {
|
||||||
return R.success(session_key);
|
return R.success(session_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ResponseBody
|
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "encryptedData", required = true),
|
@ApiImplicitParam(name = "encryptedData", required = true),
|
||||||
@ApiImplicitParam(name = "iv", required = true),
|
@ApiImplicitParam(name = "iv", required = true),
|
||||||
|
@ -128,13 +126,13 @@ public class VxUserController {
|
||||||
@RequestParam(required = true, value = "projectExperience") String projectExperience,
|
@RequestParam(required = true, value = "projectExperience") String projectExperience,
|
||||||
@RequestParam(required = true, value = "userId") Integer userId,
|
@RequestParam(required = true, value = "userId") Integer userId,
|
||||||
@RequestParam(required = true, value = "sex") String sex){
|
@RequestParam(required = true, value = "sex") String sex){
|
||||||
Integer rows = resumeService.writeResume( name, avatar,sex, status, graduateTime, birthday, phone,
|
Map<String,Object> result = resumeService.writeResume( name, avatar,sex, status, graduateTime, birthday, phone,
|
||||||
email, vx, personalAdvantage,
|
email, vx, personalAdvantage,
|
||||||
other,education_background,jobExpectation,workExperience,projectExperience,userId);
|
other,education_background,jobExpectation,workExperience,projectExperience,userId);
|
||||||
if(rows!=-2){
|
if(result==null){
|
||||||
return R.error("提交失败,请重新输入");
|
return R.error("提交失败,请重新输入");
|
||||||
}
|
}
|
||||||
return R.success("提交简历信息成功");
|
return R.success(result);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*更新简历
|
*更新简历
|
||||||
|
@ -176,13 +174,13 @@ public class VxUserController {
|
||||||
@RequestParam(required = true, value = "userId") Integer userId,
|
@RequestParam(required = true, value = "userId") Integer userId,
|
||||||
@RequestParam(required = true, value = "sex") String sex
|
@RequestParam(required = true, value = "sex") String sex
|
||||||
){
|
){
|
||||||
Integer rows = resumeService.updateResume(id,name,avatar, sex, status, graduateTime,
|
Map<String,Object> result = resumeService.updateResume(id,name,avatar, sex, status, graduateTime,
|
||||||
birthday, phone, email, vx, personalAdvantage,
|
birthday, phone, email, vx, personalAdvantage,
|
||||||
other,education_background,jobExpectation,workExperience,projectExperience,userId);
|
other,education_background,jobExpectation,workExperience,projectExperience,userId);
|
||||||
if(rows!=1){
|
if(result==null){
|
||||||
return R.error("提交失败,请重新输入");
|
return R.error("提交失败,请重新输入");
|
||||||
}
|
}
|
||||||
return R.success("提交简历信息成功");
|
return R.success(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -326,7 +324,7 @@ public R getResume(Integer userId){
|
||||||
@RequestParam(required = true, value = "phone") String phone,
|
@RequestParam(required = true, value = "phone") String phone,
|
||||||
@RequestParam(required = true, value = "content") String content){
|
@RequestParam(required = true, value = "content") String content){
|
||||||
Integer rows=vxFeedBackService.writeFeedBack(userid,imgUrl,phone,content);
|
Integer rows=vxFeedBackService.writeFeedBack(userid,imgUrl,phone,content);
|
||||||
if (rows==-2){
|
if (rows!=1){
|
||||||
return R.error("提交失败");
|
return R.error("提交失败");
|
||||||
}
|
}
|
||||||
return R.success("提交成功");
|
return R.success("提交成功");
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.yzdx.AiInterviewer.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@TableName("job_posting")
|
||||||
|
public class JobPosting extends BaseEntity{
|
||||||
|
|
||||||
|
@TableId(type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
private String companyEncoding;
|
||||||
|
|
||||||
|
private String recruitmentName;
|
||||||
|
|
||||||
|
private String startTime;
|
||||||
|
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
private String endTime;
|
||||||
|
|
||||||
|
private String jobId;
|
||||||
|
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.yzdx.AiInterviewer.entity.dto;
|
||||||
|
|
||||||
|
import com.yzdx.AiInterviewer.entity.JobEntity;
|
||||||
|
import com.yzdx.AiInterviewer.entity.JobPosting;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class JobPostingDto extends JobPosting {
|
||||||
|
|
||||||
|
private String jobName;
|
||||||
|
|
||||||
|
private String time;
|
||||||
|
|
||||||
|
private List<JobEntity> checkedList;
|
||||||
|
}
|
|
@ -1,30 +0,0 @@
|
||||||
package com.yzdx.AiInterviewer.entity;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class jobPosting extends BaseEntity{
|
|
||||||
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
private String companyEncoding;
|
|
||||||
|
|
||||||
private String recruitmentName;
|
|
||||||
|
|
||||||
private Date startTime;
|
|
||||||
|
|
||||||
private Date endTime;
|
|
||||||
|
|
||||||
private String jobId;
|
|
||||||
|
|
||||||
private String interviewQuestions;
|
|
||||||
|
|
||||||
private String promote;
|
|
||||||
|
|
||||||
private Integer interviewee;
|
|
||||||
|
|
||||||
private String contact;
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,5 +1,7 @@
|
||||||
package com.yzdx.AiInterviewer.entity.vxEntity;
|
package com.yzdx.AiInterviewer.entity.vxEntity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.yzdx.AiInterviewer.entity.BaseEntity;
|
import com.yzdx.AiInterviewer.entity.BaseEntity;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
|
@ -11,6 +13,7 @@ import lombok.Data;
|
||||||
@TableName("feedback")
|
@TableName("feedback")
|
||||||
public class VxFeedBack extends BaseEntity {
|
public class VxFeedBack extends BaseEntity {
|
||||||
@ApiModelProperty("反馈id")
|
@ApiModelProperty("反馈id")
|
||||||
|
@TableId(type = IdType.AUTO)
|
||||||
private Integer id;
|
private Integer id;
|
||||||
@ApiModelProperty("用户id")
|
@ApiModelProperty("用户id")
|
||||||
private Integer userId;
|
private Integer userId;
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
package com.yzdx.AiInterviewer.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.yzdx.AiInterviewer.entity.JobPosting;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface JobPostingMapper extends BaseMapper<JobPosting> {
|
||||||
|
}
|
|
@ -140,5 +140,5 @@ public interface JobListService extends IService<JobEntity> {
|
||||||
* @return jobList
|
* @return jobList
|
||||||
*
|
*
|
||||||
* */
|
* */
|
||||||
Map<String,Object> getSuggestJob(Integer userId);
|
List<Map<String,Object>> getSuggestJob(Integer userId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,54 @@
|
||||||
|
package com.yzdx.AiInterviewer.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.yzdx.AiInterviewer.entity.JobPosting;
|
||||||
|
import com.yzdx.AiInterviewer.entity.dto.JobPostingDto;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface JobPostingService extends IService<JobPosting> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*招聘发布
|
||||||
|
* @param name 招聘名称
|
||||||
|
* @param startTime 招聘开始时间
|
||||||
|
* @param endTime 招聘结束时间
|
||||||
|
* @param encoding 招聘公司编码
|
||||||
|
* @param checkList 招聘岗位IDs
|
||||||
|
* @param userId 添加人的ID
|
||||||
|
* @return 影响的行数
|
||||||
|
* */
|
||||||
|
|
||||||
|
Integer addJobPosting(String name, String startTime, String endTime, String checkList, Integer userId, String encoding);
|
||||||
|
/**
|
||||||
|
*招聘修改
|
||||||
|
* @param id 招聘信息id
|
||||||
|
* @param name 招聘名称
|
||||||
|
* @param startTime 招聘开始时间
|
||||||
|
* @param endTime 招聘结束时间
|
||||||
|
* @param checkList 招聘岗位IDs
|
||||||
|
* @param userId 添加人的ID
|
||||||
|
* @return 影响的行数
|
||||||
|
* */
|
||||||
|
|
||||||
|
Integer updateJobPosting(Integer id,String name, String startTime, String endTime,
|
||||||
|
String checkList, Integer userId,Integer status);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 招聘删除
|
||||||
|
* @param id 招聘信息ID
|
||||||
|
* return 影响的行数
|
||||||
|
* */
|
||||||
|
|
||||||
|
Integer deleteJobPosting(Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取招聘列表
|
||||||
|
* @param encoding 公司编码
|
||||||
|
* @return JobPostingDto列表
|
||||||
|
*
|
||||||
|
* */
|
||||||
|
List<JobPostingDto> getJobPostingList(String encoding);
|
||||||
|
}
|
|
@ -5,6 +5,7 @@ import com.yzdx.AiInterviewer.entity.JobExpectation;
|
||||||
import com.yzdx.AiInterviewer.entity.Resume;
|
import com.yzdx.AiInterviewer.entity.Resume;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public interface ResumeService extends IService<Resume> {
|
public interface ResumeService extends IService<Resume> {
|
||||||
|
|
||||||
|
@ -27,14 +28,14 @@ public interface ResumeService extends IService<Resume> {
|
||||||
* @param userId
|
* @param userId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Integer writeResume(String name, String avatar,String sex, String status
|
Map<String,Object> writeResume(String name, String avatar, String sex, String status
|
||||||
, String graduateTime, String birthday, String phone, String email
|
, String graduateTime, String birthday, String phone, String email
|
||||||
, String vx, String personalAdvantage, String other,String education
|
, String vx, String personalAdvantage, String other, String education
|
||||||
, String jobExpectation, String workExperience, String projectExperience, Integer userId);
|
, String jobExpectation, String workExperience, String projectExperience, Integer userId);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Integer updateResume(Integer id, String name, String avatar,String sex, String status,
|
Map<String,Object> updateResume(Integer id, String name, String avatar,String sex, String status,
|
||||||
String graduateTime, String birthday, String phone, String email, String vx,
|
String graduateTime, String birthday, String phone, String email, String vx,
|
||||||
String personalAdvantage, String other,String education,String jobExpectation, String workExperience,
|
String personalAdvantage, String other,String education,String jobExpectation, String workExperience,
|
||||||
String projectExperience, Integer userId);
|
String projectExperience, Integer userId);
|
||||||
|
|
|
@ -97,6 +97,9 @@ public interface UserService extends IService<User> {
|
||||||
* */
|
* */
|
||||||
User updateUserInfo(Integer userId,Integer updateId,String username,String age,String email,String sex);
|
User updateUserInfo(Integer userId,Integer updateId,String username,String age,String email,String sex);
|
||||||
|
|
||||||
|
|
||||||
R vxLogin(String phone);
|
R vxLogin(String phone);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,13 +15,7 @@ public class VxFeedBackServiceImpl extends ServiceImpl<VxFeedBackMapper, VxFeedB
|
||||||
private VxFeedBackMapper vxFeedBackMapper;
|
private VxFeedBackMapper vxFeedBackMapper;
|
||||||
@Override
|
@Override
|
||||||
public Integer writeFeedBack(Integer userid, String imgUrl, String phone, String content) {
|
public Integer writeFeedBack(Integer userid, String imgUrl, String phone, String content) {
|
||||||
LambdaQueryWrapper<VxFeedBack> queryWrapper=new LambdaQueryWrapper<>();
|
|
||||||
queryWrapper.eq(VxFeedBack::getUserId,userid);
|
|
||||||
VxFeedBack vxFeedBack = vxFeedBackMapper.selectOne(queryWrapper);
|
|
||||||
if(vxFeedBack!=null){
|
|
||||||
//反馈已存在,提交失败
|
|
||||||
return -2;
|
|
||||||
}
|
|
||||||
VxFeedBack vxFeedBack1=new VxFeedBack();
|
VxFeedBack vxFeedBack1=new VxFeedBack();
|
||||||
vxFeedBack1.setContent(content);
|
vxFeedBack1.setContent(content);
|
||||||
vxFeedBack1.setPhone(phone);
|
vxFeedBack1.setPhone(phone);
|
||||||
|
|
|
@ -332,9 +332,8 @@ public class JobListServiceImpl extends ServiceImpl<JobMapper, JobEntity> implem
|
||||||
|
|
||||||
///需要改----------------------------------------------------------------
|
///需要改----------------------------------------------------------------
|
||||||
@Override
|
@Override
|
||||||
public Map<String,Object> getSuggestJob(Integer userId) {
|
public List<Map<String,Object>> getSuggestJob(Integer userId) {
|
||||||
|
List<Map<String,Object>> result=new ArrayList<>();
|
||||||
Map<String,Object> result=new HashMap<>();
|
|
||||||
//先获取用户的岗位期望
|
//先获取用户的岗位期望
|
||||||
Resume resume = resumeService.getResume(userId);
|
Resume resume = resumeService.getResume(userId);
|
||||||
|
|
||||||
|
@ -411,7 +410,11 @@ public class JobListServiceImpl extends ServiceImpl<JobMapper, JobEntity> implem
|
||||||
|
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
result.put(jobName,vxJobLikeDtoList);
|
Map<String,Object> jobEntitys=new HashMap<>();
|
||||||
|
jobEntitys.put("suggestJobName",jobName);
|
||||||
|
jobEntitys.put("suggestJobList",vxJobLikeDtoList);
|
||||||
|
|
||||||
|
result.add(jobEntitys);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,191 @@
|
||||||
|
package com.yzdx.AiInterviewer.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.yzdx.AiInterviewer.entity.JobEntity;
|
||||||
|
import com.yzdx.AiInterviewer.entity.JobPosting;
|
||||||
|
import com.yzdx.AiInterviewer.entity.dto.JobPostingDto;
|
||||||
|
import com.yzdx.AiInterviewer.mapper.JobPostingMapper;
|
||||||
|
import com.yzdx.AiInterviewer.service.JobListService;
|
||||||
|
import com.yzdx.AiInterviewer.service.JobPostingService;
|
||||||
|
import com.yzdx.AiInterviewer.utiles.TimeUtil;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class JobPostingServiceImpl extends ServiceImpl<JobPostingMapper, JobPosting> implements JobPostingService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private JobPostingMapper jobPostingMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private JobListService jobListService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer addJobPosting(String name, String startTime, String endTime, String checkList, Integer userId, String encoding) {
|
||||||
|
|
||||||
|
LambdaQueryWrapper<JobPosting> queryWrapper=new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
queryWrapper.eq(JobPosting::getRecruitmentName,name).eq(JobPosting::getCompanyEncoding,encoding);
|
||||||
|
|
||||||
|
JobPosting findJobPosting = jobPostingMapper.selectOne(queryWrapper);
|
||||||
|
|
||||||
|
if(findJobPosting!=null){
|
||||||
|
|
||||||
|
return -2;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
JobPosting newJobPosting=new JobPosting();
|
||||||
|
|
||||||
|
newJobPosting.setRecruitmentName(name);
|
||||||
|
|
||||||
|
newJobPosting.setStartTime(startTime);
|
||||||
|
|
||||||
|
newJobPosting.setEndTime(endTime);
|
||||||
|
|
||||||
|
newJobPosting.setJobId(checkList);
|
||||||
|
|
||||||
|
newJobPosting.setCreateUser(userId);
|
||||||
|
|
||||||
|
newJobPosting.setCreateTime(TimeUtil.getTime());
|
||||||
|
|
||||||
|
newJobPosting.setUpdateUser(userId);
|
||||||
|
|
||||||
|
newJobPosting.setUpdateTime(TimeUtil.getTime());
|
||||||
|
|
||||||
|
newJobPosting.setCompanyEncoding(encoding);
|
||||||
|
|
||||||
|
Integer rows = jobPostingMapper.insert(newJobPosting);
|
||||||
|
|
||||||
|
return rows;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer updateJobPosting(Integer id, String name, String startTime, String endTime,
|
||||||
|
String checkList, Integer userId,Integer status) {
|
||||||
|
LambdaQueryWrapper<JobPosting> queryWrapper=new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
queryWrapper.eq(JobPosting::getId,id);
|
||||||
|
|
||||||
|
JobPosting findJobPosting = jobPostingMapper.selectOne(queryWrapper);
|
||||||
|
|
||||||
|
findJobPosting.setRecruitmentName(name);
|
||||||
|
|
||||||
|
findJobPosting.setStartTime(startTime);
|
||||||
|
|
||||||
|
findJobPosting.setEndTime(endTime);
|
||||||
|
|
||||||
|
findJobPosting.setJobId(checkList);
|
||||||
|
|
||||||
|
findJobPosting.setUpdateUser(userId);
|
||||||
|
|
||||||
|
findJobPosting.setUpdateTime(TimeUtil.getTime());
|
||||||
|
|
||||||
|
findJobPosting.setStatus(status);
|
||||||
|
|
||||||
|
Integer rows = jobPostingMapper.updateById(findJobPosting);
|
||||||
|
|
||||||
|
return rows;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer deleteJobPosting(Integer id) {
|
||||||
|
LambdaQueryWrapper<JobPosting> queryWrapper=new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
queryWrapper.eq(JobPosting::getId,id);
|
||||||
|
|
||||||
|
Integer rows = jobPostingMapper.delete(queryWrapper);
|
||||||
|
|
||||||
|
return rows;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<JobPostingDto> getJobPostingList(String encoding) {
|
||||||
|
LambdaQueryWrapper<JobPosting> queryWrapper=new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
queryWrapper.eq(JobPosting::getCompanyEncoding,encoding);
|
||||||
|
|
||||||
|
List<JobPosting> jobPostings = jobPostingMapper.selectList(queryWrapper);
|
||||||
|
|
||||||
|
List<JobPostingDto> JobPostingDtoList=jobPostings.stream().map(item->{
|
||||||
|
JobPostingDto jobPostingDto=new JobPostingDto();
|
||||||
|
|
||||||
|
BeanUtils.copyProperties(item,jobPostingDto);
|
||||||
|
|
||||||
|
JSONArray jsonArray= (JSONArray) JSON.parse( item.getJobId());
|
||||||
|
|
||||||
|
String JobName="";
|
||||||
|
|
||||||
|
List<JobEntity> checkedList=new ArrayList<>();
|
||||||
|
|
||||||
|
for (int i = 0; i < jsonArray.size(); i++) {
|
||||||
|
|
||||||
|
JobEntity jobById = jobListService.getJobById((Integer) jsonArray.get(i));
|
||||||
|
|
||||||
|
if(i==jsonArray.size()-1){
|
||||||
|
JobName=JobName+jobById.getJobName();
|
||||||
|
checkedList.add(jobById);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
JobName=jobById.getJobName()+",";
|
||||||
|
checkedList.add(jobById);
|
||||||
|
}
|
||||||
|
|
||||||
|
jobPostingDto.setJobName(JobName);
|
||||||
|
jobPostingDto.setCheckedList(checkedList);
|
||||||
|
// 定义输入字符串的格式
|
||||||
|
SimpleDateFormat inputStartTimeFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
|
||||||
|
// 定义输出字符串的格式
|
||||||
|
SimpleDateFormat outputStartTimeFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
String startTime ="";
|
||||||
|
try {
|
||||||
|
// 将输入字符串解析为日期对象
|
||||||
|
Date date = inputStartTimeFormat.parse(item.getStartTime());
|
||||||
|
// 将日期对象格式化为输出字符串
|
||||||
|
startTime = outputStartTimeFormat.format(date);
|
||||||
|
|
||||||
|
} catch (ParseException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 定义输入字符串的格式
|
||||||
|
SimpleDateFormat inputEndTimeFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
|
||||||
|
// 定义输出字符串的格式
|
||||||
|
SimpleDateFormat outputEndTimeFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
|
||||||
|
String endTime ="";
|
||||||
|
try {
|
||||||
|
// 将输入字符串解析为日期对象
|
||||||
|
Date date = inputEndTimeFormat.parse(item.getStartTime());
|
||||||
|
// 将日期对象格式化为输出字符串
|
||||||
|
endTime = outputEndTimeFormat.format(date);
|
||||||
|
|
||||||
|
// 输出结果
|
||||||
|
} catch (ParseException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
String Time=startTime+"至"+endTime;
|
||||||
|
|
||||||
|
jobPostingDto.setTime(Time);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return jobPostingDto;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
|
return JobPostingDtoList;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,12 +1,15 @@
|
||||||
package com.yzdx.AiInterviewer.service.impl;
|
package com.yzdx.AiInterviewer.service.impl;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.yzdx.AiInterviewer.entity.JobExpectation;
|
import com.yzdx.AiInterviewer.entity.JobExpectation;
|
||||||
import com.yzdx.AiInterviewer.entity.Resume;
|
import com.yzdx.AiInterviewer.entity.Resume;
|
||||||
|
import com.yzdx.AiInterviewer.entity.User;
|
||||||
import com.yzdx.AiInterviewer.mapper.JobExpectationMapper;
|
import com.yzdx.AiInterviewer.mapper.JobExpectationMapper;
|
||||||
import com.yzdx.AiInterviewer.mapper.ResumeMapper;
|
import com.yzdx.AiInterviewer.mapper.ResumeMapper;
|
||||||
|
import com.yzdx.AiInterviewer.mapper.UserMapper;
|
||||||
import com.yzdx.AiInterviewer.service.ResumeService;
|
import com.yzdx.AiInterviewer.service.ResumeService;
|
||||||
import com.yzdx.AiInterviewer.utiles.TimeUtil;
|
import com.yzdx.AiInterviewer.utiles.TimeUtil;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -14,23 +17,26 @@ import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.Period;
|
import java.time.Period;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class ResumeServiceImpl extends ServiceImpl<ResumeMapper, Resume> implements ResumeService {
|
public class ResumeServiceImpl extends ServiceImpl<ResumeMapper, Resume> implements ResumeService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ResumeMapper resumeMapper;
|
private ResumeMapper resumeMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private UserMapper userMapper;
|
||||||
// @Autowired
|
// @Autowired
|
||||||
// private JobExpectationMapper jobExpectationMapper;
|
// private JobExpectationMapper jobExpectationMapper;
|
||||||
@Override
|
@Override
|
||||||
public Integer writeResume( String name, String avatar,String sex, String status, String graduateTime, String birthday,
|
public Map<String,Object> writeResume( String name, String avatar,String sex, String status, String graduateTime, String birthday,
|
||||||
String phone, String email, String vx, String personalAdvantage, String other,String education,
|
String phone, String email, String vx, String personalAdvantage, String other,String education,
|
||||||
String jobExpectation, String workExperience, String projectExperience,
|
String jobExpectation, String workExperience, String projectExperience,
|
||||||
Integer userId) {
|
Integer userId) {
|
||||||
|
|
||||||
|
Map<String,Object> result=new HashMap<>();
|
||||||
|
|
||||||
LambdaQueryWrapper<Resume> queryWrapper=new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Resume> queryWrapper=new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
queryWrapper.eq(Resume::getUserId,userId);
|
queryWrapper.eq(Resume::getUserId,userId);
|
||||||
|
@ -38,7 +44,18 @@ public class ResumeServiceImpl extends ServiceImpl<ResumeMapper, Resume> impleme
|
||||||
Resume resume1 = resumeMapper.selectOne(queryWrapper);
|
Resume resume1 = resumeMapper.selectOne(queryWrapper);
|
||||||
|
|
||||||
if(resume1!=null){
|
if(resume1!=null){
|
||||||
return -2;
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(avatar!=null){
|
||||||
|
|
||||||
|
LambdaQueryWrapper<User> queryWrapper1=new LambdaQueryWrapper<User>();
|
||||||
|
|
||||||
|
queryWrapper1.eq(User::getId,userId);
|
||||||
|
|
||||||
|
User findUser = userMapper.selectOne(queryWrapper1);
|
||||||
|
|
||||||
|
findUser.setAvatar(avatar);
|
||||||
}
|
}
|
||||||
|
|
||||||
Resume resume=new Resume();
|
Resume resume=new Resume();
|
||||||
|
@ -94,9 +111,98 @@ public class ResumeServiceImpl extends ServiceImpl<ResumeMapper, Resume> impleme
|
||||||
|
|
||||||
resume.setEducationBackground(education);
|
resume.setEducationBackground(education);
|
||||||
|
|
||||||
|
//解析在校经历,计算出学历
|
||||||
|
|
||||||
|
JSONArray educationJSONArray= JSON.parseArray(education);
|
||||||
|
|
||||||
|
long difference =0;
|
||||||
|
|
||||||
|
String eduBack="";
|
||||||
|
|
||||||
|
String school="";
|
||||||
|
|
||||||
|
String major="";
|
||||||
|
for (int i = 0; i < educationJSONArray.size(); i++) {
|
||||||
|
|
||||||
|
Map<String,Object> educationMap= (Map<String,Object>)educationJSONArray.get(i);
|
||||||
|
|
||||||
|
String lastEndTime= (String)educationMap.get("endTime");
|
||||||
|
|
||||||
|
// 将字符串转换为日期对象
|
||||||
|
Date date = new Date(Integer.valueOf(lastEndTime) - 1900, 0, 1); // 注意:年份需减去1900
|
||||||
|
|
||||||
|
// 获取日期对象的时间戳(毫秒数)
|
||||||
|
|
||||||
|
long timestamp = date.getTime();
|
||||||
|
|
||||||
|
// 获取当前时间的时间戳
|
||||||
|
long currentTimestamp = System.currentTimeMillis();
|
||||||
|
|
||||||
|
// 计算时间戳差值
|
||||||
|
long differenceTime = currentTimestamp - timestamp;
|
||||||
|
|
||||||
|
//初始化值
|
||||||
|
if(i==0){
|
||||||
|
difference=differenceTime;
|
||||||
|
eduBack=(String)educationMap.get("eduDegree");
|
||||||
|
school=(String)educationMap.get("school");
|
||||||
|
major=(String)educationMap.get("major");
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//判断最近的毕业年份
|
||||||
|
if(differenceTime<difference){
|
||||||
|
difference=differenceTime;
|
||||||
|
eduBack=(String)educationMap.get("eduDegree");
|
||||||
|
school=(String)educationMap.get("school");
|
||||||
|
major=(String)educationMap.get("major");
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
resume.setEducation(eduBack);
|
||||||
|
|
||||||
Integer rows= resumeMapper.insert(resume);
|
Integer rows= resumeMapper.insert(resume);
|
||||||
|
|
||||||
return rows;
|
if(rows!=1){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
int experience=0;
|
||||||
|
//计算工作时间
|
||||||
|
JSONArray jobJSONArray=JSON.parseArray(workExperience);
|
||||||
|
|
||||||
|
if(jobJSONArray.size()==0) {
|
||||||
|
//放入工作时间
|
||||||
|
result.put("experience", experience);
|
||||||
|
}else{
|
||||||
|
for (int i = 0; i < jobJSONArray.size(); i++) {
|
||||||
|
|
||||||
|
Map<String,Object> jobJSON=(Map<String, Object>) jobJSONArray.get(i);
|
||||||
|
|
||||||
|
// 将字符串日期转换为LocalDate对象
|
||||||
|
LocalDate startDate = LocalDate.parse(jobJSON.get("startTime")+ "-01");
|
||||||
|
LocalDate endDate = LocalDate.parse(jobJSON.get("endTime") + "-01");
|
||||||
|
|
||||||
|
// 计算年份差异
|
||||||
|
Period period = Period.between(startDate, endDate);
|
||||||
|
int yearDifference = period.getYears();
|
||||||
|
experience+=yearDifference;
|
||||||
|
}
|
||||||
|
//放入工作时间
|
||||||
|
result.put("experience", experience);
|
||||||
|
}
|
||||||
|
result.put("userName",name);
|
||||||
|
result.put("userImgUrl",avatar);
|
||||||
|
result.put("eduBack",eduBack);
|
||||||
|
result.put("gender",sex);
|
||||||
|
result.put("school",school);
|
||||||
|
result.put("major",major);
|
||||||
|
result.put("phone",phone);
|
||||||
|
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
// @Override
|
||||||
|
@ -148,10 +254,23 @@ public class ResumeServiceImpl extends ServiceImpl<ResumeMapper, Resume> impleme
|
||||||
// }
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer updateResume(Integer id, String name, String avatar,String sex, String status,
|
public Map<String,Object> updateResume(Integer id, String name, String avatar,String sex, String status,
|
||||||
String graduateTime, String birthday, String phone, String email, String vx,
|
String graduateTime, String birthday, String phone, String email, String vx,
|
||||||
String personalAdvantage, String other,String education,String jobExpectation, String workExperience,
|
String personalAdvantage, String other,String education,String jobExpectation, String workExperience,
|
||||||
String projectExperience, Integer userId) {
|
String projectExperience, Integer userId) {
|
||||||
|
|
||||||
|
Map<String,Object> result=new HashMap<>();
|
||||||
|
if(avatar!=null){
|
||||||
|
|
||||||
|
LambdaQueryWrapper<User> queryWrapper1=new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
queryWrapper1.eq(User::getId,userId);
|
||||||
|
|
||||||
|
User findUser = userMapper.selectOne(queryWrapper1);
|
||||||
|
|
||||||
|
findUser.setAvatar(avatar);
|
||||||
|
}
|
||||||
|
|
||||||
Resume resume=new Resume();
|
Resume resume=new Resume();
|
||||||
resume.setId(id);
|
resume.setId(id);
|
||||||
resume.setName(name);
|
resume.setName(name);
|
||||||
|
@ -170,8 +289,99 @@ public class ResumeServiceImpl extends ServiceImpl<ResumeMapper, Resume> impleme
|
||||||
resume.setJobExpectation(jobExpectation);
|
resume.setJobExpectation(jobExpectation);
|
||||||
resume.setWorkExperience(workExperience);
|
resume.setWorkExperience(workExperience);
|
||||||
resume.setProjectExperience(projectExperience);
|
resume.setProjectExperience(projectExperience);
|
||||||
|
|
||||||
|
//解析在校经历,计算出学历
|
||||||
|
|
||||||
|
JSONArray educationJSONArray= JSON.parseArray(education);
|
||||||
|
|
||||||
|
long difference =0;
|
||||||
|
|
||||||
|
String eduBack="";
|
||||||
|
|
||||||
|
String school="";
|
||||||
|
|
||||||
|
String major="";
|
||||||
|
for (int i = 0; i < educationJSONArray.size(); i++) {
|
||||||
|
|
||||||
|
Map<String,Object> educationMap= (Map<String,Object>)educationJSONArray.get(i);
|
||||||
|
|
||||||
|
String lastEndTime= (String)educationMap.get("endTime");
|
||||||
|
|
||||||
|
// 将字符串转换为日期对象
|
||||||
|
Date date = new Date(Integer.valueOf(lastEndTime) - 1900, 0, 1); // 注意:年份需减去1900
|
||||||
|
|
||||||
|
// 获取日期对象的时间戳(毫秒数)
|
||||||
|
|
||||||
|
long timestamp = date.getTime();
|
||||||
|
|
||||||
|
// 获取当前时间的时间戳
|
||||||
|
long currentTimestamp = System.currentTimeMillis();
|
||||||
|
|
||||||
|
// 计算时间戳差值
|
||||||
|
long differenceTime = currentTimestamp - timestamp;
|
||||||
|
|
||||||
|
//初始化值
|
||||||
|
if(i==0){
|
||||||
|
difference=differenceTime;
|
||||||
|
eduBack=(String)educationMap.get("eduDegree");
|
||||||
|
school=(String)educationMap.get("school");
|
||||||
|
major=(String)educationMap.get("major");
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//判断最近的毕业年份
|
||||||
|
if(differenceTime<difference){
|
||||||
|
difference=differenceTime;
|
||||||
|
eduBack=(String)educationMap.get("eduDegree");
|
||||||
|
school=(String)educationMap.get("school");
|
||||||
|
major=(String)educationMap.get("major");
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
resume.setEducation(eduBack);
|
||||||
|
|
||||||
Integer rows= resumeMapper.updateById(resume);
|
Integer rows= resumeMapper.updateById(resume);
|
||||||
return rows;
|
|
||||||
|
if(rows!=1){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
int experience=0;
|
||||||
|
//计算工作时间
|
||||||
|
JSONArray jobJSONArray=JSON.parseArray(workExperience);
|
||||||
|
|
||||||
|
if(jobJSONArray.size()==0) {
|
||||||
|
//放入工作时间
|
||||||
|
result.put("experience", experience);
|
||||||
|
}else{
|
||||||
|
for (int i = 0; i < jobJSONArray.size(); i++) {
|
||||||
|
|
||||||
|
Map<String,Object> jobJSON=(Map<String, Object>) jobJSONArray.get(i);
|
||||||
|
|
||||||
|
// 将字符串日期转换为LocalDate对象
|
||||||
|
LocalDate startDate = LocalDate.parse(jobJSON.get("startTime")+ "-01");
|
||||||
|
LocalDate endDate = LocalDate.parse(jobJSON.get("endTime") + "-01");
|
||||||
|
|
||||||
|
// 计算年份差异
|
||||||
|
Period period = Period.between(startDate, endDate);
|
||||||
|
int yearDifference = period.getYears();
|
||||||
|
experience+=yearDifference;
|
||||||
|
}
|
||||||
|
//放入工作时间
|
||||||
|
result.put("experience", experience);
|
||||||
|
}
|
||||||
|
result.put("userName",name);
|
||||||
|
result.put("userImgUrl",avatar);
|
||||||
|
result.put("eduBack",eduBack);
|
||||||
|
result.put("gender",sex);
|
||||||
|
result.put("school",school);
|
||||||
|
result.put("major",major);
|
||||||
|
result.put("phone",phone);
|
||||||
|
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue