From b07472f884708a6bfdf63d999004bbf0bb5f00a8 Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期一, 17 十一月 2025 17:12:57 +0800
Subject: [PATCH] 新增分单功能、二维码打印及物料供应商管理页面

---
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_OrderServices/Dt_InboundOrderService.cs |   68 +++++++++++++++++++++++++++++++++-
 1 files changed, 66 insertions(+), 2 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_OrderServices/Dt_InboundOrderService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_OrderServices/Dt_InboundOrderService.cs"
index 13e300e..f4ab182 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_OrderServices/Dt_InboundOrderService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_OrderServices/Dt_InboundOrderService.cs"
@@ -7,6 +7,7 @@
 using WIDESEA_Core.BaseServices;
 using WIDESEA_Core.Const;
 using WIDESEA_Core.Helper;
+using WIDESEA_IBusinessesRepository;
 using WIDESEA_IOrderRepository;
 using WIDESEA_IOrderServices;
 using WIDESEA_IServices;
@@ -22,14 +23,31 @@
     {
         private readonly IUnitOfWorkManage _unitOfWorkManage;
         private readonly ISys_ConfigService _configService;
+        private readonly IDt_WareAreaInfoRepository _wareAreaInfoRepository;
 
         public Dt_InboundOrderService(IDt_InboundOrderRepository BaseDal,
                                         IUnitOfWorkManage unitOfWorkManage,
-                                        ISys_ConfigService configService) : base(BaseDal)
+                                        ISys_ConfigService configService,
+                                        IDt_WareAreaInfoRepository wareAreaInfoRepository) : base(BaseDal)
         {
             _unitOfWorkManage = unitOfWorkManage;
             _configService = configService;
+            _wareAreaInfoRepository = wareAreaInfoRepository;
+        }
 
+        public override WebResponseContent UpdateData(SaveModel saveModel)
+        {
+            var quantity = saveModel.MainData["quantity"].ToString();
+            var wareHouseId = saveModel.MainData["wareHouseId"].ToString();
+
+            Dt_WareAreaInfo? wareinfo = _wareAreaInfoRepository.QueryFirst(x => x.WareAreaCode == wareHouseId);
+
+            if (wareinfo == null)
+            {
+                return WebResponseContent.Instance.Error("鏈壘鍒颁粨搴撲俊鎭�!");
+            }
+            saveModel.MainData.Add("warehouseName", wareinfo.WareAreaName.ToString());
+            return base.UpdateData(saveModel);
         }
 
         public WebResponseContent GetInboundOrderInfo(string OrderNo)
@@ -65,6 +83,53 @@
                 }
                 content=PrintInbound(inboundOrders);
                 return content;
+            }
+            catch (Exception ex)
+            {
+                return content.Error("鏈煡閿欒锛岃鑱旂郴绠$悊鍛�");
+            }
+        }
+
+        public WebResponseContent SplitOrder(int id,int num)
+        {
+            WebResponseContent content = new WebResponseContent();
+            try
+            {
+                var originalOrder = BaseDal.QueryFirst(x => x.Id == id);
+                if (originalOrder == null)
+                {
+                    return content.Error("鏈壘鍒拌鍏ュ簱鍗曚俊鎭�");
+                }
+                if(originalOrder.Quantity < num || num <= 0)
+                {
+                    return content.Error("鎷嗗垎鏁伴噺涓嶅悎娉�");
+                }
+                Dt_InboundOrder orderNew = new Dt_InboundOrder()
+                {
+                    OrderNo = GetOrderPintCode("OrderNoIn"),
+                    UpperOrderNo = originalOrder.UpperOrderNo,
+                    DemandClassification = originalOrder.DemandClassification,
+                    OrderType = originalOrder.OrderType,
+                    WarehouseName = originalOrder.WarehouseName,
+                    Datetime = originalOrder.Datetime,
+                    LineNumber = originalOrder.LineNumber,
+                    ProductDrawingNumber = originalOrder.ProductDrawingNumber,
+                    MaterialNo = originalOrder.MaterialNo,
+                    MaterialName = originalOrder.MaterialName,
+                    Weight = originalOrder.Weight,
+                    WareHouseId = originalOrder.WareHouseId,
+                    Specs = originalOrder.Specs,
+                    Unit = originalOrder.Unit,
+                    Texture = originalOrder.Texture,
+                    Quantity = num,
+                    OrderStatus = originalOrder.OrderStatus,
+
+                };
+                originalOrder.Quantity = originalOrder.Quantity - num;
+
+                BaseDal.AddData(orderNew);
+                BaseDal.UpdateData(originalOrder);
+                return content.OK();
             }
             catch (Exception ex)
             {
@@ -125,7 +190,6 @@
 
         public WebResponseContent PrintInbound(List<Dt_InboundOrder> orders)
         {
-            WebResponseContent content = new WebResponseContent();
             var configs = _configService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress);
             var Base = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.PrintIPAddress)?.ConfigValue;
             var ipAddress = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.PrintInboundOrder)?.ConfigValue;

--
Gitblit v1.9.3