From c00956f6649cc13b094ec83cc3121e7cb0027b3c Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期一, 15 四月 2024 22:15:21 +0800
Subject: [PATCH] 盟祺-查询导出修改

---
 Tiger.Business/WMS/MengQi/Biz.Mq.SNData.cs |   62 +++++++++++++++++++++++++++++++
 1 files changed, 62 insertions(+), 0 deletions(-)

diff --git a/Tiger.Business/WMS/MengQi/Biz.Mq.SNData.cs b/Tiger.Business/WMS/MengQi/Biz.Mq.SNData.cs
index 2dcdbf7..978ab99 100644
--- a/Tiger.Business/WMS/MengQi/Biz.Mq.SNData.cs
+++ b/Tiger.Business/WMS/MengQi/Biz.Mq.SNData.cs
@@ -89,6 +89,68 @@
                 res.Data = pageList;
                 return res;
             }
+
+            /// <summary>
+            /// 鑾峰彇鎵�鏈夋潯鐮侊紝鍘熷巶鏉$爜鍜屽鎴锋潯鐮佸湪鍚屼竴琛岋紝鎸夋潯浠�
+            /// </summary>
+            /// <param name="where"></param>
+            /// <returns></returns>
+            public async Task<ApiAction<List<SNData_His>>> GetAllSNDataHis(SNDataWhere where)
+            {
+                var res = new ApiAction<List<SNData_His>>();
+                List<SNData_His> list = new List<SNData_His>();
+                try
+                {
+                    DateTime StartTime = DateTime.Now;
+                    DateTime EndTime = DateTime.Now;
+                    string[] strTime = where.strStartEnd?.Split(',');
+                    if (!string.IsNullOrEmpty(where.strStartEnd)) { StartTime = Convert.ToDateTime(strTime[0].ToString()); EndTime = strTime.Length == 2 ? Convert.ToDateTime(strTime[1].ToString()) : DateTime.MinValue; }
+                    RefAsync<int> total = 0;
+                    list = await Db.Queryable<SNData_His>()
+                        .WhereIF(!string.IsNullOrEmpty(where.strStartEnd), x => Convert.ToDateTime(x.ScanTime) > StartTime)
+                        .WhereIF(!string.IsNullOrEmpty(where.strStartEnd) && strTime.Length == 2, x => Convert.ToDateTime(x.ScanTime) < EndTime)
+                        .WhereIF(!string.IsNullOrEmpty(where.model), x => x.ModelCode == where.model)
+                        .WhereIF(!string.IsNullOrEmpty(where.customerCode), x => x.CustomerCode.Equals(where.customerCode))
+                        .ToListAsync();
+                }
+                catch (Exception ex)
+                {
+                    res.CatchExceptionWithLog(ex, "鏌ヨ寮傚父");
+                }
+                res.Data = list;
+                return res;
+            }
+
+            /// <summary>
+            /// 鑾峰彇鎵�鏈夋潯鐮侊紝鍘熷巶鏉$爜鍜屽鎴锋潯鐮佸垎寮�涓よ锛屾寜鏉′欢
+            /// </summary>
+            /// <param name="where"></param>
+            /// <returns></returns>
+            public async Task<ApiAction<List<SNData>>> GetAllSNData(SNDataWhere where)
+            {
+                var res = new ApiAction<List<SNData>>();
+                List<SNData> list = new List<SNData>();
+                try
+                {
+                    DateTime StartTime = DateTime.Now;
+                    DateTime EndTime = DateTime.Now;
+                    string[] strTime = where.strStartEnd?.Split(',');
+                    if (!string.IsNullOrEmpty(where.strStartEnd)) { StartTime = Convert.ToDateTime(strTime[0].ToString()); EndTime = strTime.Length == 2 ? Convert.ToDateTime(strTime[1].ToString()) : DateTime.MinValue; }
+                    RefAsync<int> total = 0;
+                    list = await Db.Queryable<SNData>()
+                        .WhereIF(!string.IsNullOrEmpty(where.strStartEnd), x => Convert.ToDateTime(x.CREATE_TIME) > StartTime)
+                        .WhereIF(!string.IsNullOrEmpty(where.strStartEnd) && strTime.Length == 2, x => Convert.ToDateTime(x.CREATE_TIME) < EndTime)
+                        .WhereIF(!string.IsNullOrEmpty(where.model), x => x.ItemCode == where.model)
+                        .WhereIF(!string.IsNullOrEmpty(where.customerCode), x => x.CustomerCode.Equals(where.customerCode))
+                        .ToListAsync();
+                }
+                catch (Exception ex)
+                {
+                    res.CatchExceptionWithLog(ex, "鏌ヨ寮傚父");
+                }
+                res.Data = list;
+                return res;
+            }
         }
     }
 }

--
Gitblit v1.9.3