From 677cdf1dcb7a0f5f9f1b08e384e5727e22378647 Mon Sep 17 00:00:00 2001
From: 647556386 <647556386@qq.com>
Date: 星期三, 21 一月 2026 19:34:44 +0800
Subject: [PATCH] Merge branch 'htq20251215' of http://115.159.85.185:8098/r/ZhongRui/ALDbanyunxiangmu into htq20251215
---
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundPickingService.cs | 57 +++++++++++++++++++++++++++++++++++----------------------
1 files changed, 35 insertions(+), 22 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_OutboundService/OutboundPickingService.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_OutboundService/OutboundPickingService.cs"
index c148873..ce1dd2c 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_OutboundService/OutboundPickingService.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_OutboundService/OutboundPickingService.cs"
@@ -2322,6 +2322,10 @@
{
return WebResponseContent.Instance.Error("鏈壘鍒版弧瓒冲嚭搴撴潯浠剁殑鍑哄簱鍗�");
}
+ if(outboundOrder.IsBatch == 0)
+ {
+ return WebResponseContent.Instance.Error("璇ュ崟鎹笉灞炰簬鍒嗘壒鍥炰紶鍗曟嵁锛屼笉鍏佽铏氭嫙鍑哄叆搴�");
+ }
//鍏堟竻绌哄崟鎹櫄鎷熷嚭鍏ュ簱鏁伴噺杩涜璁$畻
foreach (var item in outboundOrder.Details)
{
@@ -2463,7 +2467,7 @@
Barcodes barcodes = new Barcodes
{
Barcode = item.Barcode,
- Qty = item.BarcodeQty,
+ Qty = item.OrderQuantity,
SupplyCode = item?.SupplyCode ?? "",
BatchNo = item?.BatchNo ?? "",
Unit = item?.Unit ?? ""
@@ -2535,7 +2539,7 @@
Barcodes barcodes = new Barcodes
{
Barcode = matchedDetail.Barcode,
- Qty = matchedDetail.BarcodeQty,
+ Qty = matchedDetail.OrderQuantity,
SupplyCode = matchedDetail?.SupplyCode ?? "",
BatchNo = matchedDetail?.BatchNo ?? "",
Unit = matchedDetail?.Unit ?? ""
@@ -2691,6 +2695,15 @@
_inboundOrderService.Db.Updateable(updateInboundOrders.Values.ToList()).ExecuteCommand();
}
+ // 7. 寰幆鍒嗙粍缁撴灉锛岃皟鐢∕ES鍥炰紶鏂规硶锛堟寜鍏ュ簱鍗曞垎缁勫洖浼狅級
+ foreach (var kvp in orderIdBarCodeDict)
+ {
+ int orderId = kvp.Key;
+ List<string> barCodeList = kvp.Value;
+ //鍏ュ簱鍥炰紶MES
+ NoStockOutBatchInOrderFeedbackToMes(orderId, barCodeList);
+ }
+
//鍙鍑哄簱鏉$爜鐨勫嚭搴撳崟鏄庣粏杩涜璁$畻鍥炰紶
List<Dt_OutboundOrderDetail> outboundOrderDetail = outboundOrder.Details
.Where(x => !string.IsNullOrWhiteSpace(x.documentsNO)
@@ -2700,15 +2713,15 @@
foreach (var item in outboundOrderDetail)
{
- item.LockQuantity = item.NoStockOutQty;
- item.OverOutQuantity = item.NoStockOutQty;
- item.CurrentDeliveryQty = item.OverOutQuantity;
+ item.LockQuantity += item.NoStockOutQty;
+ item.OverOutQuantity += item.NoStockOutQty;
+ item.CurrentDeliveryQty = item.NoStockOutQty;
//娣诲姞鍥炰紶MES鍙傛暟
List<Barcodes> barcodesList = new List<Barcodes>();
List<Barcodes> documentsNOList = new List<Barcodes>();
if (!string.IsNullOrEmpty(item.ReturnJsonData))
{
- barcodesList = JsonConvert.DeserializeObject<List<Barcodes>>(item.documentsNO) ?? new List<Barcodes>();
+ barcodesList = JsonConvert.DeserializeObject<List<Barcodes>>(item.ReturnJsonData) ?? new List<Barcodes>();
}
if (!string.IsNullOrEmpty(item.documentsNO) && item.documentsNO!="")
{
@@ -2737,8 +2750,8 @@
TaskNum = 0,
ChangeType = (int)StockChangeTypeEnum.Inbound,
ChangeQuantity = -item.NoStockOutQty,
- BeforeQuantity = item.OrderQuantity - item.OverOutQuantity-item.MoveQty,
- AfterQuantity = item.OrderQuantity - item.OverOutQuantity - item.MoveQty - item.NoStockOutQty,
+ BeforeQuantity = item.OrderQuantity,
+ AfterQuantity = item.OrderQuantity - item.OverOutQuantity,
SupplyCode = item.SupplyCode ?? "",
WarehouseCode = item.WarehouseCode ?? "",
Remark = $"铏氭嫙鍑哄簱"
@@ -2757,18 +2770,14 @@
if (CheckOutboundOrderCompleted(outboundOrder.OrderNo))
{
outboundOrder.OrderStatus = OutOrderStatusEnum.鍑哄簱瀹屾垚.ObjToInt();
- _outboundOrderService.UpdateData(outboundOrder);
- }
- _unitOfWorkManage.CommitTran();
- // 7. 寰幆鍒嗙粍缁撴灉锛岃皟鐢∕ES鍥炰紶鏂规硶锛堟寜鍏ュ簱鍗曞垎缁勫洖浼狅級
- foreach (var kvp in orderIdBarCodeDict)
- {
- int orderId = kvp.Key;
- List<string> barCodeList = kvp.Value;
- //鍏ュ簱鍥炰紶MES
- NoStockOutBatchInOrderFeedbackToMes(orderId, barCodeList);
}
+ else
+ {
+ outboundOrder.OrderStatus = OutOrderStatusEnum.鍑哄簱涓�.ObjToInt();
+ }
+ _outboundOrderService.UpdateData(outboundOrder);
+ _unitOfWorkManage.CommitTran();
//鍑哄簱鍥炰紶MES
_feedbackMesService.OutboundFeedback(outboundOrder.OrderNo);
@@ -2844,12 +2853,16 @@
if (response != null && response.IsSuccess)
{
_inboundOrderRepository.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 1 })
- .Where(it => it.OrderId == inboundOrder.Id).ExecuteCommand();
+ .Where(it => it.OrderId == inboundOrder.Id && barCodeList.Contains(it.Barcode)).ExecuteCommand();
+ _inboundOrderRepository.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 1 })
+ .Where(it => it.Id == inboundOrder.Id).ExecuteCommand();
}
else
{
_inboundOrderRepository.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 2 })
- .Where(it => it.OrderId == inboundOrder.Id).ExecuteCommand();
+ .Where(it => it.OrderId == inboundOrder.Id && barCodeList.Contains(it.Barcode)).ExecuteCommand();
+ _inboundOrderRepository.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus =2})
+ .Where(it => it.Id == inboundOrder.Id).ExecuteCommand();
return content.Error("鍥炰紶MES澶辫触");
}
}
@@ -2877,13 +2890,13 @@
if (response != null && response.IsSuccess)
{
_inboundOrderRepository.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 1 })
- .Where(it => it.OrderId == inboundOrder.Id).ExecuteCommand();
+ .Where(it => it.OrderId == inboundOrder.Id && barCodeList.Contains(it.Barcode)).ExecuteCommand();
_inboundOrderRepository.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 1 })
.Where(it => it.Id == inboundOrder.Id).ExecuteCommand();
}
else
{
- _inboundOrderRepository.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 2 }).Where(it => it.OrderId == inboundOrder.Id).ExecuteCommand();
+ _inboundOrderRepository.Db.Updateable<Dt_InboundOrderDetail>().SetColumns(it => new Dt_InboundOrderDetail { ReturnToMESStatus = 2 }).Where(it => it.OrderId == inboundOrder.Id && barCodeList.Contains(it.Barcode)).ExecuteCommand();
_inboundOrderRepository.Db.Updateable<Dt_InboundOrder>().SetColumns(it => new Dt_InboundOrder { ReturnToMESStatus = 2 })
.Where(it => it.Id == inboundOrder.Id).ExecuteCommand();
return content.Error("鍥炰紶MES澶辫触");
--
Gitblit v1.9.3