From 600ab3a248d229758257154384d8f3de89899e7d Mon Sep 17 00:00:00 2001 From: wangxiangshun Date: Sun, 30 Nov 2025 17:54:39 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8E=86=E8=A7=A3=E6=9E=90=E4=B8=9A?= =?UTF-8?q?=E5=8A=A1=E9=80=BB=E8=BE=91=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../socket/ChatWebSocketMultipleHandler.java | 10 +- .../web/controller/ai/AiCommonController.java | 17 ++- .../src/main/resources/application-druid.yml | 1 + .../target/classes/application-druid.yml | 1 + .../ai/elevenLabs/ElevenLabsStreamClient.java | 12 +- .../vetti/common/ai/gpt/ChatGPTClient.java | 5 + .../com/vetti/hotake/domain/HotakeCvInfo.java | 10 ++ .../hotake/domain/HotakeProblemBaseInfo.java | 3 + .../hotake/domain/dto/HotakeCvInfoDto.java | 40 +++++ .../domain/dto/VcDto/VcEducationDto.java | 25 ++++ .../dto/VcDto/VcExperienceDescriptionDto.java | 19 +++ .../domain/dto/VcDto/VcExperienceDto.java | 34 +++++ .../domain/dto/VcDto/VcLanguagesDto.java | 19 +++ .../hotake/domain/dto/VcDto/VcLinksDto.java | 19 +++ .../domain/dto/VcDto/VcSkillsToolsDto.java | 19 +++ .../hotake/service/IHotakeCvInfoService.java | 6 +- .../service/impl/HotakeCvInfoServiceImpl.java | 141 ++++++++++++------ 17 files changed, 326 insertions(+), 55 deletions(-) create mode 100644 vetti-hotakes/src/main/java/com/vetti/hotake/domain/dto/HotakeCvInfoDto.java create mode 100644 vetti-hotakes/src/main/java/com/vetti/hotake/domain/dto/VcDto/VcEducationDto.java create mode 100644 vetti-hotakes/src/main/java/com/vetti/hotake/domain/dto/VcDto/VcExperienceDescriptionDto.java create mode 100644 vetti-hotakes/src/main/java/com/vetti/hotake/domain/dto/VcDto/VcExperienceDto.java create mode 100644 vetti-hotakes/src/main/java/com/vetti/hotake/domain/dto/VcDto/VcLanguagesDto.java create mode 100644 vetti-hotakes/src/main/java/com/vetti/hotake/domain/dto/VcDto/VcLinksDto.java create mode 100644 vetti-hotakes/src/main/java/com/vetti/hotake/domain/dto/VcDto/VcSkillsToolsDto.java diff --git a/vetti-admin/src/main/java/com/vetti/socket/ChatWebSocketMultipleHandler.java b/vetti-admin/src/main/java/com/vetti/socket/ChatWebSocketMultipleHandler.java index 8a18f48..67b4442 100644 --- a/vetti-admin/src/main/java/com/vetti/socket/ChatWebSocketMultipleHandler.java +++ b/vetti-admin/src/main/java/com/vetti/socket/ChatWebSocketMultipleHandler.java @@ -186,7 +186,8 @@ public class ChatWebSocketMultipleHandler { mapEntity.put("content", StrUtil.format(content, cacheResultText)); cacheMsgMapData1.put(session.getId(), JSONUtil.toJsonStr(list)); } - + Long replyNums = cacheQuestionNum.get(session.getId()); + cacheQuestionNum.put(session.getId(), replyNums+1); //验证是否结速 Boolean isEndFlag = checkIsEnd(session); if(isEndFlag){ @@ -633,6 +634,7 @@ public class ChatWebSocketMultipleHandler { /** * 验证面试是否结束 + * 记录回答问题的次数 * @param session * @return */ @@ -640,7 +642,8 @@ public class ChatWebSocketMultipleHandler { Long replyNums = cacheQuestionNum.get(session.getId()); //回答次数大于等于5就直接结束面试 Boolean flag = true; - if(replyNums >= 5){ + if(replyNums.longValue() >= 5L){ + flag = false; //获取问答评分记录 String promptJson = cacheMsgMapData1.get(session.getId()); //根据模型获取评分 @@ -668,9 +671,6 @@ public class ChatWebSocketMultipleHandler { e.printStackTrace(); } } - flag = false; - }else{ - cacheQuestionNum.put(session.getId(), replyNums+1); } return flag; } diff --git a/vetti-admin/src/main/java/com/vetti/web/controller/ai/AiCommonController.java b/vetti-admin/src/main/java/com/vetti/web/controller/ai/AiCommonController.java index aeaab0d..493fafc 100644 --- a/vetti-admin/src/main/java/com/vetti/web/controller/ai/AiCommonController.java +++ b/vetti-admin/src/main/java/com/vetti/web/controller/ai/AiCommonController.java @@ -9,7 +9,10 @@ import com.vetti.common.core.controller.BaseController; import com.vetti.common.core.domain.AjaxResult; import com.vetti.common.core.domain.R; import com.vetti.common.core.domain.dto.RealtimeClientSecretDto; +import com.vetti.common.enums.MinioBucketNameEnum; +import com.vetti.common.utils.readFile.FileContentUtil; import com.vetti.web.service.ICommonService; +import io.minio.GetObjectArgs; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; @@ -18,6 +21,10 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; + /** * AI 共通测试接口处理 * @@ -75,7 +82,15 @@ public class AiCommonController extends BaseController @GetMapping("/handleAiChat") public AjaxResult handleAiChat(@RequestParam String text) { - String resultMsg = chatGPTClient.handleAiChat(text,"YT"); + 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\\\": [{\\\"content\\\":\\\"\\\"}], \\\"about\\\": \\\"\\\", \\\"skillsTools\\\": [{\\\"content\\\":\\\"\\\"}], \\\"languages\\\": [{\\\"content\\\":\\\"\\\"}], \\\"experience\\\": [{\\\"title\\\": \\\"\\\", \\\"company\\\": \\\"\\\",\\\"location\\\": \\\"\\\",\\\"duration\\\": \\\"\\\",\\\"description\\\": [{\\\"content\\\":\\\"\\\"}]}], \\\"education\\\": [{\\\"degree\\\": \\\"\\\",\\\"institution\\\": \\\"\\\",\\\"date\\\": \\\"\\\"}] }。字段不存在则返回 null 或空数组。只返回标准可解析的 JSON结构 ,不要多余的```json等信息,不要解释说明,不要改写内容。以下为待处理文本: Page | 1 \\nFred Nouri Curriculum Vitae \\nEmail: nouri.lgi@gmail.com M: 0401 084 098 \\nPROJECT EXPERIENCE \\nDec 2023 – June 2025 | Hill International Inc. Saudi Arabia | Construction Business Unit Projects Manager \\nProject: Portfolio of 129 active construction projects across the Southern Cluster in Saudi Arabia, including \\nwater and wastewater infrastructure. Key projects include regional pipeline networks, water reservoir \\nexpansions, pumping stations, treatment plant upgrades, and utility relocations. Major initiatives encompass \\nAsir, Jazan, Al Baha, and Najran regions, collectively valued at over $30B. \\n \\nCompany’s role in the Project: PMO / PMC | Value: USD 30+b \\nResponsibilities: \\n\uF0FC Leadership & Strategic Oversight: Managed a portfolio of 129 active construction projects across the Southern \\nCluster, including Asir, Jazan, Al Baha, and Najran in the Kingdom of Saudi Arabia, leading a team of 22 Program \\nManagers, Project Managers and Project engineers. Providing visionary leadership to ensure alignment with \\nstrategic business objectives and achieving successful delivery. \\n\uF0FC Strategic Project Leadership: Managed high-profile infrastructure and utilities programs, providing leadership \\nfrom initial planning through successful completion, ensuring projects adhered to budgetary and scheduling \\nconstraints. Guided design, coordination, and construction phases, driving project success through effective \\ndecision-making and strategic oversight. \\n\uF0FC Client & Stakeholder Engagement: Acted as the primary representative for the organization with clients and \\nsuppliers, securing client objectives and negotiating scope changes. Led client-facing presentations and ensured \\nproject alignment with client vision and requirements. \\n\uF0FC Infrastructure Design & Technical Excellence: Oversaw infrastructure design development and technical \\nquality, managing a team of technical specialists and ensuring strict compliance with quality standards and \\nproject objectives. \\n\uF0FC Project Value Improvement (PVI) Implementation: Spearheaded the Project Value Improvement (PVI) initiative, \\nintegrating lessons learned and advanced technology to optimize project delivery in both design and \\nconstruction, minimizing errors and enhancing project value. \\n\uF0FC Regulatory Compliance and Risk Management: Ensured full adherence to legal and regulatory standards across \\nall projects, securing necessary permits, maintaining compliance with health and safety, and quality assurance \\nprotocols. \\n\uF0FC Budget & Schedule Management: Established and maintained project scopes, schedules, and budgets, \\nimplementing cost control measures and providing transparent progress updates to senior management. \\n\uF0FC Resource Allocation & Team Development: Mobilized and assigned project resources effectively, leveraging \\nteam strengths to drive project execution. Provided input on performance reviews, supporting team \\ndevelopment and growth. \\n\uF0FC Financial and Programmatic Oversight: Managed project budgets with expertise in cost accounting, ensuring \\nfinancial performance aligned with objectives and reporting on key financial metrics. \\n\uF0FC Cross-Functional Collaboration and Comprehensive Planning: Worked seamlessly with consultants, contractors, \\nand subcontractors to maintain project momentum, drive efficiency, and address potential delays or scope \\nchanges. \\n\uF0FC Project Controls & Governance Excellence: Established and implemented robust project control frameworks to \\nmonitor progress, ensure alignment with contractual and strategic goals, and enforce governance standards \\nthroughout the project lifecycle. Exercised rigorous oversight of project performance indicators, driving \\naccountability and operational transparency via structured control systems. \\n\uF0FC Integrated Planning & Program Governance: Developed comprehensive master schedules and aligned planning \\nmethodologies with organizational objectives. Oversaw governance frameworks ensuring compliance with \\ncorporate protocols, regulatory mandates, and contractual requirements, thereby enhancing project visibility and \\nenabling informed decision-making across all phases. \\n\uF0FC Milestone-Driven Management and Operational Efficiency: Maintained a focus on key milestones to ensure \\nproject completion within scope, budget, and time constraints, driving operational efficiency and successful \\nproject outcomes. \\n \\nMay 2021 – Sep 2023 | Sydney Water Corporation Sydney, Australia | Project Manager \\n \\nProjects: Upper South Creek Networks Program for Water and Wastewater pipelines and pumping stations, \\nWastewater Treatment Plant’s. Development of Business Cases from Needs to Delivery including Concept Design \\nand delivery design, Western Sydney Aerotropolis Upper South Creek: $2.1B+ AWRC & Network Project, USCN \\nAdvance Water Recycling Plant: $1.6B, Western Sydney Water and Wastewater Pipelines, Manholes, Pumping \\nStations: $2.0B, Sydney Austral/Leppington Greenfield Program: $394M, Sydney Richmond WRP/North \\nRichmond WWTP Precinct Upgrade Project: $155.9M, Sydney Rosehill Wastewater Treatment Plant & WRP. \\nPage | 2 \\n \\nCompany’s role in the Project: Client of the Project | Value: AUD 30B over 10 Years \\nResponsibilities: \\n\uF0FC Project Management for Austral-Leppington Greenfield site 5-year program to meet state government housing \\ngoals managing West Sydney Delivery Team Contractor from concept to detailed design & Delivery \\n\uF0FC Advanced Business Cases Development: Developed Need Approval, Option Approval, Delivery Approval and \\nVariation Approval Business Cases for Projects including Risk Based Cost Estimates Workshops, \\n\uF0FC Conducting Workshops: Project Risk Workshops, Environmental Risks Workshop and Wastewater Treatment \\nPlants Decommissioning Workshops \\n\uF0FC Contractual and Program Management Excellence: Managing of the NEC 4 Contract with West Region Delivery \\nTeam i.e. Fulton Hogan, Abergeldie and SWC project management team and managed delivery main and sub-\\ncontractors according to NEC4 contract \\n\uF0FC Managing RFIs, Early Warnings, Compensation Events, Works Requests, Work to proceed via SW delivery \\nPortal \\n\uF0FC Comprehensive SAP/Bxp Oversight: SAP/Bxp management such as Resource assignment, PR/PO processes, \\nP44 cost planning, EPPM Project suits, Managed purchase orders from requisition to service and/or good \\nreceipt & payment \\n\uF0FC Modification of Richmond Waste Treatment plant to meet EPA compliance and growth \\n\uF0FC Facilitating risk-based solutions as part of value engineering to meet program outcomes and goals \\n\uF0FC Financial and Programmatic Oversight: Overseeing Financial & Commercial programs and plans TOC inclusive \\n\uF0FC Managing issues & risks on program, contractor performance, planning, engineering & commercial \\n\uF0FC Sophisticated Design and Project Delivery: Managed 50%-90% Designs Drawings development and CHAIR \\nmeetings and Managed IFC drawings development & supply chain negotiations according to design \\n\uF0FC Milestone-Driven Management and Operational Efficiency: Optimized project schedules and operational \\nworkflows to ensure timely, efficient project delivery. \\n\uF0FC Power BI for Data Visualization & Reporting: Used Power BI to create dynamic dashboards and real-time \\nreports, integrating data from multiple project management platforms. Enhanced decision-making capabilities \\nfor senior management through clear, interactive visualizations that track project performance, risks, and key \\nmetrics. \\n\uF0FC Strategic Decision-Making and Stakeholder Engagement: Engaged stakeholders with data-driven insights to \\ninform high-impact decisions and enhance project support. \\n \\nAchievements: \\n\uF0FC Developed the Greenfield Program for Western Greater Sydney Upper South Creek, valued at $1.6B AWRC & \\nNetwork. \\n\uF0FC Established the Greenfield Program for the South-West Region Aerotropolis Areas of Austral Leppington linked to \\nthe New South-West Airport, valued at $2.0B. \\n\uF0FC Developed the program for the modification and amplification of Richmond’s Pump Stations and Treatment Plant, \\nincluding decommissioning redundant assets. \\n\uF0FC Successfully delivered the Austral/Leppington Water and Wastewater Pipeline and Pumping Station Project, valued \\nat $394M. \\n\uF0FC Developed and implemented risk-based budgets for both programs, facilitating property acquisitions and \\ncompliance with environmental regulations within approved Review of Environmental Factors (REF). \\n\uF0FC Developed Needs, Option, and Delivery Approval Business Cases for the Ministry of Water and Energy. \\n\uF0FC Formulated Strategy and Final Business Cases for Infrastructure New South Wales State Government Gateways. \\n \\nOct 2018 – May 2021 | MU Group Infrastructure Consulting Sydney, Australia | Project Manager \\nProjects: West Connex, a 33km pipeline of motorways and tunnels located in southeast of Sydney Greater Area, \\nGreat Western Highway Design and New build, Acciona/Samsung/Bouygues Joint Venture (ASB JV) For West \\nConnex (M4-M5 Link) St Peters and Rozelle Interexchange Tunnels $16.8 Billion Tunneling and Motorways \\nProject, Bridges Design and Rehabilitation $389M, 60+ Condition Assessment of Traffic Lights, Roads, Bridges \\nand Pavement, Housing development site design development for 600+ Units \\nCompany’s role in the Project: Design and Project Management Consultant Value: USD 12b \\n \\nResponsibilities: \\n\uF0FC Project Development & Delivery: Directed the design, rehabilitation, and construction phases for RMS Regional \\nMaintenance Delivery (RMD) projects, ensuring quality outcomes aligned with project specifications. \\n\uF0FC Capital Works Planning & Coordination: Led capital works planning and project coordination, aligning resources \\nto meet strategic objectives and timelines. \\n\uF0FC Condition Assessment & Reporting: Conducted in-depth condition assessments, producing actionable reports \\nthat guided project planning and prioritization. \\n\uF0FC Structural Issue Identification: Identified and assessed structural issues, ensuring early detection and resolution \\nfor project stability and safety. \\n\uF0FC Site Engineering & Civil Supervision: Provided on-site engineering oversight, coordinating civil supervision to \\nuphold technical standards and project integrity. \\nPage | 3 \\n\uF0FC Preliminary Work Planning: Managed initial project planning stages, establishing foundational frameworks for \\nsmooth execution. \\n\uF0FC SAP for Financial Tracking & Resource Management: Utilized SAP software to manage project budgets, track \\nexpenditures, and allocate resources efficiently. Provided accurate financial reporting and forecasting, \\nsupporting cost control measures and ensuring fiscal accountability aligned with project and organizational \\nobjectives. \\n\uF0FC Tender & Project Document Management: Oversaw tender processes and maintained meticulous control of \\nproject documents to support compliance and transparency. \\n\uF0FC Financial Management: Administered budgets and financial tracking, ensuring cost-effective project execution. \\n\uF0FC Variation Management & Negotiation: Managed variations and led negotiations to maintain budgetary \\nalignment while accommodating project changes. \\n\uF0FC Schedule Risk Management & Mitigation: Directed proactive identification, analysis, and mitigation of \\nschedule-related risks, employing quantitative and qualitative techniques to forecast potential delays \\nand develop contingency plans. Maintained schedule integrity through continuous risk assessments \\nand scenario planning, ensuring resilience against disruptions and safeguarding critical milestones. \\nAchievements: \\n\uF0FC West Connex: Completion of Civil Works, Service Installation, Drainages, Pressure Tests and Cross Passages \\n\uF0FC Made Sure FY 19/20 Quarter 3- And 4 Pavement and Major Civil Projects Completed According to The Program. \\n\uF0FC Creation Of Sophisticated Gantt Chart Program For $70M FY 20/21- Works, Major Civil and Pavement Projects \\n\uF0FC Overall Saving Of $6.5M Within $150M Budget for Panel Pavement Program in FY19-20 Q3&4 \\nOct 2016 – Sep 2018 | Canterbury & Bankstown City Council \\nSydney | Project & Program Manager for Roads Operations & Capital Works \\nProjects: Capital Works such as Roads, bridges resurfacing and asphalt \\nCompany’s role in the Project: Client of the project | Value: AUD 500k-50M \\nResponsibilities: \\n\uF0FC Project Coordination: Coordinated assigned capital works, including asphalt and associated civil works projects, \\nfrom initial planning through to completion. Ensured that all project phases were executed efficiently and \\neffectively. Managed Sydney Road and Assets Performance Contract. \\n\uF0FC Stakeholder Engagement, Community Communication, Contractual Documentation, Compliance Oversight, \\nTechnical & Project Management, Quality, WHS & Environmental Compliance, Stakeholder Representation, Project \\nMeetings, Financial Management, Variation Management, Procurement & Scheduling, Risk Management, Team \\nLeadership \\nAchievements: \\n\uF0FC Made Sure Pavement and Major Civil Projects Completed According to The Program \\n\uF0FC Creation Sophisticated Gantt Chart Program For $170M - Works, Major Civil and Pavement Projects \\n\uF0FC Overall Saving Of $6.8m Within $150M Budget for Panel Pavement Program \\n \\nNov 2013 – Oct 2016 | Downer EDI | Sydney, Australia | Project Manager \\nProjects: Road and Motorways New builds and widening projects, Slope remediation, Storm Water new builds, \\nGreater Sydney Area Asset Performance contract management, Motorways New Builds. \\nCompany’s role in the Project: Delivery Contractor and Designer | Value: AUD 2M-100M \\nResponsibilities: \\n\uF0FC Contract Documentation Assessment: Evaluated comprehensive contract documentation, including Project \\nManagement Plans (PMP), Zero Harm Management Plans (ZHMP), Construction Environmental Management Plans \\n(CEMP), Quality Management Plans (QMP), Emergency Management Plans (EMP), Safe Work Method Statements \\n(SWMS), Material Safety Data Sheets (MSDS), Approved for Construction Drawings (AFC Drawings), Traffic \\nManagement Plans (TMP), Traffic Control Plans (TCP), and Project Programs. Ensured thorough review and \\ncompliance with project requirements. \\n\uF0FC Project and Construction Management, Project Planning & Forecasting, Profit & Loss Calculation, Quality & Risk \\nControl, Risk Assessment Workshops, Site Management & Permits, Site Inspections & Progress Monitoring, Design \\nCollaboration & RFI Management, Statutory Reporting & Liaison, Utility Coordination, Daily & Weekly Reporting, \\nIssue Resolution & Improvement, Stakeholder Relationship Management, Defect Management \\nAchievements: \\n\uF0FC TfNSW Intersection Upgrade Project Delivered Within Time Frame and Budget With 10% Variations. \\n\uF0FC TfNSW Slope Rehabilitation Projects on M1 Delivered Within Time Frame and Budget / Savings: 6% \\n\uF0FC TfNSW Pavement Projects Delivered on Time and Within the Project Budget. \\n\uF0FC No Service Strikes Within 4 Months in Cumberland Hwy/Merrylands Rd. Due to Permanent Supervision and \\nCollaboration with All Stockholders on Site. \\n \\n \\nPage | 4 \\nApr 2010 – Nov 2013 | VBA JV | Sydney, Australia | Site Supervisor → Senior Project Engineer \\nProjects: Bridge New builds, Intersection Widening, Utilities, Storm Water and Water pipeline projects, Bridge \\nRehabilitations \\nCompany’s role in the Project: Delivery Contractor and Designer for SRAP (Sydney Asset Performance Contract 10 \\nYears Program) | Value: AUD 5M-100M \\nResponsibilities: \\n\uF0FC Project Management: Directed the RMS-Sydney Maintenance Contract, overseeing a range of assets including \\ncorridors, bridges, tunnels, tactical pavements, minor complexes, intersection upgrades, services, utilities, slopes, \\nretaining walls, culverts, new builds, excavation, and demolition works. Managed projects from the tender stage \\nthrough to successful completion. \\n\uF0FC Stakeholder Liaison, Design & Documentation Assessment, Team Management, Variation & Financial \\nManagement, Site & Project Oversight, Compliance & Documentation, Risk Assessment & Permits, Contractor \\nIntegration & Compliance \\nAchievements: \\n\uF0FC Road And Motorways Upgrade, And Pavement Projects Delivered on Time and Within Budget with Savings Up To \\n14% \\n\uF0FC Culverts Rehabilitation and Guard Rail Projects Delivered Within Project Time and Budget Without Variations. \\n\uF0FC No Major Accidents or ZERO Harm Issues on Site \\n \\nMarch 2008 – April 2010 | Kashan Construction | Sydney & ACT |Project Manager \\nProject: Subdivision developments and housing projects, residential and commercial construction \\nCompany’s role in the Project: Delivery Contractor and Designer | Value: AUD 5M-100M \\nResponsibilities: \\n\uF0FC Project Management: Directed the rehabilitation, maintenance, and construction of roads, bridges, and utilities, \\nensuring project delivery from initiation to completion. \\n\uF0FC Commitment Delivery, Program Development and scheduling, Compliance Assurance, Utility Coordination, Risk \\nManagement, Organizational Representation, Reporting, Financial Management \\nAchievements: \\n\uF0FC Up To 15% Savings on Purchasing Equipment’s and Materials. \\n\uF0FC Up To 20% Savings on Services and Ad \\n\uF0FC 5% Project Schedule Time Savings \\n\uF0FC Projects Delivered Within Time Frame and Budget. \\n \\nFeb 2003 – Jan 2008 | HAE Construction | MENA Region | Project Engineer → Project Manager \\nSep 2000 – Jan 2003 | Bau Mitte Demuth GmbH Germany |Junior Project Engineer → Project Engineer \\n \\nEDUCATION \\nB.Sc. Civil Engineering, Berlin, Germany \\nLANGUAGES \\nEnglish, German \\nNationalities: \\nGerman | Australian Permanent Resident \\n KEY QUALIFICATIONS (LICENSES, REGISTRATIONS/MEMBERSHIPS, CERTIFICATIONS) \\n2025: PMI, PPS (In progress) (United States) \\n2024: Professional Accreditation of bachelor’s degree by Ministry of Human Resource (QVP/KSA) \\n2024 Council of Engineers Membership (KSA) \\n2024: PfMP (United States) \\n2023: Finance for Project Managers, Australian Institute of Management, Sydney, Australia. \\n2021: PMP (United States) \\n2020: Project Management Essentials, Australian Institute of Management, Sydney, Australia. \\n2019: Work Safety at Heights, Coates Hire Training Services, Sydney, Australia \\n2018: First Aid, CPR & Basic Life Support, Medi Life Education, Sydney, Australia \\n2015: Work Safety in The Construction Industry, Eclipse Education, Sydney, Australia \\n2015: Asbestos Awareness, Keys Human Resources, Sydney, Australia \\n \\n\"\n" + + " }\n" + + "]"; + + + String resultMsg = chatGPTClient.handleAiChat(pom,"JX"); return AjaxResult.success(resultMsg); } diff --git a/vetti-admin/src/main/resources/application-druid.yml b/vetti-admin/src/main/resources/application-druid.yml index aa620e5..c85208c 100644 --- a/vetti-admin/src/main/resources/application-druid.yml +++ b/vetti-admin/src/main/resources/application-druid.yml @@ -172,6 +172,7 @@ chatGpt: model: ft:gpt-3.5-turbo-0125:vetti:interview-unified:CaGyCXOr modelQuestion: gpt-4o-mini modelCV: ft:gpt-3.5-turbo-0125:vetti:vetti-resume-full:CYT0C8JG + modelJxCv: gpt-4o-mini role: system http: diff --git a/vetti-admin/target/classes/application-druid.yml b/vetti-admin/target/classes/application-druid.yml index aa620e5..c85208c 100644 --- a/vetti-admin/target/classes/application-druid.yml +++ b/vetti-admin/target/classes/application-druid.yml @@ -172,6 +172,7 @@ chatGpt: model: ft:gpt-3.5-turbo-0125:vetti:interview-unified:CaGyCXOr modelQuestion: gpt-4o-mini modelCV: ft:gpt-3.5-turbo-0125:vetti:vetti-resume-full:CYT0C8JG + modelJxCv: gpt-4o-mini role: system http: diff --git a/vetti-common/src/main/java/com/vetti/common/ai/elevenLabs/ElevenLabsStreamClient.java b/vetti-common/src/main/java/com/vetti/common/ai/elevenLabs/ElevenLabsStreamClient.java index 20711ed..7c04404 100644 --- a/vetti-common/src/main/java/com/vetti/common/ai/elevenLabs/ElevenLabsStreamClient.java +++ b/vetti-common/src/main/java/com/vetti/common/ai/elevenLabs/ElevenLabsStreamClient.java @@ -71,6 +71,7 @@ public class ElevenLabsStreamClient { ByteArrayOutputStream smallChunkBuffer = new ByteArrayOutputStream(); byte[] buffer = new byte[4096]; int bytesRead; + log.info("开始发送语音流:{}",System.currentTimeMillis()/1000); while ((bytesRead = inputStream.read(buffer)) != -1) { try{ // 如果上一包还在发送 → 阻塞等待 @@ -80,10 +81,10 @@ public class ElevenLabsStreamClient { } }catch (Exception e){} //语音流合并到2KB左右进行发送 - if(smallChunkBuffer.size() >= 3072){ + if(smallChunkBuffer.size() >= 4096){ // 🔥开始发送 → 上锁 sending[0] = true; - log.info("语音流大于"+smallChunkBuffer.size()+"啦,发送完成!!!"); +// log.info("语音流大于"+smallChunkBuffer.size()+"啦,发送完成!!!"); byte[] merged = smallChunkBuffer.toByteArray(); smallChunkBuffer.reset(); session.getAsyncRemote().sendBinary(ByteBuffer.wrap(merged), result -> { @@ -99,16 +100,19 @@ public class ElevenLabsStreamClient { } //都加完缓冲区,最最后一次发送 if(smallChunkBuffer.size() > 2){ + try { + Thread.sleep(50); + }catch (Exception e){} // 如果上一包还在发送 → 阻塞等待 byte[] merged = smallChunkBuffer.toByteArray(); smallChunkBuffer.reset(); session.getAsyncRemote().sendBinary(ByteBuffer.wrap(merged), result -> { - log.info("最后一次发送,语音流大于"+smallChunkBuffer.size()+"啦,发送完成!!!"); }); } + log.info("结束发送语音流:{}",System.currentTimeMillis()/1000); //返回结束点 try { - Thread.sleep(20); + Thread.sleep(50); }catch (Exception e){} Map dataText = new HashMap<>(); dataText.put("type","voiceEnd"); diff --git a/vetti-common/src/main/java/com/vetti/common/ai/gpt/ChatGPTClient.java b/vetti-common/src/main/java/com/vetti/common/ai/gpt/ChatGPTClient.java index 43dabb9..1e95fe3 100644 --- a/vetti-common/src/main/java/com/vetti/common/ai/gpt/ChatGPTClient.java +++ b/vetti-common/src/main/java/com/vetti/common/ai/gpt/ChatGPTClient.java @@ -39,6 +39,9 @@ public class ChatGPTClient { @Value("${chatGpt.modelCV}") private String modelCV; + @Value("${chatGpt.modelJxCv}") + private String modelJxCv; + @Value("${chatGpt.role}") private String role; @@ -66,6 +69,8 @@ public class ChatGPTClient { resultText = sendMessage(promptText, modelQuestion,objectMapper,client,role); } else if("PF".equals(type)){ resultText = sendMessage(promptText, model,objectMapper,client,role); + }else if("JX".equals(type)){ + resultText = sendMessage(promptText, modelJxCv,objectMapper,client,role); }else { resultText = sendMessage(promptText, modelQuestion,objectMapper,client,role); } diff --git a/vetti-hotakes/src/main/java/com/vetti/hotake/domain/HotakeCvInfo.java b/vetti-hotakes/src/main/java/com/vetti/hotake/domain/HotakeCvInfo.java index 13ada70..7b2dec0 100644 --- a/vetti-hotakes/src/main/java/com/vetti/hotake/domain/HotakeCvInfo.java +++ b/vetti-hotakes/src/main/java/com/vetti/hotake/domain/HotakeCvInfo.java @@ -1,5 +1,6 @@ package com.vetti.hotake.domain; +import com.vetti.hotake.domain.dto.HotakeCvInfoDto; import lombok.Data; import lombok.experimental.Accessors; import io.swagger.annotations.ApiModelProperty; @@ -52,4 +53,13 @@ public class HotakeCvInfo extends BaseEntity @Excel(name = "状态", readConverterExp = "0=,禁=用,1,启=用") private String status; + @ApiModelProperty("简历详细信息-固定模版") + private HotakeCvInfoDto cvInfoDto; + + @ApiModelProperty("简历预设问题记录") + private HotakeProblemBaseInfo problemBaseInfo; + + @ApiModelProperty("简历评分") + private String score; + } diff --git a/vetti-hotakes/src/main/java/com/vetti/hotake/domain/HotakeProblemBaseInfo.java b/vetti-hotakes/src/main/java/com/vetti/hotake/domain/HotakeProblemBaseInfo.java index d85fac7..4f59c65 100644 --- a/vetti-hotakes/src/main/java/com/vetti/hotake/domain/HotakeProblemBaseInfo.java +++ b/vetti-hotakes/src/main/java/com/vetti/hotake/domain/HotakeProblemBaseInfo.java @@ -32,6 +32,9 @@ public class HotakeProblemBaseInfo extends BaseEntity @Excel(name = "问题") private String contents; + @ApiModelProperty("问题数量") + private Integer questionNums; + /** 状态(0 禁用,1 启用) */ @ApiModelProperty("状态(0 禁用,1 启用)") @Excel(name = "状态", readConverterExp = "0=,禁=用,1,启=用") diff --git a/vetti-hotakes/src/main/java/com/vetti/hotake/domain/dto/HotakeCvInfoDto.java b/vetti-hotakes/src/main/java/com/vetti/hotake/domain/dto/HotakeCvInfoDto.java new file mode 100644 index 0000000..9ed35a8 --- /dev/null +++ b/vetti-hotakes/src/main/java/com/vetti/hotake/domain/dto/HotakeCvInfoDto.java @@ -0,0 +1,40 @@ +package com.vetti.hotake.domain.dto; + +import com.vetti.hotake.domain.dto.VcDto.*; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.List; + +/** + * 简历结构化信息对象 hotake_cv_info + * + * @author wangxiangshun + * @date 2025-11-30 + */ +@Data +@Accessors(chain = true) +public class HotakeCvInfoDto { + + @ApiModelProperty("姓名") + private String name; + @ApiModelProperty("电话") + private String phone; + @ApiModelProperty("邮箱") + private String email; + @ApiModelProperty("链接对象集合") + private List linksList; + @ApiModelProperty("自我介绍") + private String about; + @ApiModelProperty("技能工具-许可证、注册/会员资格、认证") + private List skillsToolsList; + @ApiModelProperty("语言") + private List languagesList; + @ApiModelProperty("工作经验集合") + private List experienceList; + @ApiModelProperty("教育经历") + private List educationList; + + +} diff --git a/vetti-hotakes/src/main/java/com/vetti/hotake/domain/dto/VcDto/VcEducationDto.java b/vetti-hotakes/src/main/java/com/vetti/hotake/domain/dto/VcDto/VcEducationDto.java new file mode 100644 index 0000000..1ba2cce --- /dev/null +++ b/vetti-hotakes/src/main/java/com/vetti/hotake/domain/dto/VcDto/VcEducationDto.java @@ -0,0 +1,25 @@ +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 VcEducationDto { + + @ApiModelProperty("学位") + private String degree; + + @ApiModelProperty("学校名") + private String institution; + + @ApiModelProperty("时间") + private String date; +} diff --git a/vetti-hotakes/src/main/java/com/vetti/hotake/domain/dto/VcDto/VcExperienceDescriptionDto.java b/vetti-hotakes/src/main/java/com/vetti/hotake/domain/dto/VcDto/VcExperienceDescriptionDto.java new file mode 100644 index 0000000..a29462a --- /dev/null +++ b/vetti-hotakes/src/main/java/com/vetti/hotake/domain/dto/VcDto/VcExperienceDescriptionDto.java @@ -0,0 +1,19 @@ +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 VcExperienceDescriptionDto { + + @ApiModelProperty("内容") + private String content; +} diff --git a/vetti-hotakes/src/main/java/com/vetti/hotake/domain/dto/VcDto/VcExperienceDto.java b/vetti-hotakes/src/main/java/com/vetti/hotake/domain/dto/VcDto/VcExperienceDto.java new file mode 100644 index 0000000..13e207d --- /dev/null +++ b/vetti-hotakes/src/main/java/com/vetti/hotake/domain/dto/VcDto/VcExperienceDto.java @@ -0,0 +1,34 @@ +package com.vetti.hotake.domain.dto.VcDto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.List; + +/** + * 简历-工作经验-信息对象 + * + * @author wangxiangshun + * @date 2025-11-30 + */ +@Data +@Accessors(chain = true) +public class VcExperienceDto { + + @ApiModelProperty("标题") + private String title; + + @ApiModelProperty("公司") + private String company; + + @ApiModelProperty("地点") + private String location; + + @ApiModelProperty("时间") + private String duration; + + @ApiModelProperty("描述集合") + private List descriptionList; +} + diff --git a/vetti-hotakes/src/main/java/com/vetti/hotake/domain/dto/VcDto/VcLanguagesDto.java b/vetti-hotakes/src/main/java/com/vetti/hotake/domain/dto/VcDto/VcLanguagesDto.java new file mode 100644 index 0000000..9380768 --- /dev/null +++ b/vetti-hotakes/src/main/java/com/vetti/hotake/domain/dto/VcDto/VcLanguagesDto.java @@ -0,0 +1,19 @@ +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 VcLanguagesDto { + + @ApiModelProperty("内容") + private String content; +} diff --git a/vetti-hotakes/src/main/java/com/vetti/hotake/domain/dto/VcDto/VcLinksDto.java b/vetti-hotakes/src/main/java/com/vetti/hotake/domain/dto/VcDto/VcLinksDto.java new file mode 100644 index 0000000..759aef7 --- /dev/null +++ b/vetti-hotakes/src/main/java/com/vetti/hotake/domain/dto/VcDto/VcLinksDto.java @@ -0,0 +1,19 @@ +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 VcLinksDto { + + @ApiModelProperty("内容") + private String content; +} diff --git a/vetti-hotakes/src/main/java/com/vetti/hotake/domain/dto/VcDto/VcSkillsToolsDto.java b/vetti-hotakes/src/main/java/com/vetti/hotake/domain/dto/VcDto/VcSkillsToolsDto.java new file mode 100644 index 0000000..94ddf18 --- /dev/null +++ b/vetti-hotakes/src/main/java/com/vetti/hotake/domain/dto/VcDto/VcSkillsToolsDto.java @@ -0,0 +1,19 @@ +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 VcSkillsToolsDto { + + @ApiModelProperty("内容") + private String content; +} diff --git a/vetti-hotakes/src/main/java/com/vetti/hotake/service/IHotakeCvInfoService.java b/vetti-hotakes/src/main/java/com/vetti/hotake/service/IHotakeCvInfoService.java index f3baeca..63daec2 100644 --- a/vetti-hotakes/src/main/java/com/vetti/hotake/service/IHotakeCvInfoService.java +++ b/vetti-hotakes/src/main/java/com/vetti/hotake/service/IHotakeCvInfoService.java @@ -2,6 +2,8 @@ package com.vetti.hotake.service; import java.util.List; import com.vetti.hotake.domain.HotakeCvInfo; +import com.vetti.hotake.domain.HotakeProblemBaseInfo; +import com.vetti.hotake.domain.dto.HotakeCvInfoDto; /** * 简历信息Service接口 @@ -38,10 +40,10 @@ public interface IHotakeCvInfoService /** * 处理简历信息 * - * @param hotakeCvInfo 简历信息 + * @param cvInfoDto 简历信息 * @return 结果 */ - public void handleHotakeCvInfo(HotakeCvInfo hotakeCvInfo); + public HotakeProblemBaseInfo handleHotakeCvInfo(HotakeCvInfoDto cvInfoDto); /** diff --git a/vetti-hotakes/src/main/java/com/vetti/hotake/service/impl/HotakeCvInfoServiceImpl.java b/vetti-hotakes/src/main/java/com/vetti/hotake/service/impl/HotakeCvInfoServiceImpl.java index 4cf16ef..f6a8294 100644 --- a/vetti-hotakes/src/main/java/com/vetti/hotake/service/impl/HotakeCvInfoServiceImpl.java +++ b/vetti-hotakes/src/main/java/com/vetti/hotake/service/impl/HotakeCvInfoServiceImpl.java @@ -1,13 +1,5 @@ package com.vetti.hotake.service.impl; -import java.io.File; -import java.io.FileInputStream; -import java.io.InputStream; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - import cn.hutool.core.io.FileUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.json.JSONUtil; @@ -17,11 +9,12 @@ 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.file.MinioUtil; import com.vetti.common.utils.readFile.FileContentUtil; -import com.vetti.common.utils.readText.ResumeTextExtractor; -import com.vetti.common.utils.readText.vo.ResumeData; +import com.vetti.hotake.domain.HotakeCvInfo; import com.vetti.hotake.domain.HotakeProblemBaseInfo; +import com.vetti.hotake.domain.dto.HotakeCvInfoDto; +import com.vetti.hotake.mapper.HotakeCvInfoMapper; +import com.vetti.hotake.service.IHotakeCvInfoService; import com.vetti.hotake.service.IHotakeProblemBaseInfoService; import io.minio.GetObjectArgs; import io.minio.MinioClient; @@ -30,11 +23,11 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import com.vetti.hotake.mapper.HotakeCvInfoMapper; -import com.vetti.hotake.domain.HotakeCvInfo; -import com.vetti.hotake.service.IHotakeCvInfoService; - -import javax.annotation.Resource; +import java.io.InputStream; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; /** * 简历信息Service业务层处理 @@ -113,8 +106,23 @@ public class HotakeCvInfoServiceImpl extends BaseServiceImpl implements IHotakeC } hotakeCvInfo.setCvFileSuffix(fileSuffix); if("cv".equals(hotakeCvInfo.getCvFileType())){ - //对简历数据进行处理生成相应的题库数据 - handleHotakeCvInfo(hotakeCvInfo); + 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){ + } } return hotakeCvInfo; } @@ -125,19 +133,9 @@ public class HotakeCvInfoServiceImpl extends BaseServiceImpl implements IHotakeC * @return */ @Override - public void handleHotakeCvInfo(HotakeCvInfo hotakeCvInfo) { + public HotakeProblemBaseInfo handleHotakeCvInfo(HotakeCvInfoDto cvInfoDto) { + HotakeProblemBaseInfo problemBaseInfo = new HotakeProblemBaseInfo(); try{ - InputStream inputStream = minioClient.getObject( - GetObjectArgs.builder() - .bucket(MinioBucketNameEnum.CV.getCode()) - .object(hotakeCvInfo.getCvUrl()) - .build()); - - String contents = FileContentUtil.readFileContent(inputStream,hotakeCvInfo.getCvFileSuffix()); - //进行简历数据提取 - ResumeTextExtractor extractor = new ResumeTextExtractor(); - ResumeData resumeData = extractor.extractResumeData(contents,""); - log.info("返回简历基本内容:{}", resumeData); //调用AI大模型 List> list = new LinkedList(); Map mapEntity = new HashMap<>(); @@ -147,35 +145,33 @@ public class HotakeCvInfoServiceImpl extends BaseServiceImpl implements IHotakeC Map mapEntityOne = new HashMap<>(); mapEntityOne.put("role","user"); mapEntityOne.put("content","Position: Construction Labourer"+ - "\\nCandidate: "+resumeData.getPersonalInfo().getName()+ - "\\nKey Skills: "+JSONUtil.toJsonStr(resumeData.getSkills())+ - "\\nExperience: "+resumeData.getPersonalInfo().getExperienceYears()+"years"+ + "\\nCandidate: "+cvInfoDto.getName()+ + "\\nKey Skills: "+JSONUtil.toJsonStr(cvInfoDto.getSkillsToolsList())+ + "\\nExperience: "+JSONUtil.toJsonStr(cvInfoDto.getExperienceList())+ "\\nStrengths: Professional certifications, Relevant experience"+ - "\\nConcerns: "+JSONUtil.toJsonStr(resumeData.getSummary())); + "\\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 question = ""; + Integer questionNums = 0; if(StrUtil.isNotEmpty(resultMsg)){ - String[] results = resultMsg.split("#AA#"); - question = results[0].replaceAll(QUESTION_PREFIX,""); - if(StrUtil.isEmpty(question)){ - //设置一个默认值 - question = "Your professional certifications is impressive. Can you give me a specific example of how this benefited a project?"; - } + resultMsg = resultMsg.replaceAll(QUESTION_PREFIX,""); + questionNums = resultMsg.split("#AA#").length; } - log.info("返回初始化问题:{}",resultMsg); //生成预设问题记录 //先删除该用户的预设问题 hotakeProblemBaseInfoService.deleteHotakeProblemBaseInfoByUserId(SecurityUtils.getUserId()); - HotakeProblemBaseInfo problemBaseInfo = new HotakeProblemBaseInfo(); problemBaseInfo.setUserId(SecurityUtils.getUserId()); - problemBaseInfo.setContents(question); + problemBaseInfo.setContents(resultMsg); + problemBaseInfo.setQuestionNums(questionNums); hotakeProblemBaseInfoService.insertHotakeProblemBaseInfo(problemBaseInfo); }catch (Exception e) { e.printStackTrace(); } + return problemBaseInfo; } @@ -230,4 +226,63 @@ public class HotakeCvInfoServiceImpl extends BaseServiceImpl implements IHotakeC public int batchInsertHotakeCvInfo(List hotakeCvInfoList){ return hotakeCvInfoMapper.batchInsertHotakeCvInfo(hotakeCvInfoList); } + + + /** + * 简历解析数据 + * @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); + return cvInfoDto; + }catch (Exception e){ + } + return new HotakeCvInfoDto(); + } + + + /** + * 处理简历信息 + * @param hotakeCvInfo 简历信息 + * @return + */ + private HotakeProblemBaseInfo handleHotakeCvInfoScore(HotakeCvInfoDto cvInfoDto) { + HotakeProblemBaseInfo problemBaseInfo = new HotakeProblemBaseInfo(); + try{ + //调用AI大模型 + List> list = new LinkedList(); + Map 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 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) { + e.printStackTrace(); + } + return problemBaseInfo; + } + }