From 87981962b33096da6af6fab9eabf55ec7d032b52 Mon Sep 17 00:00:00 2001
From: sfd <sun.sunshine@163.com>
Date: 星期四, 22 五月 2025 17:56:56 +0800
Subject: [PATCH] 修改workshop 取值
---
aps-modules/aps-core/src/main/java/com/aps/core/controller/mainPlan/ApsGasPipelineMoController.java | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/controller/mainPlan/ApsGasPipelineMoController.java b/aps-modules/aps-core/src/main/java/com/aps/core/controller/mainPlan/ApsGasPipelineMoController.java
index 5f836fe..f99787f 100644
--- a/aps-modules/aps-core/src/main/java/com/aps/core/controller/mainPlan/ApsGasPipelineMoController.java
+++ b/aps-modules/aps-core/src/main/java/com/aps/core/controller/mainPlan/ApsGasPipelineMoController.java
@@ -12,10 +12,17 @@
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
+import lombok.SneakyThrows;
+import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.io.ByteArrayResource;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
import java.util.List;
/**
@@ -117,4 +124,24 @@
{
return toAjax(apsGasPipelineMoService.deleteApsGasPipelineMoByIds(ids));
}
+
+ /**
+ * 涓嬭浇姘斾綋棰勬祴鏁版嵁瀵煎叆妯℃澘
+ */
+ @SneakyThrows
+ @Operation(summary = "涓嬭浇姘斾綋宸ュ崟鏁版嵁瀵煎叆妯℃澘", description = "涓嬭浇姘斾綋宸ュ崟鏁版嵁瀵煎叆妯℃澘")
+// @RequiresPermissions("gasPipeline:mo:template")
+// @Log(title = "涓嬭浇姘斾綋宸ュ崟鏁版嵁瀵煎叆妯℃澘", businessType = BusinessType.EXPORT)
+ @GetMapping("/template")
+ public ResponseEntity<ByteArrayResource> exportTemplate() {
+ byte[] file = IOUtils.resourceToByteArray("/templates/姘斾綋宸ュ崟鏁版嵁妯℃澘v1.0.xlsx");
+ ByteArrayResource resource = new ByteArrayResource(file);
+ return ResponseEntity.ok()
+ .header("Access-Control-Expose-Headers", HttpHeaders.CONTENT_DISPOSITION)
+ .header(HttpHeaders.CONTENT_DISPOSITION,
+ String.format("attachment;filename=%s", URLEncoder.encode("姘斾綋宸ュ崟鏁版嵁妯℃澘.xlsx", StandardCharsets.UTF_8)))
+ .header(HttpHeaders.CONTENT_TYPE, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
+ .contentLength(file.length)
+ .body(resource);
+ }
}
--
Gitblit v1.9.3