From 3460ffdc967b65ea67c959212c2505a19008401e Mon Sep 17 00:00:00 2001
From: 647556386 <647556386@qq.com>
Date: 星期四, 16 四月 2026 13:39:56 +0800
Subject: [PATCH] 盘点优化,智仓调智仓防呆

---
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_AllocateService/AllocateService.cs |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_AllocateService/AllocateService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_AllocateService/AllocateService.cs"
index 5e198a5..35bbece 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_AllocateService/AllocateService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_AllocateService/AllocateService.cs"
@@ -143,6 +143,7 @@
             try
             {
                 var allocateOrder = Db.Queryable<Dt_AllocateOrder>().Where(x => x.UpperOrderNo == model.UpperOrderNo).Includes(x => x.Details).First();
+                var outOrder = Db.Queryable<Dt_OutboundOrder>().Where(x => x.UpperOrderNo == model.UpperOrderNo).Includes(x => x.Details).First();
                 if (allocateOrder == null)
                 {
                     return WebResponseContent.Instance.Error($"鏈壘鍒拌皟鎷ㄥ崟淇℃伅");
@@ -150,6 +151,10 @@
                 if (allocateOrder.Details == null || allocateOrder.Details.Count == 0)
                 {
                     return WebResponseContent.Instance.Error($"鏈壘鍒拌皟鎷ㄥ崟鏄庣粏淇℃伅");
+                }
+                if (outOrder.OrderStatus != (int)OutOrderStatusEnum.鏈紑濮�)
+                {
+                    return WebResponseContent.Instance.Error($"璇ヨ鍗曠姸鎬佷笉鍏佽淇敼");
                 }
                 List<Dt_AllocateOrderDetail> allocateOrderDetails = new List<Dt_AllocateOrderDetail>();
                 List<Dt_AllocateOrderDetail> updateAllocateOrderDetails = new List<Dt_AllocateOrderDetail>();
@@ -254,6 +259,12 @@
                 {
                     return WebResponseContent.Instance.Error($"鏈壘鍒拌皟鎷ㄥ崟鏄庣粏淇℃伅");
                 }
+                var outOrder = Db.Queryable<Dt_OutboundOrder>().Where(x => x.UpperOrderNo == model.UpperOrderNo).Includes(x => x.Details).First();
+
+                if (outOrder.OrderStatus != (int)OutOrderStatusEnum.鏈紑濮�)
+                {
+                    return WebResponseContent.Instance.Error($"璇ヨ鍗曠姸鎬佷笉鍏佽鍒犻櫎");
+                }
                 //Db.DeleteNav(Allocate).Include(x => x.Details).ExecuteCommand();
                 _unitOfWorkManage.BeginTran();
                 // BaseDal.DeleteAndMoveIntoHty(allocateOrder, OperateTypeEnum.鑷姩鍒犻櫎);

--
Gitblit v1.9.3