简历以及招聘人基础逻辑修改
This commit is contained in:
@@ -0,0 +1,116 @@
|
||||
package com.vetti.hotake.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.vetti.common.core.service.BaseServiceImpl;
|
||||
import com.vetti.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.vetti.hotake.mapper.HotakeCandidateInterviewRecordInfoMapper;
|
||||
import com.vetti.hotake.domain.HotakeCandidateInterviewRecordInfo;
|
||||
import com.vetti.hotake.service.IHotakeCandidateInterviewRecordInfoService;
|
||||
|
||||
/**
|
||||
* 候选人面试记录信息Service业务层处理
|
||||
*
|
||||
* @author wangxiangshun
|
||||
* @date 2025-12-08
|
||||
*/
|
||||
@SuppressWarnings("all")
|
||||
@Service
|
||||
public class HotakeCandidateInterviewRecordInfoServiceImpl extends BaseServiceImpl implements IHotakeCandidateInterviewRecordInfoService
|
||||
{
|
||||
@Autowired
|
||||
private HotakeCandidateInterviewRecordInfoMapper hotakeCandidateInterviewRecordInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询候选人面试记录信息
|
||||
*
|
||||
* @param id 候选人面试记录信息主键
|
||||
* @return 候选人面试记录信息
|
||||
*/
|
||||
@Transactional(readOnly = true)
|
||||
@Override
|
||||
public HotakeCandidateInterviewRecordInfo selectHotakeCandidateInterviewRecordInfoById(Long id)
|
||||
{
|
||||
return hotakeCandidateInterviewRecordInfoMapper.selectHotakeCandidateInterviewRecordInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询候选人面试记录信息列表
|
||||
*
|
||||
* @param hotakeCandidateInterviewRecordInfo 候选人面试记录信息
|
||||
* @return 候选人面试记录信息
|
||||
*/
|
||||
@Transactional(readOnly = true)
|
||||
@Override
|
||||
public List<HotakeCandidateInterviewRecordInfo> selectHotakeCandidateInterviewRecordInfoList(HotakeCandidateInterviewRecordInfo hotakeCandidateInterviewRecordInfo)
|
||||
{
|
||||
return hotakeCandidateInterviewRecordInfoMapper.selectHotakeCandidateInterviewRecordInfoList(hotakeCandidateInterviewRecordInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增候选人面试记录信息
|
||||
*
|
||||
* @param hotakeCandidateInterviewRecordInfo 候选人面试记录信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor=Exception.class)
|
||||
@Override
|
||||
public int insertHotakeCandidateInterviewRecordInfo(HotakeCandidateInterviewRecordInfo hotakeCandidateInterviewRecordInfo)
|
||||
{
|
||||
return hotakeCandidateInterviewRecordInfoMapper.insertHotakeCandidateInterviewRecordInfo(hotakeCandidateInterviewRecordInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改候选人面试记录信息
|
||||
*
|
||||
* @param hotakeCandidateInterviewRecordInfo 候选人面试记录信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor=Exception.class)
|
||||
@Override
|
||||
public int updateHotakeCandidateInterviewRecordInfo(HotakeCandidateInterviewRecordInfo hotakeCandidateInterviewRecordInfo)
|
||||
{
|
||||
return hotakeCandidateInterviewRecordInfoMapper.updateHotakeCandidateInterviewRecordInfo(hotakeCandidateInterviewRecordInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除候选人面试记录信息
|
||||
*
|
||||
* @param ids 需要删除的候选人面试记录信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor=Exception.class)
|
||||
@Override
|
||||
public int deleteHotakeCandidateInterviewRecordInfoByIds(Long[] ids)
|
||||
{
|
||||
return hotakeCandidateInterviewRecordInfoMapper.deleteHotakeCandidateInterviewRecordInfoByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除候选人面试记录信息信息
|
||||
*
|
||||
* @param id 候选人面试记录信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor=Exception.class)
|
||||
@Override
|
||||
public int deleteHotakeCandidateInterviewRecordInfoById(Long id)
|
||||
{
|
||||
return hotakeCandidateInterviewRecordInfoMapper.deleteHotakeCandidateInterviewRecordInfoById(id);
|
||||
}
|
||||
/**
|
||||
* 批量新增候选人面试记录信息
|
||||
*
|
||||
* @param hotakeCandidateInterviewRecordInfoList 候选人面试记录信息列表
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor=Exception.class)
|
||||
@Override
|
||||
public int batchInsertHotakeCandidateInterviewRecordInfo(List<HotakeCandidateInterviewRecordInfo> hotakeCandidateInterviewRecordInfoList){
|
||||
return hotakeCandidateInterviewRecordInfoMapper.batchInsertHotakeCandidateInterviewRecordInfo(hotakeCandidateInterviewRecordInfoList);
|
||||
}
|
||||
}
|
||||
@@ -112,6 +112,8 @@ public class HotakeCvInfoServiceImpl extends BaseServiceImpl implements IHotakeC
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public HotakeCvInfo insertHotakeCvInfo(HotakeCvInfo hotakeCvInfo) {
|
||||
//删除原先的CV简历信息
|
||||
hotakeCvInfoMapper.deleteHotakeCvInfoByUserIdAndType(SecurityUtils.getUserId(),"cv");
|
||||
fill(FillTypeEnum.INSERT.getCode(), hotakeCvInfo);
|
||||
String fileSuffix = FileUtil.getSuffix(hotakeCvInfo.getCvUrl());
|
||||
if (StrUtil.isNotEmpty(fileSuffix)) {
|
||||
@@ -247,12 +249,14 @@ public class HotakeCvInfoServiceImpl extends BaseServiceImpl implements IHotakeC
|
||||
.object(cvInfo.getCvUrl())
|
||||
.build());
|
||||
String contents = FileContentUtil.readFileContent(inputStream, cvInfo.getCvFileSuffix());
|
||||
log.info("简历信息:{}",contents);
|
||||
//验证文件内容是否改变,如果未改变不进行模型解析直接返回原有结果
|
||||
String md5Hash = MD5.create().digestHex16(contents);
|
||||
if(StrUtil.isNotEmpty(md5Hash) && md5Hash.equals(cvInfo.getCvMd5())){
|
||||
//直接返回简历结果
|
||||
return cvInfo;
|
||||
}
|
||||
cvInfo.setCvMd5(md5Hash);
|
||||
//生成简历模版数据信息
|
||||
HotakeCvInfoDto cvInfoDto = handleAnalysisCvInfo(contents);
|
||||
cvInfo.setCvInfoDto(cvInfoDto);
|
||||
@@ -285,7 +289,7 @@ 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(所有链接地址)、currentWork(当前工作公司)、about(关于我/自我介绍)、skills_tools(关键资格(许可证、注册/会员资格、认证))、languages(语言能力,主要就是Languages下面的语言)、experience(工作经历,除了title、company、location、durationStart、durationEnd,其他的都放到description里面,并且description里面要根据换行符分成不同的content),日期要拆分成开始时间(durationStart)和结束时间(durationEnd))、education(教育经历,日期要拆分成开始时间(durationStart)和结束时间(durationEnd))。请将提取结果以结构化 JSON 格式返回,格式如下:{ \\\"name\\\": \\\"\\\", \\\"phone\\\": \\\"\\\", \\\"email\\\": \\\"\\\", \\\"links\\\": [{\\\"content\\\":\\\"\\\"}], \\\"about\\\": \\\"\\\", \\\"skillsTools\\\": [{\\\"content\\\":\\\"\\\"}], \\\"languages\\\": [{\\\"content\\\":\\\"\\\"}], \\\"experience\\\": [{\\\"title\\\": \\\"\\\", \\\"company\\\": \\\"\\\",\\\"location\\\": \\\"\\\",\\\"durationStart\\\": \\\"\\\",\\\"durationEnd\\\": \\\"\\\",\\\"description\\\": [{\\\"content\\\":\\\"\\\"}]}], \\\"education\\\": [{\\\"degree\\\": \\\"\\\",\\\"institution\\\": \\\"\\\",\\\"durationStart\\\": \\\"\\\",\\\"durationEnd\\\": \\\"\\\"}] }。字段不存在则返回 null 或空数组。只返回标准可解析的 JSON结构 ,不要多余的```json等信息,不要解释说明,不要改写内容。以下为待处理文本:"+contents);
|
||||
entity.put("content","从下面提供的文本中提取所有能识别到的简历信息,只提取原文中存在的内容,不要补充、不推测、不总结。需要提取的字段包括:name(姓名或人名)、phone(电话号码)、email(电子邮件地址)、position(岗位或者简历中自己期望的职位等)、location(地点或者地址、家庭住址)、links(所有链接地址)、currentWork(当前工作公司)、about(关于我/自我介绍)、skills_tools(关键资格(许可证、注册/会员资格、认证))、languages(语言能力,主要就是Languages下面的语言)、experience(工作经历,除了title、company、location、durationStart、durationEnd,其他的都放到description里面,并且description里面要根据换行符分成不同的content),日期要拆分成开始时间(durationStart)和结束时间(durationEnd))、education(教育经历,日期要拆分成开始时间(durationStart)和结束时间(durationEnd))。请将提取结果以结构化 JSON 格式返回,格式如下:{ \\\"name\\\": \\\"\\\", \\\"phone\\\": \\\"\\\", \\\"currentWork\\\": \\\"\\\", \\\"position\\\": \\\"\\\", \\\"location\\\": \\\"\\\", \\\"email\\\": \\\"\\\", \\\"links\\\": [{\\\"content\\\":\\\"\\\"}], \\\"about\\\": \\\"\\\", \\\"skillsTools\\\": [{\\\"content\\\":\\\"\\\"}], \\\"languages\\\": [{\\\"content\\\":\\\"\\\"}], \\\"experience\\\": [{\\\"title\\\": \\\"\\\", \\\"company\\\": \\\"\\\",\\\"location\\\": \\\"\\\",\\\"durationStart\\\": \\\"\\\",\\\"durationEnd\\\": \\\"\\\",\\\"description\\\": [{\\\"content\\\":\\\"\\\"}]}], \\\"education\\\": [{\\\"degree\\\": \\\"\\\",\\\"institution\\\": \\\"\\\",\\\"durationStart\\\": \\\"\\\",\\\"durationEnd\\\": \\\"\\\"}] }。字段不存在则返回 null 或空数组。只返回标准可解析的 JSON结构 ,不要多余的```json等信息,不要解释说明,不要改写内容。以下为待处理文本:"+contents);
|
||||
//根据AI做
|
||||
list.add(entity);
|
||||
String resultCv = chatGPTClient.handleAiChat(JSONUtil.toJsonStr(list), "JX");
|
||||
|
||||
Reference in New Issue
Block a user