master
1 year ago
parent ba059ae638
commit 682b2cab50

@ -386,6 +386,7 @@ namespace Khd.Core.Wcs.Wcs
var TargetFloor = dbContext.WmsBaseWarehouse.Where(t => t.warehouseId == warehouseId).FirstOrDefault(); var TargetFloor = dbContext.WmsBaseWarehouse.Where(t => t.warehouseId == warehouseId).FirstOrDefault();
if (TargetFloor != null) if (TargetFloor != null)
{ {
BaseEquip baseEquip1 = dbContext.BaseEquip.First(t => t.objid == TargetFloor.warehouseFloor);
//插入task表 //插入task表
var dic = StaticData.BaseDictionary.Where(t => t.dicKey == "TaskType" && t.agvType == "I" && t.dicField == TargetFloor.warehouseInstockType).FirstOrDefault(); var dic = StaticData.BaseDictionary.Where(t => t.dicKey == "TaskType" && t.agvType == "I" && t.dicField == TargetFloor.warehouseInstockType).FirstOrDefault();
@ -407,7 +408,8 @@ namespace Khd.Core.Wcs.Wcs
nextPointId = T01, nextPointId = T01,
nextPointNo = "TSJ_01", nextPointNo = "TSJ_01",
ud1 = 20, ud1 = 20,
endPointId = warehouseId, endPointId = baseEquip1.objid,
endPointNo=baseEquip1.equipNo,
fromFloorNo = 1, fromFloorNo = 1,
floorNo = TargetFloor.warehouseFloor, floorNo = TargetFloor.warehouseFloor,
useFlag = 1, useFlag = 1,
@ -509,11 +511,13 @@ namespace Khd.Core.Wcs.Wcs
{ {
using var scope = _host.Services.CreateScope(); using var scope = _host.Services.CreateScope();
using var dbContext = scope.ServiceProvider.GetRequiredService<DefaultDbContext>(); using var dbContext = scope.ServiceProvider.GetRequiredService<DefaultDbContext>();
List<int> Outtpyes = new();//有问题的楼层任务
while (true) while (true)
{ {
using var transaction = dbContext.Database.BeginTransaction(); using var transaction = dbContext.Database.BeginTransaction();
try try
{ {
Outtpyes.Clear();
var mesCloseValue = StaticData.PlcDic[0].Read(this.mesClose.plcpointAddress); //MES关闭状态 读 var mesCloseValue = StaticData.PlcDic[0].Read(this.mesClose.plcpointAddress); //MES关闭状态 读
var serialno06Value = StaticData.PlcDic[0].Read(this.serialno06.plcpointAddress); //提升机流水号 读 var serialno06Value = StaticData.PlcDic[0].Read(this.serialno06.plcpointAddress); //提升机流水号 读
var equipstate06Value = StaticData.PlcDic[0].Read(this.equipstate06.plcpointAddress); //提升机状态 读 var equipstate06Value = StaticData.PlcDic[0].Read(this.equipstate06.plcpointAddress); //提升机状态 读
@ -535,6 +539,7 @@ namespace Khd.Core.Wcs.Wcs
.OrderBy(t => t.ud1).OrderBy(t => t.createTime).ToList(); .OrderBy(t => t.ud1).OrderBy(t => t.createTime).ToList();
foreach (var wcsTask in wcsTasks) foreach (var wcsTask in wcsTasks)
{ {
Outtpyes.Add(wcsTask.floorNo.Value);
if (wcsTask.taskType == StaticTaskType.SecondTransitToLift && !string.IsNullOrEmpty(wcsTask.containerNo)) if (wcsTask.taskType == StaticTaskType.SecondTransitToLift && !string.IsNullOrEmpty(wcsTask.containerNo))
{ {
var mesBasePalletInfo = dbContext.MesBasePalletInfo var mesBasePalletInfo = dbContext.MesBasePalletInfo
@ -782,6 +787,7 @@ namespace Khd.Core.Wcs.Wcs
transaction.Commit(); transaction.Commit();
} }
} }
Outtpyes.Clear();
break; break;
} }
else else
@ -800,8 +806,15 @@ namespace Khd.Core.Wcs.Wcs
continue; continue;
} }
} }
if (Outtpyes.Count > 0)
{
SystemData.InsertWaringLog(dbContext, WaringType., Outtpyes.ToJsonString());
}
else
{
SystemData.DeleteWaringLog(dbContext, WaringType.); SystemData.DeleteWaringLog(dbContext, WaringType.);
} }
}
catch (Exception ex) catch (Exception ex)
{ {
try try

@ -129,8 +129,12 @@ namespace Khd.Core.Wcs.Wcs
} }
} }
else
{
continue;
} }
else if (item.taskType == StaticTaskType.FiveStockReturnTask)//出库任务 }
else if (item.taskType == StaticTaskType.FiveStockReturnTask)//退库任务
{ {
BaseEquip lineEquip = dbContext.BaseEquip.First(t => t.objid == 5); BaseEquip lineEquip = dbContext.BaseEquip.First(t => t.objid == 5);
if (lineEquip.equipStatus == 0) if (lineEquip.equipStatus == 0)
@ -188,6 +192,10 @@ namespace Khd.Core.Wcs.Wcs
} }
} }
else
{
continue;
}
} }
else if (item.taskType == StaticTaskType.FiveRawToBack)//原材料到背板安装 else if (item.taskType == StaticTaskType.FiveRawToBack)//原材料到背板安装
{ {

@ -246,6 +246,8 @@ namespace Khd.Core.Wcs.Wcs
else if (item.taskType == StaticTaskType.SecondTransitToLift)//周转位-提升机 else if (item.taskType == StaticTaskType.SecondTransitToLift)//周转位-提升机
{ {
var startPoint = StaticData.BaseEquip.First(t => t.objid == item.currPointId); var startPoint = StaticData.BaseEquip.First(t => t.objid == item.currPointId);
if (lineEquip.equipStatus == 0)
{
var agvTask = new RequestAGVTaskDto var agvTask = new RequestAGVTaskDto
{ {
reqCode = StaticData.SnowId.NextId().ToString(), reqCode = StaticData.SnowId.NextId().ToString(),
@ -283,6 +285,11 @@ namespace Khd.Core.Wcs.Wcs
_logger.Info("2楼Agv下发任务失败" + item.taskType + result); _logger.Info("2楼Agv下发任务失败" + item.taskType + result);
} }
} }
else
{
continue;
}
}
else if (item.taskType == StaticTaskType.SecondStorageToLift)//库位-提升机 else if (item.taskType == StaticTaskType.SecondStorageToLift)//库位-提升机
{ {
var startPoint = dbContext.WmsBaseLocation.First(t => t.locationId == item.currPointId); var startPoint = dbContext.WmsBaseLocation.First(t => t.locationId == item.currPointId);
@ -328,6 +335,10 @@ namespace Khd.Core.Wcs.Wcs
_logger.Info("五楼Agv下发任务失败" + item.taskType + result); _logger.Info("五楼Agv下发任务失败" + item.taskType + result);
} }
} }
else
{
continue;
}
} }
else if (item.taskType == StaticTaskType.SecondRemove)//2F移库 else if (item.taskType == StaticTaskType.SecondRemove)//2F移库
{ {

@ -471,6 +471,10 @@ namespace Khd.Core.Wcs.Wcs
_logger.Info("三楼Agv下发任务失败" + item.taskType + result); _logger.Info("三楼Agv下发任务失败" + item.taskType + result);
} }
} }
else
{
continue;
}
} }
else if (item.taskType == StaticTaskType.ThirdTransitToSecond)//三楼空托盘转运到二楼 else if (item.taskType == StaticTaskType.ThirdTransitToSecond)//三楼空托盘转运到二楼
{ {
@ -518,6 +522,10 @@ namespace Khd.Core.Wcs.Wcs
_logger.Info("三楼Agv下发任务失败" + item.taskType + result); _logger.Info("三楼Agv下发任务失败" + item.taskType + result);
} }
} }
else
{
continue;
}
} }
else if (item.taskType == StaticTaskType.ThirdStockReturnTask) else if (item.taskType == StaticTaskType.ThirdStockReturnTask)
{ {
@ -564,6 +572,10 @@ namespace Khd.Core.Wcs.Wcs
_logger.Info("三楼Agv下发任务失败" + item.taskType + result); _logger.Info("三楼Agv下发任务失败" + item.taskType + result);
} }
} }
else
{
continue;
}
} }
} }
else else

Loading…
Cancel
Save