fix: 调整excel文件分段策略

This commit is contained in:
wenjinbo 2025-09-24 19:39:04 +08:00
parent 60cb1eef62
commit fe51278f14
2 changed files with 6 additions and 3 deletions

View File

@ -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());

View File

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