简历解析结构修改和字典逻辑修改

This commit is contained in:
2025-12-02 21:32:31 +08:00
parent 22c0f3d95d
commit 4eb473b77e
14 changed files with 246 additions and 41 deletions

View File

@@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.vetti.common.core.domain.R;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -67,11 +68,10 @@ public class SysDictDataController extends BaseController
* 查询字典数据详细 * 查询字典数据详细
*/ */
@ApiOperation("查询字典数据详细") @ApiOperation("查询字典数据详细")
@PreAuthorize("@ss.hasPermi('system:dict:query')")
@GetMapping(value = "/{dictCode}") @GetMapping(value = "/{dictCode}")
public AjaxResult<SysDictData> getInfo(@PathVariable Long dictCode) public R<SysDictData> getInfo(@PathVariable Long dictCode)
{ {
return success(dictDataService.selectDictDataById(dictCode)); return R.ok(dictDataService.selectDictDataById(dictCode));
} }
/** /**
@@ -79,14 +79,14 @@ public class SysDictDataController extends BaseController
*/ */
@ApiOperation("根据字典类型查询字典数据信息") @ApiOperation("根据字典类型查询字典数据信息")
@GetMapping(value = "/type/{dictType}") @GetMapping(value = "/type/{dictType}")
public AjaxResult<List<SysDictData>> dictType(@PathVariable String dictType) public R<List<SysDictData>> dictType(@PathVariable String dictType)
{ {
List<SysDictData> data = dictTypeService.selectDictDataByType(dictType); List<SysDictData> data = dictTypeService.selectDictDataByType(dictType);
if (StringUtils.isNull(data)) if (StringUtils.isNull(data))
{ {
data = new ArrayList<SysDictData>(); data = new ArrayList<SysDictData>();
} }
return success(data); return R.ok(data);
} }
/** /**

View File

@@ -170,7 +170,7 @@ chatGpt:
apiKey: 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 apiKey: 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
apiUrl: https://api.openai.com/v1/chat/completions apiUrl: https://api.openai.com/v1/chat/completions
model: ft:gpt-3.5-turbo-0125:vetti:interview-unified:CaGyCXOr model: ft:gpt-3.5-turbo-0125:vetti:interview-unified:CaGyCXOr
modelQuestion: gpt-4o-mini modelQuestion: ft:gpt-4o-mini-2024-07-18:vetti:interview-corpus:ChvLmzLu
modelCV: ft:gpt-3.5-turbo-0125:vetti:vetti-resume-full:CYT0C8JG modelCV: ft:gpt-3.5-turbo-0125:vetti:vetti-resume-full:CYT0C8JG
modelJxCv: gpt-4o-mini modelJxCv: gpt-4o-mini
role: system role: system

View File

@@ -170,7 +170,7 @@ chatGpt:
apiKey: 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 apiKey: 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
apiUrl: https://api.openai.com/v1/chat/completions apiUrl: https://api.openai.com/v1/chat/completions
model: ft:gpt-3.5-turbo-0125:vetti:interview-unified:CaGyCXOr model: ft:gpt-3.5-turbo-0125:vetti:interview-unified:CaGyCXOr
modelQuestion: gpt-4o-mini modelQuestion: ft:gpt-4o-mini-2024-07-18:vetti:interview-corpus:ChvLmzLu
modelCV: ft:gpt-3.5-turbo-0125:vetti:vetti-resume-full:CYT0C8JG modelCV: ft:gpt-3.5-turbo-0125:vetti:vetti-resume-full:CYT0C8JG
modelJxCv: gpt-4o-mini modelJxCv: gpt-4o-mini
role: system role: system

View File

@@ -4,6 +4,7 @@ import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
import com.vetti.common.international.International; import com.vetti.common.international.International;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.vetti.common.annotation.Excel; import com.vetti.common.annotation.Excel;
@@ -11,6 +12,8 @@ import com.vetti.common.annotation.Excel.ColumnType;
import com.vetti.common.constant.UserConstants; import com.vetti.common.constant.UserConstants;
import com.vetti.common.core.domain.BaseEntity; import com.vetti.common.core.domain.BaseEntity;
import java.util.List;
/** /**
* 字典数据表 sys_dict_data * 字典数据表 sys_dict_data
* *
@@ -21,40 +24,52 @@ public class SysDictData extends BaseEntity
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 字典编码 */ /** 字典编码 */
@ApiModelProperty("字典编码")
@Excel(name = "字典编码", cellType = ColumnType.NUMERIC) @Excel(name = "字典编码", cellType = ColumnType.NUMERIC)
private Long dictCode; private Long dictCode;
/** 字典编码 */
@ApiModelProperty("字典父编码")
@Excel(name = "字典父编码", cellType = ColumnType.NUMERIC)
private Long dictParentCode;
/** 字典排序 */ /** 字典排序 */
@ApiModelProperty("字典排序")
@Excel(name = "字典排序", cellType = ColumnType.NUMERIC) @Excel(name = "字典排序", cellType = ColumnType.NUMERIC)
private Long dictSort; private Long dictSort;
/** 字典标签 */ /** 字典标签 */
@ApiModelProperty("字典标签")
@Excel(name = "字典标签") @Excel(name = "字典标签")
@International(type = "sys_dict_label")
private String dictLabel; private String dictLabel;
/** 字典键值 */ /** 字典键值 */
@ApiModelProperty("字典键值")
@Excel(name = "字典键值") @Excel(name = "字典键值")
private String dictValue; private String dictValue;
/** 字典类型 */ /** 字典类型 */
@ApiModelProperty("字典类型")
@Excel(name = "字典类型") @Excel(name = "字典类型")
private String dictType; private String dictType;
/** 样式属性(其他样式扩展 */ @ApiModelProperty("样式属性(其他样式扩展)")
private String cssClass; private String cssClass;
/** 表格字典样式 */ @ApiModelProperty("表格字典样式")
private String listClass; private String listClass;
/** 是否默认Y是 N否 */ @ApiModelProperty("是否默认Y是 N否")
@Excel(name = "是否默认", readConverterExp = "Y=是,N=否") @Excel(name = "是否默认", readConverterExp = "Y=是,N=否")
private String isDefault; private String isDefault;
/** 状态0正常 1停用 */ @ApiModelProperty("状态0正常 1停用")
@Excel(name = "状态", readConverterExp = "0=正常,1=停用") @Excel(name = "状态", readConverterExp = "0=正常,1=停用")
private String status; private String status;
@ApiModelProperty("字典子类集合")
private List<SysDictData> childrenDictData;
public Long getDictCode() public Long getDictCode()
{ {
return dictCode; return dictCode;
@@ -65,6 +80,14 @@ public class SysDictData extends BaseEntity
this.dictCode = dictCode; this.dictCode = dictCode;
} }
public Long getDictParentCode() {
return dictParentCode;
}
public void setDictParentCode(Long dictParentCode) {
this.dictParentCode = dictParentCode;
}
public Long getDictSort() public Long getDictSort()
{ {
return dictSort; return dictSort;
@@ -156,7 +179,16 @@ public class SysDictData extends BaseEntity
{ {
this.status = status; this.status = status;
} }
public List<SysDictData> getChildrenDictData() {
return childrenDictData;
}
public void setChildrenDictData(List<SysDictData> childrenDictData) {
this.childrenDictData = childrenDictData;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

View File

@@ -28,17 +28,17 @@ public class HotakeCvInfoDto {
@ApiModelProperty("地点") @ApiModelProperty("地点")
private String location; private String location;
@ApiModelProperty("链接对象集合") @ApiModelProperty("链接对象集合")
private List<VcLinksDto> linksList; private List<VcLinksDto> links;
@ApiModelProperty("自我介绍") @ApiModelProperty("自我介绍")
private String about; private String about;
@ApiModelProperty("技能工具-许可证、注册/会员资格、认证") @ApiModelProperty("技能工具-许可证、注册/会员资格、认证")
private List<VcSkillsToolsDto> skillsToolsList; private List<VcSkillsToolsDto> skillsTools;
@ApiModelProperty("语言") @ApiModelProperty("语言")
private List<VcLanguagesDto> languagesList; private List<VcLanguagesDto> languages;
@ApiModelProperty("工作经验集合") @ApiModelProperty("工作经验集合")
private List<VcExperienceDto> experienceList; private List<VcExperienceDto> experience;
@ApiModelProperty("教育经历") @ApiModelProperty("教育经历")
private List<VcEducationDto> educationList; private List<VcEducationDto> education;
} }

View File

@@ -0,0 +1,29 @@
package com.vetti.hotake.domain.dto.VcDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 简历-教育经历-证书-信息对象
*
* @author wangxiangshun
* @date 2025-11-30
*/
@Data
@Accessors(chain = true)
public class VcCertificateDto {
@ApiModelProperty("文件名称")
private String fileName;
@ApiModelProperty("文件后缀(doc/pdf)")
private String fileSuffix;
@ApiModelProperty("文件地址")
private String fileUrl;
@ApiModelProperty("文件大小")
private String fileSizeShow;
}

View File

@@ -22,4 +22,8 @@ public class VcEducationDto {
@ApiModelProperty("时间") @ApiModelProperty("时间")
private String date; private String date;
@ApiModelProperty("证书附件")
private VcCertificateDto certificate;
} }

View File

@@ -29,6 +29,6 @@ public class VcExperienceDto {
private String duration; private String duration;
@ApiModelProperty("描述集合") @ApiModelProperty("描述集合")
private List<VcExperienceDescriptionDto> descriptionList; private List<VcExperienceDescriptionDto> description;
} }

