소스 검색

20250317修改查询对比文献

lrj 5 달 전
부모
커밋
53696d60ef
23개의 변경된 파일952개의 추가작업 그리고 52개의 파일을 삭제
  1. 14 0
      pom.xml
  2. 12 0
      src/main/java/cn/cslg/pas/common/config/WebConfig.java
  3. 4 4
      src/main/java/cn/cslg/pas/common/config/WebSocketConfig.java
  4. 1 0
      src/main/java/cn/cslg/pas/common/dto/TechnicalCaseIdDTO.java
  5. 15 0
      src/main/java/cn/cslg/pas/common/model/dify/ChatMessageDTO.java
  6. 22 0
      src/main/java/cn/cslg/pas/common/model/dify/DifyChatMessageDTO.java
  7. 14 0
      src/main/java/cn/cslg/pas/common/model/dify/DifyFile.java
  8. 11 0
      src/main/java/cn/cslg/pas/common/model/dify/DifyHistoryMessageDTO.java
  9. 9 0
      src/main/java/cn/cslg/pas/common/model/novelty/AddConfessionDTO.java
  10. 43 0
      src/main/java/cn/cslg/pas/common/utils/DataUtils.java
  11. 42 11
      src/main/java/cn/cslg/pas/controller/NoveltyProjectController.java
  12. 81 0
      src/main/java/cn/cslg/pas/controller/outApi/DifyController.java
  13. 38 0
      src/main/java/cn/cslg/pas/domain/dify/DifySession.java
  14. 24 0
      src/main/java/cn/cslg/pas/domain/report/AssoProjectConfession.java
  15. 18 0
      src/main/java/cn/cslg/pas/mapper/dify/DifySessionMapper.java
  16. 18 0
      src/main/java/cn/cslg/pas/mapper/report/AssoProjectConfessionMapper.java
  17. 16 0
      src/main/java/cn/cslg/pas/service/business/TechnicalCaseService.java
  18. 299 0
      src/main/java/cn/cslg/pas/service/common/DifyService.java
  19. 2 1
      src/main/java/cn/cslg/pas/service/common/FileManagerService.java
  20. 42 0
      src/main/java/cn/cslg/pas/service/dify/DifySessionService.java
  21. 110 0
      src/main/java/cn/cslg/pas/service/report/AssoProjectConfessionService.java
  22. 40 36
      src/main/resources/application-dev.yml
  23. 77 0
      src/test/java/cn/cslg/pas/service/common/DifyServiceTest.java

+ 14 - 0
pom.xml

@@ -275,6 +275,20 @@
             <groupId>io.micrometer</groupId>
             <groupId>io.micrometer</groupId>
             <artifactId>micrometer-registry-prometheus</artifactId>
             <artifactId>micrometer-registry-prometheus</artifactId>
         </dependency>
         </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-webflux</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.squareup.okhttp3</groupId>
+            <artifactId>okhttp-sse</artifactId>
+            <version>3.14.9</version>
+        </dependency>
+        <dependency>
+            <groupId>com.vladsch.flexmark</groupId>
+            <artifactId>flexmark-all</artifactId>
+            <version>0.64.8</version>
+        </dependency>
     </dependencies>
     </dependencies>
 
 
     <build>
     <build>

+ 12 - 0
src/main/java/cn/cslg/pas/common/config/WebConfig.java

@@ -0,0 +1,12 @@
+package cn.cslg.pas.common.config;
+
+import com.google.common.net.HttpHeaders;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.MediaType;
+import org.springframework.web.reactive.function.client.WebClient;
+
+@Configuration
+public class WebConfig {
+
+}

+ 4 - 4
src/main/java/cn/cslg/pas/common/config/WebSocketConfig.java

@@ -6,8 +6,8 @@ import org.springframework.web.socket.server.standard.ServerEndpointExporter;
 
 
 @Configuration
 @Configuration
 public class WebSocketConfig {
 public class WebSocketConfig {
-    @Bean
-    public ServerEndpointExporter serverEndpointExporter() {
-        return new ServerEndpointExporter();
-    }
+//    @Bean
+//    public ServerEndpointExporter serverEndpointExporter() {
+//        return new ServerEndpointExporter();
+//    }
 }
 }

+ 1 - 0
src/main/java/cn/cslg/pas/common/dto/TechnicalCaseIdDTO.java

@@ -8,4 +8,5 @@ public class TechnicalCaseIdDTO {
     private Integer projectId;
     private Integer projectId;
 
 
     private Integer technicalCaseId;
     private Integer technicalCaseId;
+    private String inventionPoint;
 }
 }

+ 15 - 0
src/main/java/cn/cslg/pas/common/model/dify/ChatMessageDTO.java

@@ -0,0 +1,15 @@
+package cn.cslg.pas.common.model.dify;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.gson.annotations.SerializedName;
+import lombok.Data;
+
+import java.util.List;
+import java.util.Map;
+
+@Data
+public class ChatMessageDTO {
+    private String query;
+    private String conversationId;
+    private Integer projectId;
+}

+ 22 - 0
src/main/java/cn/cslg/pas/common/model/dify/DifyChatMessageDTO.java

@@ -0,0 +1,22 @@
+package cn.cslg.pas.common.model.dify;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.gson.annotations.SerializedName;
+import lombok.Data;
+
+import java.util.List;
+import java.util.Map;
+
+@Data
+public class DifyChatMessageDTO {
+    private String  query;
+    @SerializedName("response_mode")
+    private String responseMode;
+    @SerializedName("conversation_id")
+    private String conversationId;
+    @JsonProperty("user")
+    private String user;
+
+    private Map<String,Object> inputs;
+    private List<DifyFile> files;
+}

+ 14 - 0
src/main/java/cn/cslg/pas/common/model/dify/DifyFile.java

@@ -0,0 +1,14 @@
+package cn.cslg.pas.common.model.dify;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+
+@Data
+public class DifyFile {
+    private String type;
+    @JsonProperty("transfer_method")
+    private String transferMethod;
+    private String url;
+    @JsonProperty("upload_file_id")
+    private String uploadFileId;
+}

