From c7f255af77f13a52e6f01c8ec81482dc9ae07f68 Mon Sep 17 00:00:00 2001
From: yanjinhui <3306209981@qq.com>
Date: 星期五, 24 十月 2025 22:06:00 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/ZhiHuiQiCe/FangCangZhiNeng

---
 新建文件夹/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/DeliveryOrderServices.cs |   51 ++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 40 insertions(+), 11 deletions(-)

diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/DeliveryOrderServices.cs" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/DeliveryOrderServices.cs"
index 28e25a5..9f4cf27 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/DeliveryOrderServices.cs"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/WIDESEA_WMSServer/WIDESEA_SquareCabinServices/DeliveryOrderServices.cs"
@@ -120,7 +120,31 @@
                         {
                             // 鍒涘缓鍑哄簱閫�璐у崟 - 杩欓噷闇�瑕佹牴鎹笟鍔¢�昏緫瀹炵幇
                             // 鏆傛椂璺宠繃鎴栧疄鐜伴��璐ч�昏緫
-                            continue;
+                            //continue;
+                            #region 杞崲鎴愬叆搴撳崟
+                            UpstreamOrderInfo order = new UpstreamOrderInfo()
+                            {
+                                order_no = outorder.order_no,
+                                order_type = outorder.order_type,
+                                warehouse_no = outorder.warehouse_no,
+                                details = new List<UpstreamOrderDetail>()
+                            };
+                            foreach (var item in outorder.details)
+                            {
+                                UpstreamOrderDetail detail = new UpstreamOrderDetail()
+                                {
+                                    batch_num = item.batch_num,
+                                    goods_no = item.goods_no,
+                                    order_qty = item.order_qty,
+                                    exp_date = item.exp_date,
+                                };
+                                order.details.Add(detail);
+                            }
+                            responseContent = _cabinOrderServices.CreateInboundOrder(order);
+                            List<Dt_CabinOrder>? dt_CabinOrders = responseContent.Data as List<Dt_CabinOrder>;
+                            if (dt_CabinOrders != null && dt_CabinOrders.Count > 0)
+                                BaseDal.Db.InsertNav(dt_CabinOrders).Include(x => x.Details).ExecuteCommand();
+                            #endregion
                         }
                         else if (outorder.order_type == "1") // 姝e父鍑哄簱鍗�
                         {
@@ -129,19 +153,19 @@
                     }
 
                     // 鎵归噺鎻掑叆鍑哄簱鍗曞拰鏄庣粏
-                    if (_DeliveryOrders.Any())
-                    {
-                        BaseDal.Db.InsertNav(_DeliveryOrders).Include(x => x.Details).ExecuteCommand();
-                    }
+                    //if (_DeliveryOrders.Any())
+                    //{
+                    //    BaseDal.Db.InsertNav(_DeliveryOrders).Include(x => x.Details).ExecuteCommand();
+                    //}
                     //涓嬪彂鍑哄簱鍗曚换鍔$粰wcs
 
 
                     Db.Ado.CommitTran();
-                    var tex = CreateSupplyTask(order_no);
-                    if (!tex)
-                    {
-                        return responseContent.Error("鍒涘缓渚涘簲浠诲姟澶辫触");
-                    }
+                    //var tex = CreateSupplyTask(order_no);
+                    //if (!tex)
+                    //{
+                    //    return responseContent.Error("鍒涘缓渚涘簲浠诲姟澶辫触");
+                    //}
                     return responseContent.OK($"鍚屾鍑哄簱鍗曟垚鍔燂紝鍏眥_DeliveryOrders.Count}鏉�");
                 }
                 catch (Exception ex)
@@ -1048,7 +1072,12 @@
                 }
                 #endregion
                 if (supplyTask.WarehouseCode == WarehouseEnum.绔嬪簱.ObjToInt().ToString("000"))
-                    CreateAllocatInOut(materielInfo);//鍒涘缓璋冩嫧浠诲姟
+                {
+                    materielInfo.Business_qty -= supplyTask.StockQuantity;
+                    _basicService.MaterielInfoService.Repository.UpdateData(materielInfo);
+                    if (materielInfo.Business_qty < materielInfo.MinQty)
+                        CreateAllocatInOut(materielInfo);//鍒涘缓璋冩嫧浠诲姟
+                }
                 _unitOfWorkManage.CommitTran();
                 #endregion
                 content.OK();

--
Gitblit v1.9.3