From f7ad3416dfc1558be842f3190688adc9a5a8933d Mon Sep 17 00:00:00 2001
From: wankeda <Administrator@DESKTOP-HAU3ST3>
Date: 星期日, 18 一月 2026 14:51:23 +0800
Subject: [PATCH] 添加盘点,合托流程
---
WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs | 514 +++++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 371 insertions(+), 143 deletions(-)
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs b/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs
index 2448941..467c714 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs
@@ -47,6 +47,10 @@
if (stockInfo != null)
{
Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == stockInfo.LocationCode);
+ if (locationInfo == null)
+ {
+ throw new Exception("鏈壘鍒板嚭搴撳簱浣�");
+ }
Dt_Task dt_Task = BaseDal.QueryFirst(x => x.SourceAddress == locationInfo.LocationCode || x.TargetAddress == locationInfo.LocationCode);
if (dt_Task != null)
{
@@ -61,30 +65,58 @@
Dt_StockInfoDetail stockInfoDetail = _stockService.StockInfoDetailService.Repository.QueryFirst(x => x.StockId == stockInfo.Id);
if (roadwayInfo != null)
{
- Dt_Task task = new()
+ if (roadwayInfo.RoadwayNo.Contains("CP"))
{
- PalletType = stockInfo.PalletType,
- OrderNo = stockInfoDetail.OrderNo,
- CurrentAddress = locationInfo.LocationCode,
- Grade = 0,
- Creater = "WMS",
- PalletCode = stockInfo.PalletCode,
- NextAddress = roadwayInfo.OutSCStationCode,
- Roadway = locationInfo.RoadwayNo,
- SourceAddress = locationInfo.LocationCode,
- TargetAddress = "",
- TaskStatus = OutTaskStatusEnum.OutNew.ObjToInt(),
- TaskType = taskType.ObjToInt(),
- Depth = locationInfo.Depth,
- WarehouseId = stockInfo.WarehouseId,
- TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum))
- };
- if (taskType != TaskTypeEnum.OutEmpty)
- {
- task.MaterielCode = stockInfo.Details?.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.MaterielCode;
- task.Quantity = (float)stockInfo.Details?.Where(x => x.StockId == stockInfo.Id).Sum(x => x.StockQuantity);
+ Dt_Task task = new()
+ {
+ PalletType = stockInfo.PalletType,
+ OrderNo = stockInfoDetail.OrderNo,
+ CurrentAddress = locationInfo.LocationCode,
+ Grade = 0,
+ Creater = "WMS",
+ PalletCode = stockInfo.PalletCode,
+ NextAddress = roadwayInfo.OutSCStationCode,
+ Roadway = locationInfo.RoadwayNo,
+ SourceAddress = locationInfo.LocationCode,
+ TargetAddress = "",
+ TaskStatus = OutTaskStatusEnum.OutNew.ObjToInt(),
+ TaskType = taskType.ObjToInt(),
+ Depth = locationInfo.Depth,
+ WarehouseId = stockInfo.WarehouseId,
+ TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
+ MaterielCode = stockInfoDetail.MaterielCode,
+ Quantity = (float)stockInfoDetail.StockQuantity
+ };
+ tasks.Add(task);
}
- tasks.Add(task);
+ else
+ {
+ Dt_Task task = new()
+ {
+ PalletType = stockInfo.PalletType,
+ OrderNo = stockInfoDetail.OrderNo,
+ CurrentAddress = locationInfo.LocationCode,
+ Grade = 0,
+ Creater = "WMS",
+ PalletCode = stockInfo.PalletCode,
+ NextAddress = roadwayInfo.OutSCStationCode,
+ Roadway = locationInfo.RoadwayNo,
+ SourceAddress = locationInfo.LocationCode,
+ TargetAddress = "",
+ TaskStatus = OutTaskStatusEnum.OutNew.ObjToInt(),
+ TaskType = taskType.ObjToInt(),
+ Depth = locationInfo.Depth,
+ WarehouseId = stockInfo.WarehouseId,
+ TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum))
+ };
+ if (taskType != TaskTypeEnum.OutEmpty)
+ {
+ task.MaterielCode = stockInfo.Details?.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.MaterielCode;
+ task.Quantity = (float)stockInfo.Details?.Where(x => x.StockId == stockInfo.Id).Sum(x => x.StockQuantity);
+ }
+ tasks.Add(task);
+ }
+
}
}
@@ -131,7 +163,7 @@
(int)OrderTypeEnum.鍙嶆嫞鍑哄簱鍗� => TaskTypeEnum.ReverseOut,
_ => new TaskTypeEnum()
};
- tasks = GetTasks(result.Item1,typeEnum);
+ tasks = GetTasks(result.Item1, typeEnum);
tasks.ForEach(x =>
{
x.OrderNo = outboundOrder.OrderNo;
@@ -254,36 +286,300 @@
{
return WebResponseContent.Instance.Error($"鏈壘鍒拌浠撳簱淇℃伅");
}
- Dt_OutboundOrder oldOuboundOrder = BaseDal.Db.Queryable<Dt_OutboundOrder>().Where(x => x.UpperOrderNo == orderAddDTO.No).Includes(x => x.Details).First();
- Dt_Production production = new Dt_Production();
- if (oldOuboundOrder != null)
+ if (warehouse.WarehouseCode.Contains("CP"))
{
- if (oldOuboundOrder.OutWareHouse != warehouse.WarehouseCode)
+ Dt_NewOutboundOrder newOutboundOrder = BaseDal.Db.Queryable<Dt_NewOutboundOrder>().Where(x => x.UpperOrderNo == orderAddDTO.No).Includes(x => x.Details).First();
+ Dt_Production production1 = new Dt_Production();
+ if (newOutboundOrder != null)
{
- return WebResponseContent.Instance.Error($"浠撳簱涓嶄竴鑷�");
+ if (newOutboundOrder.OutWareHouse != warehouse.WarehouseCode)
+ {
+ return WebResponseContent.Instance.Error($"浠撳簱涓嶄竴鑷�");
+ }
+ else
+ {
+ OutboundOrderAddDTO orderAddDTO1 = new OutboundOrderAddDTO();
+ orderAddDTO1.Details = orderAddDTO.DetailList.DicToIEnumerable<OutboundOrderDetailAddDTO>();
+ var details = orderAddDTO1.Details.FirstOrDefault();
+ Dt_NewOutboundOrderDetail outboundOrderDetail = new Dt_NewOutboundOrderDetail()
+ {
+ LPNNo = details.LPNNo,
+ BatchNo = details.BatchNo,
+ MaterielCode = details.MaterielCode,
+ MaterielName = details.MaterielName,
+ MaterieSpec = details.MaterieSpec,
+ OrderDetailStatus = OrderDetailStatusEnum.New.ObjToInt(),
+ OrderQuantity = details.OrderQuantity,
+ LinId = details.LinId,
+ OrderId = newOutboundOrder.Id,
+ Creater = "WMS",
+ CreateDate = DateTime.Now,
+ Remark = details.Remark,
+ SupplierBatch = details.SupplierBatch,
+ OrinalLocation = details.OrinalLocation,
+ };
+ _newOutboundOrderDetailRepository.AddData(outboundOrderDetail);
+ foreach (var item in orderAddDTO1.Details)
+ {
+ if (string.IsNullOrWhiteSpace(item.Remark))
+ {
+ continue;
+ }
+ string[] remarkEntries = item.Remark.Split(
+ new[] { ';' },
+ StringSplitOptions.RemoveEmptyEntries
+ );
+
+ foreach (var entry in remarkEntries)
+ {
+ string[] keyValuePairs = entry.Split(
+ new[] { ',' },
+ StringSplitOptions.RemoveEmptyEntries
+ );
+
+ foreach (var kvp in keyValuePairs)
+ {
+ int colonIndex = kvp.IndexOf(':');
+ if (colonIndex <= 0 || colonIndex >= kvp.Length - 1)
+ {
+ continue;
+ }
+
+ string key = kvp.Substring(0, colonIndex).Trim();
+ string value = kvp.Substring(colonIndex + 1).Trim();
+
+ switch (key)
+ {
+ case "鍒堕�犲崟鍙�":
+ production1.ProductionNo = value;
+ break;
+ case "鍒堕�犻儴浠�":
+ production1.ManufacturingCo = value;
+ break;
+ case "鍑哄簱鏁伴噺":
+ if (decimal.TryParse(value, out decimal outQuantity))
+ {
+ production1.OutQuantity = outQuantity;
+ }
+ else
+ {
+ Console.WriteLine($"鍑哄簱鏁伴噺鏍煎紡閿欒锛歿value}锛堝簲涓烘暟鍊硷紝濡�14.0000锛�");
+ }
+ break;
+ default:
+ Console.WriteLine($"鏈煡閿悕锛歿key}锛堝搴斿�硷細{value}锛岃烦杩囪閿�煎锛�");
+ break;
+ }
+
+ }
+ production1.Creater = "WMS";
+ production1.OrderId = outboundOrderDetail.Id;
+ _productionRepository.AddData(production1);
+ }
+ }
+ }
}
else
{
OutboundOrderAddDTO orderAddDTO1 = new OutboundOrderAddDTO();
+ orderAddDTO1.OrderNo = orderAddDTO.No;
+ orderAddDTO1.UpperOrderNo = orderAddDTO.No;
+ orderAddDTO1.OutWareHouse = orderAddDTO.OutWareHouse;
+ orderAddDTO1.TransactionCode = orderAddDTO.TransactionCode ?? "宸ュ崟鍙戞枡";
+ orderAddDTO1.InoutType = orderAddDTO.OrderType ?? InoutTypeEnum.WorkFeed.ToString();
+ orderAddDTO1.OrderType = orderAddDTO.InoutType;
+ orderAddDTO1.System = orderAddDTO.System;
+ IEnumerable<int> inOrderTypes = Enum.GetValues<OrderTypeEmun>().Cast<int>();
orderAddDTO1.Details = orderAddDTO.DetailList.DicToIEnumerable<OutboundOrderDetailAddDTO>();
- var details = orderAddDTO1.Details.FirstOrDefault();
- Dt_OutboundOrderDetail outboundOrderDetail = new Dt_OutboundOrderDetail()
+ #region 楠岃瘉鏁版嵁
+ (bool, string, object?) result = CheckOutboundOrderAddData(orderAddDTO1);
+ if (!result.Item1) return content = WebResponseContent.Instance.Error(result.Item2);
+ #endregion
+ Dt_NewOutboundOrder inboundOrder = _mapper.Map<Dt_NewOutboundOrder>(orderAddDTO1);
+ inboundOrder.OrderStatus = InboundStatusEnum.鏈紑濮�.ObjToInt();
+ inboundOrder.Creater = "WMS";
+ inboundOrder.CreateDate = DateTime.Now;
+ inboundOrder.CreateType = CreateType.UpperSystemPush.ObjToInt();
+ _unitOfWorkManage.BeginTran();
+ bool a = BaseDal.Db.InsertNav(inboundOrder).Include(x => x.Details).ExecuteCommand();
+
+ foreach (var item in orderAddDTO1.Details)
{
- LPNNo = details.LPNNo,
- BatchNo = details.BatchNo,
- MaterielCode = details.MaterielCode,
- MaterielName = details.MaterielName,
- MaterieSpec = details.MaterieSpec,
- OrderDetailStatus = OrderDetailStatusEnum.New.ObjToInt(),
- OrderQuantity = details.OrderQuantity,
- LinId = details.LinId,
- OrderId = oldOuboundOrder.Id,
- Creater = "WMS",
- CreateDate = DateTime.Now,
- Remark = details.Remark,
- SupplierBatch = details.SupplierBatch
- };
- _outboundOrderDetailRepository.AddData(outboundOrderDetail);
+ if (string.IsNullOrWhiteSpace(item.Remark))
+ {
+ continue;
+ }
+ string[] remarkEntries = item.Remark.Split(
+ new[] { ';' },
+ StringSplitOptions.RemoveEmptyEntries
+ );
+
+ foreach (var entry in remarkEntries)
+ {
+ string[] keyValuePairs = entry.Split(
+ new[] { ',' },
+ StringSplitOptions.RemoveEmptyEntries
+ );
+
+ foreach (var kvp in keyValuePairs)
+ {
+ int colonIndex = kvp.IndexOf(':');
+ if (colonIndex <= 0 || colonIndex >= kvp.Length - 1)
+ {
+ continue;
+ }
+
+ string key = kvp.Substring(0, colonIndex).Trim();
+ string value = kvp.Substring(colonIndex + 1).Trim();
+
+ switch (key)
+ {
+ case "鍒堕�犲崟鍙�":
+ production1.ProductionNo = value;
+ break;
+ case "鍒堕�犻儴浠�":
+ production1.ManufacturingCo = value;
+ break;
+ case "鍑哄簱鏁伴噺":
+ if (decimal.TryParse(value, out decimal outQuantity))
+ {
+ production1.OutQuantity = outQuantity;
+ }
+ else
+ {
+ Console.WriteLine($"鍑哄簱鏁伴噺鏍煎紡閿欒锛歿value}锛堝簲涓烘暟鍊硷紝濡�14.0000锛�");
+ }
+ break;
+ default:
+ Console.WriteLine($"鏈煡閿悕锛歿key}锛堝搴斿�硷細{value}锛岃烦杩囪閿�煎锛�");
+ break;
+ }
+
+ }
+ production1.Creater = "WMS";
+ production1.OrderId = inboundOrder.Details.FirstOrDefault().Id;
+ _productionRepository.AddData(production1);
+ }
+ }
+ _unitOfWorkManage.CommitTran();
+ }
+ }
+ else
+ {
+ Dt_OutboundOrder oldOuboundOrder = BaseDal.Db.Queryable<Dt_OutboundOrder>().Where(x => x.UpperOrderNo == orderAddDTO.No).Includes(x => x.Details).First();
+ Dt_Production production = new Dt_Production();
+ if (oldOuboundOrder != null)
+ {
+ if (oldOuboundOrder.OutWareHouse != warehouse.WarehouseCode)
+ {
+ return WebResponseContent.Instance.Error($"浠撳簱涓嶄竴鑷�");
+ }
+ else
+ {
+ OutboundOrderAddDTO orderAddDTO1 = new OutboundOrderAddDTO();
+ orderAddDTO1.Details = orderAddDTO.DetailList.DicToIEnumerable<OutboundOrderDetailAddDTO>();
+ var details = orderAddDTO1.Details.FirstOrDefault();
+ Dt_OutboundOrderDetail outboundOrderDetail = new Dt_OutboundOrderDetail()
+ {
+ LPNNo = details.LPNNo,
+ BatchNo = details.BatchNo,
+ MaterielCode = details.MaterielCode,
+ MaterielName = details.MaterielName,
+ MaterieSpec = details.MaterieSpec,
+ OrderDetailStatus = OrderDetailStatusEnum.New.ObjToInt(),
+ OrderQuantity = details.OrderQuantity,
+ LinId = details.LinId,
+ OrderId = oldOuboundOrder.Id,
+ Creater = "WMS",
+ CreateDate = DateTime.Now,
+ Remark = details.Remark,
+ SupplierBatch = details.SupplierBatch
+ };
+ _outboundOrderDetailRepository.AddData(outboundOrderDetail);
+ foreach (var item in orderAddDTO1.Details)
+ {
+ if (string.IsNullOrWhiteSpace(item.Remark))
+ {
+ continue;
+ }
+ string[] remarkEntries = item.Remark.Split(
+ new[] { ';' },
+ StringSplitOptions.RemoveEmptyEntries
+ );
+
+ foreach (var entry in remarkEntries)
+ {
+ string[] keyValuePairs = entry.Split(
+ new[] { ',' },
+ StringSplitOptions.RemoveEmptyEntries
+ );
+
+ foreach (var kvp in keyValuePairs)
+ {
+ int colonIndex = kvp.IndexOf(':');
+ if (colonIndex <= 0 || colonIndex >= kvp.Length - 1)
+ {
+ continue;
+ }
+
+ string key = kvp.Substring(0, colonIndex).Trim();
+ string value = kvp.Substring(colonIndex + 1).Trim();
+
+ switch (key)
+ {
+ case "鍒堕�犲崟鍙�":
+ production.ProductionNo = value;
+ break;
+ case "鍒堕�犻儴浠�":
+ production.ManufacturingCo = value;
+ break;
+ case "鍑哄簱鏁伴噺":
+ if (decimal.TryParse(value, out decimal outQuantity))
+ {
+ production.OutQuantity = outQuantity;
+ }
+ else
+ {
+ Console.WriteLine($"鍑哄簱鏁伴噺鏍煎紡閿欒锛歿value}锛堝簲涓烘暟鍊硷紝濡�14.0000锛�");
+ }
+ break;
+ default:
+ Console.WriteLine($"鏈煡閿悕锛歿key}锛堝搴斿�硷細{value}锛岃烦杩囪閿�煎锛�");
+ break;
+ }
+
+ }
+ production.Creater = "WMS";
+ production.OrderId = outboundOrderDetail.Id;
+ _productionRepository.AddData(production);
+ }
+ }
+ }
+ }
+ else
+ {
+ OutboundOrderAddDTO orderAddDTO1 = new OutboundOrderAddDTO();
+ orderAddDTO1.OrderNo = orderAddDTO.No;
+ orderAddDTO1.UpperOrderNo = orderAddDTO.No;
+ orderAddDTO1.OutWareHouse = orderAddDTO.OutWareHouse;
+ orderAddDTO1.TransactionCode = orderAddDTO.TransactionCode ?? "宸ュ崟鍙戞枡";
+ orderAddDTO1.InoutType = orderAddDTO.OrderType ?? InoutTypeEnum.WorkFeed.ToString();
+ orderAddDTO1.OrderType = orderAddDTO.InoutType;
+ orderAddDTO1.System = orderAddDTO.System;
+ IEnumerable<int> inOrderTypes = Enum.GetValues<OrderTypeEmun>().Cast<int>();
+ orderAddDTO1.Details = orderAddDTO.DetailList.DicToIEnumerable<OutboundOrderDetailAddDTO>();
+ #region 楠岃瘉鏁版嵁
+ (bool, string, object?) result = CheckOutboundOrderAddData(orderAddDTO1);
+ if (!result.Item1) return content = WebResponseContent.Instance.Error(result.Item2);
+ #endregion
+ Dt_OutboundOrder inboundOrder = _mapper.Map<Dt_OutboundOrder>(orderAddDTO1);
+ inboundOrder.OrderStatus = InboundStatusEnum.鏈紑濮�.ObjToInt();
+ inboundOrder.Creater = "WMS";
+ inboundOrder.CreateDate = DateTime.Now;
+ inboundOrder.CreateType = CreateType.UpperSystemPush.ObjToInt();
+ _unitOfWorkManage.BeginTran();
+ bool a = BaseDal.Db.InsertNav(inboundOrder).Include(x => x.Details).ExecuteCommand();
+
foreach (var item in orderAddDTO1.Details)
{
if (string.IsNullOrWhiteSpace(item.Remark))
@@ -338,96 +634,14 @@
}
production.Creater = "WMS";
- production.OrderId = outboundOrderDetail.Id;
+ production.OrderId = inboundOrder.Details.FirstOrDefault().Id;
_productionRepository.AddData(production);
}
}
+ _unitOfWorkManage.CommitTran();
}
}
- else
- {
- OutboundOrderAddDTO orderAddDTO1 = new OutboundOrderAddDTO();
- orderAddDTO1.OrderNo = orderAddDTO.No;
- orderAddDTO1.UpperOrderNo = orderAddDTO.No;
- orderAddDTO1.OutWareHouse = orderAddDTO.OutWareHouse;
- orderAddDTO1.TransactionCode = orderAddDTO.TransactionCode?? "宸ュ崟鍙戞枡";
- orderAddDTO1.InoutType = orderAddDTO.OrderType ?? InoutTypeEnum.WorkFeed.ToString();
- orderAddDTO1.OrderType = orderAddDTO.InoutType;
- orderAddDTO1.System = orderAddDTO.System;
- IEnumerable<int> inOrderTypes = Enum.GetValues<OrderTypeEmun>().Cast<int>();
- orderAddDTO1.Details = orderAddDTO.DetailList.DicToIEnumerable<OutboundOrderDetailAddDTO>();
- #region 楠岃瘉鏁版嵁
- (bool, string, object?) result = CheckOutboundOrderAddData(orderAddDTO1);
- if (!result.Item1) return content = WebResponseContent.Instance.Error(result.Item2);
- #endregion
- Dt_OutboundOrder inboundOrder = _mapper.Map<Dt_OutboundOrder>(orderAddDTO1);
- inboundOrder.OrderStatus = InboundStatusEnum.鏈紑濮�.ObjToInt();
- inboundOrder.Creater = "WMS";
- inboundOrder.CreateDate = DateTime.Now;
- inboundOrder.CreateType = CreateType.UpperSystemPush.ObjToInt();
- _unitOfWorkManage.BeginTran();
- bool a = BaseDal.Db.InsertNav(inboundOrder).Include(x => x.Details).ExecuteCommand();
-
- foreach (var item in orderAddDTO1.Details)
- {
- if (string.IsNullOrWhiteSpace(item.Remark))
- {
- continue;
- }
- string[] remarkEntries = item.Remark.Split(
- new[] { ';' },
- StringSplitOptions.RemoveEmptyEntries
- );
- foreach (var entry in remarkEntries)
- {
- string[] keyValuePairs = entry.Split(
- new[] { ',' },
- StringSplitOptions.RemoveEmptyEntries
- );
-
- foreach (var kvp in keyValuePairs)
- {
- int colonIndex = kvp.IndexOf(':');
- if (colonIndex <= 0 || colonIndex >= kvp.Length - 1)
- {
- continue;
- }
-
- string key = kvp.Substring(0, colonIndex).Trim();
- string value = kvp.Substring(colonIndex + 1).Trim();
-
- switch (key)
- {
- case "鍒堕�犲崟鍙�":
- production.ProductionNo = value;
- break;
- case "鍒堕�犻儴浠�":
- production.ManufacturingCo = value;
- break;
- case "鍑哄簱鏁伴噺":
- if (decimal.TryParse(value, out decimal outQuantity))
- {
- production.OutQuantity = outQuantity;
- }
- else
- {
- Console.WriteLine($"鍑哄簱鏁伴噺鏍煎紡閿欒锛歿value}锛堝簲涓烘暟鍊硷紝濡�14.0000锛�");
- }
- break;
- default:
- Console.WriteLine($"鏈煡閿悕锛歿key}锛堝搴斿�硷細{value}锛岃烦杩囪閿�煎锛�");
- break;
- }
-
- }
- production.Creater = "WMS";
- production.OrderId = inboundOrder.Details.FirstOrDefault().Id;
- _productionRepository.AddData(production);
- }
- }
- _unitOfWorkManage.CommitTran();
- }
content = WebResponseContent.Instance.OK();
@@ -462,23 +676,25 @@
inboundOrder.OrderType = OutOrderTypeEnum.OutInventory.ObjToInt();
inboundOrder.Creater = "WMS";
inboundOrder.CreateDate = DateTime.Now;
-
- Dt_OutboundOrder oldOutboundOrder = BaseDal.Db.Queryable<Dt_OutboundOrder>().Where(x => x.OrderNo == orderAddDTO1.OrderNo).Includes(x => x.Details).First();
- Dt_OutboundOrderDetail outboundOrderDetail = _outboundService.OutboundOrderDetailService.Repository.QueryFirst(x => x.OrderId == oldOutboundOrder.Id);
List<StockSelectViewDTO> stockSelectViews = new List<StockSelectViewDTO>();
- StockSelectViewDTO stockSelectViewDTO = new()
+ foreach (var item in inboundOrder.Details)
{
- OrderNo = orderAddDTO1.OrderNo,
- MaterielCode = outboundOrderDetail.MaterielCode,
- MaterielName = outboundOrderDetail.MaterielName,
- UseableQuantity = outboundOrderDetail.OrderQuantity,
- BatchNo = outboundOrderDetail.BatchNo,
- LinId = outboundOrderDetail.LinId,
- };
+
+ StockSelectViewDTO stockSelectViewDTO = new()
+ {
+ OrderNo = orderAddDTO1.OrderNo,
+ MaterielCode = item.MaterielCode,
+ MaterielName = item.MaterielName,
+ UseableQuantity = item.OrderQuantity,
+ BatchNo = item.BatchNo,
+ LinId = item.LinId,
+ };
+ stockSelectViews.Add(stockSelectViewDTO);
+ }
_unitOfWorkManage.BeginTran();
bool a = BaseDal.Db.InsertNav(inboundOrder).Include(x => x.Details).ExecuteCommand();
- stockSelectViews.Add(stockSelectViewDTO);
- GenerateOutboundTasks(oldOutboundOrder.Id, stockSelectViews);
+
+ GenerateOutboundTasks(inboundOrder.Id, stockSelectViews);
_unitOfWorkManage.CommitTran();
content = WebResponseContent.Instance.OK();
}
@@ -611,7 +827,15 @@
}
_unitOfWorkManage.CommitTran();
//灏嗕换鍔℃帹閫佸埌WCS
- PushTasksToWCS(tasks);
+
+ if (tasks.FirstOrDefault().Roadway.Contains("SC01_BC"))
+ {
+ PushTasksToWCS(tasks);
+ }
+ else
+ {
+ PushTasksWCS(tasks);
+ }
return WebResponseContent.Instance.OK();
}
catch (Exception ex)
@@ -933,6 +1157,10 @@
{
return content.Error($"鏈壘鍒皗item.PalletCode}搴撳瓨鏄庣粏鏁版嵁");
}
+ if (item.System.Contains("SMOM"))
+ {
+ return content.Error($"SMOM绯荤粺搴撳瓨鏁版嵁涓嶅彲鎵嬪姩鐩樼偣锛屾墭鐩樺彿{item.PalletCode}");
+ }
Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.LocationCode == item.LocationCode);
if (locationInfo != null && (locationInfo.EnableStatus == EnableStatusEnum.OnlyOut.ObjToInt() || locationInfo.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && locationInfo.LocationStatus == LocationStatusEnum.InStock.ObjToInt() && item.StockStatus == StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt())
{
--
Gitblit v1.9.3