View File

@@ -16,7 +16,4 @@ public class VcSkillsToolsDto {
@ApiModelProperty("内容") @ApiModelProperty("内容")
private String content; private String content;
@ApiModelProperty("证书附件URL")
private String fileUrl;
} }

View File

@@ -13,6 +13,7 @@ import com.vetti.common.utils.readFile.FileContentUtil;
import com.vetti.hotake.domain.HotakeCvInfo; import com.vetti.hotake.domain.HotakeCvInfo;
import com.vetti.hotake.domain.HotakeProblemBaseInfo; import com.vetti.hotake.domain.HotakeProblemBaseInfo;
import com.vetti.hotake.domain.dto.HotakeCvInfoDto; import com.vetti.hotake.domain.dto.HotakeCvInfoDto;
import com.vetti.hotake.domain.dto.VcDto.*;
import com.vetti.hotake.mapper.HotakeCvInfoMapper; import com.vetti.hotake.mapper.HotakeCvInfoMapper;
import com.vetti.hotake.service.IHotakeCvInfoService; import com.vetti.hotake.service.IHotakeCvInfoService;
import com.vetti.hotake.service.IHotakeProblemBaseInfoService; import com.vetti.hotake.service.IHotakeProblemBaseInfoService;
@@ -67,8 +68,11 @@ public class HotakeCvInfoServiceImpl extends BaseServiceImpl implements IHotakeC
@Override @Override
public HotakeCvInfo selectHotakeCvInfoById(Long id) { public HotakeCvInfo selectHotakeCvInfoById(Long id) {
HotakeCvInfo cvInfo = hotakeCvInfoMapper.selectHotakeCvInfoById(id); HotakeCvInfo cvInfo = hotakeCvInfoMapper.selectHotakeCvInfoById(id);
HotakeCvInfoDto cvInfoDto = JSONUtil.toBean(cvInfo.getCvTemplateJson(),HotakeCvInfoDto.class); if(StrUtil.isNotEmpty(cvInfo.getCvTemplateJson())){
cvInfo.setCvInfoDto(cvInfoDto); HotakeCvInfoDto cvInfoDto = JSONUtil.toBean(cvInfo.getCvTemplateJson(),HotakeCvInfoDto.class);
cvInfo.setCvInfoDto(cvInfoDto);
}
HotakeProblemBaseInfo query = new HotakeProblemBaseInfo(); HotakeProblemBaseInfo query = new HotakeProblemBaseInfo();
query.setCvId(id); query.setCvId(id);
List<HotakeProblemBaseInfo> problemBaseInfoList = hotakeProblemBaseInfoService.selectHotakeProblemBaseInfoList(query); List<HotakeProblemBaseInfo> problemBaseInfoList = hotakeProblemBaseInfoService.selectHotakeProblemBaseInfoList(query);
@@ -138,8 +142,8 @@ public class HotakeCvInfoServiceImpl extends BaseServiceImpl implements IHotakeC
mapEntityOne.put("role", "user"); mapEntityOne.put("role", "user");
mapEntityOne.put("content", "Position: Construction Labourer" + mapEntityOne.put("content", "Position: Construction Labourer" +
"\\nCandidate: " + cvInfoDto.getName() + "\\nCandidate: " + cvInfoDto.getName() +
"\\nKey Skills: " + JSONUtil.toJsonStr(cvInfoDto.getSkillsToolsList()) + "\\nKey Skills: " + JSONUtil.toJsonStr(cvInfoDto.getSkillsTools()) +
"\\nExperience: " + JSONUtil.toJsonStr(cvInfoDto.getExperienceList()) + "\\nExperience: " + JSONUtil.toJsonStr(cvInfoDto.getExperience()) +
"\\nStrengths: Professional certifications, Relevant experience" + "\\nStrengths: Professional certifications, Relevant experience" +
"\\nConcerns: " + JSONUtil.toJsonStr(cvInfoDto.getAbout())); "\\nConcerns: " + JSONUtil.toJsonStr(cvInfoDto.getAbout()));
list.add(mapEntityOne); list.add(mapEntityOne);
@@ -180,7 +184,12 @@ public class HotakeCvInfoServiceImpl extends BaseServiceImpl implements IHotakeC
fill(FillTypeEnum.UPDATE.getCode(), hotakeCvInfo); fill(FillTypeEnum.UPDATE.getCode(), hotakeCvInfo);
hotakeCvInfo.setCvTemplateJson(JSONUtil.toJsonStr(hotakeCvInfo.getCvInfoDto())); hotakeCvInfo.setCvTemplateJson(JSONUtil.toJsonStr(hotakeCvInfo.getCvInfoDto()));
//修改的时候重新生成问题和评分
hotakeCvInfoMapper.updateHotakeCvInfo(hotakeCvInfo); hotakeCvInfoMapper.updateHotakeCvInfo(hotakeCvInfo);
return hotakeCvInfo; return hotakeCvInfo;
} }
@@ -269,12 +278,109 @@ public class HotakeCvInfoServiceImpl extends BaseServiceImpl implements IHotakeC
List<Map<String,String>> list = new LinkedList(); List<Map<String,String>> list = new LinkedList();
Map<String,String> entity = new HashMap<>(); Map<String,String> entity = new HashMap<>();
entity.put("role","user"); 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做 //根据AI做
list.add(entity); list.add(entity);
String resultCv = chatGPTClient.handleAiChat(JSONUtil.toJsonStr(list), "JX"); String resultCv = chatGPTClient.handleAiChat(JSONUtil.toJsonStr(list), "JX");
log.info("开始返回简历解析结果:{}", resultCv); log.info("开始返回简历解析结果:{}", resultCv);
HotakeCvInfoDto cvInfoDto = JSONUtil.toBean(resultCv, HotakeCvInfoDto.class); 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; return cvInfoDto;
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
@@ -303,10 +409,10 @@ public class HotakeCvInfoServiceImpl extends BaseServiceImpl implements IHotakeC
mapEntityOne.put("content", "Position: Construction Labourer" + mapEntityOne.put("content", "Position: Construction Labourer" +
"\\nCandidate: " + cvInfoDto.getName() + "\\nCandidate: " + cvInfoDto.getName() +
"\\nResume Summary: " + JSONUtil.toJsonStr(cvInfoDto.getAbout()) + "\\nResume Summary: " + JSONUtil.toJsonStr(cvInfoDto.getAbout()) +
"\\nSkills: " + JSONUtil.toJsonStr(cvInfoDto.getSkillsToolsList()) + "\\nSkills: " + JSONUtil.toJsonStr(cvInfoDto.getSkillsTools()) +
"\\nExperience: " + JSONUtil.toJsonStr(cvInfoDto.getExperienceList()) + "\\nExperience: " + JSONUtil.toJsonStr(cvInfoDto.getExperience()) +
"\\nEducation: " + JSONUtil.toJsonStr(cvInfoDto.getEducationList()) + "\\nEducation: " + JSONUtil.toJsonStr(cvInfoDto.getEducation()) +
"\\nCertifications: " + JSONUtil.toJsonStr(cvInfoDto.getSkillsToolsList())); "\\nCertifications: " + JSONUtil.toJsonStr(cvInfoDto.getSkillsTools()));
list.add(mapEntityOne); list.add(mapEntityOne);
String promptText = JSONUtil.toJsonStr(list); String promptText = JSONUtil.toJsonStr(list);
resultMsg = chatGPTClient.handleAiChat(promptText, "CV"); resultMsg = chatGPTClient.handleAiChat(promptText, "CV");

