简历解析业务逻辑处理
This commit is contained in:
@@ -53,6 +53,12 @@ public class HotakeCvInfo extends BaseEntity
|
||||
@Excel(name = "状态", readConverterExp = "0=,禁=用,1,启=用")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty("简历模版Json")
|
||||
private String cvTemplateJson;
|
||||
|
||||
@ApiModelProperty("简历评分以及说明")
|
||||
private String cvScore;
|
||||
|
||||
@ApiModelProperty("简历详细信息-固定模版")
|
||||
private HotakeCvInfoDto cvInfoDto;
|
||||
|
||||
|
||||
@@ -27,6 +27,9 @@ public class HotakeProblemBaseInfo extends BaseEntity
|
||||
@Excel(name = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty("简历ID")
|
||||
private Long cvId;
|
||||
|
||||
/** 问题 */
|
||||
@ApiModelProperty("问题")
|
||||
@Excel(name = "问题")
|
||||
|
||||
@@ -23,6 +23,10 @@ public class HotakeCvInfoDto {
|
||||
private String phone;
|
||||
@ApiModelProperty("邮箱")
|
||||
private String email;
|
||||
@ApiModelProperty("岗位")
|
||||
private String position;
|
||||
@ApiModelProperty("地点")
|
||||
private String location;
|
||||
@ApiModelProperty("链接对象集合")
|
||||
private List<VcLinksDto> linksList;
|
||||
@ApiModelProperty("自我介绍")
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.vetti.hotake.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.vetti.hotake.domain.HotakeProblemBaseInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 面试者问题库信息Mapper接口
|
||||
@@ -72,6 +73,6 @@ public interface HotakeProblemBaseInfoMapper
|
||||
* @param userId 面试者ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHotakeProblemBaseInfoByUserId(Long userId);
|
||||
public int deleteHotakeProblemBaseInfoByUserId(@Param("userId") Long userId,@Param("cvId") Long cvId);
|
||||
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public interface IHotakeCvInfoService
|
||||
* @param cvInfoDto 简历信息
|
||||
* @return 结果
|
||||
*/
|
||||
public HotakeProblemBaseInfo handleHotakeCvInfo(HotakeCvInfoDto cvInfoDto);
|
||||
public HotakeProblemBaseInfo handleHotakeCvInfo(HotakeCvInfoDto cvInfoDto,Long cvId);
|
||||
|
||||
|
||||
/**
|
||||
@@ -78,4 +78,13 @@ public interface IHotakeCvInfoService
|
||||
*/
|
||||
public int batchInsertHotakeCvInfo(List<HotakeCvInfo> hotakeCvInfoList);
|
||||
|
||||
/**
|
||||
* 简历解析以及生成问题和评分
|
||||
*
|
||||
* @param hotakeCvInfo 简历信息
|
||||
* @return 结果
|
||||
*/
|
||||
public HotakeCvInfo handleCvAnalysis(HotakeCvInfo hotakeCvInfo);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -73,6 +73,6 @@ public interface IHotakeProblemBaseInfoService
|
||||
* @param userId 面试者用户ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHotakeProblemBaseInfoByUserId(Long userId);
|
||||
public int deleteHotakeProblemBaseInfoByUserId(Long userId,Long cvId);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.vetti.hotake.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
@@ -7,7 +8,6 @@ import com.vetti.common.ai.gpt.ChatGPTClient;
|
||||
import com.vetti.common.core.service.BaseServiceImpl;
|
||||
import com.vetti.common.enums.FillTypeEnum;
|
||||
import com.vetti.common.enums.MinioBucketNameEnum;
|
||||
import com.vetti.common.utils.DateUtils;
|
||||
import com.vetti.common.utils.SecurityUtils;
|
||||
import com.vetti.common.utils.readFile.FileContentUtil;
|
||||
import com.vetti.hotake.domain.HotakeCvInfo;
|
||||
@@ -31,22 +31,20 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* 简历信息Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author wangxiangshun
|
||||
* @date 2025-11-02
|
||||
*/
|
||||
@Slf4j
|
||||
@SuppressWarnings("all")
|
||||
@Service
|
||||
public class HotakeCvInfoServiceImpl extends BaseServiceImpl implements IHotakeCvInfoService
|
||||
{
|
||||
public class HotakeCvInfoServiceImpl extends BaseServiceImpl implements IHotakeCvInfoService {
|
||||
|
||||
/**
|
||||
* 问题前缀
|
||||
*/
|
||||
private final String QUESTION_PREFIX = "Question:";
|
||||
|
||||
|
||||
@Autowired
|
||||
private HotakeCvInfoMapper hotakeCvInfoMapper;
|
||||
|
||||
@@ -59,116 +57,111 @@ public class HotakeCvInfoServiceImpl extends BaseServiceImpl implements IHotakeC
|
||||
@Autowired
|
||||
private IHotakeProblemBaseInfoService hotakeProblemBaseInfoService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询简历信息
|
||||
*
|
||||
*
|
||||
* @param id 简历信息主键
|
||||
* @return 简历信息
|
||||
*/
|
||||
@Transactional(readOnly = true)
|
||||
@Override
|
||||
public HotakeCvInfo selectHotakeCvInfoById(Long id)
|
||||
{
|
||||
return hotakeCvInfoMapper.selectHotakeCvInfoById(id);
|
||||
public HotakeCvInfo selectHotakeCvInfoById(Long id) {
|
||||
HotakeCvInfo cvInfo = hotakeCvInfoMapper.selectHotakeCvInfoById(id);
|
||||
HotakeCvInfoDto cvInfoDto = JSONUtil.toBean(cvInfo.getCvTemplateJson(),HotakeCvInfoDto.class);
|
||||
cvInfo.setCvInfoDto(cvInfoDto);
|
||||
HotakeProblemBaseInfo query = new HotakeProblemBaseInfo();
|
||||
query.setCvId(id);
|
||||
List<HotakeProblemBaseInfo> problemBaseInfoList = hotakeProblemBaseInfoService.selectHotakeProblemBaseInfoList(query);
|
||||
if(CollectionUtil.isNotEmpty(problemBaseInfoList)){
|
||||
cvInfo.setProblemBaseInfo(problemBaseInfoList.get(0));
|
||||
}
|
||||
return cvInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询简历信息列表
|
||||
*
|
||||
*
|
||||
* @param hotakeCvInfo 简历信息
|
||||
* @return 简历信息
|
||||
*/
|
||||
@Transactional(readOnly = true)
|
||||
@Override
|
||||
public List<HotakeCvInfo> selectHotakeCvInfoList(HotakeCvInfo hotakeCvInfo)
|
||||
{
|
||||
return hotakeCvInfoMapper.selectHotakeCvInfoList(hotakeCvInfo);
|
||||
public List<HotakeCvInfo> selectHotakeCvInfoList(HotakeCvInfo hotakeCvInfo) {
|
||||
List<HotakeCvInfo> cvInfoList = hotakeCvInfoMapper.selectHotakeCvInfoList(hotakeCvInfo);
|
||||
if(CollectionUtil.isNotEmpty(cvInfoList)){
|
||||
for(HotakeCvInfo cvInfo : cvInfoList){
|
||||
HotakeCvInfoDto cvInfoDto = JSONUtil.toBean(cvInfo.getCvTemplateJson(),HotakeCvInfoDto.class);
|
||||
cvInfo.setCvInfoDto(cvInfoDto);
|
||||
//返回问题记录
|
||||
}
|
||||
}
|
||||
return cvInfoList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增简历信息
|
||||
*
|
||||
*
|
||||
* @param hotakeCvInfo 简历信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor=Exception.class)
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public HotakeCvInfo insertHotakeCvInfo(HotakeCvInfo hotakeCvInfo)
|
||||
{
|
||||
fill(FillTypeEnum.INSERT.getCode(),hotakeCvInfo);
|
||||
hotakeCvInfoMapper.insertHotakeCvInfo(hotakeCvInfo);
|
||||
//获取文件后缀
|
||||
public HotakeCvInfo insertHotakeCvInfo(HotakeCvInfo hotakeCvInfo) {
|
||||
fill(FillTypeEnum.INSERT.getCode(), hotakeCvInfo);
|
||||
String fileSuffix = FileUtil.getSuffix(hotakeCvInfo.getCvUrl());
|
||||
if(StrUtil.isNotEmpty(fileSuffix)){
|
||||
if (StrUtil.isNotEmpty(fileSuffix)) {
|
||||
fileSuffix = fileSuffix.toLowerCase();
|
||||
}
|
||||
hotakeCvInfo.setCvFileSuffix(fileSuffix);
|
||||
if("cv".equals(hotakeCvInfo.getCvFileType())){
|
||||
try{
|
||||
InputStream inputStream = minioClient.getObject(
|
||||
GetObjectArgs.builder()
|
||||
.bucket(MinioBucketNameEnum.CV.getCode())
|
||||
.object(hotakeCvInfo.getCvUrl())
|
||||
.build());
|
||||
String contents = FileContentUtil.readFileContent(inputStream,hotakeCvInfo.getCvFileSuffix());
|
||||
//生成简历模版数据信息
|
||||
HotakeCvInfoDto cvInfoDto = handleAnalysisCvInfo(contents);
|
||||
hotakeCvInfo.setCvInfoDto(cvInfoDto);
|
||||
//对简历数据进行处理生成相应的题库数据
|
||||
HotakeProblemBaseInfo problemBaseInfo = handleHotakeCvInfo(cvInfoDto);
|
||||
hotakeCvInfo.setProblemBaseInfo(problemBaseInfo);
|
||||
//生成对应的简历评分
|
||||
handleHotakeCvInfoScore(cvInfoDto);
|
||||
}catch (Exception e){
|
||||
}
|
||||
}
|
||||
hotakeCvInfoMapper.insertHotakeCvInfo(hotakeCvInfo);
|
||||
return hotakeCvInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理简历信息
|
||||
*
|
||||
* @param hotakeCvInfo 简历信息
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public HotakeProblemBaseInfo handleHotakeCvInfo(HotakeCvInfoDto cvInfoDto) {
|
||||
public HotakeProblemBaseInfo handleHotakeCvInfo(HotakeCvInfoDto cvInfoDto,Long cvId) {
|
||||
log.info("处理简历信息");
|
||||
HotakeProblemBaseInfo problemBaseInfo = new HotakeProblemBaseInfo();
|
||||
try{
|
||||
try {
|
||||
//调用AI大模型
|
||||
List<Map<String,String>> list = new LinkedList();
|
||||
Map<String,String> mapEntity = new HashMap<>();
|
||||
mapEntity.put("role","system");
|
||||
mapEntity.put("content","You are an experienced interviewer for construction management positions. Generate targeted interview questions based on candidate resumes.");
|
||||
List<Map<String, String>> list = new LinkedList();
|
||||
Map<String, String> mapEntity = new HashMap<>();
|
||||
mapEntity.put("role", "system");
|
||||
mapEntity.put("content", "You are an experienced interviewer for construction management positions. Generate targeted interview questions based on candidate resumes.");
|
||||
list.add(mapEntity);
|
||||
Map<String,String> mapEntityOne = new HashMap<>();
|
||||
mapEntityOne.put("role","user");
|
||||
mapEntityOne.put("content","Position: Construction Labourer"+
|
||||
"\\nCandidate: "+cvInfoDto.getName()+
|
||||
"\\nKey Skills: "+JSONUtil.toJsonStr(cvInfoDto.getSkillsToolsList())+
|
||||
"\\nExperience: "+JSONUtil.toJsonStr(cvInfoDto.getExperienceList())+
|
||||
"\\nStrengths: Professional certifications, Relevant experience"+
|
||||
"\\nConcerns: "+JSONUtil.toJsonStr(cvInfoDto.getAbout()));
|
||||
Map<String, String> mapEntityOne = new HashMap<>();
|
||||
mapEntityOne.put("role", "user");
|
||||
mapEntityOne.put("content", "Position: Construction Labourer" +
|
||||
"\\nCandidate: " + cvInfoDto.getName() +
|
||||
"\\nKey Skills: " + JSONUtil.toJsonStr(cvInfoDto.getSkillsToolsList()) +
|
||||
"\\nExperience: " + JSONUtil.toJsonStr(cvInfoDto.getExperienceList()) +
|
||||
"\\nStrengths: Professional certifications, Relevant experience" +
|
||||
"\\nConcerns: " + JSONUtil.toJsonStr(cvInfoDto.getAbout()));
|
||||
list.add(mapEntityOne);
|
||||
String promptText = JSONUtil.toJsonStr(list);
|
||||
String resultMsg = chatGPTClient.handleAiChat(promptText,"CV");
|
||||
log.info("返回简历问题数据:{}",resultMsg);
|
||||
resultMsg = resultMsg.replaceAll("\n","#AA#");
|
||||
String resultMsg = chatGPTClient.handleAiChat(promptText, "CV");
|
||||
log.info("返回简历问题数据:{}", resultMsg);
|
||||
resultMsg = resultMsg.replaceAll("\n", "#AA#");
|
||||
String question = "";
|
||||
Integer questionNums = 0;
|
||||
if(StrUtil.isNotEmpty(resultMsg)){
|
||||
resultMsg = resultMsg.replaceAll(QUESTION_PREFIX,"");
|
||||
if (StrUtil.isNotEmpty(resultMsg)) {
|
||||
resultMsg = resultMsg.replaceAll(QUESTION_PREFIX, "");
|
||||
questionNums = resultMsg.split("#AA#").length;
|
||||
}
|
||||
//生成预设问题记录
|
||||
//先删除该用户的预设问题
|
||||
hotakeProblemBaseInfoService.deleteHotakeProblemBaseInfoByUserId(SecurityUtils.getUserId());
|
||||
hotakeProblemBaseInfoService.deleteHotakeProblemBaseInfoByUserId(SecurityUtils.getUserId(),cvId);
|
||||
problemBaseInfo.setUserId(SecurityUtils.getUserId());
|
||||
problemBaseInfo.setContents(resultMsg);
|
||||
problemBaseInfo.setQuestionNums(questionNums);
|
||||
problemBaseInfo.setCvId(cvId);
|
||||
hotakeProblemBaseInfoService.insertHotakeProblemBaseInfo(problemBaseInfo);
|
||||
}catch (Exception e) {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return problemBaseInfo;
|
||||
@@ -177,75 +170,114 @@ public class HotakeCvInfoServiceImpl extends BaseServiceImpl implements IHotakeC
|
||||
|
||||
/**
|
||||
* 修改简历信息
|
||||
*
|
||||
*
|
||||
* @param hotakeCvInfo 简历信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor=Exception.class)
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public HotakeCvInfo updateHotakeCvInfo(HotakeCvInfo hotakeCvInfo)
|
||||
{
|
||||
hotakeCvInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
public HotakeCvInfo updateHotakeCvInfo(HotakeCvInfo hotakeCvInfo) {
|
||||
fill(FillTypeEnum.UPDATE.getCode(), hotakeCvInfo);
|
||||
|
||||
hotakeCvInfo.setCvTemplateJson(JSONUtil.toJsonStr(hotakeCvInfo.getCvInfoDto()));
|
||||
hotakeCvInfoMapper.updateHotakeCvInfo(hotakeCvInfo);
|
||||
return hotakeCvInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除简历信息
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的简历信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor=Exception.class)
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public int deleteHotakeCvInfoByIds(Long[] ids)
|
||||
{
|
||||
public int deleteHotakeCvInfoByIds(Long[] ids) {
|
||||
return hotakeCvInfoMapper.deleteHotakeCvInfoByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除简历信息信息
|
||||
*
|
||||
*
|
||||
* @param id 简历信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor=Exception.class)
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public int deleteHotakeCvInfoById(Long id)
|
||||
{
|
||||
public int deleteHotakeCvInfoById(Long id) {
|
||||
return hotakeCvInfoMapper.deleteHotakeCvInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量新增简历信息
|
||||
*
|
||||
* @param hotakeCvInfoList 简历信息列表
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor=Exception.class)
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public int batchInsertHotakeCvInfo(List<HotakeCvInfo> hotakeCvInfoList){
|
||||
public int batchInsertHotakeCvInfo(List<HotakeCvInfo> hotakeCvInfoList) {
|
||||
return hotakeCvInfoMapper.batchInsertHotakeCvInfo(hotakeCvInfoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 简历解析以及生成问题和评分
|
||||
* @param hotakeCvInfo 简历信息
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public HotakeCvInfo handleCvAnalysis(HotakeCvInfo hotakeCvInfo) {
|
||||
HotakeCvInfo cvInfo = selectHotakeCvInfoById(hotakeCvInfo.getId());
|
||||
if ("cv".equals(cvInfo.getCvFileType())) {
|
||||
log.info("开始处理简历");
|
||||
try {
|
||||
InputStream inputStream = minioClient.getObject(
|
||||
GetObjectArgs.builder()
|
||||
.bucket(MinioBucketNameEnum.CV.getCode())
|
||||
.object(cvInfo.getCvUrl())
|
||||
.build());
|
||||
String contents = FileContentUtil.readFileContent(inputStream, cvInfo.getCvFileSuffix());
|
||||
//生成简历模版数据信息
|
||||
HotakeCvInfoDto cvInfoDto = handleAnalysisCvInfo(contents);
|
||||
cvInfo.setCvInfoDto(cvInfoDto);
|
||||
//对简历数据进行处理生成相应的题库数据
|
||||
HotakeProblemBaseInfo problemBaseInfo = handleHotakeCvInfo(cvInfoDto,hotakeCvInfo.getId());
|
||||
cvInfo.setProblemBaseInfo(problemBaseInfo);
|
||||
//生成对应的简历评分
|
||||
String resultMsg = handleHotakeCvInfoScore(cvInfoDto);
|
||||
cvInfo.setScore(resultMsg);
|
||||
cvInfo.setCvTemplateJson(JSONUtil.toJsonStr(cvInfoDto));
|
||||
fill(FillTypeEnum.UPDATE.getCode(), cvInfo);
|
||||
hotakeCvInfoMapper.updateHotakeCvInfo(cvInfo);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return cvInfo;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 简历解析数据
|
||||
*
|
||||
* @param contents
|
||||
* @return
|
||||
*/
|
||||
private HotakeCvInfoDto handleAnalysisCvInfo(String contents){
|
||||
//根据AI做
|
||||
String pom = "[\n" +
|
||||
" {\n" +
|
||||
" \"role\": \"user\",\n" +
|
||||
" \"content\": \"从下面提供的文本中提取所有能识别到的简历信息,只提取原文中存在的内容,不要补充、不推测、不总结。需要提取的字段包括:name(姓名)、phone(电话号码)、email(电子邮件地址)、links(所有链接地址)、about(关于我/自我介绍)、skills_tools(关键资格(许可证、注册/会员资格、认证))、languages(语言能力)、experience(工作经历(除了title、company、location、duration其他的都放到描述里面))、education(教育经历)。请将提取结果以结构化 JSON 格式返回,格式如下:{ \\\"name\\\": \\\"\\\", \\\"phone\\\": \\\"\\\", \\\"email\\\": \\\"\\\", \\\"links\\\": [], \\\"about\\\": \\\"\\\", \\\"skills_tools\\\": [], \\\"languages\\\": [], \\\"experience\\\": [{\\\"title\\\": \\\"\\\", \\\"company\\\": \\\"\\\",\\\"location\\\": \\\"\\\",\\\"duration\\\": \\\"\\\",\\\"description\\\": []}], \\\"education\\\": [{\\\"degree\\\": \\\"\\\",\\\"institution\\\": \\\"\\\",\\\"date\\\": \\\"\\\"}] }。字段不存在则返回 null 或空数组。只返回标准可解析的 JSON结构 ,不要多余的```json等信息,不要解释说明,不要改写内容。以下为待处理文本:" + contents +
|
||||
" }\n" +
|
||||
"]";
|
||||
String resultCv = chatGPTClient.handleAiChat(pom,"JX");
|
||||
try{
|
||||
HotakeCvInfoDto cvInfoDto = JSONUtil.toBean(resultCv,HotakeCvInfoDto.class);
|
||||
private HotakeCvInfoDto handleAnalysisCvInfo(String contents) {
|
||||
log.info("开始简历解析");
|
||||
try {
|
||||
List<Map<String,String>> list = new LinkedList();
|
||||
Map<String,String> entity = new HashMap<>();
|
||||
entity.put("role","user");
|
||||
entity.put("content","从下面提供的文本中提取所有能识别到的简历信息,只提取原文中存在的内容,不要补充、不推测、不总结。需要提取的字段包括:name(姓名)、phone(电话号码)、position(岗位)、location(地点)、email(电子邮件地址)、links(所有链接地址)、about(关于我/自我介绍)、skills_tools(关键资格(许可证、注册/会员资格、认证))、languages(语言能力)、experience(工作经历(除了title、company、location、duration其他的都放到描述里面))、education(教育经历)。请将提取结果以结构化 JSON 格式返回,格式如下:{ \\\"name\\\": \\\"\\\", \\\"phone\\\": \\\"\\\", \\\"position\\\": \\\"\\\", \\\"location\\\": \\\"\\\", \\\"email\\\": \\\"\\\", \\\"links\\\": [], \\\"about\\\": \\\"\\\", \\\"skills_tools\\\": [], \\\"languages\\\": [], \\\"experience\\\": [{\\\"title\\\": \\\"\\\", \\\"company\\\": \\\"\\\",\\\"location\\\": \\\"\\\",\\\"duration\\\": \\\"\\\",\\\"description\\\": []}], \\\"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);
|
||||
return cvInfoDto;
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return new HotakeCvInfoDto();
|
||||
}
|
||||
@@ -253,36 +285,36 @@ public class HotakeCvInfoServiceImpl extends BaseServiceImpl implements IHotakeC
|
||||
|
||||
/**
|
||||
* 处理简历信息
|
||||
*
|
||||
* @param hotakeCvInfo 简历信息
|
||||
* @return
|
||||
*/
|
||||
private HotakeProblemBaseInfo handleHotakeCvInfoScore(HotakeCvInfoDto cvInfoDto) {
|
||||
HotakeProblemBaseInfo problemBaseInfo = new HotakeProblemBaseInfo();
|
||||
try{
|
||||
private String handleHotakeCvInfoScore(HotakeCvInfoDto cvInfoDto) {
|
||||
String resultMsg = "";
|
||||
try {
|
||||
//调用AI大模型
|
||||
List<Map<String,String>> list = new LinkedList();
|
||||
Map<String,String> mapEntity = new HashMap<>();
|
||||
mapEntity.put("role","system");
|
||||
mapEntity.put("content","You are a construction industry HR expert. Evaluate resumes and provide scores and recommendations for construction management positions.");
|
||||
List<Map<String, String>> list = new LinkedList();
|
||||
Map<String, String> mapEntity = new HashMap<>();
|
||||
mapEntity.put("role", "system");
|
||||
mapEntity.put("content", "You are a construction industry HR expert. Evaluate resumes and provide scores and recommendations for construction management positions.");
|
||||
list.add(mapEntity);
|
||||
Map<String,String> mapEntityOne = new HashMap<>();
|
||||
mapEntityOne.put("role","user");
|
||||
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()));
|
||||
Map<String, String> mapEntityOne = new HashMap<>();
|
||||
mapEntityOne.put("role", "user");
|
||||
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()));
|
||||
list.add(mapEntityOne);
|
||||
String promptText = JSONUtil.toJsonStr(list);
|
||||
String resultMsg = chatGPTClient.handleAiChat(promptText,"CV");
|
||||
log.info("返回简历评分数据:{}",resultMsg);
|
||||
|
||||
}catch (Exception e) {
|
||||
resultMsg = chatGPTClient.handleAiChat(promptText, "CV");
|
||||
log.info("返回简历评分数据:{}", resultMsg);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return problemBaseInfo;
|
||||
return resultMsg;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -123,8 +123,8 @@ public class HotakeProblemBaseInfoServiceImpl extends BaseServiceImpl implements
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int deleteHotakeProblemBaseInfoByUserId(Long userId) {
|
||||
public int deleteHotakeProblemBaseInfoByUserId(Long userId,Long cvId) {
|
||||
|
||||
return hotakeProblemBaseInfoMapper.deleteHotakeProblemBaseInfoByUserId(userId);
|
||||
return hotakeProblemBaseInfoMapper.deleteHotakeProblemBaseInfoByUserId(userId,cvId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="fileSizeShow" column="file_size_show" />
|
||||
<result property="cvFileSuffix" column="cv_file_suffix" />
|
||||
<result property="status" column="status" />
|
||||
<result property="cvTemplateJson" column="cv_template_json" />
|
||||
<result property="cvScore" column="cv_score" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
@@ -22,7 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectHotakeCvInfoVo">
|
||||
select id, user_id, cv_name, cv_file_type, cv_url,file_size_show,cv_file_suffix, status,
|
||||
select id, user_id, cv_name, cv_file_type, cv_url,file_size_show,cv_file_suffix, status,cv_template_json,cv_score,
|
||||
del_flag, create_by, create_time, update_by, update_time, remark from hotake_cv_info
|
||||
</sql>
|
||||
|
||||
@@ -54,6 +56,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="fileSizeShow != null">file_size_show,</if>
|
||||
<if test="cvFileSuffix != null">cv_file_suffix,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="cvTemplateJson != null">cv_template_json,</if>
|
||||
<if test="cvScore != null">cv_score,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
@@ -69,6 +73,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="fileSizeShow != null">#{fileSizeShow},</if>
|
||||
<if test="cvFileSuffix != null">#{cvFileSuffix},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="cvTemplateJson != null">#{cvTemplateJson},</if>
|
||||
<if test="cvScore != null">#{cvScore},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
@@ -88,6 +94,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="fileSizeShow != null">file_size_show = #{fileSizeShow},</if>
|
||||
<if test="cvFileSuffix != null">cv_file_suffix = #{cvFileSuffix},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="cvTemplateJson != null">cv_template_json = #{cvTemplateJson},</if>
|
||||
<if test="cvScore != null">cv_score = #{cvScore},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
|
||||
@@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<resultMap type="HotakeProblemBaseInfo" id="HotakeProblemBaseInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="cvId" column="cv_id" />
|
||||
<result property="contents" column="contents" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
@@ -18,13 +19,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectHotakeProblemBaseInfoVo">
|
||||
select id, user_id, contents, status, del_flag, create_by, create_time, update_by, update_time, remark from hotake_problem_base_info
|
||||
select id, user_id,cv_id, contents, status, del_flag, create_by, create_time, update_by, update_time, remark from hotake_problem_base_info
|
||||
</sql>
|
||||
|
||||
<select id="selectHotakeProblemBaseInfoList" parameterType="HotakeProblemBaseInfo" resultMap="HotakeProblemBaseInfoResult">
|
||||
<include refid="selectHotakeProblemBaseInfoVo"/>
|
||||
<where>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="cvId != null "> and cv_id = #{cvId}</if>
|
||||
<if test="contents != null and contents != ''"> and contents = #{contents}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
</where>
|
||||
@@ -39,6 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
insert into hotake_problem_base_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="cvId != null">cv_id,</if>
|
||||
<if test="contents != null">contents,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
@@ -50,6 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="cvId != null">#{cvId},</if>
|
||||
<if test="contents != null">#{contents},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
@@ -65,6 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
update hotake_problem_base_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="cvId != null">cv_id = #{cvId},</if>
|
||||
<if test="contents != null">contents = #{contents},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
@@ -82,7 +87,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</delete>
|
||||
|
||||
<delete id="deleteHotakeProblemBaseInfoByUserId" parameterType="Long">
|
||||
delete from hotake_problem_base_info where user_id = #{userId}
|
||||
delete from hotake_problem_base_info where user_id = #{userId} and cv_id = #{cvId}
|
||||
|
||||
</delete>
|
||||
|
||||
<delete id="deleteHotakeProblemBaseInfoByIds" parameterType="String">
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
com/vetti/hotake/domain/dto/VcDto/VcExperienceDto.class
|
||||
com/vetti/hotake/domain/dto/VcDto/VcSkillsToolsDto.class
|
||||
com/vetti/hotake/domain/dto/VcDto/VcEducationDto.class
|
||||
com/vetti/hotake/domain/dto/VcDto/VcLinksDto.class
|
||||
com/vetti/hotake/domain/dto/VcDto/VcExperienceDescriptionDto.class
|
||||
com/vetti/hotake/domain/dto/VcDto/VcLanguagesDto.class
|
||||
|
||||
Reference in New Issue
Block a user