+ 11 - 0
src/main/java/cn/cslg/pas/common/model/dify/DifyHistoryMessageDTO.java

@@ -0,0 +1,11 @@
+package cn.cslg.pas.common.model.dify;
+
+import lombok.Data;
+
+@Data
+public class DifyHistoryMessageDTO {
+    private String conversationId;
+    private String user;
+    private String firstId;
+    private Integer limit;
+}

+ 9 - 0
src/main/java/cn/cslg/pas/common/model/novelty/AddConfessionDTO.java

@@ -0,0 +1,9 @@
+package cn.cslg.pas.common.model.novelty;
+
+import lombok.Data;
+
+@Data
+public class AddConfessionDTO {
+    private Integer projectId;
+    private String fileGuid;
+}

+ 43 - 0
src/main/java/cn/cslg/pas/common/utils/DataUtils.java

@@ -2,8 +2,14 @@ package cn.cslg.pas.common.utils;
 
 
 
 
 import cn.dev33.satoken.secure.SaSecureUtil;
 import cn.dev33.satoken.secure.SaSecureUtil;
+import com.vladsch.flexmark.ext.tables.TablesExtension;
+import com.vladsch.flexmark.html.HtmlRenderer;
+import com.vladsch.flexmark.parser.Parser;
+import com.vladsch.flexmark.util.ast.Node;
+import com.vladsch.flexmark.util.data.MutableDataSet;
 import jakarta.annotation.Resource;
 import jakarta.annotation.Resource;
 import org.apache.logging.log4j.util.Base64Util;
 import org.apache.logging.log4j.util.Base64Util;
+import org.jsoup.Jsoup;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
 import org.springframework.util.Base64Utils;
 import org.springframework.util.Base64Utils;
 
 
@@ -14,6 +20,8 @@ import java.util.*;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.function.Function;
 import java.util.function.Function;
 import java.util.function.Predicate;
 import java.util.function.Predicate;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 
 
 @Component
 @Component
@@ -235,4 +243,39 @@ public class DataUtils {
         }
         }
         return result;
         return result;
     }
     }
+    public static String unicodeDecode(String string) {
+        Pattern pattern = Pattern.compile("(\\\\u(\\p{XDigit}{4}))");
+        Matcher matcher = pattern.matcher(string);
+        char ch;
+        while (matcher.find()) {
+            ch = (char) Integer.parseInt(matcher.group(2), 16);
+            string = string.replace(matcher.group(1), ch + "");
+        }
+        return string;
+    }
+
+    public static String getMarkDownText(String markdownText){
+
+
+        // 配置解析器(支持表格等扩展)
+        MutableDataSet options = new MutableDataSet();
+        options.set(Parser.EXTENSIONS, Arrays.asList(TablesExtension.create()));
+
+        // 构建解析器和渲染器
+        Parser parser = Parser.builder(options).build();
+        HtmlRenderer renderer = HtmlRenderer.builder(options).build();
+
+        // 将 Markdown 解析为 HTML
+        Node document = parser.parse(markdownText);
+        String html = renderer.render(document);
+
+//        // 使用 JSoup 去除 HTML 标签
+//        String re= Jsoup.parse(html).text()
+//                .replaceAll("\\s+", " ")   // 合并多余空格
+//                .trim();
+        // 输出普通文本
+      return  html;
+    }
+
+
 }
 }

+ 42 - 11
src/main/java/cn/cslg/pas/controller/NoveltyProjectController.java

@@ -7,6 +7,8 @@ import cn.cslg.pas.common.dto.NoveltyProjectDTO.NoveltyRetrieveRecordDTO;
 import cn.cslg.pas.common.dto.NoveltyProjectDTO.QueryTemplateDTO;
 import cn.cslg.pas.common.dto.NoveltyProjectDTO.QueryTemplateDTO;
 import cn.cslg.pas.common.dto.business.LiteratureQueryDTO;
 import cn.cslg.pas.common.dto.business.LiteratureQueryDTO;
 import cn.cslg.pas.common.model.cronModel.Records;
 import cn.cslg.pas.common.model.cronModel.Records;
+import cn.cslg.pas.common.model.cronModel.SystemFile;
+import cn.cslg.pas.common.model.novelty.AddConfessionDTO;
 import cn.cslg.pas.common.model.request.StringRequest;
 import cn.cslg.pas.common.model.request.StringRequest;
 import cn.cslg.pas.common.utils.Response;
 import cn.cslg.pas.common.utils.Response;
 import cn.cslg.pas.common.vo.NoveltyProjectVO.QueryTemplateVO;
 import cn.cslg.pas.common.vo.NoveltyProjectVO.QueryTemplateVO;
@@ -14,6 +16,7 @@ import cn.cslg.pas.common.vo.QueryCompareFileVO;
 import cn.cslg.pas.common.vo.QueryInventionPointVO;
 import cn.cslg.pas.common.vo.QueryInventionPointVO;
 import cn.cslg.pas.common.vo.QueryNoveltyProjectVO;
 import cn.cslg.pas.common.vo.QueryNoveltyProjectVO;
 import cn.cslg.pas.common.vo.TechnicalCaseVO;
 import cn.cslg.pas.common.vo.TechnicalCaseVO;
+import cn.cslg.pas.domain.business.TechnicalCase;
 import cn.cslg.pas.factorys.businessFactory.Business;
 import cn.cslg.pas.factorys.businessFactory.Business;
 import cn.cslg.pas.factorys.businessFactory.BusinessFactory;
 import cn.cslg.pas.factorys.businessFactory.BusinessFactory;
 import cn.cslg.pas.service.business.NoveltyProjectService;
 import cn.cslg.pas.service.business.NoveltyProjectService;
@@ -21,12 +24,10 @@ import cn.cslg.pas.service.business.TechnicalCaseService;
 import cn.cslg.pas.service.novelty.NoveltyReportTemplateService;
 import cn.cslg.pas.service.novelty.NoveltyReportTemplateService;
 import cn.cslg.pas.service.novelty.NoveltySearchRecordService;
 import cn.cslg.pas.service.novelty.NoveltySearchRecordService;
 import cn.cslg.pas.service.novelty.NoveltyCompareLiteratureService;
 import cn.cslg.pas.service.novelty.NoveltyCompareLiteratureService;