View File

@@ -4,3 +4,4 @@ com/vetti/hotake/domain/dto/VcDto/VcEducationDto.class
com/vetti/hotake/domain/dto/VcDto/VcLinksDto.class com/vetti/hotake/domain/dto/VcDto/VcLinksDto.class
com/vetti/hotake/domain/dto/VcDto/VcExperienceDescriptionDto.class com/vetti/hotake/domain/dto/VcDto/VcExperienceDescriptionDto.class
com/vetti/hotake/domain/dto/VcDto/VcLanguagesDto.class com/vetti/hotake/domain/dto/VcDto/VcLanguagesDto.class
com/vetti/hotake/service/impl/HotakeCvInfoServiceImpl.class

View File

@@ -5,6 +5,8 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
import cn.hutool.core.collection.CollectionUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@@ -73,20 +75,46 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
@Override @Override
public List<SysDictData> selectDictDataByType(String dictType) public List<SysDictData> selectDictDataByType(String dictType)
{ {
List<SysDictData> dictDatas = DictUtils.getDictCache(dictType); // List<SysDictData> dictDataTops = DictUtils.getDictCache(dictType);
// if (StringUtils.isNotEmpty(dictDataTops))
// {
// return dictDataTops;
// }
List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dictType);
if (StringUtils.isNotEmpty(dictDatas)) if (StringUtils.isNotEmpty(dictDatas))
{ {
return dictDatas; //先查询父类字典数据
} List<SysDictData> dictParentDatas = dictDatas.stream().filter(e->e.getDictParentCode().longValue() == -1L).toList();
dictDatas = dictDataMapper.selectDictDataByType(dictType); if(CollectionUtil.isNotEmpty(dictParentDatas)){
if (StringUtils.isNotEmpty(dictDatas)) //递归查询子集
{ for(SysDictData dictData : dictParentDatas){
DictUtils.setDictCache(dictType, dictDatas); //查询对应的子级数据
return dictDatas; getChildrenDictData(dictDatas,dictData);
}
}
// DictUtils.setDictCache(dictType, dictParentDatas);
return dictParentDatas;
} }
return null; return null;
} }
/**
* 查询子级字典数据
* @param dictDatas
* @param dictParentData
*/
private void getChildrenDictData(List<SysDictData> dictDatas,SysDictData dictParentData){
List<SysDictData> dictChildrenDatas = dictDatas.stream().
filter(e->e.getDictParentCode().longValue() == dictParentData.getDictCode().longValue()).toList();
if(CollectionUtil.isNotEmpty(dictChildrenDatas)){
for(SysDictData dictChildData : dictChildrenDatas){
getChildrenDictData(dictDatas,dictChildData);
}
dictParentData.setChildrenDictData(dictChildrenDatas);
}
}
/** /**
* 根据字典类型ID查询信息 * 根据字典类型ID查询信息
* *

View File

@@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="SysDictData" id="SysDictDataResult"> <resultMap type="SysDictData" id="SysDictDataResult">
<id property="dictCode" column="dict_code" /> <id property="dictCode" column="dict_code" />
<result property="dictParentCode" column="dict_parent_code" />
<result property="dictSort" column="dict_sort" /> <result property="dictSort" column="dict_sort" />
<result property="dictLabel" column="dict_label" /> <result property="dictLabel" column="dict_label" />
<result property="dictValue" column="dict_value" /> <result property="dictValue" column="dict_value" />
@@ -21,13 +22,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectDictDataVo"> <sql id="selectDictDataVo">
select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark select dict_code, dict_parent_code,dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark
from sys_dict_data from sys_dict_data
</sql> </sql>
<select id="selectDictDataList" parameterType="SysDictData" resultMap="SysDictDataResult"> <select id="selectDictDataList" parameterType="SysDictData" resultMap="SysDictDataResult">
<include refid="selectDictDataVo"/> <include refid="selectDictDataVo"/>
<where> <where>
<if test="dictParentCode != null and dictParentCode != ''">
AND dict_parent_code = #{dictParentCode}
</if>
<if test="dictType != null and dictType != ''"> <if test="dictType != null and dictType != ''">
AND dict_type = #{dictType} AND dict_type = #{dictType}
</if> </if>

View File

@@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="SysDictData" id="SysDictDataResult"> <resultMap type="SysDictData" id="SysDictDataResult">
<id property="dictCode" column="dict_code" /> <id property="dictCode" column="dict_code" />
<result property="dictParentCode" column="dict_parent_code" />
<result property="dictSort" column="dict_sort" /> <result property="dictSort" column="dict_sort" />
<result property="dictLabel" column="dict_label" /> <result property="dictLabel" column="dict_label" />
<result property="dictValue" column="dict_value" /> <result property="dictValue" column="dict_value" />
@@ -21,13 +22,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectDictDataVo"> <sql id="selectDictDataVo">
select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark select dict_code, dict_parent_code,dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark
from sys_dict_data from sys_dict_data
</sql> </sql>
<select id="selectDictDataList" parameterType="SysDictData" resultMap="SysDictDataResult"> <select id="selectDictDataList" parameterType="SysDictData" resultMap="SysDictDataResult">
<include refid="selectDictDataVo"/> <include refid="selectDictDataVo"/>
<where> <where>
<if test="dictParentCode != null and dictParentCode != ''">
AND dict_parent_code = #{dictParentCode}
</if>
<if test="dictType != null and dictType != ''"> <if test="dictType != null and dictType != ''">
AND dict_type = #{dictType} AND dict_type = #{dictType}
</if> </if>