liuwf 1 year ago
parent 15ec20ac54
commit 67b328ce08

@ -84,11 +84,11 @@ namespace Khd.Core.Wcs
SecondFloorLine secondFloorLine = new(_host, 2);
secondFloorLine.StartPoint();
//三层接驳位
//三层接驳位
ThirdFloorPoint thirdFloorPoint = new(_host, 3);
thirdFloorPoint.StartPoint();
// 三层AGV
// 三层AGV
ThirdFloorAGV thirdFloorAGV = new(_host, 3);
thirdFloorAGV.StartPoint();

@ -1795,6 +1795,10 @@ namespace Khd.Core.Wcs.Wcs
foreach (var item in rawOutStock)
{
if (item.endStationCode == "BB_01")
{
}
decimal? RealOutNumber = item.realOutstockAmount;
var endEquip = dbContext.BaseEquip.FirstOrDefault(t => t.equipNo == item.endStationCode);
if (endEquip != null && endEquip.floorNo == 5)
@ -1988,6 +1992,7 @@ namespace Khd.Core.Wcs.Wcs
.ToList();
decimal? needNumber = order.TotalAmount - order.realOutstockAmount;
// 寻找已经创建任务的料箱中的是否含有当前物料A物料在料箱A\B中然后找B物料的时候是否在料箱A\B中
foreach (var task in tasks)
{
var wmsRawStock = rawStock.Where(t => t.palletInfoCode == task.containerNo && t.materialId == order.MaterialId && t.saleOrderId == order.SaleOrderId).ToList();
@ -2056,9 +2061,10 @@ namespace Khd.Core.Wcs.Wcs
}
else
{
needNumber = 0;
RealOutNumber += needNumber;
qty = Convert.ToInt32(needNumber);
needNumber = 0;
stock.updateDate = DateTime.Now;
}
WmsRawOutstock? wmsRawOutstock = orderList.Where(t => t.materialId == order.MaterialId).FirstOrDefault();
@ -2391,7 +2397,7 @@ namespace Khd.Core.Wcs.Wcs
}
}
}
else if (endEquip.equipType == 13)
else if (endEquip.equipType == 13) //原材料到背板安装
{
var stock = dbContext.WmsRawStock.Where(t => t.instockBatch == item.materialBatch).FirstOrDefault();
if (stock != null)

@ -548,14 +548,20 @@ namespace Khd.Core.Wcs.Wcs
}
else if (item.taskType == StaticTaskType.FiveAccessoryIn)//入库任务
{
WmsBaseLocation wmsBaseLocation = dbContext.WmsBaseLocation
.First(t => t.locationId == item.endPointId && t.warehouseFloor == 5);
wmsBaseLocation.locationStatus = "1";
wmsBaseLocation.ContainerStatus = "1";
dbContext.Update(wmsBaseLocation);
dbContext.Remove(item);
dbContext.SaveChanges();
dbContext.WcsTaskLog.Where(t => t.objid == item.objid).Update(t => new WcsTaskLog() { taskStatus = 6 });
try
{
WmsBaseLocation wmsBaseLocation = dbContext.WmsBaseLocation
.First(t => t.locationId == item.endPointId && t.warehouseFloor == 5);
wmsBaseLocation.locationStatus = "1";
wmsBaseLocation.ContainerStatus = "1";
dbContext.Update(wmsBaseLocation);
dbContext.Remove(item);
dbContext.SaveChanges();
dbContext.WcsTaskLog.Where(t => t.objid == item.objid).Update(t => new WcsTaskLog() { taskStatus = 6 });
}catch (Exception ex)
{
_logger.Error($"入库异常捕捉:{ex.Message}");
}
}
else if (item.taskType == StaticTaskType.FiveAccessoryStorage || item.taskType == StaticTaskType.FiveAccessoryRemove)//出库任务
{

@ -398,9 +398,10 @@ namespace Khd.Core.Wpf.Form
List<WcsTask> wcsTasks = dbContext.WcsTask.Where(t => t.taskType == 30).Where(t => orderIds.Contains(t.orderId)).ToList();
List<string> containerNos = wcsTasks.Select(t => t.containerNo).ToList();
List<WmsRawStock> wmsRawStocks = dbContext.WmsRawStock.Where(t => containerNos.Contains(t.palletInfoCode)).ToList();
var thisOutList = wmsRawStocks.GroupBy(t => new { t.materialId, t.saleOrderId })
var thisOutList = wmsRawStocks.GroupBy(t => new { t.materialId, t.saleOrderId,t.palletInfoCode })
.Select(t => new
{
palletInfoCode = t.Key.palletInfoCode,
materialId = t.Key.materialId,
saleOrderId = t.Key.saleOrderId,
thisOutAmount = t.Sum(x => x.totalAmount) - t.Sum(x => x.frozenAmount)
@ -420,17 +421,19 @@ namespace Khd.Core.Wpf.Form
var orderNumber = from a in bill
from b in thisOutList
from c in mesBaseMaterialInfos
where a.materialId == b.materialId && a.saleOrderId == b.saleOrderId
where a.materialId == b.materialId && a.saleOrderId == b.saleOrderId && a.materialId ==c.MaterialId
select new
{
palletInfoCode = b.palletInfoCode,
materialBatch = a.materialBatch,
saleOrderId = b.saleOrderId,
outstockAmount = a.outstockAmount,
materialSpec = c.MaterialSpec,
realOutstockAmount = a.realOutstockAmount,
thisOutAmount = b.thisOutAmount,
thisOutAmount = b.thisOutAmount,
isSendOver = a.outstockAmount <= (a.realOutstockAmount + b.thisOutAmount) ? "已出完" : "未出完"
};
Dispatcher.Invoke(() =>
{
this.OutTaskNumber.ItemsSource = orderNumber;

Loading…
Cancel
Save