+import cn.cslg.pas.service.report.AssoProjectConfessionService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.Operation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
@@ -53,6 +54,8 @@ public class NoveltyProjectController {
 
 
     @Autowired
     @Autowired
     private NoveltyCompareLiteratureService noveltyCompareLiteratureService;
     private NoveltyCompareLiteratureService noveltyCompareLiteratureService;
+    @Autowired
+    private AssoProjectConfessionService assoProjectConfessionService;
 
 
     @Operation(summary = "添加查新检索报告")
     @Operation(summary = "添加查新检索报告")
     @PostMapping("/addNoveltyProject")
     @PostMapping("/addNoveltyProject")
@@ -156,7 +159,7 @@ public class NoveltyProjectController {
         Integer compareFileId = null;
         Integer compareFileId = null;
         try {
         try {
             compareFileId = noveltyCompareLiteratureService.addCompareFile(fileDTO);
             compareFileId = noveltyCompareLiteratureService.addCompareFile(fileDTO);
-        }  catch (Exception e) {
+        } catch (Exception e) {
             return Response.error(e.getMessage());
             return Response.error(e.getMessage());
         }
         }
         return Response.success(compareFileId);
         return Response.success(compareFileId);
@@ -236,7 +239,7 @@ public class NoveltyProjectController {
     @Operation(summary = "查询查新检索报告模板")
     @Operation(summary = "查询查新检索报告模板")
     @PostMapping("/queryTemplate")
     @PostMapping("/queryTemplate")
     public Response queryTemplate(@RequestBody QueryTemplateDTO queryTemplateDTO) throws IOException {
     public Response queryTemplate(@RequestBody QueryTemplateDTO queryTemplateDTO) throws IOException {
-         Records records = noveltyReportTemplateService.queryTemplate(queryTemplateDTO);
+        Records records = noveltyReportTemplateService.queryTemplate(queryTemplateDTO);
         return Response.success(records);
         return Response.success(records);
     }
     }
 
 
@@ -249,7 +252,7 @@ public class NoveltyProjectController {
 
 
     @Operation(summary = "添加检索记录")
     @Operation(summary = "添加检索记录")
     @PostMapping("/addSearchRecord")
     @PostMapping("/addSearchRecord")
-    public Response addSearchRecord(@RequestBody NoveltyRetrieveRecordDTO noveltyRetrieveRecordDTO){
+    public Response addSearchRecord(@RequestBody NoveltyRetrieveRecordDTO noveltyRetrieveRecordDTO) {
         Integer id = noveltySearchRecordService.addSearchRecord(noveltyRetrieveRecordDTO);
         Integer id = noveltySearchRecordService.addSearchRecord(noveltyRetrieveRecordDTO);
         Records records = new Records();
         Records records = new Records();
         records.setData(id);
         records.setData(id);
@@ -258,7 +261,7 @@ public class NoveltyProjectController {
 
 
     @Operation(summary = "修改检索记录")
     @Operation(summary = "修改检索记录")
     @PostMapping("/updateSearchRecord")
     @PostMapping("/updateSearchRecord")
-    public Response updateSearchRecord(@RequestBody NoveltyRetrieveRecordDTO noveltyRetrieveRecordDTO){
+    public Response updateSearchRecord(@RequestBody NoveltyRetrieveRecordDTO noveltyRetrieveRecordDTO) {
         Integer id = noveltySearchRecordService.updateSearchRecord(noveltyRetrieveRecordDTO);
         Integer id = noveltySearchRecordService.updateSearchRecord(noveltyRetrieveRecordDTO);
         Records records = new Records();
         Records records = new Records();
         records.setData(id);
         records.setData(id);
@@ -267,17 +270,45 @@ public class NoveltyProjectController {
 
 
     @Operation(summary = "删除检索记录")
     @Operation(summary = "删除检索记录")
     @PostMapping("/deleteSearchRecord")
     @PostMapping("/deleteSearchRecord")
-    public Response deleteSearchRecord(@RequestBody DelSearchRecordDTO vo){
+    public Response deleteSearchRecord(@RequestBody DelSearchRecordDTO vo) {
         List<Integer> ids = noveltySearchRecordService.deleteSearchRecord(vo);
         List<Integer> ids = noveltySearchRecordService.deleteSearchRecord(vo);
         Records records = new Records();
         Records records = new Records();
         records.setData(ids);
         records.setData(ids);
         return Response.success(records);
         return Response.success(records);
     }
     }
+
     @Operation(summary = "复用报告")
     @Operation(summary = "复用报告")
     @PostMapping("/copyMessage")
     @PostMapping("/copyMessage")
-    public Response copyMessage(@RequestBody NoveltyProjectCopyDTO noveltyProjectCopyDTO) throws Exception{
-      Integer id=   noveltyProjectService.copyNoveltyProject(noveltyProjectCopyDTO);
+    public Response copyMessage(@RequestBody NoveltyProjectCopyDTO noveltyProjectCopyDTO) throws Exception {
+        Integer id = noveltyProjectService.copyNoveltyProject(noveltyProjectCopyDTO);
         return Response.success(id);
         return Response.success(id);
     }
     }
 
 
+    @Operation(summary = "添加技术交底书")
+    @PostMapping("/addConfession")
+    public Response addConfession(@RequestBody AddConfessionDTO addConfessionDTO) throws Exception {
+        Integer id = assoProjectConfessionService.addProjectConfession(addConfessionDTO);
+        return Response.success(id);
+    }
+
+    @Operation(summary = "查询技术交底书")
+    @GetMapping("/queryConfession")
+    public Response queryConfession(Integer projectId) throws Exception {
+        SystemFile systemFile = assoProjectConfessionService.queryConfession(projectId);
+        return Response.success(systemFile);
+    }
+
+    @Operation(summary = "更新发明点")
+    @PostMapping("/updateInventionPoint")
+    public Response updateInventionPoint(@RequestBody TechnicalCaseIdDTO caseIdDTO) throws Exception {
+        TechnicalCase technicalCase = new TechnicalCase();
+        try {
+          Integer projectId =caseIdDTO.getProjectId();
+          String inventPoint=caseIdDTO.getInventionPoint();
+            technicalCase = technicalCaseService.updateInventionPoint(projectId,inventPoint);
+        } catch (Exception e) {
+            return Response.error(e.getMessage());
+        }
+        return Response.success(technicalCase);
+    }
 }
 }

+ 81 - 0
src/main/java/cn/cslg/pas/controller/outApi/DifyController.java

@@ -0,0 +1,81 @@
+package cn.cslg.pas.controller.outApi;
+
+import cn.cslg.pas.common.core.base.Constants;
+import cn.cslg.pas.common.model.dify.ChatMessageDTO;
+import cn.cslg.pas.common.model.dify.DifyChatMessageDTO;
+import cn.cslg.pas.common.model.dify.DifyHistoryMessageDTO;
+import cn.cslg.pas.common.utils.Response;
+import cn.cslg.pas.domain.business.ProjectTask;
+import cn.cslg.pas.domain.business.ReportProject;
+import cn.cslg.pas.domain.business.TaskCode;
+import cn.cslg.pas.service.business.ProjectTaskService;
+import cn.cslg.pas.service.business.ReportProjectService;
+import cn.cslg.pas.service.business.TaskCodeService;
+import cn.cslg.pas.service.business.es.EsPatentVectorService;
+import cn.cslg.pas.service.common.DifyService;
+import cn.cslg.pas.service.dify.DifySessionService;
+import com.alibaba.fastjson2.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.google.gson.JsonObject;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.servlet.http.HttpServletResponse;
+import lombok.RequiredArgsConstructor;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
+import reactor.core.publisher.Flux;
+
+import java.io.IOException;
+import java.util.List;
+
+
+@SuppressWarnings({"all"})
+@Tag(name = "外部人员调用接口")
+@RestController
+@RequestMapping(Constants.API_XiaoSHI + "/dify")
+@RequiredArgsConstructor(onConstructor_ = {@Lazy})
+
+public class DifyController {
+    private final DifyService difyService;
+    private final DifySessionService difySessionService;
+
+    //
+    @RequestMapping(value = "/chatMessage", method = RequestMethod.POST, produces = MediaType.TEXT_EVENT_STREAM_VALUE)
+    @Operation(summary = "发送对话")
+    public Flux<String> chatMessage(@RequestBody ChatMessageDTO chatMessageDTO) throws IOException {
+        return difyService.getOkhttp(chatMessageDTO);
+    }
+
+
+    @RequestMapping(value = "/queryHistoryMessage", method = RequestMethod.POST)
+    @Operation(summary = "查询历史会话")
+    public Response queryHistoryMessage(@RequestBody DifyHistoryMessageDTO difyHistoryMessageDTO) throws IOException {
+      String jsons=  difyService.queryHistoryMessage(difyHistoryMessageDTO);
+        JSONObject jsonObject = JSONObject.parseObject(jsons);
+        return Response.success(jsonObject);
+    }
+
+    @RequestMapping(value = "/querySessionId", method = RequestMethod.GET)
+    @Operation(summary = "查询会话id")
+    public Response querySessionId(Integer projectId) throws IOException {
+        String userId = "1";
+        return Response.success(difySessionService.getSessionId(projectId, userId));
+    }
+
+    @RequestMapping(value = "/stopMessage", method = RequestMethod.GET)
+    @Operation(summary = "停止会话")
+    public Response stopMessage(String  taskId) throws IOException {
+        return Response.success(difyService.stopMessage(taskId));
+    }
+    @RequestMapping(value = "/generateInventionPoint", method = RequestMethod.POST)
+    @Operation(summary = "生成发明点")
+    public Response generateInventionPoint(@RequestBody ChatMessageDTO chatMessageDTO) throws IOException {
+        return Response.success(difyService.generateInventionPoint(chatMessageDTO));
+    }
+}

+ 38 - 0
src/main/java/cn/cslg/pas/domain/dify/DifySession.java

@@ -0,0 +1,38 @@
+package cn.cslg.pas.domain.dify;
+
+import cn.cslg.pas.domain.AiUseRecord;
+import cn.cslg.pas.domain.BaseEntity;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import lombok.Data;
+
+/**
+ * @TableName dify_session
+ */
+@TableName(value = "dify_session")
+@Data
+public class DifySession extends BaseEntity<DifySession> {
+    @TableField(value = "project_id")
+    private Integer projectId;
+
+    @TableField(value = "patent_no")
+    private Integer patentNo;
+
+    @TableField(value = "session_id")
+    private String sessionId;
+
+    @TableField(value = "create_id")
+    private String createId;
+
+    /**
+     * 创建时间
+     */
+    @TableField(value = "create_time")
+    private Date createTime;
+}

+ 24 - 0
src/main/java/cn/cslg/pas/domain/report/AssoProjectConfession.java

@@ -0,0 +1,24 @@
+package cn.cslg.pas.domain.report;
+
+import cn.cslg.pas.domain.BaseEntity;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import lombok.Data;
+
+/**
+ * @TableName asso_project_confession
+ */
+@TableName(value ="asso_project_confession")
+@Data
+public class AssoProjectConfession extends BaseEntity<AssoProjectConfession> {
+    private Integer id;
+
+    private Integer projectId;
+
+    private String fileGuid;
+
+    private static final long serialVersionUID = 1L;
+}

+ 18 - 0
src/main/java/cn/cslg/pas/mapper/dify/DifySessionMapper.java

@@ -0,0 +1,18 @@
+package cn.cslg.pas.mapper.dify;
+
+import cn.cslg.pas.domain.dify.DifySession;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+* @author admin
+* @description 针对表【dify_session(会话表)】的数据库操作Mapper
+* @createDate 2025-04-09 11:18:33
+* @Entity cn.cslg.pas.domain.novelty.domain.DifySession
+*/
+public interface DifySessionMapper extends BaseMapper<DifySession> {
+
+}
+
+
+
+

+ 18 - 0
src/main/java/cn/cslg/pas/mapper/report/AssoProjectConfessionMapper.java

@@ -0,0 +1,18 @@
+package cn.cslg.pas.mapper.report;
+
+import cn.cslg.pas.domain.report.AssoProjectConfession;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+* @author admin
+* @description 针对表【asso_project_confession(技术交底书表)】的数据库操作Mapper
+* @createDate 2025-04-09 11:33:33
+* @Entity cn.cslg.pas.domain.novelty.domain.AssoProjectConfession
+*/
+public interface AssoProjectConfessionMapper extends BaseMapper<AssoProjectConfession> {
+
+}
+
+
+
+

+ 16 - 0
src/main/java/cn/cslg/pas/service/business/TechnicalCaseService.java

@@ -308,4 +308,20 @@ public class TechnicalCaseService extends ServiceImpl<TechnicalCaseMapper, Techn
         return technicalCase;
         return technicalCase;
     }
     }
 
 
+
+    public TechnicalCase updateInventionPoint(Integer projectId,String inventionPoint) {
+        TechnicalCase technicalCase=   this.getByProjectId(projectId);
+        technicalCase.setInventionPoint(inventionPoint);
+        if(technicalCase.getId()==null){
+            technicalCase.setProjectId(projectId);
+            technicalCase.insert();
+        }
+        else {
+                technicalCase.updateById();
+
+        }
+        return technicalCase;
+
+    }
+
 }
 }

+ 299 - 0
src/main/java/cn/cslg/pas/service/common/DifyService.java

@@ -0,0 +1,299 @@
+package cn.cslg.pas.service.common;
+
+
+import cn.cslg.pas.common.model.dify.ChatMessageDTO;
+import cn.cslg.pas.common.model.dify.DifyChatMessageDTO;
+import cn.cslg.pas.common.model.dify.DifyHistoryMessageDTO;
+
+import cn.cslg.pas.common.utils.DataUtils;
+import cn.cslg.pas.domain.business.TechnicalCase;
+import cn.cslg.pas.domain.report.AssoProjectConfession;
+import cn.cslg.pas.service.business.TechnicalCaseService;
+import cn.cslg.pas.service.dify.DifySessionService;
+import cn.cslg.pas.service.report.AssoProjectConfessionService;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import okhttp3.*;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.HttpHeaders;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.reactive.function.client.WebClient;
+import reactor.core.publisher.Flux;
+
+import java.io.*;
+
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.concurrent.TimeUnit;
+
+
+/**
+ * Okhttp调用FMS上传文件接口
+ *
+ * @Author lrj
+ * @Date 2025/4/10
+ */
+@RequiredArgsConstructor
+@Slf4j
+@Service
+public class DifyService {
+    @Value("${DIFY.apiKey}")
+    private String apiKey;
+    @Value("${DIFY.url}")
+    private String url;
+    @Value("${FileDownloadUrl}")
+    private String fileDownloadUrl;
+    private final DifySessionService difySessionService;
+    private final TechnicalCaseService technicalCaseService;
+    private final AssoProjectConfessionService assoProjectConfessionService;
+
+    /**
+     * 调用文件系统删除文件接口
+     */
+    public String chatMessage(DifyChatMessageDTO difyChatMessageDTO) throws IOException {
+        String param = new Gson().toJson(difyChatMessageDTO);
+        RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), param);
+        OkHttpClient okHttpClient = new OkHttpClient.Builder()
+                .connectTimeout(60, TimeUnit.SECONDS)
+                .writeTimeout(60, TimeUnit.SECONDS)
+                .readTimeout(60, TimeUnit.SECONDS)
+                .build();
+        Request request = new Request.Builder()
+                .url(url + "chat-messages")
+                .post(requestBody)
+                .addHeader("Authorization", "Bearer " + apiKey)
+                .build();
+        return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
+    }
+
+
+    /**
+     * 调用文件系统删除文件接口
+     */
+    public String queryHistoryMessage(DifyHistoryMessageDTO difyChatMessageDTO) throws IOException {
+        difyChatMessageDTO.setUser("1");
+        OkHttpClient okHttpClient = new OkHttpClient.Builder()
+                .connectTimeout(600, TimeUnit.SECONDS)
+                .writeTimeout(600, TimeUnit.SECONDS)
+                .readTimeout(600, TimeUnit.SECONDS)
+                .build();
+        String path = "messages?conversation_id=" + difyChatMessageDTO.getConversationId() + "&user=" + difyChatMessageDTO.getUser() + "&limit=" + difyChatMessageDTO.getLimit();
+        if (difyChatMessageDTO.getFirstId() != null) {
+            path += "&first_id=" + difyChatMessageDTO.getFirstId();
+        }
+        Request request = new Request.Builder()
+                .url(url + path)
+                .get()
+                .addHeader("Authorization", "Bearer " + apiKey)
+                .build();
+        return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
+    }
+
+    public Flux<String> chatMessageStream(DifyChatMessageDTO difyChatMessageDTO) {
+        Gson gson = new GsonBuilder()
+                .disableHtmlEscaping() // 禁用 HTML 转义
+                .setPrettyPrinting()
+                .create();
+
+        return WebClient.create().post().uri(url + "chat-messages").header("Authorization", "Bearer " + apiKey).header(HttpHeaders.CONTENT_TYPE, "application/json").bodyValue(gson.toJson(difyChatMessageDTO))
+                .retrieve().bodyToFlux(String.class) // 接收原始字节
+                .map(string -> {
+                    String chinese = "";
+                    try {
+                        ObjectMapper mapper = new ObjectMapper();
+                        JsonNode node = mapper.readTree(string);
+                        String prettyJson = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(node);
+
+                        chinese = prettyJson;
+                    } catch (Exception e) {
+
+                    }
+                    return chinese;
+                })// 这里指定编码
+                .doOnNext(System.out::println).doFinally(data -> {
+                    System.out.println("数据接收完毕,可以在这里执行后续操作");
+                });
+    }
+
+
+    public Flux<String> getOkhttp(ChatMessageDTO chatMessageDTO) {
+        Integer projectId = chatMessageDTO.getProjectId();
+        String conversationId = chatMessageDTO.getConversationId();
+        String userId = "1";
+        String query = chatMessageDTO.getQuery();
+        if (conversationId == null) {
+            conversationId = difySessionService.getSessionId(projectId, userId);
+        }
+
+        String temConversationId = conversationId;
+        OkHttpClient client = new OkHttpClient.Builder()
+                .connectTimeout(600, TimeUnit.SECONDS)
+                .writeTimeout(600, TimeUnit.SECONDS)
+                .readTimeout(600, TimeUnit.SECONDS)
+                .build();
+
+        DifyChatMessageDTO difyChatMessageDTO = new DifyChatMessageDTO();
+        Map<String, Object> map = new HashMap<>();
+        String fileContent = this.getConfression(projectId);
+        String inventionPoint = this.getInventPoint(projectId);
+        map.put("file_path", fileContent);
+        map.put("invention_point", inventionPoint);
+        difyChatMessageDTO.setInputs(map);
+        difyChatMessageDTO.setConversationId(conversationId);
+        difyChatMessageDTO.setResponseMode("streaming");
+        difyChatMessageDTO.setUser(userId);
+        difyChatMessageDTO.setQuery(query);
+        difyChatMessageDTO.setFiles(new ArrayList<>());
+
+        String param = new Gson().toJson(difyChatMessageDTO);
+        RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), param);
+        Request request = this.getChatMessageRequest(requestBody);
+        return Flux.create(emitter -> {
+            client.newCall(request).enqueue(new Callback() {
+                @Override
+                public void onFailure(Call call, IOException e) {
+                    emitter.error(e);
+                }
+
+                @Override
+                public void onResponse(Call call, Response response) throws IOException {
+                    if (!response.isSuccessful()) {
+                        emitter.error(new IOException("Unexpected code: " + response));
+                        return;
+                    }
+
+                    try (Reader reader = response.body().charStream()) {
+                        BufferedReader bufferedReader = new BufferedReader(reader);
+                        String line;
+                        String temConversationId2 = temConversationId;
+                        String prefixToRemove = "data: ";
+                        while ((line = bufferedReader.readLine()) != null) {
+                            if (line.isEmpty()) {
+                                continue;
+                            }
+                            if (line.startsWith(prefixToRemove)) {
+                                line = line.substring(prefixToRemove.length());
+                            }
+                            if (temConversationId2 == null) {
+                                try {
+                                    JSONObject jsonObject = JSON.parseObject(line);
+                                    temConversationId2 = jsonObject.get("conversation_id").toString();
+                                    difySessionService.addDifySession(projectId, userId, temConversationId2);
+                                } catch (Exception e) {
+                                }
+
+                            }
+                            emitter.next(line); // 将每行数据发送到 Flux
+                        }
+                    } catch (IOException e) {
+                        emitter.error(e);
+                    } finally {
+                        emitter.complete();
+                    }
+                }
+            });
+        });
+    }
+
+
+    public String getInventPoint(Integer projectId) {
+        String re = "";
+        TechnicalCase technicalCase = technicalCaseService.getByProjectId(projectId);
+        if (technicalCase != null) {
+            if (technicalCase.getInventionPoint() != null) {
+                re = technicalCase.getInventionPoint();
+            }
+        }
+        return re;
+    }
+
+    public String getConfression(Integer projectId) {
+        String url = "";
+        AssoProjectConfession assoProjectConfession = assoProjectConfessionService.queryAssoProjectConfession(projectId);
+        if (assoProjectConfession != null) {
+            url = fileDownloadUrl + assoProjectConfession.getFileGuid();
+        }
+
+        return url;
+    }
+
+    public Request getChatMessageRequest(RequestBody requestBody) {
+        Request request = new Request.Builder()
+                .url(url + "chat-messages")
+                .addHeader("Authorization", "Bearer " + apiKey).addHeader(HttpHeaders.CONTENT_TYPE, "application/json")
+                .post(requestBody)
+                .build();
+        return request;
+    }
+
+    public JSONObject stopMessage(String taskId) throws IOException {
+        OkHttpClient client = new OkHttpClient.Builder()
+                .connectTimeout(60, TimeUnit.SECONDS)
+                .writeTimeout(60, TimeUnit.SECONDS)
+                .readTimeout(60, TimeUnit.SECONDS)
+                .build();
+        DifyChatMessageDTO difyChatMessageDTO = new DifyChatMessageDTO();
+        difyChatMessageDTO.setUser("1");
+        String param = new Gson().toJson(difyChatMessageDTO);
+        RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), param);
+        Request request = new Request.Builder()
+                .url(url + "chat-messages/" + taskId + "/stop")
+                .addHeader("Authorization", "Bearer " + apiKey).addHeader(HttpHeaders.CONTENT_TYPE, "application/json")
+                .post(requestBody)
+                .build();
+        String json = Objects.requireNonNull(client.newCall(request).execute().body()).string();
+        JSONObject jsonObject = JSONObject.parseObject(json);
+        return jsonObject;
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    public Map<String, Object> generateInventionPoint(ChatMessageDTO chatMessageDTO) throws IOException {
+        Integer projectId = chatMessageDTO.getProjectId();
+        String query = "生成发明点";
+        String userId = "1";
+        String conversationId = chatMessageDTO.getConversationId();
+        DifyChatMessageDTO difyChatMessageDTO = new DifyChatMessageDTO();
+        Map<String, Object> map = new HashMap<>();
+        String fileContent = this.getConfression(projectId);
+        map.put("file_path", fileContent);
+        difyChatMessageDTO.setInputs(map);
+        difyChatMessageDTO.setConversationId(conversationId);
+        difyChatMessageDTO.setResponseMode("blocking");
+        difyChatMessageDTO.setUser(userId);
+        difyChatMessageDTO.setQuery(query);
+        difyChatMessageDTO.setFiles(new ArrayList<>());
+
+
+        OkHttpClient client = new OkHttpClient.Builder()
+                .connectTimeout(600, TimeUnit.SECONDS)
+                .writeTimeout(600, TimeUnit.SECONDS)
+                .readTimeout(600, TimeUnit.SECONDS)
+                .build();
+        String param = new Gson().toJson(difyChatMessageDTO);
+        RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), param);
+        Request request = this.getChatMessageRequest(requestBody);
+        String res = Objects.requireNonNull(client.newCall(request).execute().body()).string();
+        JSONObject jsonObject = JSONObject.parseObject(res);
+        String inventionPoint = jsonObject.get("answer").toString();
+        inventionPoint = DataUtils.getMarkDownText(inventionPoint);
+        if (conversationId == null) {
+            conversationId = jsonObject.get("conversation_id").toString();
+            difySessionService.addDifySession(projectId, userId, conversationId);
+        }
+        Map<String, Object> map1 = new HashMap<>();
+        map1.put("invention_point", inventionPoint);
+        technicalCaseService.updateInventionPoint(projectId, inventionPoint);
+        map1.put("conversation_id", conversationId);
+        return map1;
+    }
+}

