候选人AI面试分析
This commit is contained in:
@@ -128,5 +128,11 @@ public interface IHotakeAiCommonToolsService {
|
||||
public String getAiInterviewQuestions(HotakeRolesInfo rolesInfo);
|
||||
|
||||
|
||||
/**
|
||||
* 候选人AI面试分析
|
||||
* @param analysisVo 候选人AI面试分析信息
|
||||
* @return
|
||||
*/
|
||||
public String handleCandidateAiInterviewAnalysis(HotakeCandidateAiInterviewAnalysisVo analysisVo);
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.vetti.hotake.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.vetti.hotake.domain.HotakeRolesApplyInfo;
|
||||
import com.vetti.hotake.domain.vo.HotakeRolesApplyStageVo;
|
||||
|
||||
/**
|
||||
* 候选人岗位申请信息Service接口
|
||||
@@ -67,4 +68,13 @@ public interface IHotakeRolesApplyInfoService
|
||||
*/
|
||||
public int batchInsertHotakeRolesApplyInfo(List<HotakeRolesApplyInfo> hotakeRolesApplyInfoList);
|
||||
|
||||
/**
|
||||
* 修改候选人岗位申请信息
|
||||
*
|
||||
* @param stageVoList 候选人岗位申请信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBatchEditStage(List<HotakeRolesApplyStageVo> stageVoList);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -988,4 +988,52 @@ public class HotakeAiCommonToolsServiceImpl extends BaseServiceImpl implements I
|
||||
|
||||
return resultJsonOne;
|
||||
}
|
||||
|
||||
/**
|
||||
* 候选人AI面试分析
|
||||
* @param rolesInfo 候选人AI面试分析信息
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String handleCandidateAiInterviewAnalysis(HotakeCandidateAiInterviewAnalysisVo analysisVo) {
|
||||
|
||||
String prompt = AiCommonPromptConstants.initializationCandidateAiInterviewAnalysisPrompt();
|
||||
|
||||
String qa = "";
|
||||
if(CollectionUtil.isNotEmpty(analysisVo.getAiInterviewQuestionRecordVoList())){
|
||||
for(HotakeAiInterviewQuestionRecordVo recordVo : analysisVo.getAiInterviewQuestionRecordVoList()){
|
||||
if("assistant".equals(recordVo.getUserType())){
|
||||
qa = qa + "Question:"+recordVo.getContentText();
|
||||
}
|
||||
if("user".equals(recordVo.getUserType())){
|
||||
qa = qa + "Answer:"+recordVo.getContentText();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String userPrompt_1 = "Please conduct an interview analysis based on the questions answered by the following candidates:\n" +
|
||||
"\n" +
|
||||
"**Job Information**:\n" +
|
||||
"Position:【"+analysisVo.getPosition()+"】\n" +
|
||||
"Question And Answer:【"+qa+"】\n"+
|
||||
"Please return the analysis results in the required JSON format.";
|
||||
|
||||
log.info("AI面试问题生成:{}",userPrompt_1);
|
||||
//处理岗位信息补充
|
||||
List<Map<String, String>> listOne = new LinkedList();
|
||||
Map<String, String> mapEntityOne = new HashMap<>();
|
||||
mapEntityOne.put("role", "system");
|
||||
mapEntityOne.put("content",prompt);
|
||||
listOne.add(mapEntityOne);
|
||||
Map<String, String> mapUserEntityOne = new HashMap<>();
|
||||
mapUserEntityOne.put("role", "user");
|
||||
mapUserEntityOne.put("content",userPrompt_1);
|
||||
listOne.add(mapUserEntityOne);
|
||||
String promptJsonOne = JSONUtil.toJsonStr(listOne);
|
||||
String resultStrOne = chatGPTClient.handleAiChat(promptJsonOne,"AIINTPF");
|
||||
String resultJsonOne = resultStrOne.replaceAll("```json","").replaceAll("```","");
|
||||
log.info("候选人AI面试分析结果:{}",resultJsonOne);
|
||||
|
||||
return resultJsonOne;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.vetti.hotake.domain.HotakeRolesApplyOperRecord;
|
||||
import com.vetti.hotake.domain.HotakeRolesInfo;
|
||||
import com.vetti.hotake.domain.dto.HotakeCvInfoDto;
|
||||
import com.vetti.hotake.domain.dto.VcDto.*;
|
||||
import com.vetti.hotake.domain.vo.HotakeRolesApplyStageVo;
|
||||
import com.vetti.hotake.mapper.HotakeRolesApplyInfoMapper;
|
||||
import com.vetti.hotake.mapper.HotakeRolesInfoMapper;
|
||||
import com.vetti.hotake.service.IHotakeRolesApplyInfoService;
|
||||
@@ -334,4 +335,40 @@ public class HotakeRolesApplyInfoServiceImpl extends BaseServiceImpl implements
|
||||
return new HotakeCvInfoDto();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改候选人岗位申请信息
|
||||
*
|
||||
* @param hotakeRolesApplyInfo 候选人岗位申请信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor=Exception.class)
|
||||
@Override
|
||||
public int updateBatchEditStage(List<HotakeRolesApplyStageVo> stageVoList)
|
||||
{
|
||||
int resultNum = 0;
|
||||
if(CollectionUtil.isNotEmpty(stageVoList)){
|
||||
for(HotakeRolesApplyStageVo stageVo : stageVoList){
|
||||
HotakeRolesApplyInfo hotakeRolesApplyInfo = new HotakeRolesApplyInfo();
|
||||
hotakeRolesApplyInfo.setId(stageVo.getRoleApplyId());
|
||||
hotakeRolesApplyInfo.setStage(stageVo.getStage());
|
||||
fill(FillTypeEnum.UPDATE.getCode(), hotakeRolesApplyInfo);
|
||||
resultNum = hotakeRolesApplyInfoMapper.updateHotakeRolesApplyInfo(hotakeRolesApplyInfo);
|
||||
HotakeRolesApplyOperRecord query = new HotakeRolesApplyOperRecord();
|
||||
query.setRoleApplyId(hotakeRolesApplyInfo.getId()).setApplyStage(hotakeRolesApplyInfo.getStage());
|
||||
List<HotakeRolesApplyOperRecord> applyOperRecords = rolesApplyOperRecordService.selectHotakeRolesApplyOperRecordList(query);
|
||||
if(CollectionUtil.isEmpty(applyOperRecords)) {
|
||||
StageEnum stageEnum = StageEnum.getByInfo(hotakeRolesApplyInfo.getStage());
|
||||
if(stageEnum != null){
|
||||
HotakeRolesApplyOperRecord hotakeRolesApplyOperRecord = new HotakeRolesApplyOperRecord();
|
||||
hotakeRolesApplyOperRecord.setApplyStage(hotakeRolesApplyInfo.getStage());
|
||||
hotakeRolesApplyOperRecord.setRoleApplyId(hotakeRolesApplyInfo.getId());
|
||||
hotakeRolesApplyOperRecord.setRoleId(hotakeRolesApplyInfo.getRoleId());
|
||||
rolesApplyOperRecordService.insertHotakeRolesApplyOperRecord(hotakeRolesApplyOperRecord);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return resultNum;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user