修改背负Agv确认

master
1 year ago
parent 1386e72c86
commit 09344a7839

@ -10,6 +10,7 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using SixLabors.ImageSharp; using SixLabors.ImageSharp;
using System.Data; using System.Data;
using System.Linq;
using Z.EntityFramework.Plus; using Z.EntityFramework.Plus;
namespace Khd.Core.Wcs.Wcs namespace Khd.Core.Wcs.Wcs
@ -1792,7 +1793,6 @@ namespace Khd.Core.Wcs.Wcs
dbContext.SaveChanges(); dbContext.SaveChanges();
} }
} }
foreach (var item in rawOutStock) foreach (var item in rawOutStock)
{ {
if (item.endStationCode == "BB_01") if (item.endStationCode == "BB_01")
@ -1996,7 +1996,7 @@ namespace Khd.Core.Wcs.Wcs
foreach (var task in tasks) foreach (var task in tasks)
{ {
var wmsRawStock = rawStock.Where(t => t.palletInfoCode == task.containerNo && t.materialId == order.MaterialId && t.saleOrderId == order.SaleOrderId).ToList(); var wmsRawStock = rawStock.Where(t => t.palletInfoCode == task.containerNo && t.materialId == order.MaterialId && t.saleOrderId == order.SaleOrderId).ToList();
decimal? total = wmsRawStock.Sum(t => t.totalAmount - t.frozenAmount); decimal? total = wmsRawStock.Sum(t => t.totalAmount)- wmsRawStock.Sum(t => t.frozenAmount);
needNumber -= total; needNumber -= total;
WmsBaseLocation wmsBaseLocation = AllWmsBaseLocations.Where(t => t.locationCode == task.currPointNo).First(); WmsBaseLocation wmsBaseLocation = AllWmsBaseLocations.Where(t => t.locationCode == task.currPointNo).First();
index = wmsBaseLocation.locRow; index = wmsBaseLocation.locRow;
@ -2054,23 +2054,20 @@ namespace Khd.Core.Wcs.Wcs
int qty = 0; int qty = 0;
if (stock.totalAmount - stock.frozenAmount <= needNumber)//该料箱全部出 if (stock.totalAmount - stock.frozenAmount <= needNumber)//该料箱全部出
{ {
needNumber -= stock.totalAmount - stock.frozenAmount; needNumber -= (stock.totalAmount - stock.frozenAmount);
RealOutNumber += stock.totalAmount - stock.frozenAmount;
qty = Convert.ToInt32(stock.totalAmount - stock.frozenAmount); qty = Convert.ToInt32(stock.totalAmount - stock.frozenAmount);
stock.updateDate = DateTime.Now; stock.updateDate = DateTime.Now;
} }
else else
{ {
RealOutNumber += needNumber;
qty = Convert.ToInt32(needNumber); qty = Convert.ToInt32(needNumber);
needNumber = 0; needNumber = 0;
stock.updateDate = DateTime.Now; stock.updateDate = DateTime.Now;
} }
WmsRawOutstock? wmsRawOutstock = orderList.Where(t => t.materialId == order.MaterialId).FirstOrDefault(); WmsRawOutstock? wmsRawOutstock = orderList.Where(t => t.materialId == order.MaterialId).FirstOrDefault();
if (wmsRawOutstock != null) if (wmsRawOutstock != null)
{ {
WcsTask wcsTask = new WcsTask() var wcsTask = new WcsTask()
{ {
objid = StaticData.SnowId.NextId(), objid = StaticData.SnowId.NextId(),
orderId = wmsRawOutstock.rawOutstockId, orderId = wmsRawOutstock.rawOutstockId,

@ -1348,7 +1348,7 @@ namespace Khd.Core.Wpf.Form
wcsTask.objid = Global.SnowId.NextId(); wcsTask.objid = Global.SnowId.NextId();
WcsTaskLog wcsTaskLog = CoreMapper.Map<WcsTaskLog>(wcsTask); WcsTaskLog wcsTaskLog = CoreMapper.Map<WcsTaskLog>(wcsTask);
dbContext.Add(wcsTaskLog); dbContext.Add(wcsTaskLog);
dbContext.Update(wcsTask); dbContext.Add(wcsTask);
} }
else if (messageBoxResult == MessageBoxResult.Cancel) else if (messageBoxResult == MessageBoxResult.Cancel)
{ {

Loading…
Cancel
Save