From d0791ab04a33bee7fbe952117a205c28eb354634 Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Mon, 22 Sep 2025 14:20:54 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E9=9B=86=E6=88=90?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=AF=BC=E5=87=BA=E5=8D=95=E4=B8=AA=E9=9B=86?= =?UTF-8?q?=E6=88=90=E6=97=B6=E4=BD=BF=E7=94=A8=E9=9B=86=E6=88=90=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E4=BD=9C=E4=B8=BA=E5=AF=BC=E5=87=BA=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E7=9A=84=E5=89=8D=E7=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1515938715762688]集成管理导出单个集成时使用集成名称作为导出文件名称的前缀 http://192.168.0.96:8090/demo/rdm.html#/story-detail/939050947543040/939050947543042/1515938715762688 --- .../tenant/api/integration/IntegrationExportApi.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/neatlogic/module/tenant/api/integration/IntegrationExportApi.java b/src/main/java/neatlogic/module/tenant/api/integration/IntegrationExportApi.java index 4839f295..7e4d6ba9 100644 --- a/src/main/java/neatlogic/module/tenant/api/integration/IntegrationExportApi.java +++ b/src/main/java/neatlogic/module/tenant/api/integration/IntegrationExportApi.java @@ -62,7 +62,7 @@ public class IntegrationExportApi extends PrivateBinaryStreamApiComponentBase { return null; } - @Input({@Param(name = "uuidList", type = ApiParamType.JSONARRAY, desc = "集成配置uuid列表", isRequired = true)}) + @Input({@Param(name = "uuidList", type = ApiParamType.JSONARRAY, desc = "集成配置uuid列表", minSize = 1, isRequired = true)}) @Description(desc = "导出集成设置信息") @Override public Object myDoService(JSONObject paramObj, HttpServletRequest request, HttpServletResponse response) throws Exception { @@ -72,7 +72,14 @@ public class IntegrationExportApi extends PrivateBinaryStreamApiComponentBase { if (CollectionUtils.isNotEmpty(uuidList)) { throw new IntegrationNotFoundException(uuidList); } - String fileName = FileUtil.getEncodedFileName("集成配置." + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".pak"); + String prefix = "集成配置"; + if (existedUuidList.size() == 1) { + IntegrationVo integration = integrationMapper.getIntegrationByUuid(existedUuidList.get(0)); + if (integration != null) { + prefix = integration.getName(); + } + } + String fileName = FileUtil.getEncodedFileName(prefix + "." + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".pak"); response.setContentType("application/zip"); response.setHeader("Content-Disposition", " attachment; filename=\"" + fileName + "\""); try (ZipOutputStream zos = new ZipOutputStream(response.getOutputStream())) { -- Gitee