From 96b7df5c86df57e5b1bb92c377d5e41e0d4355b9 Mon Sep 17 00:00:00 2001
From: yangpeixing <yangpeixing@hnkhzn.com>
Date: 星期一, 02 三月 2026 14:56:53 +0800
Subject: [PATCH] 1
---
WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/NewPartialTaskService_Outbound.cs | 73 +++++++++++++++++++++++-------------
1 files changed, 46 insertions(+), 27 deletions(-)
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/NewPartialTaskService_Outbound.cs b/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/NewPartialTaskService_Outbound.cs
index 0734036..f4ff4bf 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/NewPartialTaskService_Outbound.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/NewPartialTaskService_Outbound.cs
@@ -39,8 +39,9 @@
{
throw new Exception("鎵�閫夊嚭搴撳崟鏄庣粏瀛樺湪鍑哄簱涓垨宸插畬鎴�");
}
- if (outboundOrderDetails.FirstOrDefault()?.LPNNo == null)
+ if (outboundOrderDetails.FirstOrDefault()?.LPNNo == null || outboundOrderDetails.FirstOrDefault()?.LPNNo == "")
{
+ outboundOrderDetails.Clear();
try
{
List<StockSelectViewDTO> stockSelectViews = new List<StockSelectViewDTO>();
@@ -63,17 +64,13 @@
}
if (result.Item5 != null && result.Item5.Count > 0)
{
- locationInfos.AddRange(result.Item5);
+ locationInfos.AddRange(result.Item5.DistinctBy(x => x.LocationCode));
}
if (result.Item1 != null && result.Item1.Count > 0)
{
tasks.AddRange(result.Item1);
}
- if (locationInfos.First().RoadwayNo.Contains("DW") || locationInfos.First().RoadwayNo.Contains("YS"))
- {
- break;
- }
-
+ break;
}
WebResponseContent content = NEWGenerateOutboundTaskDataUpdate(tasks, stockInfos, outboundOrderDetails, outStockLockInfos, locationInfos);
@@ -408,16 +405,46 @@
//}
var stockdetailbox = BaseDal.Db.Queryable<Dt_StockInfo>().LeftJoin<Dt_StockInfoDetail>((s, d) => s.Id == d.StockId).LeftJoin<Dt_StockInfoDetailCP>((s, d, cp) => d.Id == cp.StockDetailId).Where((s, d, cp) => allBoxCodes.Contains(cp.BoxCode)).Select((s, d, cp) => cp.BoxCode)
- .Distinct()
- .ToList();
+ .Distinct()
+ .ToList();
var stockInfoDetailCPList = _stockInfoDetailCPRepository.QueryData(x => stockdetailbox.Contains(x.BoxCode)).ToList();
if (stockInfoDetailCPList != null)
{
_stockInfoDetailCPRepository.DeleteAndMoveIntoHty(stockInfoDetailCPList, App.User.UserId == 0 ? OperateType.鑷姩瀹屾垚 : OperateType.浜哄伐瀹屾垚);
+ foreach(var stockLPNO in houseStockDetail.DetailList)
+ {
+ Dt_StockInfo dt_StockInfo = BaseDal.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == stockLPNO.LPNNo).Includes(x => x.Details).First();
+ for (int i = 0; i<stockInfoDetailCPList.Count(); i++)
+ {
+ foreach (var item1 in dt_StockInfo.Details)
+ {
+ foreach (var batchNos in houseStockDetail.DetailList)
+ {
+ if (stockInfoDetailCPList[i].PartNum == item1.MaterielCode && batchNos.BatchNo == item.BatchNo)
+ {
+ item1.StockQuantity-=(decimal)stockInfoDetailCPList[i].QtyOfpcs;
+ item1.OutboundQuantity = 0;
+ _stockInfoDetailRepository.UpdateData(item1);
+ }
+ if (item1.StockQuantity == 0)
+ {
+ _stockService.StockInfoDetailService.Repository.DeleteAndMoveIntoHty(item1, App.User.UserId == 0 ? OperateType.鑷姩瀹屾垚 : OperateType.浜哄伐瀹屾垚);
+ }
+ //鍏ㄩ儴閮藉嚭搴� 鍒犻櫎搴撳瓨
+ if (dt_StockInfo.Details.Sum(x => x.StockQuantity) == 0)
+ {
+ _stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(dt_StockInfo, App.User.UserId == 0 ? OperateType.鑷姩瀹屾垚 : OperateType.浜哄伐瀹屾垚);
+ }
+ }
+ }
+ }
+ }
+
+
}
+ _unitOfWorkManage.CommitTran();
}
- _unitOfWorkManage.CommitTran();
}
catch (Exception ex)
{
@@ -447,14 +474,14 @@
List<Dt_LocationInfo>? locationInfos = null;
//if (outboundOrderDetail.OrderDetailStatus == OrderDetailStatusEnum.New.ObjToInt())
{
- Dt_OutboundOrder dt_OutboundOrder = _outboundService.OutboundOrderService.Repository.QueryData(x => x.Id == outboundOrderDetails.First().OrderId).First();
+ Dt_NewOutboundOrder dt_OutboundOrder = _outboundService.NewOutboundOrderService.Repository.QueryData(x => x.Id == outboundOrderDetails.First().OrderId).First();
(List<Dt_StockInfo>, List<Dt_NewOutboundOrderDetail>, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = new();
result = _outboundService.NewOutboundOrderDetailService.CPAssignStockOutbound(outboundOrderDetails);
if (result.Item1 != null && result.Item1.Count > 0)
{
- Dt_OutboundOrder outboundOrder = _outboundService.OutboundOrderService.Repository.QueryFirst(x => x.Id == outboundOrderDetails.FirstOrDefault().OrderId);
+ Dt_NewOutboundOrder outboundOrder = _outboundService.NewOutboundOrderService.Repository.QueryFirst(x => x.Id == outboundOrderDetails.FirstOrDefault().OrderId);
TaskTypeEnum typeEnum = outboundOrder.OrderType switch
{
(int)OrderTypeEnum.鐢熶骇鍑哄簱鍗� => TaskTypeEnum.Outbound,
@@ -467,27 +494,19 @@
{
x.OrderNo = outboundOrder.OrderNo;
});
- if (dt_OutboundOrder.OutWareHouse.Contains("DW") || dt_OutboundOrder.OutWareHouse.Contains("YS"))
+ result.Item2.ForEach(x =>
{
- result.Item2.ForEach(x =>
+ foreach(var item in result.Item2)
{
- if (x.LockQuantity == x.OrderQuantity)
+ if(item.LockQuantity > 0)
{
- x.OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt();
+ item.OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt();
}
- });
- }
- else
- {
- result.Item2.ForEach(x =>
- {
- x.OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt();
- });
- }
-
+ }
+
+ });
result.Item3.ForEach(x =>
{
-
x.Status = OutStockStatus.鍑哄簱涓�.ObjToInt();
});
--
Gitblit v1.9.3