From fb5dcaeb2ab91d0f9ffea26fd15ddcbbe5d36bb9 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期五, 31 七月 2026 17:57:27 +0800
Subject: [PATCH] feat(aftersales): 售后工单新增问题类型和严重程度字段
---
yudao-module-ai/src/main/java/cn/iocoder/yudao/module/ai/service/knowledge/AiKnowledgeSegmentService.java | 146 +++---------------------------------------------
1 files changed, 11 insertions(+), 135 deletions(-)
diff --git a/yudao-module-ai/src/main/java/cn/iocoder/yudao/module/ai/service/knowledge/AiKnowledgeSegmentService.java b/yudao-module-ai/src/main/java/cn/iocoder/yudao/module/ai/service/knowledge/AiKnowledgeSegmentService.java
index 9894e73..4e70bf5 100644
--- a/yudao-module-ai/src/main/java/cn/iocoder/yudao/module/ai/service/knowledge/AiKnowledgeSegmentService.java
+++ b/yudao-module-ai/src/main/java/cn/iocoder/yudao/module/ai/service/knowledge/AiKnowledgeSegmentService.java
@@ -1,157 +1,33 @@
package cn.iocoder.yudao.module.ai.service.knowledge;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
-import cn.iocoder.yudao.module.ai.controller.admin.knowledge.vo.segment.AiKnowledgeSegmentPageReqVO;
-import cn.iocoder.yudao.module.ai.controller.admin.knowledge.vo.segment.AiKnowledgeSegmentProcessRespVO;
-import cn.iocoder.yudao.module.ai.controller.admin.knowledge.vo.segment.AiKnowledgeSegmentSaveReqVO;
-import cn.iocoder.yudao.module.ai.controller.admin.knowledge.vo.segment.AiKnowledgeSegmentUpdateStatusReqVO;
+import cn.iocoder.yudao.module.ai.controller.admin.knowledge.vo.segment.*;
import cn.iocoder.yudao.module.ai.dal.dataobject.knowledge.AiKnowledgeSegmentDO;
import cn.iocoder.yudao.module.ai.service.knowledge.bo.AiKnowledgeSegmentSearchReqBO;
import cn.iocoder.yudao.module.ai.service.knowledge.bo.AiKnowledgeSegmentSearchRespBO;
-import org.springframework.scheduling.annotation.Async;
-import java.util.Collection;
import java.util.List;
-import java.util.Map;
-import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;
-
-/**
- * AI 鐭ヨ瘑搴撴钀� Service 鎺ュ彛
- *
- * @author xiaoxin
- */
public interface AiKnowledgeSegmentService {
- /**
- * 鑾峰彇鐭ヨ瘑搴撴钀借鎯�
- *
- * @param id 娈佃惤缂栧彿
- * @return 娈佃惤璇︽儏
- */
- AiKnowledgeSegmentDO getKnowledgeSegment(Long id);
+ AiKnowledgeSegmentDO getSegment(Long id);
- /**
- * 鑾峰彇鐭ヨ瘑搴撴钀藉垪琛�
- *
- * @param ids 娈佃惤缂栧彿鍒楄〃
- * @return 娈佃惤鍒楄〃
- */
- List<AiKnowledgeSegmentDO> getKnowledgeSegmentList(Collection<Long> ids);
+ AiKnowledgeSegmentDO validateSegmentExists(Long id);
- /**
- * 鑾峰彇鐭ヨ瘑搴撴钀� Map
- *
- * @param ids 娈佃惤缂栧彿鍒楄〃
- * @return 娈佃惤 Map
- */
- default Map<Long, AiKnowledgeSegmentDO> getKnowledgeSegmentMap(Collection<Long> ids) {
- return convertMap(getKnowledgeSegmentList(ids), AiKnowledgeSegmentDO::getId);
- }
+ PageResult<AiKnowledgeSegmentDO> getSegmentPage(AiKnowledgeSegmentPageReqVO pageReqVO);
- /**
- * 鑾峰彇娈佃惤鍒嗛〉
- *
- * @param pageReqVO 鍒嗛〉鏌ヨ
- * @return 鏂囨。鍒嗛〉
- */
- PageResult<AiKnowledgeSegmentDO> getKnowledgeSegmentPage(AiKnowledgeSegmentPageReqVO pageReqVO);
+ Long createSegment(AiKnowledgeSegmentSaveReqVO saveReqVO);
- /**
- * 鍩轰簬 content 鍐呭锛屽垏鐗囧垱寤哄涓钀�
- *
- * @param documentId 鐭ヨ瘑搴撴枃妗g紪鍙�
- * @param content 鏂囨。鍐呭
- */
- void createKnowledgeSegmentBySplitContent(Long documentId, String content);
+ void updateSegment(AiKnowledgeSegmentSaveReqVO saveReqVO);
- /**
- * 銆愬紓姝ャ�戝熀浜� content 鍐呭锛屽垏鐗囧垱寤哄涓钀�
- *
- * @param documentId 鐭ヨ瘑搴撴枃妗g紪鍙�
- * @param content 鏂囨。鍐呭
- */
- @Async
- default void createKnowledgeSegmentBySplitContentAsync(Long documentId, String content) {
- createKnowledgeSegmentBySplitContent(documentId, content);
- }
+ void deleteSegment(Long id);
- /**
- * 鍒涘缓鐭ヨ瘑搴撴钀�
- *
- * @param createReqVO 鍒涘缓淇℃伅
- * @return 娈佃惤缂栧彿
- */
- Long createKnowledgeSegment(AiKnowledgeSegmentSaveReqVO createReqVO);
+ void updateSegmentStatus(AiKnowledgeSegmentUpdateStatusReqVO updateStatusReqVO);
- /**
- * 鏇存柊娈佃惤鐨勫唴瀹�
- *
- * @param reqVO 鏇存柊鍐呭
- */
- void updateKnowledgeSegment(AiKnowledgeSegmentSaveReqVO reqVO);
+ void deleteSegmentsByDocumentId(Long documentId);
- /**
- * 鏇存柊娈佃惤鐨勭姸鎬�
- *
- * @param reqVO 鏇存柊鍐呭
- */
- void updateKnowledgeSegmentStatus(AiKnowledgeSegmentUpdateStatusReqVO reqVO);
+ void saveSegments(List<AiKnowledgeSegmentDO> segments, Long knowledgeId, Long embeddingModelId);
- /**
- * 鍒犻櫎鐭ヨ瘑搴撴钀�
- *
- * @param id 娈佃惤缂栧彿
- */
- void deleteKnowledgeSegment(Long id);
-
- /**
- * 閲嶆柊绱㈠紩鐭ヨ瘑搴撲笅鐨勬墍鏈夋枃妗f钀�
- *
- * @param knowledgeId 鐭ヨ瘑搴撶紪鍙�
- */
- void reindexKnowledgeSegmentByKnowledgeId(Long knowledgeId);
-
- /**
- * 銆愬紓姝ャ�戦噸鏂扮储寮曠煡璇嗗簱涓嬬殑鎵�鏈夋枃妗f钀�
- *
- * @param knowledgeId 鐭ヨ瘑搴撶紪鍙�
- */
- @Async
- default void reindexByKnowledgeIdAsync(Long knowledgeId) {
- reindexKnowledgeSegmentByKnowledgeId(knowledgeId);
- }
-
- /**
- * 鏍规嵁鏂囨。缂栧彿鍒犻櫎娈佃惤
- *
- * @param documentId 鏂囨。缂栧彿
- */
- void deleteKnowledgeSegmentByDocumentId(Long documentId);
-
- /**
- * 鎼滅储鐭ヨ瘑搴撴钀斤紝骞惰繑鍥炵粨鏋�
- *
- * @param reqBO 鎼滅储璇锋眰淇℃伅
- * @return 鎼滅储缁撴灉娈佃惤鍒楄〃
- */
- List<AiKnowledgeSegmentSearchRespBO> searchKnowledgeSegment(AiKnowledgeSegmentSearchReqBO reqBO);
-
- /**
- * 鏍规嵁 URL 鍐呭锛屽垏鐗囧垱寤哄涓钀�
- *
- * @param url URL 鍦板潃
- * @param segmentMaxTokens 娈佃惤鏈�澶� Token 鏁�
- * @return 鍒囩墖鍚庣殑娈佃惤鍒楄〃
- */
- List<AiKnowledgeSegmentDO> splitContent(String url, Integer segmentMaxTokens);
-
- /**
- * 鑾峰彇鏂囨。澶勭悊杩涘害锛堝涓級
- *
- * @param documentIds 鏂囨。缂栧彿鍒楄〃
- * @return 鏂囨。澶勭悊鍒楄〃
- */
- List<AiKnowledgeSegmentProcessRespVO> getKnowledgeSegmentProcessList(List<Long> documentIds);
+ List<AiKnowledgeSegmentSearchRespBO> searchSegments(AiKnowledgeSegmentSearchReqBO searchReqBO);
}
--
Gitblit v1.9.3