简历解析结构修改和字典逻辑修改
This commit is contained in:
@@ -13,6 +13,7 @@ import com.vetti.common.utils.readFile.FileContentUtil;
|
||||
import com.vetti.hotake.domain.HotakeCvInfo;
|
||||
import com.vetti.hotake.domain.HotakeProblemBaseInfo;
|
||||
import com.vetti.hotake.domain.dto.HotakeCvInfoDto;
|
||||
import com.vetti.hotake.domain.dto.VcDto.*;
|
||||
import com.vetti.hotake.mapper.HotakeCvInfoMapper;
|
||||
import com.vetti.hotake.service.IHotakeCvInfoService;
|
||||
import com.vetti.hotake.service.IHotakeProblemBaseInfoService;
|
||||
@@ -67,8 +68,11 @@ public class HotakeCvInfoServiceImpl extends BaseServiceImpl implements IHotakeC
|
||||
@Override
|
||||
public HotakeCvInfo selectHotakeCvInfoById(Long id) {
|
||||
HotakeCvInfo cvInfo = hotakeCvInfoMapper.selectHotakeCvInfoById(id);
|
||||
HotakeCvInfoDto cvInfoDto = JSONUtil.toBean(cvInfo.getCvTemplateJson(),HotakeCvInfoDto.class);
|
||||
cvInfo.setCvInfoDto(cvInfoDto);
|
||||
if(StrUtil.isNotEmpty(cvInfo.getCvTemplateJson())){
|
||||
HotakeCvInfoDto cvInfoDto = JSONUtil.toBean(cvInfo.getCvTemplateJson(),HotakeCvInfoDto.class);
|
||||
cvInfo.setCvInfoDto(cvInfoDto);
|
||||
}
|
||||
|
||||
HotakeProblemBaseInfo query = new HotakeProblemBaseInfo();
|
||||
query.setCvId(id);
|
||||
List<HotakeProblemBaseInfo> problemBaseInfoList = hotakeProblemBaseInfoService.selectHotakeProblemBaseInfoList(query);
|
||||
@@ -138,8 +142,8 @@ public class HotakeCvInfoServiceImpl extends BaseServiceImpl implements IHotakeC
|
||||
mapEntityOne.put("role", "user");
|
||||
mapEntityOne.put("content", "Position: Construction Labourer" +
|
||||
"\\nCandidate: " + cvInfoDto.getName() +
|
||||
"\\nKey Skills: " + JSONUtil.toJsonStr(cvInfoDto.getSkillsToolsList()) +
|
||||
"\\nExperience: " + JSONUtil.toJsonStr(cvInfoDto.getExperienceList()) +
|
||||
"\\nKey Skills: " + JSONUtil.toJsonStr(cvInfoDto.getSkillsTools()) +
|
||||
"\\nExperience: " + JSONUtil.toJsonStr(cvInfoDto.getExperience()) +
|
||||
"\\nStrengths: Professional certifications, Relevant experience" +
|
||||
"\\nConcerns: " + JSONUtil.toJsonStr(cvInfoDto.getAbout()));
|
||||
list.add(mapEntityOne);
|
||||
@@ -180,7 +184,12 @@ public class HotakeCvInfoServiceImpl extends BaseServiceImpl implements IHotakeC
|
||||
fill(FillTypeEnum.UPDATE.getCode(), hotakeCvInfo);
|
||||
|
||||
hotakeCvInfo.setCvTemplateJson(JSONUtil.toJsonStr(hotakeCvInfo.getCvInfoDto()));
|
||||
//修改的时候重新生成问题和评分
|
||||
|
||||
|
||||
|
||||
hotakeCvInfoMapper.updateHotakeCvInfo(hotakeCvInfo);
|
||||
|
||||
return hotakeCvInfo;
|
||||
}
|
||||
|
||||
@@ -269,12 +278,109 @@ public class HotakeCvInfoServiceImpl extends BaseServiceImpl implements IHotakeC
|
||||
List<Map<String,String>> list = new LinkedList();
|
||||
Map<String,String> entity = new HashMap<>();
|
||||
entity.put("role","user");
|
||||
entity.put("content","从下面提供的文本中提取所有能识别到的简历信息,只提取原文中存在的内容,不要补充、不推测、不总结。需要提取的字段包括:name(姓名)、phone(电话号码)、email(电子邮件地址)、position(岗位)、location(地点)、links(所有链接地址)、about(关于我/自我介绍)、skills_tools(关键资格(许可证、注册/会员资格、认证))、languages(语言能力)、experience(工作经历(除了title、company、location、duration其他的都放到描述里面))、education(教育经历)。请将提取结果以结构化 JSON 格式返回,格式如下:{ \\\"name\\\": \\\"\\\", \\\"phone\\\": \\\"\\\", \\\"email\\\": \\\"\\\", \\\"links\\\": [{\\\"content\\\":\\\"\\\"}], \\\"about\\\": \\\"\\\", \\\"skillsTools\\\": [{\\\"content\\\":\\\"\\\"}], \\\"languages\\\": [{\\\"content\\\":\\\"\\\"}], \\\"experience\\\": [{\\\"title\\\": \\\"\\\", \\\"company\\\": \\\"\\\",\\\"location\\\": \\\"\\\",\\\"duration\\\": \\\"\\\",\\\"description\\\": [{\\\"content\\\":\\\"\\\"}]}], \\\"education\\\": [{\\\"degree\\\": \\\"\\\",\\\"institution\\\": \\\"\\\",\\\"date\\\": \\\"\\\"}] }。字段不存在则返回 null 或空数组。只返回标准可解析的 JSON结构 ,不要多余的```json等信息,不要解释说明,不要改写内容。以下为待处理文本:"+contents);
|
||||
entity.put("content","从下面提供的文本中提取所有能识别到的简历信息,只提取原文中存在的内容,不要补充、不推测、不总结。需要提取的字段包括:name(姓名)、phone(电话号码)、email(电子邮件地址)、position(岗位)、location(地点)、links(所有链接地址)、about(关于我/自我介绍)、skills_tools(关键资格(许可证、注册/会员资格、认证))、languages(语言能力)、experience(工作经历(除了title、company、location、duration,其他的都放到description里面,并且description里面要根据换行符分成不同的content))、education(教育经历)。请将提取结果以结构化 JSON 格式返回,格式如下:{ \\\"name\\\": \\\"\\\", \\\"phone\\\": \\\"\\\", \\\"email\\\": \\\"\\\", \\\"links\\\": [{\\\"content\\\":\\\"\\\"}], \\\"about\\\": \\\"\\\", \\\"skillsTools\\\": [{\\\"content\\\":\\\"\\\"}], \\\"languages\\\": [{\\\"content\\\":\\\"\\\"}], \\\"experience\\\": [{\\\"title\\\": \\\"\\\", \\\"company\\\": \\\"\\\",\\\"location\\\": \\\"\\\",\\\"duration\\\": \\\"\\\",\\\"description\\\": [{\\\"content\\\":\\\"\\\"}]}], \\\"education\\\": [{\\\"degree\\\": \\\"\\\",\\\"institution\\\": \\\"\\\",\\\"date\\\": \\\"\\\"}] }。字段不存在则返回 null 或空数组。只返回标准可解析的 JSON结构 ,不要多余的```json等信息,不要解释说明,不要改写内容。以下为待处理文本:"+contents);
|
||||
//根据AI做
|
||||
list.add(entity);
|
||||
String resultCv = chatGPTClient.handleAiChat(JSONUtil.toJsonStr(list), "JX");
|
||||
log.info("开始返回简历解析结果:{}", resultCv);
|
||||
HotakeCvInfoDto cvInfoDto = JSONUtil.toBean(resultCv, HotakeCvInfoDto.class);
|
||||
//数据添加默认值
|
||||
if(cvInfoDto != null){
|
||||
if(StrUtil.isEmpty(cvInfoDto.getName())){
|
||||
cvInfoDto.setName("-");
|
||||
}
|
||||
if(StrUtil.isEmpty(cvInfoDto.getPhone())){
|
||||
cvInfoDto.setPhone("-");
|
||||
}
|
||||
if(StrUtil.isEmpty(cvInfoDto.getEmail())){
|
||||
cvInfoDto.setEmail("-");
|
||||
}
|
||||
if(StrUtil.isEmpty(cvInfoDto.getPosition())){
|
||||
cvInfoDto.setPosition("-");
|
||||
}
|
||||
if(StrUtil.isEmpty(cvInfoDto.getLocation())){
|
||||
cvInfoDto.setLocation("-");
|
||||
}
|
||||
if(StrUtil.isEmpty(cvInfoDto.getAbout())){
|
||||
cvInfoDto.setAbout("-");
|
||||
}
|
||||
if(CollectionUtil.isNotEmpty(cvInfoDto.getSkillsTools())){
|
||||
for (VcSkillsToolsDto toolsDto :cvInfoDto.getSkillsTools()) {
|
||||
if(StrUtil.isEmpty(toolsDto.getContent())){
|
||||
toolsDto.setContent("-");
|
||||
}
|
||||
}
|
||||
}
|
||||
if(CollectionUtil.isNotEmpty(cvInfoDto.getLinks())){
|
||||
for (VcLinksDto linksDto :cvInfoDto.getLinks()) {
|
||||
if(StrUtil.isEmpty(linksDto.getContent())){
|
||||
linksDto.setContent("-");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(CollectionUtil.isNotEmpty(cvInfoDto.getLanguages())){
|
||||
for (VcLanguagesDto languagesDto :cvInfoDto.getLanguages()) {
|
||||
if(StrUtil.isEmpty(languagesDto.getContent())){
|
||||
languagesDto.setContent("-");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(CollectionUtil.isNotEmpty(cvInfoDto.getExperience())){
|
||||
for (VcExperienceDto experienceDto :cvInfoDto.getExperience()) {
|
||||
if (StrUtil.isEmpty(experienceDto.getTitle())){
|
||||
experienceDto.setTitle("-");
|
||||
}
|
||||
if(StrUtil.isEmpty(experienceDto.getCompany())){
|
||||
experienceDto.setCompany("-");
|
||||
}
|
||||
if(StrUtil.isEmpty(experienceDto.getLocation())){
|
||||
experienceDto.setLocation("-");
|
||||
}
|
||||
if(StrUtil.isEmpty(experienceDto.getDuration())){
|
||||
experienceDto.setDuration("-");
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(experienceDto.getDescription())){
|
||||
for(VcExperienceDescriptionDto descriptionDto :experienceDto.getDescription()){
|
||||
if(StrUtil.isEmpty(descriptionDto.getContent())){
|
||||
descriptionDto.setContent("-");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(CollectionUtil.isNotEmpty(cvInfoDto.getEducation())){
|
||||
for (VcEducationDto educationDto :cvInfoDto.getEducation()) {
|
||||
if (StrUtil.isEmpty(educationDto.getDegree())){
|
||||
educationDto.setDegree("-");
|
||||
}
|
||||
if(StrUtil.isEmpty(educationDto.getInstitution())){
|
||||
educationDto.setInstitution("-");
|
||||
}
|
||||
if(StrUtil.isEmpty(educationDto.getDate())){
|
||||
educationDto.setDate("-");
|
||||
}
|
||||
if(educationDto.getCertificate() != null){
|
||||
if(StrUtil.isEmpty(educationDto.getCertificate().getFileName())){
|
||||
educationDto.getCertificate().setFileName("-");
|
||||
}
|
||||
if (StrUtil.isEmpty(educationDto.getCertificate().getFileSuffix())){
|
||||
educationDto.getCertificate().setFileSuffix("-");
|
||||
}
|
||||
if (StrUtil.isEmpty(educationDto.getCertificate().getFileUrl())){
|
||||
educationDto.getCertificate().setFileUrl("-");
|
||||
}
|
||||
if (StrUtil.isEmpty(educationDto.getCertificate().getFileSizeShow())){
|
||||
educationDto.getCertificate().setFileSizeShow("-");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return cvInfoDto;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -303,10 +409,10 @@ public class HotakeCvInfoServiceImpl extends BaseServiceImpl implements IHotakeC
|
||||
mapEntityOne.put("content", "Position: Construction Labourer" +
|
||||
"\\nCandidate: " + cvInfoDto.getName() +
|
||||
"\\nResume Summary: " + JSONUtil.toJsonStr(cvInfoDto.getAbout()) +
|
||||
"\\nSkills: " + JSONUtil.toJsonStr(cvInfoDto.getSkillsToolsList()) +
|
||||
"\\nExperience: " + JSONUtil.toJsonStr(cvInfoDto.getExperienceList()) +
|
||||
"\\nEducation: " + JSONUtil.toJsonStr(cvInfoDto.getEducationList()) +
|
||||
"\\nCertifications: " + JSONUtil.toJsonStr(cvInfoDto.getSkillsToolsList()));
|
||||
"\\nSkills: " + JSONUtil.toJsonStr(cvInfoDto.getSkillsTools()) +
|
||||
"\\nExperience: " + JSONUtil.toJsonStr(cvInfoDto.getExperience()) +
|
||||
"\\nEducation: " + JSONUtil.toJsonStr(cvInfoDto.getEducation()) +
|
||||
"\\nCertifications: " + JSONUtil.toJsonStr(cvInfoDto.getSkillsTools()));
|
||||
list.add(mapEntityOne);
|
||||
String promptText = JSONUtil.toJsonStr(list);
|
||||
resultMsg = chatGPTClient.handleAiChat(promptText, "CV");
|
||||
|
||||
Reference in New Issue
Block a user