From 6d3ea08855337c0cfcc60df2903d3431611c7097 Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期六, 13 十二月 2025 17:36:56 +0800
Subject: [PATCH] 优化程序,输送线入库按钮对接

---
 项目代码/WCSServices/WIDESEAWCS_BasicInfoService/LocationInfoService.cs |   59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 57 insertions(+), 2 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCSServices/WIDESEAWCS_BasicInfoService/LocationInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCSServices/WIDESEAWCS_BasicInfoService/LocationInfoService.cs"
index d26efaa..97ea408 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCSServices/WIDESEAWCS_BasicInfoService/LocationInfoService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCSServices/WIDESEAWCS_BasicInfoService/LocationInfoService.cs"
@@ -1,4 +1,8 @@
 锘縰sing HslCommunication.WebSocket;
+using Magicodes.ExporterAndImporter.Core;
+using Magicodes.ExporterAndImporter.Excel;
+using MathNet.Numerics.Statistics.Mcmc;
+using NPOI.Util.Collections;
 using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup;
 using OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
 using SqlSugar;
@@ -29,7 +33,7 @@
 
         public DateTime DateTime { get; set; }
     }
-    public partial class LocationInfoService : ServiceBase<Dt_LocationInfo, ILocationInfoRepository>, ILocationInfoService
+    public class LocationInfoService : ServiceBase<Dt_LocationInfo, ILocationInfoRepository>, ILocationInfoService
     {
         private readonly IUnitOfWorkManage _unitOfWorkManage;
         public ILocationInfoRepository Repository => BaseDal;
@@ -112,8 +116,8 @@
 
                 Dictionary<string, OrderByType> orderBy = new Dictionary<string, OrderByType>()
                 {
-                    { nameof(Dt_LocationInfo.Row),OrderByType.Asc },
                     { nameof(Dt_LocationInfo.Layer),OrderByType.Asc },
+                    { nameof(Dt_LocationInfo.Row),OrderByType.Asc },
                     { nameof(Dt_LocationInfo.Columns),OrderByType.Desc },
                 };
 
@@ -188,5 +192,56 @@
                 return WebResponseContent.Instance.Error(ex.Message);
             }
         }
+        public override WebResponseContent Export(PageDataOptions options)
+        {
+            WebResponseContent content = new WebResponseContent();
+            try
+            {
+                string savePath = AppDomain.CurrentDomain.BaseDirectory + $"ExcelExport";
+                IExporter exporter = new ExcelExporter();
+                options.Page = 1;
+                options.Rows = 30;
+                options.Order = "asc";
+                options.Sort = "id";
+
+                string where = string.Empty;
+                ISugarQueryable<Dt_LocationInfo> sugarQueryable = BaseDal.Db.Queryable<Dt_LocationInfo>();
+                if (!string.IsNullOrEmpty(options.Wheres))
+                {
+                    try
+                    {
+                        List<SearchParameters> searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>();
+                        if (searchParametersList?.Any() == true)
+                        {
+                            foreach (var param in searchParametersList)
+                            {
+                                switch (param.Name)
+                                {
+                                    
+                                }
+                            }
+                        }
+                    }
+                    catch (Exception ex)
+                    {
+                    }
+                }
+
+                
+
+                byte[] data = exporter.ExportAsByteArray(sugarQueryable.ToList()).Result;
+
+                string fileName = "搴撲綅淇℃伅.xlsx";
+
+                FileHelper.WriteFile(savePath, fileName, data);
+
+                content = WebResponseContent.Instance.OK(data: savePath + "\\" + fileName);
+            }
+            catch (Exception ex)
+            {
+                content = WebResponseContent.Instance.Error(ex.Message);
+            }
+            return content;
+        }
     }
 }

--
Gitblit v1.9.3