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文件处理完成,设置特定参数"); } }