From 72390e0230b64cd43fedf0ba8e17aba097568a4a Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期四, 26 六月 2025 16:36:13 +0800
Subject: [PATCH] 1

---
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Base/OutboundOrderService.cs |   51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 51 insertions(+), 0 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Base/OutboundOrderService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Base/OutboundOrderService.cs"
index b5ce69c..7f00344 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Base/OutboundOrderService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Base/OutboundOrderService.cs"
@@ -4,6 +4,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Linq.Expressions;
 using System.Text;
 using System.Threading.Tasks;
 using WIDESEA_Core;
@@ -47,6 +48,7 @@
                 BatchNo = x.FirstOrDefault()?.BatchNo ?? "",
                 MaterielCode = x.Key,
                 OrderQuantity = x.Sum(x => x.OrderQuantity),
+                MaterielName= x.FirstOrDefault()?.MaterielName ?? "",
                 Remark = x.FirstOrDefault(v => !string.IsNullOrEmpty(v.Remark))?.Remark ?? ""
             }).ToList();
             return AddOutboundOrder(outboundOrder);
@@ -141,5 +143,54 @@
             }
             return content;
         }
+
+        public WebResponseContent GetOutboundOrder(OutboundOrderGetDTO outboundOrderGetDTO)
+        {
+            WebResponseContent content = new WebResponseContent();
+            try
+            {
+                Expression<Func<Dt_OutboundOrder, bool>> expressionOrder = x => true;
+                if (!string.IsNullOrEmpty(outboundOrderGetDTO.OrderNo))
+                {
+                    expressionOrder = x => x.OrderNo.Contains(outboundOrderGetDTO.OrderNo);
+                }
+                int count = BaseDal.QueryData(x => x.OrderStatus == OutboundStatusEnum.鏈紑濮�.ObjToInt()).ToList().Count();
+                int maxPage = Convert.ToInt32(Math.Ceiling(count / 10.0));
+                if (outboundOrderGetDTO.pageNo <= maxPage)
+                {
+                    var outboundOrder = BaseDal.Db.Queryable<Dt_OutboundOrder>().Where(expressionOrder).OrderByDescending(x => x.CreateDate).Skip((outboundOrderGetDTO.pageNo - 1) * 10).Take(10).Select(x => new Dt_OutboundOrder { OrderNo = x.OrderNo, Id = x.Id, CreateDate = x.CreateDate, Creater = x.Creater }).ToList();
+
+                    content = WebResponseContent.Instance.OK(data: outboundOrder);
+                }
+                else
+                {
+                    content = WebResponseContent.Instance.OK(data: null, message: "宸插埌鏈�鍚庝竴椤�");
+                }
+            }
+            catch (Exception ex)
+            {
+                content = WebResponseContent.Instance.Error($"鏌ヨ鍑哄簱鍗曟嵁閿欒,閿欒淇℃伅:{ex.Message}");
+            }
+
+            return content;
+        }
+
+        public WebResponseContent GetOutboundOrderDetail(string OrderNo)
+        {
+            WebResponseContent content = new WebResponseContent();
+            try
+            {
+                Dt_OutboundOrder outboundOrder = BaseDal.QueryFirst(x => x.OrderNo == OrderNo);
+
+                var outboundOrderDetail = BaseDal.Db.Queryable<Dt_OutboundOrderDetail>().Where(x => x.OrderId == outboundOrder.Id).Take(10).Select(x => new Dt_OutboundOrderDetail {Id=x.Id, MaterielCode = x.MaterielCode, MaterielName = x.MaterielName, OrderQuantity = x.OrderQuantity, OverOutQuantity = x.OverOutQuantity, LockQuantity = x.LockQuantity }).ToList();
+
+                content = WebResponseContent.Instance.OK(data: outboundOrderDetail);
+            }
+            catch (Exception ex)
+            {
+                content = WebResponseContent.Instance.Error($"鏌ヨ鍑哄簱鍗曟嵁鏄庣粏閿欒,閿欒淇℃伅:{ex.Message}");
+            }
+            return content;
+        }
     }
 }

--
Gitblit v1.9.3