|
@@ -15,6 +15,7 @@ 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.common.POIService;
|
|
|
import cn.cslg.pas.service.dify.DifySessionService;
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
@@ -22,15 +23,22 @@ 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.HttpServletRequest;
|
|
|
import jakarta.servlet.http.HttpServletResponse;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
+import org.springframework.core.io.InputStreamResource;
|
|
|
import org.springframework.http.MediaType;
|
|
|
+import org.springframework.http.ResponseEntity;
|
|
|
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.context.request.RequestAttributes;
|
|
|
+import org.springframework.web.context.request.RequestContextHolder;
|
|
|
+import org.springframework.web.context.request.ServletRequestAttributes;
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
|
|
import reactor.core.publisher.Flux;
|
|
|
|
|
@@ -47,6 +55,7 @@ import java.util.List;
|
|
|
public class DifyController {
|
|
|
private final DifyService difyService;
|
|
|
private final DifySessionService difySessionService;
|
|
|
+ private final POIService poiService;
|
|
|
@Autowired
|
|
|
private CacheUtils cacheUtils;
|
|
|
@Autowired
|
|
@@ -86,4 +95,16 @@ public class DifyController {
|
|
|
public Response generateInventionPoint(@RequestBody ChatMessageDTO chatMessageDTO) throws IOException {
|
|
|
return Response.success(difyService.generateInventionPoint(chatMessageDTO));
|
|
|
}
|
|
|
+
|
|
|
+ //
|
|
|
+ @RequestMapping(value = "/getCheckFile", method = RequestMethod.POST)
|
|
|
+ @Operation(summary = "获取质检文件")
|
|
|
+ public ResponseEntity<InputStreamResource> addConfessionSession(MultipartFile file) throws Exception {
|
|
|
+ RequestAttributes ra = RequestContextHolder.getRequestAttributes();
|
|
|
+ ServletRequestAttributes sra = (ServletRequestAttributes) ra;
|
|
|
+ HttpServletRequest httpRequest = sra.getRequest();
|
|
|
+ String a= httpRequest.getHeader("Content-Type");
|
|
|
+ System.out.println(a);
|
|
|
+ return poiService.exportCheckFile(file);
|
|
|
+ }
|
|
|
}
|