From cf3482e6a4d40713cc09d107f11092c8db2e245a Mon Sep 17 00:00:00 2001
From: buhuazhen <hua100783@gmail.com>
Date: 星期三, 27 五月 2026 17:18:40 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_天津_阳光彩印' into dev_天津_阳光彩印

---
 src/main/java/com/ruoyi/production/controller/ProductionPrintOrderController.java |   34 +++++++++++++++++++++++++++++-----
 1 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/src/main/java/com/ruoyi/production/controller/ProductionPrintOrderController.java b/src/main/java/com/ruoyi/production/controller/ProductionPrintOrderController.java
index 973f9de..94a5cb7 100644
--- a/src/main/java/com/ruoyi/production/controller/ProductionPrintOrderController.java
+++ b/src/main/java/com/ruoyi/production/controller/ProductionPrintOrderController.java
@@ -1,14 +1,17 @@
 package com.ruoyi.production.controller;
 
+import com.ruoyi.framework.web.domain.R;
 import com.ruoyi.production.dto.SaveProductionPrintOrderDto;
 import com.ruoyi.production.pojo.ProductionPrintOrder;
 import com.ruoyi.production.service.ProductionPrintOrderService;
 import io.swagger.annotations.Api;
 import lombok.RequiredArgsConstructor;
-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 lombok.SneakyThrows;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletResponse;
+import java.net.URLEncoder;
 
 /**
  * @author buhuazhen
@@ -24,8 +27,29 @@
     private final ProductionPrintOrderService productionPrintOrderService;
 
     @PostMapping("/save")
-    public void save(@RequestBody SaveProductionPrintOrderDto dto){
+    public R save(@RequestBody SaveProductionPrintOrderDto dto) {
         productionPrintOrderService.save(dto);
+        return R.ok();
     }
 
+
+    @PostMapping("/getByProductWordId/{id}")
+    public ProductionPrintOrder getByProductWordId(@PathVariable Long id) {
+        return productionPrintOrderService.getByProductWordId(id);
+    }
+
+    @PostMapping("/export/{id}")
+    @SneakyThrows
+    public void export(@PathVariable Long id, HttpServletResponse response) {
+        byte[] bytes = productionPrintOrderService.exportPrintExcelByWordId(id);
+        String fileName = "鍗板埛瀹氬嵃鍗�.xlsx";
+        response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
+        response.setCharacterEncoding("utf-8");
+        // 瑙e喅涓枃鏂囦欢鍚嶄贡鐮�
+        response.setHeader("Content-Disposition",
+                "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
+        ServletOutputStream out = response.getOutputStream();
+        out.write(bytes);
+        out.flush();
+    }
 }

--
Gitblit v1.9.3