From ba8aa925e7901381ceb394adb53eca8723d1c4c5 Mon Sep 17 00:00:00 2001
From: leiqunqing <zhengqifeng@hnkhzn.com>
Date: 星期一, 19 一月 2026 11:05:49 +0800
Subject: [PATCH] 完善工位界面

---
 代码管理/WIDESEAWCS_Server/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/ProcessInfoService.cs |   45 ++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 40 insertions(+), 5 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WIDESEAWCS_Server/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/ProcessInfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WIDESEAWCS_Server/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/ProcessInfoService.cs"
index 81866db..098bb4e 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WIDESEAWCS_Server/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/ProcessInfoService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WIDESEAWCS_Server/WIDESEAWCS_Server/WIDESEAWCS_BasicInfoService/ProcessInfoService.cs"
@@ -1,10 +1,9 @@
-锘縰sing System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+锘縰sing OfficeOpenXml;
+using Spire.Xls;
+using WIDESEAWCS_Core;
 using WIDESEAWCS_Core.BaseRepository;
 using WIDESEAWCS_Core.BaseServices;
+using WIDESEAWCS_DTO.BasicInfo;
 using WIDESEAWCS_Model.Models;
 
 namespace WIDESEAWCS_BasicInfoService
@@ -16,5 +15,41 @@
         }
 
         public IRepository<Dt_ProcessInfo> Repository => BaseDal;
+
+        /// <summary>
+        /// 涓嬭浇娴佺▼鍗�
+        /// </summary>
+        /// <param name="dt_ProcessInfo"></param>
+        /// <returns></returns>
+        public WebResponseContent ExportData(Dt_ProcessInfo dt_ProcessInfo)
+        {
+            
+                string fileName = $"{DateTime.Now.ToString("yyyyMMddHHssmm")}.xlsx";
+                string templatePath = $"{AppDomain.CurrentDomain.BaseDirectory}ExprotTemplate\\鍙戠數鏈哄脊鎬ф敮鎾戜俊鎭寲娴佺▼鍗�.xlsx";//妯℃澘璺緞
+                string savePath = $"{AppDomain.CurrentDomain.BaseDirectory}Download\\{fileName}";//淇濆瓨鏂囦欢璺緞
+
+                using Stream templateStream = new FileStream(templatePath, FileMode.Open);
+                using Stream saveStream = new FileStream(savePath, FileMode.Create);
+                using ExcelPackage package = new ExcelPackage(saveStream, templateStream);
+                ExcelWorksheet worksheet = package.Workbook.Worksheets["娴佺▼鍗�"];
+                worksheet.Cells[3, 5].Value = dt_ProcessInfo.ProductCode;//鎴愬搧缂栧彿
+
+                package.Save();
+
+                string pdfFileName = $"{DateTime.Now.ToString("yyyyMMddHHssmm")}.pdf";
+                string pdfPath = $"{AppDomain.CurrentDomain.BaseDirectory}Download\\{pdfFileName}";
+
+                Workbook workbook = new Workbook();
+                workbook.LoadFromFile(savePath);
+
+                // 杞崲绗竴涓伐浣滆〃鍒癙DF
+                workbook.SaveToFile(pdfPath, FileFormat.PDF);
+                return WebResponseContent.Instance.OK(data: new { path = pdfPath, fileName = pdfFileName });
+             
+            }
+
+        
+
+
     }
 }

--
Gitblit v1.9.3