From 5cf8be1f30878aeb2af568f471949d0b9190036a Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期五, 19 十二月 2025 16:12:12 +0800
Subject: [PATCH] CTU故障信息接口查询,故障上报至WMS,任务下发优化

---
 项目代码/WCSServices/WIDESEAWCS_BasicInfoService/LocationInfoService.cs |   48 ++++++++++++++++++++++++++++++++++--------------
 1 files changed, 34 insertions(+), 14 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..a554c4e 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,22 +1,17 @@
-锘縰sing HslCommunication.WebSocket;
-using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup;
-using OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
+锘縰sing Magicodes.ExporterAndImporter.Core;
+using Magicodes.ExporterAndImporter.Excel;
+using NPOI.SS.UserModel;
+using NPOI.Util.Collections;
+using NPOI.XSSF.UserModel;
 using SqlSugar;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using WIDESEA_Core;
-using WIDESEA_Core.Enums;
+using System.Reflection;
 using WIDESEA_DTO.Basic;
 using WIDESEAWCS_Common;
-using WIDESEAWCS_Common.WareHouseEnum;
+using WIDESEAWCS_Common.Helper;
 using WIDESEAWCS_Core;
 using WIDESEAWCS_Core.BaseRepository;
 using WIDESEAWCS_Core.BaseServices;
 using WIDESEAWCS_Core.Helper;
-using WIDESEAWCS_Core.Utilities;
 using WIDESEAWCS_IBasicInfoRepository;
 using WIDESEAWCS_IBasicInfoService;
 using WIDESEAWCS_Model.Models;
@@ -29,7 +24,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 +107,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 +183,30 @@
                 return WebResponseContent.Instance.Error(ex.Message);
             }
         }
+        public override WebResponseContent Export(PageDataOptions options)
+        {
+            WebResponseContent content = new WebResponseContent();
+            try
+            {
+                string savePath = AppDomain.CurrentDomain.BaseDirectory + "ExcelExport";
+
+                // 纭繚鐩綍瀛樺湪
+                if (!Directory.Exists(savePath))
+                    Directory.CreateDirectory(savePath);
+
+                // 鑾峰彇鏁版嵁
+                ISugarQueryable<Dt_LocationInfo> query = BaseDal.Db.Queryable<Dt_LocationInfo>();
+                var dataList = query.ToList();
+                var properties = typeof(Dt_LocationInfo).GetProperties();
+
+                string filePath = TExportHelper.GetExport(savePath, properties, dataList);
+                return WebResponseContent.Instance.OK(data: filePath);
+            }
+            catch (Exception ex)
+            {
+                content = WebResponseContent.Instance.Error(ex.Message);
+            }
+            return content;
+        }
     }
 }

--
Gitblit v1.9.3