|
|
|
|
@ -810,22 +810,49 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (mesBaseBarcodeInfo.PurchaseOrderId == -1)
|
|
|
|
|
{ // 合并的物料
|
|
|
|
|
// List<MesSaleOrderRelate> mesSaleOrderRelates = dbContext.MesSaleOrderRelate.Where(x=>x.SaleOrderId==mesBaseBarcodeInfo.saleOrderId)
|
|
|
|
|
{ // 虚拟托盘号,合并的物料
|
|
|
|
|
List<MesSaleOrderRelate> mesSaleOrderRelates = dbContext.MesSaleOrderRelate.Where(x => x.SaleOrderId == mesBaseBarcodeInfo.saleOrderId).ToList();
|
|
|
|
|
List<WmsRawInstock>? wmsRawInstocks = new List<WmsRawInstock>();
|
|
|
|
|
foreach(var mesSaleOrderRelate in mesSaleOrderRelates)
|
|
|
|
|
{
|
|
|
|
|
WmsRawInstock wmsRawInstock = new WmsRawInstock()
|
|
|
|
|
{
|
|
|
|
|
taskCode = StaticData.SnowId.NextId().ToString(),
|
|
|
|
|
materialBarCode = null,
|
|
|
|
|
materialBatchCode = null,
|
|
|
|
|
applyBy = "wcs",
|
|
|
|
|
applyDate = System.DateTime.Now,
|
|
|
|
|
purchaseOrderId = mesSaleOrderRelate.PurchaseOrderId,
|
|
|
|
|
beginTime = DateTime.Now,
|
|
|
|
|
endTime = DateTime.Now,
|
|
|
|
|
locationCode = wmsBaseLocation.locationCode,
|
|
|
|
|
executeStatus = "2",
|
|
|
|
|
instockAmount = mesSaleOrderRelate.RelateSaleOrderAmount,
|
|
|
|
|
instockType = "1",
|
|
|
|
|
|
|
|
|
|
materialId = mesBaseBarcodeInfo.materialId,
|
|
|
|
|
operationType = "3",
|
|
|
|
|
palletInfoCode = mesBaseBarcodeInfo.palletInfoCode,
|
|
|
|
|
poNo = mesBaseBarcodeInfo.poNo,
|
|
|
|
|
warehouseId = 511
|
|
|
|
|
};
|
|
|
|
|
wmsRawInstocks.Add(wmsRawInstock);
|
|
|
|
|
}
|
|
|
|
|
if(wmsRawInstocks.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
dbContext.WmsRawInstock.AddRange(wmsRawInstocks);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
WmsRawInstock wmsRawInstock = new WmsRawInstock()
|
|
|
|
|
{
|
|
|
|
|
taskCode = item.taskCode,
|
|
|
|
|
taskCode = StaticData.SnowId.NextId().ToString(),
|
|
|
|
|
materialBarCode = mesBaseBarcodeInfo.barcodeInfo,
|
|
|
|
|
materialBatchCode = mesBaseBarcodeInfo.batchCode,
|
|
|
|
|
applyBy = "wcs",
|
|
|
|
|
applyDate = System.DateTime.Now,
|
|
|
|
|
purchaseOrderId = mesBaseBarcodeInfo.PurchaseOrderId,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
beginTime = DateTime.Now,
|
|
|
|
|
endTime = DateTime.Now,
|
|
|
|
|
locationCode = wmsBaseLocation.locationCode,
|
|
|
|
|
|