From 91a570f21a0a2d459e5418d9d98a5bd83858b4cc Mon Sep 17 00:00:00 2001 From: wangzhijiang <1358525938@qq.com> Date: Fri, 29 Mar 2024 17:54:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E6=AF=94=E4=BA=9A=E8=BF=AA-?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E6=AF=94=E4=BA=9A=E8=BF=AA=E7=9A=84=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=8E=A5=E5=8F=A3=EF=BC=8C=E4=BC=A0=E5=8F=82=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=E4=BF=AE=E6=8C=89=E7=85=A7=E4=BB=96=E4=BB=AC=E7=9A=84?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=EF=BC=8C=E6=94=B9=E6=88=90URL=E4=BC=A0?= =?UTF-8?q?=E5=8F=82=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jero/modules/split/service/impl/FileSpiltService.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/byd-structuredplugins-serve/laws-modules/src/main/java/com/jero/modules/split/service/impl/FileSpiltService.java b/byd-structuredplugins-serve/laws-modules/src/main/java/com/jero/modules/split/service/impl/FileSpiltService.java index 8dfef8b..9dd5c46 100644 --- a/byd-structuredplugins-serve/laws-modules/src/main/java/com/jero/modules/split/service/impl/FileSpiltService.java +++ b/byd-structuredplugins-serve/laws-modules/src/main/java/com/jero/modules/split/service/impl/FileSpiltService.java @@ -61,6 +61,7 @@ import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; import org.springframework.web.client.RestTemplate; import org.springframework.core.io.Resource; +import org.springframework.web.util.UriComponentsBuilder; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import org.w3c.dom.NodeList; @@ -235,7 +236,12 @@ public class FileSpiltService { HttpEntity> requestEntity = new HttpEntity<>(params, headers); // 发送POST请求并获取响应 - ResponseEntity responseEntity = restTemplate.postForEntity(bydDownLoadFileUrl, requestEntity, byte[].class); +// ResponseEntity responseEntity = restTemplate.postForEntity(bydDownLoadFileUrl, requestEntity, byte[].class); + + Long fileIdLong = Long.valueOf(sarFileSplitInfoEO.getId()); + UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(bydDownLoadFileUrl).queryParam("fileId", fileIdLong); + // 发送POST请求并获取响应 + ResponseEntity responseEntity = restTemplate.postForEntity(builder.toUriString(), requestEntity, byte[].class); // 获取文件流 splitFileIs = new ByteArrayInputStream(responseEntity.getBody()); }catch (Exception ex){