+ 2 - 1
src/main/java/cn/cslg/pas/service/common/FileManagerService.java

@@ -3,6 +3,7 @@ package cn.cslg.pas.service.common;
 import cn.cslg.pas.common.dto.FMSDeleteFileDTO;
 import cn.cslg.pas.common.dto.FMSDeleteFileDTO;
 import cn.cslg.pas.common.model.cronModel.SystemFile;
 import cn.cslg.pas.common.model.cronModel.SystemFile;
 import cn.cslg.pas.common.utils.CustomizeFileUtils;
 import cn.cslg.pas.common.utils.CustomizeFileUtils;
+import cn.cslg.pas.service.business.TechnicalCaseService;
 import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.io.FileUtil;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
@@ -40,7 +41,7 @@ public class FileManagerService {
     private String FMSUrl;
     private String FMSUrl;
     @Value("${FileSource}")
     @Value("${FileSource}")
     private String FileSource;
     private String FileSource;
-
+    private TechnicalCaseService technicalCaseService;;
     /**
     /**
      * 调用文件系统上传文件接口
      * 调用文件系统上传文件接口
      *
      *

+ 42 - 0
src/main/java/cn/cslg/pas/service/dify/DifySessionService.java

@@ -0,0 +1,42 @@
+package cn.cslg.pas.service.dify;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import cn.cslg.pas.domain.dify.DifySession;
+import cn.cslg.pas.mapper.dify.DifySessionMapper;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author admin
+ * @description 针对表【dify_session(会话表)】的数据库操作Service实现
+ * @createDate 2025-04-09 11:18:33
+ */
+@Service
+public class DifySessionService extends ServiceImpl<DifySessionMapper, DifySession> {
+    public String getSessionId(Integer projectId, String userId) {
+        String id = null;
+        LambdaQueryWrapper<DifySession> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(DifySession::getProjectId, projectId)
+                .eq(DifySession::getCreateId, userId);
+        DifySession difySession = this.getOne(queryWrapper, false);
+        if (difySession != null) {
+            id = difySession.getSessionId();
+        }
+        return id;
+    }
+
+    public Integer addDifySession(Integer projectId, String userId, String sessionId) {
+        DifySession difySession = new DifySession();
+        difySession.setSessionId(sessionId);
+        difySession.setCreateId(userId);
+        difySession.setProjectId(projectId);
+        difySession.insert();
+        return difySession.getId();
+    }
+
+
+}
+
+
+
+

+ 110 - 0
src/main/java/cn/cslg/pas/service/report/AssoProjectConfessionService.java

@@ -0,0 +1,110 @@
+package cn.cslg.pas.service.report;
+
+import cn.cslg.pas.common.dto.AddNoveltyProjectDTO;
+import cn.cslg.pas.common.model.cronModel.SystemFile;
+import cn.cslg.pas.common.model.novelty.AddConfessionDTO;
+import cn.cslg.pas.common.utils.CacheUtils;
+import cn.cslg.pas.common.utils.LoginUtils;
+import cn.cslg.pas.exception.ExceptionEnum;
+import cn.cslg.pas.exception.XiaoShiException;
+import cn.cslg.pas.service.business.NoveltyProjectService;
+import cn.cslg.pas.service.business.TechnicalCaseService;
+import cn.cslg.pas.service.common.FileManagerService;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import cn.cslg.pas.domain.report.AssoProjectConfession;
+
+import cn.cslg.pas.mapper.report.AssoProjectConfessionMapper;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @author admin
+ * @description 针对表【asso_project_confession(技术交底书表)】的数据库操作Service实现
+ * @createDate 2025-04-09 11:33:33
+ */
+@Service
+@RequiredArgsConstructor
+public class AssoProjectConfessionService extends ServiceImpl<AssoProjectConfessionMapper, AssoProjectConfession> {
+    private final LoginUtils loginUtils;
+    private final CacheUtils cacheUtils;
+    private final FileManagerService fileManagerService;
+    private final NoveltyProjectService noveltyProjectService;
+    private final TechnicalCaseService technicalCaseService;
+
+    public Integer addProjectConfession(AddConfessionDTO addConfessionDTO) {
+        Integer projectId = addConfessionDTO.getProjectId();
+        String fileGuid = addConfessionDTO.getFileGuid();
+        if (projectId != null && fileGuid == null) {
+            this.rmProjectConfession(projectId);
+            return projectId;
+        }
+        if (projectId == null) {
+            AddNoveltyProjectDTO addNoveltyProjectDTO = new AddNoveltyProjectDTO();
+            projectId = noveltyProjectService.addNoveltyProject(addNoveltyProjectDTO);
+            technicalCaseService.updateInventionPoint(projectId, "");
+
+        }
+        this.updateProjectConfession(projectId, fileGuid);
+        return projectId;
+    }
+
+    public SystemFile queryConfession(Integer projectId) {
+        AssoProjectConfession assoProjectConfession = this.queryAssoProjectConfession(projectId);
+        if (assoProjectConfession == null) {
+            return new SystemFile();
+        }
+        String fileGuid = assoProjectConfession.getFileGuid();
+        SystemFile systemFile = null;
+        try {
+            String res = fileManagerService.getSystemFileFromFMS(Arrays.asList(fileGuid));
+            List<SystemFile> systemFiles = JSONObject.parseArray(res, SystemFile.class);
+            if (systemFiles != null && !systemFiles.isEmpty()) {
+                systemFile = systemFiles.get(0);
+            }
+        } catch (Exception e) {
+        }
+
+        return systemFile;
+    }
+
+    public AssoProjectConfession queryAssoProjectConfession(Integer projectId) {
+        LambdaQueryWrapper<AssoProjectConfession> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(AssoProjectConfession::getProjectId, projectId);
+        AssoProjectConfession assoProjectConfession = this.getOne(queryWrapper, false);
+        return assoProjectConfession;
+    }
+
+    public void adProjectConfession(Integer projectId, String fileGuid) {
+        AssoProjectConfession assoProjectConfession = new AssoProjectConfession();
+        assoProjectConfession.setProjectId(projectId);
+        assoProjectConfession.setFileGuid(fileGuid);
+        assoProjectConfession.insert();
+    }
+
+    public void rmProjectConfession(Integer projectId) {
+        LambdaQueryWrapper<AssoProjectConfession> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(AssoProjectConfession::getProjectId, projectId);
+        this.remove(queryWrapper);
+    }
+
+    public void updateProjectConfession(Integer projectId, String fileGuid) {
+        LambdaQueryWrapper<AssoProjectConfession> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(AssoProjectConfession::getProjectId, projectId);
+        AssoProjectConfession assoProjectConfession = this.getOne(queryWrapper, false);
+        if (assoProjectConfession == null) {
+            this.adProjectConfession(projectId, fileGuid);
+        } else {
+            assoProjectConfession.setFileGuid(fileGuid);
+            assoProjectConfession.updateById();
+        }
+    }
+}
+
+
+
+

+ 40 - 36
src/main/resources/application-dev.yml

@@ -5,18 +5,18 @@ spring:
     username: admin
     username: admin
     password: 123456
     password: 123456
   data:
   data:
-   redis:
-     host: 192.168.2.24
-     port: 6379
-     database: 3
-     password: Xx0GWxdWQJxx6Swe
-     lettuce:
-       pool:
-         max-active: 20
-         max-idle: 20
-         min-idle: 0
-         max-wait: -1ms
-     timeout: 2000ms
+    redis:
+      host: 192.168.2.24
+      port: 6379
+      database: 3
+      password: Xx0GWxdWQJxx6Swe
+      lettuce:
+        pool:
+          max-active: 20
+          max-idle: 20
+          min-idle: 0
+          max-wait: -1ms
+      timeout: 2000ms
   datasource:
   datasource:
     url: jdbc:mysql://192.168.2.24:3306/pas_prod2?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8
     url: jdbc:mysql://192.168.2.24:3306/pas_prod2?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8
     username: root
     username: root
@@ -31,30 +31,30 @@ spring:
         exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"
         exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"
   quartz:
   quartz:
     #相关属性配置
     #相关属性配置
-#    properties:
-#      org:
-#        quartz:
-#          scheduler:
-#            instanceName: DefaultQuartzScheduler
-#            instanceId: AUTO
-#          jobStore:
-#            class: org.springframework.scheduling.quartz.LocalDataSourceJobStore
-#            driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
-#            tablePrefix: QRTZ_
-#            isClustered: false
-#            clusterCheckinInterval: 10000
-#            useProperties: false
-#          threadPool:
-#            class: org.quartz.simpl.SimpleThreadPool
-#            threadCount: 10
-#            threadPriority: 5
-#            threadsInheritContextClassLoaderOfInitializingThread: true
-#          dataSource:
-#            default:
-#              URL: jdbc:mysql://192.168.2.24:3306/pas_prod2?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8
-#              user: root
-#              password: rrzTwWAYX8Gxh5JH
-#              driver: com.mysql.jdbc.Driver
+    #    properties:
+    #      org:
+    #        quartz:
+    #          scheduler:
+    #            instanceName: DefaultQuartzScheduler
+    #            instanceId: AUTO
+    #          jobStore:
+    #            class: org.springframework.scheduling.quartz.LocalDataSourceJobStore
+    #            driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
+    #            tablePrefix: QRTZ_
+    #            isClustered: false
+    #            clusterCheckinInterval: 10000
+    #            useProperties: false
+    #          threadPool:
+    #            class: org.quartz.simpl.SimpleThreadPool
+    #            threadCount: 10
+    #            threadPriority: 5
+    #            threadsInheritContextClassLoaderOfInitializingThread: true
+    #          dataSource:
+    #            default:
+    #              URL: jdbc:mysql://192.168.2.24:3306/pas_prod2?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8
+    #              user: root
+    #              password: rrzTwWAYX8Gxh5JH
+    #              driver: com.mysql.jdbc.Driver
 
 
     #数据库方式
     #数据库方式
     job-store-type: memory
     job-store-type: memory
@@ -68,6 +68,7 @@ PASUrl: http://localhost:8879
 FMSUrl: http://192.168.2.24:8803
 FMSUrl: http://192.168.2.24:8803
 WDUrl: http://1.116.113.26:81
 WDUrl: http://1.116.113.26:81
 PythonUrl: http://192.168.2.24:8001
 PythonUrl: http://192.168.2.24:8001
+FileDownloadUrl: http://192.168.2.24:8803/fileManager/downloadFile?fileId=
 FileSource: 1
 FileSource: 1
 ES:
 ES:
   patentVector: patent_vector
   patentVector: patent_vector
@@ -84,3 +85,6 @@ management:
   endpoint:
   endpoint:
     health:
     health:
       show-details: always
       show-details: always
+DIFY:
+  apiKey: app-DDGJt4QUmzlc2aFQ5voOAXIj
+  url: http://192.168.2.24/v1/

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 77 - 0
src/test/java/cn/cslg/pas/service/common/DifyServiceTest.java