From fe51278f14956231986a9c58e5f85c8edf027cac Mon Sep 17 00:00:00 2001 From: wenjinbo <599483010@qq.com> Date: Wed, 24 Sep 2025 19:39:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4excel=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=88=86=E6=AE=B5=E7=AD=96=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/bjtds/brichat/service/impl/WorkFlowServiceImpl.java | 5 ++++- .../bjtds/brichat/strategy/impl/ExcelDocumentStrategy.java | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/chat-server/src/main/java/com/bjtds/brichat/service/impl/WorkFlowServiceImpl.java b/chat-server/src/main/java/com/bjtds/brichat/service/impl/WorkFlowServiceImpl.java index 506c0e5..28220a1 100644 --- a/chat-server/src/main/java/com/bjtds/brichat/service/impl/WorkFlowServiceImpl.java +++ b/chat-server/src/main/java/com/bjtds/brichat/service/impl/WorkFlowServiceImpl.java @@ -13,6 +13,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import java.util.HashMap; import java.util.Map; +import java.util.UUID; @Slf4j @Service @@ -30,7 +31,7 @@ public class WorkFlowServiceImpl implements WorkFlowService { //1.上传文件 FileUploadRequest fileUploadRequest = new FileUploadRequest(); fileUploadRequest.setFile(file); - fileUploadRequest.setUserId(userId); + fileUploadRequest.setUserId(UUID.randomUUID().toString()); fileUploadRequest.setApiKey(apiKey); FileUploadResponse fileUploadResponse = difyChatService.fileUpload(fileUploadRequest); @@ -49,6 +50,8 @@ public class WorkFlowServiceImpl implements WorkFlowService { inputMap.put("files",filesMap); workflowRunRequest.setInputs(inputMap); + + WorkflowRunResponse workflowRunResponse = workflow.runWorkflow(workflowRunRequest); log.info("一事一流程工作流运行成功,工作流id:{}",workflowRunResponse.getData()); diff --git a/chat-server/src/main/java/com/bjtds/brichat/strategy/impl/ExcelDocumentStrategy.java b/chat-server/src/main/java/com/bjtds/brichat/strategy/impl/ExcelDocumentStrategy.java index d9a2455..4eb16a1 100644 --- a/chat-server/src/main/java/com/bjtds/brichat/strategy/impl/ExcelDocumentStrategy.java +++ b/chat-server/src/main/java/com/bjtds/brichat/strategy/impl/ExcelDocumentStrategy.java @@ -17,10 +17,10 @@ public class ExcelDocumentStrategy implements IDocumentStrategy { public void execute(DocUploadReq request, MultipartFile file) { // Excel文件的特殊处理逻辑 request.getDocAnalysisStrategy().setParentSegmentMode("paragraph"); + request.getDocAnalysisStrategy().setDocForm("text_model"); + request.getDocAnalysisStrategy().setSegmentationMode("custom"); request.getDocAnalysisStrategy().setSegmentSeparator("$$"); request.getDocAnalysisStrategy().setMaxLength(4000); - request.getDocAnalysisStrategy().setChildSegmentSeparator("/n"); - request.getDocAnalysisStrategy().setChildMaxLength(512); log.info("Excel文件处理完成,设置特定参数"); } }