|
|
|
|
@ -66,34 +66,19 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
BaseDictionary baseDictionary = StaticData.BaseDictionary.First(t => t.objid == item.taskType);
|
|
|
|
|
if (item.taskType == 51)//输送线-小包入口
|
|
|
|
|
{
|
|
|
|
|
WcsCmd wcsCmd = new WcsCmd()
|
|
|
|
|
{
|
|
|
|
|
objid = StaticData.SnowId.NextId(),
|
|
|
|
|
cmdStatus = 0,
|
|
|
|
|
taskId = item.objid,
|
|
|
|
|
useFlag = 1,
|
|
|
|
|
cmdType = item.taskType,
|
|
|
|
|
containerNo = item.containerNo,
|
|
|
|
|
createTime = DateTime.Now,
|
|
|
|
|
createBy = FloorNo + "楼AGV",
|
|
|
|
|
currPointId = item.currPointId,
|
|
|
|
|
currPointNo = lineEquip.agvPositionCode,
|
|
|
|
|
nextPointId = item.endPointId,
|
|
|
|
|
nextPointNo = inEquip.agvPositionCode,
|
|
|
|
|
};
|
|
|
|
|
var agvTask = new RequestAGVTaskDto
|
|
|
|
|
{
|
|
|
|
|
reqCode = wcsCmd.objid.ToString(),
|
|
|
|
|
reqCode = StaticData.SnowId.NextId().ToString(),
|
|
|
|
|
positionCodePath = new List<Position>
|
|
|
|
|
{
|
|
|
|
|
new ()
|
|
|
|
|
{
|
|
|
|
|
positionCode=wcsCmd.currPointNo,
|
|
|
|
|
positionCode= lineEquip.agvPositionCode,
|
|
|
|
|
type="00"
|
|
|
|
|
},
|
|
|
|
|
new ()
|
|
|
|
|
{
|
|
|
|
|
positionCode=wcsCmd.nextPointNo,
|
|
|
|
|
positionCode=inEquip.agvPositionCode,
|
|
|
|
|
type="00"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
@ -106,15 +91,11 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
if (reponseMessage != null && reponseMessage.message == "成功")
|
|
|
|
|
{
|
|
|
|
|
LogManager.Info("二楼AGV线程下发任务" + agvTask.ToJsonString() + "\n" + message);
|
|
|
|
|
Console.WriteLine(DateTime.Now + ":二楼AGV线程下发任务" + item.currPointId + "," + item.endPointNo);
|
|
|
|
|
wcsCmd.taskCode = reponseMessage.data;
|
|
|
|
|
wcsCmd.cmdStatus = 1;
|
|
|
|
|
Console.WriteLine(DateTime.Now + ":二楼AGV线程下发任务" + item.currPointNo + "," + item.endPointNo);
|
|
|
|
|
item.taskCode = reponseMessage.data;
|
|
|
|
|
item.taskStatus = 1;
|
|
|
|
|
dbContext.Update(item);
|
|
|
|
|
dbContext.WcsTaskLog.Where(t => t.objid == item.objid).Update(t => new WcsTaskLog() { taskStatus = 1 });
|
|
|
|
|
WcsCmdLog wcsCmdLog = CoreMapper.Map<WcsCmdLog>(wcsCmd);
|
|
|
|
|
dbContext.Add(wcsCmdLog);
|
|
|
|
|
dbContext.Add(wcsCmd);
|
|
|
|
|
dbContext.SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
@ -125,34 +106,19 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
else if (item.taskType == 56)//废料工位-库位
|
|
|
|
|
{
|
|
|
|
|
var endEquip = StaticData.BaseEquip.First(t => t.objid == item.endPointId);
|
|
|
|
|
WcsCmd wcsCmd = new WcsCmd()
|
|
|
|
|
{
|
|
|
|
|
objid = StaticData.SnowId.NextId(),
|
|
|
|
|
cmdStatus = 0,
|
|
|
|
|
taskId = item.objid,
|
|
|
|
|
useFlag = 1,
|
|
|
|
|
cmdType = item.taskType,
|
|
|
|
|
containerNo = item.containerNo,
|
|
|
|
|
createTime = DateTime.Now,
|
|
|
|
|
createBy = FloorNo + "楼AGV",
|
|
|
|
|
currPointId = item.currPointId,
|
|
|
|
|
currPointNo = wasteEquip.agvPositionCode,
|
|
|
|
|
nextPointId = item.endPointId,
|
|
|
|
|
nextPointNo = endEquip.agvPositionCode,
|
|
|
|
|
};
|
|
|
|
|
var agvTask = new RequestAGVTaskDto
|
|
|
|
|
{
|
|
|
|
|
reqCode = wcsCmd.objid.ToString(),
|
|
|
|
|
reqCode = StaticData.SnowId.NextId().ToString(),
|
|
|
|
|
positionCodePath = new List<Position>
|
|
|
|
|
{
|
|
|
|
|
new ()
|
|
|
|
|
{
|
|
|
|
|
positionCode=wcsCmd.currPointNo,
|
|
|
|
|
positionCode=wasteEquip.agvPositionCode,
|
|
|
|
|
type="00"
|
|
|
|
|
},
|
|
|
|
|
new ()
|
|
|
|
|
{
|
|
|
|
|
positionCode=wcsCmd.nextPointNo,
|
|
|
|
|
positionCode= endEquip.agvPositionCode,
|
|
|
|
|
type="00"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
@ -166,15 +132,11 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
if (reponseMessage != null && reponseMessage.message == "成功")
|
|
|
|
|
{
|
|
|
|
|
LogManager.Info("二楼AGV线程下发任务" + agvTask.ToJsonString() + "\n" + message);
|
|
|
|
|
Console.WriteLine(DateTime.Now + ":二楼AGV线程下发任务" + item.currPointId + "," + item.endPointNo);
|
|
|
|
|
wcsCmd.taskCode = reponseMessage.data;
|
|
|
|
|
wcsCmd.cmdStatus = 1;
|
|
|
|
|
Console.WriteLine(DateTime.Now + ":二楼AGV线程下发任务" + item.currPointNo + "," + item.endPointNo);
|
|
|
|
|
item.taskCode = reponseMessage.data;
|
|
|
|
|
item.taskStatus = 1;
|
|
|
|
|
dbContext.Update(item);
|
|
|
|
|
dbContext.WcsTaskLog.Where(t => t.objid == item.objid).Update(t => new WcsTaskLog() { taskStatus = 1 });
|
|
|
|
|
WcsCmdLog wcsCmdLog = CoreMapper.Map<WcsCmdLog>(wcsCmd);
|
|
|
|
|
dbContext.Add(wcsCmdLog);
|
|
|
|
|
dbContext.Add(wcsCmd);
|
|
|
|
|
dbContext.SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
@ -186,34 +148,19 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
{
|
|
|
|
|
WmsBaseLocation wmsBaseLocation = dbContext.WmsBaseLocation.First(t => t.locationId == item.endPointId);
|
|
|
|
|
BaseEquip startEquip = dbContext.BaseEquip.First(t => t.objid == item.currPointId);
|
|
|
|
|
WcsCmd wcsCmd = new WcsCmd()
|
|
|
|
|
{
|
|
|
|
|
objid = StaticData.SnowId.NextId(),
|
|
|
|
|
cmdStatus = 0,
|
|
|
|
|
taskId = item.objid,
|
|
|
|
|
useFlag = 1,
|
|
|
|
|
cmdType = item.taskType,
|
|
|
|
|
containerNo = item.containerNo,
|
|
|
|
|
createTime = DateTime.Now,
|
|
|
|
|
createBy = FloorNo + "楼AGV",
|
|
|
|
|
currPointId = startEquip.objid,
|
|
|
|
|
currPointNo = startEquip.agvPositionCode,
|
|
|
|
|
nextPointId = item.endPointId,
|
|
|
|
|
nextPointNo = wmsBaseLocation.agvPositionCode,
|
|
|
|
|
};
|
|
|
|
|
var agvTask = new RequestAGVTaskDto
|
|
|
|
|
{
|
|
|
|
|
reqCode = wcsCmd.objid.ToString(),
|
|
|
|
|
reqCode = StaticData.SnowId.NextId().ToString(),
|
|
|
|
|
positionCodePath = new List<Position>
|
|
|
|
|
{
|
|
|
|
|
new ()
|
|
|
|
|
{
|
|
|
|
|
positionCode=wcsCmd.currPointNo,
|
|
|
|
|
positionCode=startEquip.agvPositionCode,
|
|
|
|
|
type="00"
|
|
|
|
|
},
|
|
|
|
|
new ()
|
|
|
|
|
{
|
|
|
|
|
positionCode=wcsCmd.nextPointNo,
|
|
|
|
|
positionCode=wmsBaseLocation.agvPositionCode,
|
|
|
|
|
type="00"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
@ -226,15 +173,11 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
if (reponseMessage != null && reponseMessage.message == "成功")
|
|
|
|
|
{
|
|
|
|
|
LogManager.Info("二楼AGV线程下发任务" + agvTask.ToJsonString() + "\n" + message);
|
|
|
|
|
Console.WriteLine(DateTime.Now + ":二楼AGV线程下发任务" + item.currPointId + "," + item.endPointNo);
|
|
|
|
|
wcsCmd.taskCode = reponseMessage.data;
|
|
|
|
|
wcsCmd.cmdStatus = 1;
|
|
|
|
|
Console.WriteLine(DateTime.Now + ":二楼AGV线程下发任务" + item.currPointNo + "," + item.endPointNo);
|
|
|
|
|
item.taskCode = reponseMessage.data;
|
|
|
|
|
item.taskStatus = 1;
|
|
|
|
|
dbContext.Update(item);
|
|
|
|
|
dbContext.WcsTaskLog.Where(t => t.objid == item.objid).Update(t => new WcsTaskLog() { taskStatus = 1 });
|
|
|
|
|
WcsCmdLog wcsCmdLog = CoreMapper.Map<WcsCmdLog>(wcsCmd);
|
|
|
|
|
dbContext.Add(wcsCmdLog);
|
|
|
|
|
dbContext.Add(wcsCmd);
|
|
|
|
|
dbContext.SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
@ -245,34 +188,19 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
else if (item.taskType == 57)//周转位-小包入口
|
|
|
|
|
{
|
|
|
|
|
var startPoint = StaticData.BaseEquip.First(t => t.objid == item.currPointId);
|
|
|
|
|
WcsCmd wcsCmd = new WcsCmd()
|
|
|
|
|
{
|
|
|
|
|
objid = StaticData.SnowId.NextId(),
|
|
|
|
|
cmdStatus = 0,
|
|
|
|
|
taskId = item.objid,
|
|
|
|
|
useFlag = 1,
|
|
|
|
|
cmdType = item.taskType,
|
|
|
|
|
containerNo = item.containerNo,
|
|
|
|
|
createTime = DateTime.Now,
|
|
|
|
|
createBy = FloorNo + "楼AGV",
|
|
|
|
|
currPointId = item.currPointId,
|
|
|
|
|
currPointNo = startPoint.agvPositionCode,
|
|
|
|
|
nextPointId = item.endPointId,
|
|
|
|
|
nextPointNo = lineEquip.agvPositionCode,
|
|
|
|
|
};
|
|
|
|
|
var agvTask = new RequestAGVTaskDto
|
|
|
|
|
{
|
|
|
|
|
reqCode = wcsCmd.objid.ToString(),
|
|
|
|
|
reqCode = StaticData.SnowId.NextId().ToString(),
|
|
|
|
|
positionCodePath = new List<Position>
|
|
|
|
|
{
|
|
|
|
|
new ()
|
|
|
|
|
{
|
|
|
|
|
positionCode=wcsCmd.currPointNo,
|
|
|
|
|
positionCode=startPoint.agvPositionCode,
|
|
|
|
|
type="00"
|
|
|
|
|
},
|
|
|
|
|
new ()
|
|
|
|
|
{
|
|
|
|
|
positionCode=wcsCmd.nextPointNo,
|
|
|
|
|
positionCode=lineEquip.agvPositionCode,
|
|
|
|
|
type="00"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
@ -285,15 +213,11 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
if (reponseMessage != null && reponseMessage.message == "成功")
|
|
|
|
|
{
|
|
|
|
|
LogManager.Info("二楼AGV线程下发任务" + agvTask.ToJsonString() + "\n" + message);
|
|
|
|
|
Console.WriteLine(DateTime.Now + ":二楼AGV线程下发任务" + item.currPointId + "," + item.endPointNo);
|
|
|
|
|
wcsCmd.taskCode = reponseMessage.data;
|
|
|
|
|
wcsCmd.cmdStatus = 1;
|
|
|
|
|
Console.WriteLine(DateTime.Now + ":二楼AGV线程下发任务" + item.currPointNo + "," + item.endPointNo);
|
|
|
|
|
item.taskCode = reponseMessage.data;
|
|
|
|
|
item.taskStatus = 1;
|
|
|
|
|
dbContext.Update(item);
|
|
|
|
|
dbContext.WcsTaskLog.Where(t => t.objid == item.objid).Update(t => new WcsTaskLog() { taskStatus = 1 });
|
|
|
|
|
WcsCmdLog wcsCmdLog = CoreMapper.Map<WcsCmdLog>(wcsCmd);
|
|
|
|
|
dbContext.Add(wcsCmdLog);
|
|
|
|
|
dbContext.Add(wcsCmd);
|
|
|
|
|
dbContext.SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
@ -307,34 +231,19 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
lineEquip = dbContext.BaseEquip.First(t => t.objid == 2);
|
|
|
|
|
if (lineEquip.equipStatus == 0)
|
|
|
|
|
{
|
|
|
|
|
WcsCmd wcsCmd = new WcsCmd()
|
|
|
|
|
{
|
|
|
|
|
objid = StaticData.SnowId.NextId(),
|
|
|
|
|
cmdStatus = 0,
|
|
|
|
|
taskId = item.objid,
|
|
|
|
|
useFlag = 1,
|
|
|
|
|
cmdType = item.taskType,
|
|
|
|
|
containerNo = item.containerNo,
|
|
|
|
|
createTime = DateTime.Now,
|
|
|
|
|
createBy = FloorNo + "楼AGV",
|
|
|
|
|
currPointId = item.currPointId,
|
|
|
|
|
currPointNo = startPoint.agvPositionCode,
|
|
|
|
|
nextPointId = lineEquip.objid,
|
|
|
|
|
nextPointNo = lineEquip.agvPositionCode,
|
|
|
|
|
};
|
|
|
|
|
var agvTask = new RequestAGVTaskDto
|
|
|
|
|
{
|
|
|
|
|
reqCode = wcsCmd.objid.ToString(),
|
|
|
|
|
reqCode = StaticData.SnowId.NextId().ToString(),
|
|
|
|
|
positionCodePath = new List<Position>
|
|
|
|
|
{
|
|
|
|
|
new ()
|
|
|
|
|
{
|
|
|
|
|
positionCode=wcsCmd.currPointNo,
|
|
|
|
|
positionCode=startPoint.agvPositionCode,
|
|
|
|
|
type="00"
|
|
|
|
|
},
|
|
|
|
|
new ()
|
|
|
|
|
{
|
|
|
|
|
positionCode=wcsCmd.nextPointNo,
|
|
|
|
|
positionCode= lineEquip.agvPositionCode,
|
|
|
|
|
type="00"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
@ -346,18 +255,14 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
var reponseMessage = JsonConvert.DeserializeObject<ReponseMessage>(result);
|
|
|
|
|
if (reponseMessage != null && reponseMessage.message == "成功")
|
|
|
|
|
{
|
|
|
|
|
LogManager.Info("二楼AGV线程下发任务" + wcsCmd.ToJsonString() + "\n" + message);
|
|
|
|
|
Console.WriteLine(DateTime.Now + ":二楼AGV线程下发任务" + item.currPointId + "," + item.endPointNo);
|
|
|
|
|
wcsCmd.taskCode = reponseMessage.data;
|
|
|
|
|
wcsCmd.cmdStatus = 1;
|
|
|
|
|
LogManager.Info("二楼AGV线程下发任务" + agvTask.ToJsonString() + "\n" + message);
|
|
|
|
|
Console.WriteLine(DateTime.Now + ":二楼AGV线程下发任务" + item.currPointNo + "," + item.endPointNo);
|
|
|
|
|
item.taskCode = reponseMessage.data;
|
|
|
|
|
item.taskStatus = 1;
|
|
|
|
|
lineEquip.equipStatus = 1;
|
|
|
|
|
dbContext.Update(lineEquip);
|
|
|
|
|
dbContext.Update(item);
|
|
|
|
|
dbContext.WcsTaskLog.Where(t => t.objid == item.objid).Update(t => new WcsTaskLog() { taskStatus = 1 });
|
|
|
|
|
WcsCmdLog wcsCmdLog = CoreMapper.Map<WcsCmdLog>(wcsCmd);
|
|
|
|
|
dbContext.Add(wcsCmdLog);
|
|
|
|
|
dbContext.Add(wcsCmd);
|
|
|
|
|
dbContext.SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
@ -370,34 +275,19 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
{
|
|
|
|
|
WmsBaseLocation fromWmsBaseLocation = dbContext.WmsBaseLocation.First(t => t.locationId == item.currPointId);
|
|
|
|
|
WmsBaseLocation toWmsBaseLocation = dbContext.WmsBaseLocation.First(t => t.locationId == item.endPointId);
|
|
|
|
|
WcsCmd wcsCmd = new WcsCmd()
|
|
|
|
|
{
|
|
|
|
|
objid = StaticData.SnowId.NextId(),
|
|
|
|
|
cmdStatus = 0,
|
|
|
|
|
taskId = item.objid,
|
|
|
|
|
useFlag = 1,
|
|
|
|
|
cmdType = item.taskType,
|
|
|
|
|
containerNo = item.containerNo,
|
|
|
|
|
createTime = DateTime.Now,
|
|
|
|
|
createBy = FloorNo + "楼AGV",
|
|
|
|
|
currPointId = item.currPointId,
|
|
|
|
|
currPointNo = fromWmsBaseLocation.agvPositionCode,
|
|
|
|
|
nextPointId = item.endPointId,
|
|
|
|
|
nextPointNo = toWmsBaseLocation.agvPositionCode,
|
|
|
|
|
};
|
|
|
|
|
var agvTask = new RequestAGVTaskDto
|
|
|
|
|
{
|
|
|
|
|
reqCode = wcsCmd.objid.ToString(),
|
|
|
|
|
reqCode = StaticData.SnowId.NextId().ToString(),
|
|
|
|
|
positionCodePath = new List<Position>
|
|
|
|
|
{
|
|
|
|
|
new()
|
|
|
|
|
{
|
|
|
|
|
positionCode = wcsCmd.currPointNo,
|
|
|
|
|
positionCode = fromWmsBaseLocation.agvPositionCode,
|
|
|
|
|
type = "00"
|
|
|
|
|
},
|
|
|
|
|
new()
|
|
|
|
|
{
|
|
|
|
|
positionCode = wcsCmd.nextPointNo,
|
|
|
|
|
positionCode = toWmsBaseLocation.agvPositionCode,
|
|
|
|
|
type = "00"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -411,15 +301,11 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
if (reponseMessage != null && reponseMessage.message == "成功")
|
|
|
|
|
{
|
|
|
|
|
LogManager.Info("二楼AGV线程下发任务" + agvTask.ToJsonString() + "\n" + message);
|
|
|
|
|
Console.WriteLine(DateTime.Now + ":二楼AGV线程下发任务" + item.currPointId + "," + item.endPointNo);
|
|
|
|
|
wcsCmd.taskCode = reponseMessage.data;
|
|
|
|
|
wcsCmd.cmdStatus = 1;
|
|
|
|
|
Console.WriteLine(DateTime.Now + ":二楼AGV线程下发任务" + item.currPointNo + "," + item.endPointNo);
|
|
|
|
|
item.taskCode = reponseMessage.data;
|
|
|
|
|
item.taskStatus = 1;
|
|
|
|
|
dbContext.Update(item);
|
|
|
|
|
dbContext.WcsTaskLog.Where(t => t.objid == item.objid).Update(t => new WcsTaskLog() { taskStatus = 1 });
|
|
|
|
|
WcsCmdLog wcsCmdLog = CoreMapper.Map<WcsCmdLog>(wcsCmd);
|
|
|
|
|
dbContext.Add(wcsCmdLog);
|
|
|
|
|
dbContext.Add(wcsCmd);
|
|
|
|
|
dbContext.SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
@ -429,34 +315,19 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
}
|
|
|
|
|
else if (item.taskType == 53)//提升机-废料工位
|
|
|
|
|
{
|
|
|
|
|
WcsCmd wcsCmd = new WcsCmd()
|
|
|
|
|
{
|
|
|
|
|
objid = StaticData.SnowId.NextId(),
|
|
|
|
|
cmdStatus = 0,
|
|
|
|
|
taskId = item.objid,
|
|
|
|
|
useFlag = 1,
|
|
|
|
|
cmdType = item.taskType,
|
|
|
|
|
containerNo = item.containerNo,
|
|
|
|
|
createTime = DateTime.Now,
|
|
|
|
|
createBy = FloorNo + "楼AGV",
|
|
|
|
|
currPointId = item.currPointId,
|
|
|
|
|
currPointNo = lineEquip.agvPositionCode,
|
|
|
|
|
nextPointId = item.endPointId,
|
|
|
|
|
nextPointNo = wasteEquip.agvPositionCode,
|
|
|
|
|
};
|
|
|
|
|
var agvTask = new RequestAGVTaskDto
|
|
|
|
|
{
|
|
|
|
|
reqCode = wcsCmd.objid.ToString(),
|
|
|
|
|
reqCode = StaticData.SnowId.NextId().ToString(),
|
|
|
|
|
positionCodePath = new List<Position>
|
|
|
|
|
{
|
|
|
|
|
new ()
|
|
|
|
|
{
|
|
|
|
|
positionCode=wcsCmd.currPointNo,
|
|
|
|
|
positionCode=lineEquip.agvPositionCode,
|
|
|
|
|
type="00"
|
|
|
|
|
},
|
|
|
|
|
new ()
|
|
|
|
|
{
|
|
|
|
|
positionCode=wcsCmd.nextPointNo,
|
|
|
|
|
positionCode=wasteEquip.agvPositionCode,
|
|
|
|
|
type="00"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
@ -469,15 +340,11 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
if (reponseMessage != null && reponseMessage.message == "成功")
|
|
|
|
|
{
|
|
|
|
|
LogManager.Info("二楼AGV线程下发任务" + agvTask.ToJsonString() + "\n" + message);
|
|
|
|
|
Console.WriteLine(DateTime.Now + ":二楼AGV线程下发任务" + item.currPointId + "," + item.endPointNo);
|
|
|
|
|
wcsCmd.taskCode = reponseMessage.data;
|
|
|
|
|
wcsCmd.cmdStatus = 1;
|
|
|
|
|
Console.WriteLine(DateTime.Now + ":二楼AGV线程下发任务" + item.currPointNo + "," + item.endPointNo);
|
|
|
|
|
item.taskCode = reponseMessage.data;
|
|
|
|
|
item.taskStatus = 1;
|
|
|
|
|
dbContext.Update(item);
|
|
|
|
|
dbContext.WcsTaskLog.Where(t => t.objid == item.objid).Update(t => new WcsTaskLog() { taskStatus = 1 });
|
|
|
|
|
WcsCmdLog wcsCmdLog = CoreMapper.Map<WcsCmdLog>(wcsCmd);
|
|
|
|
|
dbContext.Add(wcsCmdLog);
|
|
|
|
|
dbContext.Add(wcsCmd);
|
|
|
|
|
dbContext.SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
@ -490,34 +357,19 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
var wasteEquipLocation = StaticData.BaseEquip.FirstOrDefault(t => t.objid == item.currPointId);
|
|
|
|
|
if (wasteEquipLocation != null)
|
|
|
|
|
{
|
|
|
|
|
WcsCmd wcsCmd = new WcsCmd()
|
|
|
|
|
{
|
|
|
|
|
objid = StaticData.SnowId.NextId(),
|
|
|
|
|
cmdStatus = 0,
|
|
|
|
|
taskId = item.objid,
|
|
|
|
|
useFlag = 1,
|
|
|
|
|
cmdType = item.taskType,
|
|
|
|
|
containerNo = item.containerNo,
|
|
|
|
|
createTime = DateTime.Now,
|
|
|
|
|
createBy = FloorNo + "楼AGV",
|
|
|
|
|
currPointId = item.currPointId,
|
|
|
|
|
currPointNo = wasteEquipLocation.agvPositionCode,
|
|
|
|
|
nextPointId = item.endPointId,
|
|
|
|
|
nextPointNo = wasteEquip.agvPositionCode,
|
|
|
|
|
};
|
|
|
|
|
var agvTask = new RequestAGVTaskDto
|
|
|
|
|
{
|
|
|
|
|
reqCode = wcsCmd.objid.ToString(),
|
|
|
|
|
reqCode = StaticData.SnowId.NextId().ToString(),
|
|
|
|
|
positionCodePath = new List<Position>
|
|
|
|
|
{
|
|
|
|
|
new ()
|
|
|
|
|
{
|
|
|
|
|
positionCode=wcsCmd.currPointNo,
|
|
|
|
|
positionCode=wasteEquipLocation.agvPositionCode,
|
|
|
|
|
type="00"
|
|
|
|
|
},
|
|
|
|
|
new ()
|
|
|
|
|
{
|
|
|
|
|
positionCode=wcsCmd.nextPointNo,
|
|
|
|
|
positionCode=wasteEquip.agvPositionCode,
|
|
|
|
|
type="00"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
@ -530,15 +382,11 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
if (reponseMessage != null && reponseMessage.message == "成功")
|
|
|
|
|
{
|
|
|
|
|
LogManager.Info("二楼AGV线程下发任务" + agvTask.ToJsonString() + "\n" + message);
|
|
|
|
|
Console.WriteLine(DateTime.Now + ":二楼AGV线程下发任务" + item.currPointId + "," + item.endPointNo);
|
|
|
|
|
wcsCmd.taskCode = reponseMessage.data;
|
|
|
|
|
wcsCmd.cmdStatus = 1;
|
|
|
|
|
Console.WriteLine(DateTime.Now + ":二楼AGV线程下发任务" + item.currPointNo + "," + item.endPointNo);
|
|
|
|
|
item.taskCode = reponseMessage.data;
|
|
|
|
|
item.taskStatus = 1;
|
|
|
|
|
dbContext.Update(item);
|
|
|
|
|
dbContext.WcsTaskLog.Where(t => t.objid == item.objid).Update(t => new WcsTaskLog() { taskStatus = 1 });
|
|
|
|
|
WcsCmdLog wcsCmdLog = CoreMapper.Map<WcsCmdLog>(wcsCmd);
|
|
|
|
|
dbContext.Add(wcsCmdLog);
|
|
|
|
|
dbContext.Add(wcsCmd);
|
|
|
|
|
dbContext.SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
@ -550,34 +398,19 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
else if (item.taskType == 58)//提升机到周转位
|
|
|
|
|
{
|
|
|
|
|
var endEquip = StaticData.BaseEquip.First(t => t.objid == item.endPointId);
|
|
|
|
|
WcsCmd wcsCmd = new WcsCmd()
|
|
|
|
|
{
|
|
|
|
|
objid = StaticData.SnowId.NextId(),
|
|
|
|
|
cmdStatus = 0,
|
|
|
|
|
taskId = item.objid,
|
|
|
|
|
useFlag = 1,
|
|
|
|
|
cmdType = item.taskType,
|
|
|
|
|
containerNo = item.containerNo,
|
|
|
|
|
createTime = DateTime.Now,
|
|
|
|
|
createBy = FloorNo + "楼AGV",
|
|
|
|
|
currPointId = item.currPointId,
|
|
|
|
|
currPointNo = lineEquip.agvPositionCode,
|
|
|
|
|
nextPointId = item.endPointId,
|
|
|
|
|
nextPointNo = endEquip.agvPositionCode,
|
|
|
|
|
};
|
|
|
|
|
var agvTask = new RequestAGVTaskDto
|
|
|
|
|
{
|
|
|
|
|
reqCode = wcsCmd.objid.ToString(),
|
|
|
|
|
reqCode = StaticData.SnowId.NextId().ToString(),
|
|
|
|
|
positionCodePath = new List<Position>
|
|
|
|
|
{
|
|
|
|
|
new ()
|
|
|
|
|
{
|
|
|
|
|
positionCode=wcsCmd.currPointNo,
|
|
|
|
|
positionCode=lineEquip.agvPositionCode,
|
|
|
|
|
type="00"
|
|
|
|
|
},
|
|
|
|
|
new ()
|
|
|
|
|
{
|
|
|
|
|
positionCode=wcsCmd.nextPointNo,
|
|
|
|
|
positionCode=endEquip.agvPositionCode,
|
|
|
|
|
type="00"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
@ -590,15 +423,11 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
if (reponseMessage != null && reponseMessage.message == "成功")
|
|
|
|
|
{
|
|
|
|
|
LogManager.Info("二楼AGV线程下发任务" + agvTask.ToJsonString() + "\n" + message);
|
|
|
|
|
Console.WriteLine(DateTime.Now + ":二楼AGV线程下发任务" + item.currPointId + "," + item.endPointNo);
|
|
|
|
|
wcsCmd.taskCode = reponseMessage.data;
|
|
|
|
|
wcsCmd.cmdStatus = 1;
|
|
|
|
|
Console.WriteLine(DateTime.Now + ":二楼AGV线程下发任务" + item.currPointNo + "," + item.endPointNo);
|
|
|
|
|
item.taskCode = reponseMessage.data;
|
|
|
|
|
item.taskStatus = 1;
|
|
|
|
|
dbContext.Update(item);
|
|
|
|
|
dbContext.WcsTaskLog.Where(t => t.objid == item.objid).Update(t => new WcsTaskLog() { taskStatus = 1 });
|
|
|
|
|
WcsCmdLog wcsCmdLog = CoreMapper.Map<WcsCmdLog>(wcsCmd);
|
|
|
|
|
dbContext.Add(wcsCmdLog);
|
|
|
|
|
dbContext.Add(wcsCmd);
|
|
|
|
|
dbContext.SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
@ -610,34 +439,20 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
{
|
|
|
|
|
BaseEquip startEquip = StaticData.BaseEquip.First(t => t.objid == item.currPointId);
|
|
|
|
|
BaseEquip endEquip = StaticData.BaseEquip.First(t => t.objid == item.endPointId);
|
|
|
|
|
WcsCmd wcsCmd = new WcsCmd()
|
|
|
|
|
{
|
|
|
|
|
objid = StaticData.SnowId.NextId(),
|
|
|
|
|
cmdStatus = 0,
|
|
|
|
|
taskId = item.objid,
|
|
|
|
|
useFlag = 1,
|
|
|
|
|
cmdType = item.taskType,
|
|
|
|
|
containerNo = item.containerNo,
|
|
|
|
|
createTime = DateTime.Now,
|
|
|
|
|
createBy = FloorNo + "楼AGV",
|
|
|
|
|
currPointId = item.currPointId,
|
|
|
|
|
currPointNo = startEquip.agvPositionCode,
|
|
|
|
|
nextPointId = item.endPointId,
|
|
|
|
|
nextPointNo = endEquip.agvPositionCode,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var agvTask = new RequestAGVTaskDto
|
|
|
|
|
{
|
|
|
|
|
reqCode = wcsCmd.objid.ToString(),
|
|
|
|
|
reqCode = StaticData.SnowId.NextId().ToString(),
|
|
|
|
|
positionCodePath = new List<Position>
|
|
|
|
|
{
|
|
|
|
|
new ()
|
|
|
|
|
{
|
|
|
|
|
positionCode=wcsCmd.currPointNo,
|
|
|
|
|
positionCode=startEquip.agvPositionCode,
|
|
|
|
|
type="00"
|
|
|
|
|
},
|
|
|
|
|
new ()
|
|
|
|
|
{
|
|
|
|
|
positionCode=wcsCmd.nextPointNo,
|
|
|
|
|
positionCode=endEquip.agvPositionCode,
|
|
|
|
|
type="00"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
@ -650,15 +465,11 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
if (reponseMessage != null && reponseMessage.message == "成功")
|
|
|
|
|
{
|
|
|
|
|
LogManager.Info("二楼AGV线程下发任务" + agvTask.ToJsonString() + "\n" + message);
|
|
|
|
|
Console.WriteLine(DateTime.Now + ":二楼AGV线程下发任务" + item.currPointId + "," + item.endPointNo);
|
|
|
|
|
wcsCmd.taskCode = reponseMessage.data;
|
|
|
|
|
wcsCmd.cmdStatus = 1;
|
|
|
|
|
Console.WriteLine(DateTime.Now + ":二楼AGV线程下发任务" + item.currPointNo + "," + item.endPointNo);
|
|
|
|
|
item.taskCode = reponseMessage.data;
|
|
|
|
|
item.taskStatus = 1;
|
|
|
|
|
dbContext.Update(item);
|
|
|
|
|
dbContext.WcsTaskLog.Where(t => t.objid == item.objid).Update(t => new WcsTaskLog() { taskStatus = 1 });
|
|
|
|
|
WcsCmdLog wcsCmdLog = CoreMapper.Map<WcsCmdLog>(wcsCmd);
|
|
|
|
|
dbContext.Add(wcsCmdLog);
|
|
|
|
|
dbContext.Add(wcsCmd);
|
|
|
|
|
dbContext.SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
@ -669,13 +480,11 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
WcsCmd? wcsCmd = dbContext.WcsCmd.FirstOrDefault(t => t.taskId == item.objid);
|
|
|
|
|
if (wcsCmd != null)
|
|
|
|
|
{
|
|
|
|
|
LogManager.Info("二楼AGV线程完成任务" + item.objid);
|
|
|
|
|
if (wcsCmd.cmdStatus == 3)
|
|
|
|
|
if (item.taskStatus == 3)
|
|
|
|
|
{
|
|
|
|
|
if (wcsCmd.currPointId == lineEquip.objid)
|
|
|
|
|
if (item.currPointId == lineEquip.objid)
|
|
|
|
|
{
|
|
|
|
|
var lineSignal02 = StaticData.PlcDic[0].Read(StaticData.BasePlcpointList.First(t => t.plcpointNo == "linesignal02").plcpointAddress);
|
|
|
|
|
var rfid = StaticData.PlcDic[0].ReadRFID(StaticData.BasePlcpointList.First(t => t.plcpointNo == "RFID002").plcpointAddress);
|
|
|
|
|
@ -684,65 +493,53 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
var agvTask = new RequestAGVTaskDto
|
|
|
|
|
{
|
|
|
|
|
reqCode = StaticData.SnowId.NextId().ToString(),
|
|
|
|
|
taskCode = wcsCmd.taskCode
|
|
|
|
|
taskCode = item.taskCode
|
|
|
|
|
};
|
|
|
|
|
string message = JsonConvert.SerializeObject(agvTask);
|
|
|
|
|
string result = HttpHelper.SendPostMessage(baseEquip.serverIp, baseEquip.serverPort.Value, "rcms/services/rest/hikRpcService/continueTask", message);
|
|
|
|
|
ReponseMessage? reponseMessage = JsonConvert.DeserializeObject<ReponseMessage>(result);
|
|
|
|
|
if (reponseMessage != null && reponseMessage.message == "成功")
|
|
|
|
|
{
|
|
|
|
|
wcsCmd.cmdStatus = 4;
|
|
|
|
|
dbContext.WcsCmd.Where(t => t.objid == wcsCmd.objid).Update(t => new WcsCmd() { cmdStatus = 4 });
|
|
|
|
|
dbContext.Update(wcsCmd);
|
|
|
|
|
dbContext.WcsTask.Where(t => t.objid == item.objid).Update(t => new WcsTask() { taskStatus = 4 });
|
|
|
|
|
dbContext.WcsTaskLog.Where(t => t.objid == item.objid).Update(t => new WcsTaskLog() { taskStatus = 4 });
|
|
|
|
|
dbContext.SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (wcsCmd.currPointId == wasteEquip.objid)
|
|
|
|
|
else if (item.currPointId == wasteEquip.objid)
|
|
|
|
|
{
|
|
|
|
|
if (true)
|
|
|
|
|
{
|
|
|
|
|
var agvTask = new RequestAGVTaskDto
|
|
|
|
|
{
|
|
|
|
|
reqCode = StaticData.SnowId.NextId().ToString(),
|
|
|
|
|
taskCode = wcsCmd.taskCode
|
|
|
|
|
taskCode = item.taskCode
|
|
|
|
|
};
|
|
|
|
|
string message = JsonConvert.SerializeObject(agvTask);
|
|
|
|
|
string result = HttpHelper.SendPostMessage(baseEquip.serverIp, baseEquip.serverPort.Value, "rcms/services/rest/hikRpcService/continueTask", message);
|
|
|
|
|
ReponseMessage? reponseMessage = JsonConvert.DeserializeObject<ReponseMessage>(result);
|
|
|
|
|
if (reponseMessage != null && reponseMessage.message == "成功")
|
|
|
|
|
{
|
|
|
|
|
wcsCmd.cmdStatus = 4;
|
|
|
|
|
dbContext.WcsCmd.Where(t => t.objid == wcsCmd.objid).Update(t => new WcsCmd() { cmdStatus = 4 });
|
|
|
|
|
dbContext.Update(wcsCmd);
|
|
|
|
|
dbContext.WcsTask.Where(t => t.objid == item.objid).Update(t => new WcsTask() { taskStatus = 4 });
|
|
|
|
|
dbContext.WcsTaskLog.Where(t => t.objid == item.objid).Update(t => new WcsTaskLog() { taskStatus = 4 });
|
|
|
|
|
dbContext.SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (wcsCmd.currPointId == outEquip.objid)
|
|
|
|
|
else if (item.currPointId == outEquip.objid)
|
|
|
|
|
{
|
|
|
|
|
if (true)
|
|
|
|
|
{
|
|
|
|
|
var agvTask = new RequestAGVTaskDto
|
|
|
|
|
{
|
|
|
|
|
reqCode = StaticData.SnowId.NextId().ToString(),
|
|
|
|
|
taskCode = wcsCmd.taskCode
|
|
|
|
|
taskCode = item.taskCode
|
|
|
|
|
};
|
|
|
|
|
string message = JsonConvert.SerializeObject(agvTask);
|
|
|
|
|
string result = HttpHelper.SendPostMessage(baseEquip.serverIp, baseEquip.serverPort.Value, "rcms/services/rest/hikRpcService/continueTask", message);
|
|
|
|
|
ReponseMessage? reponseMessage = JsonConvert.DeserializeObject<ReponseMessage>(result);
|
|
|
|
|
if (reponseMessage != null && reponseMessage.message == "成功")
|
|
|
|
|
{
|
|
|
|
|
wcsCmd.cmdStatus = 4;
|
|
|
|
|
dbContext.WcsCmd.Where(t => t.objid == wcsCmd.objid).Update(t => new WcsCmd() { cmdStatus = 4 });
|
|
|
|
|
dbContext.Update(wcsCmd);
|
|
|
|
|
dbContext.WcsTask.Where(t => t.objid == item.objid).Update(t => new WcsTask() { taskStatus = 4 });
|
|
|
|
|
dbContext.WcsTaskLog.Where(t => t.objid == item.objid).Update(t => new WcsTaskLog() { taskStatus = 4 });
|
|
|
|
|
dbContext.SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -751,24 +548,19 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
var agvTask = new RequestAGVTaskDto
|
|
|
|
|
{
|
|
|
|
|
reqCode = StaticData.SnowId.NextId().ToString(),
|
|
|
|
|
taskCode = wcsCmd.taskCode
|
|
|
|
|
taskCode = item.taskCode
|
|
|
|
|
};
|
|
|
|
|
string message = JsonConvert.SerializeObject(agvTask);
|
|
|
|
|
string result = HttpHelper.SendPostMessage(baseEquip.serverIp, baseEquip.serverPort.Value, "rcms/services/rest/hikRpcService/continueTask", message);
|
|
|
|
|
ReponseMessage? reponseMessage = JsonConvert.DeserializeObject<ReponseMessage>(result);
|
|
|
|
|
if (reponseMessage != null && reponseMessage.message == "成功")
|
|
|
|
|
{
|
|
|
|
|
wcsCmd.cmdStatus = 4;
|
|
|
|
|
item.taskStatus = 4;
|
|
|
|
|
dbContext.Update(wcsCmd);
|
|
|
|
|
dbContext.Update(item);
|
|
|
|
|
dbContext.WcsTask.Where(t => t.objid == item.objid).Update(t => new WcsTask() { taskStatus = 4 });
|
|
|
|
|
dbContext.WcsTaskLog.Where(t => t.objid == item.objid).Update(t => new WcsTaskLog() { taskStatus = 4 });
|
|
|
|
|
dbContext.SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (wcsCmd.cmdStatus == 5)
|
|
|
|
|
else if (item.taskStatus == 5)
|
|
|
|
|
{
|
|
|
|
|
if (item.taskType == 51)
|
|
|
|
|
{
|
|
|
|
|
@ -777,20 +569,15 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
var agvTask = new RequestAGVTaskDto
|
|
|
|
|
{
|
|
|
|
|
reqCode = StaticData.SnowId.NextId().ToString(),
|
|
|
|
|
taskCode = wcsCmd.taskCode
|
|
|
|
|
taskCode = item.taskCode
|
|
|
|
|
};
|
|
|
|
|
string message = JsonConvert.SerializeObject(agvTask);
|
|
|
|
|
string result = HttpHelper.SendPostMessage(baseEquip.serverIp, baseEquip.serverPort.Value, "rcms/services/rest/hikRpcService/continueTask", message);
|
|
|
|
|
ReponseMessage? reponseMessage = JsonConvert.DeserializeObject<ReponseMessage>(result);
|
|
|
|
|
if (reponseMessage != null && reponseMessage.message == "成功")
|
|
|
|
|
{
|
|
|
|
|
wcsCmd.cmdStatus = 6;
|
|
|
|
|
item.taskStatus = 6;
|
|
|
|
|
dbContext.Update(item);
|
|
|
|
|
dbContext.Update(wcsCmd);
|
|
|
|
|
dbContext.WcsTask.Where(t => t.objid == item.objid).Update(t => new WcsTask() { taskStatus = 6 });
|
|
|
|
|
dbContext.WcsTaskLog.Where(t => t.objid == item.objid).Update(t => new WcsTaskLog() { taskStatus = 6 });
|
|
|
|
|
dbContext.SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -818,7 +605,6 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
if (mesBaseBarcodeInfo != null)
|
|
|
|
|
{
|
|
|
|
|
WmsBaseLocation wmsBaseLocation = dbContext.WmsBaseLocation.First(t => t.locationId == item.endPointId);
|
|
|
|
|
wmsBaseLocation.instockFlag = "0";
|
|
|
|
|
wmsBaseLocation.locationStatus = "1";
|
|
|
|
|
wmsBaseLocation.containerCode = item.containerNo;
|
|
|
|
|
WmsProductStock wmsProductStock = new WmsProductStock()
|
|
|
|
|
@ -854,9 +640,7 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
dbContext.Update(wmsBaseLocation);
|
|
|
|
|
//dbContext.Update(wmsProductInstock);
|
|
|
|
|
dbContext.Remove(item);
|
|
|
|
|
dbContext.Remove(wcsCmd);
|
|
|
|
|
dbContext.WcsTaskLog.Where(t => t.objid == item.objid).Update(t => new WcsTaskLog() { taskStatus = 8 });
|
|
|
|
|
dbContext.WcsCmdLog.Where(t => t.objid == item.objid).Update(t => new WcsCmdLog() { cmdStatus = 8 });
|
|
|
|
|
dbContext.SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
// }
|
|
|
|
|
@ -881,7 +665,6 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
}
|
|
|
|
|
wmsProductOutstockDetail.executeStatus = "2";
|
|
|
|
|
wmsBaseLocation.locationStatus = "1";
|
|
|
|
|
wmsBaseLocation.outstockFlag = "0";
|
|
|
|
|
wmsBaseLocation.containerCode = null;
|
|
|
|
|
item.nextPointId = 2;
|
|
|
|
|
item.taskStatus = 8;
|
|
|
|
|
@ -890,27 +673,23 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
dbContext.Update(wmsProductOutstockDetail);
|
|
|
|
|
dbContext.Update(wmsProductOutstock);
|
|
|
|
|
dbContext.Update(item);
|
|
|
|
|
dbContext.Remove(wcsCmd);
|
|
|
|
|
dbContext.WcsTaskLog.Where(t => t.objid == item.objid).Update(t => new WcsTaskLog() { taskStatus = 8 });
|
|
|
|
|
dbContext.WcsCmdLog.Where(t => t.objid == item.objid).Update(t => new WcsCmdLog() { cmdStatus = 8 });
|
|
|
|
|
dbContext.SaveChanges();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (item.taskType == 58)
|
|
|
|
|
else if (item.taskType == 58)//空托盘入周转位
|
|
|
|
|
{
|
|
|
|
|
BaseEquip endEquip = StaticData.BaseEquip.First(t => t.objid == item.endPointId);
|
|
|
|
|
endEquip.equipStatus = 1;
|
|
|
|
|
endEquip.emptyCount = item.qty;
|
|
|
|
|
dbContext.Update(endEquip);
|
|
|
|
|
dbContext.Remove(item);
|
|
|
|
|
dbContext.Remove(wcsCmd);
|
|
|
|
|
dbContext.WcsTaskLog.Where(t => t.objid == item.objid).Update(t => new WcsTaskLog() { taskStatus = 8 });
|
|
|
|
|
dbContext.WcsCmdLog.Where(t => t.objid == item.objid).Update(t => new WcsCmdLog() { cmdStatus = 8 });
|
|
|
|
|
dbContext.SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
else if (item.taskType == 53)
|
|
|
|
|
else if (item.taskType == 53)//提升机到废料口
|
|
|
|
|
{
|
|
|
|
|
BaseEquip startEquip = dbContext.BaseEquip.First(t => t.objid == item.currPointId);
|
|
|
|
|
startEquip.equipStatus = 0;
|
|
|
|
|
@ -921,23 +700,19 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
dbContext.Update(endEquip);
|
|
|
|
|
dbContext.Update(startEquip);
|
|
|
|
|
dbContext.Remove(item);
|
|
|
|
|
dbContext.Remove(wcsCmd);
|
|
|
|
|
dbContext.WcsTaskLog.Where(t => t.objid == item.objid).Update(t => new WcsTaskLog() { taskStatus = 8 });
|
|
|
|
|
dbContext.WcsCmdLog.Where(t => t.objid == item.objid).Update(t => new WcsCmdLog() { cmdStatus = 8 });
|
|
|
|
|
dbContext.SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
else if (item.taskType == 51)
|
|
|
|
|
else if (item.taskType == 51)//输送线到小包入口
|
|
|
|
|
{
|
|
|
|
|
BaseEquip startEquip = dbContext.BaseEquip.First(t => t.objid == item.currPointId);
|
|
|
|
|
startEquip.equipStatus = 0;
|
|
|
|
|
dbContext.Update(startEquip);
|
|
|
|
|
dbContext.Remove(item);
|
|
|
|
|
dbContext.Remove(wcsCmd);
|
|
|
|
|
dbContext.WcsTaskLog.Where(t => t.objid == item.objid).Update(t => new WcsTaskLog() { taskStatus = 8 });
|
|
|
|
|
dbContext.WcsCmdLog.Where(t => t.objid == item.objid).Update(t => new WcsCmdLog() { cmdStatus = 8 });
|
|
|
|
|
dbContext.SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
else if (item.taskType == 54)
|
|
|
|
|
else if (item.taskType == 54)//周转位到废料口
|
|
|
|
|
{
|
|
|
|
|
BaseEquip startEquip = StaticData.BaseEquip.First(t => t.objid == item.currPointId);
|
|
|
|
|
startEquip.equipStatus = 0;
|
|
|
|
|
@ -950,49 +725,34 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
dbContext.Update(startEquip);
|
|
|
|
|
dbContext.Update(endEquip);
|
|
|
|
|
dbContext.Remove(item);
|
|
|
|
|
dbContext.Remove(wcsCmd);
|
|
|
|
|
dbContext.WcsTaskLog.Where(t => t.objid == item.objid).Update(t => new WcsTaskLog() { taskStatus = 8 });
|
|
|
|
|
dbContext.WcsCmdLog.Where(t => t.objid == item.objid).Update(t => new WcsCmdLog() { cmdStatus = 8 });
|
|
|
|
|
dbContext.SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
else if (item.taskType == 55)
|
|
|
|
|
else if (item.taskType == 55)//移库
|
|
|
|
|
{
|
|
|
|
|
using var transaction = dbContext.Database.BeginTransaction();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var wmsRawStock = dbContext.WmsRawStock.Where(t => t.locationCode == item.endPointNo).FirstOrDefault();
|
|
|
|
|
if (wmsRawStock != null)
|
|
|
|
|
var wmsProductStock = dbContext.WmsProductStock.FirstOrDefault(t => t.locationCode == item.currPointNo);
|
|
|
|
|
if (wmsProductStock != null)
|
|
|
|
|
{
|
|
|
|
|
wmsRawStock.locationCode = item.endPointNo;
|
|
|
|
|
dbContext.Update(wmsRawStock);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var wmsProductStock = dbContext.WmsProductStock.FirstOrDefault(t => t.locationCode == item.currPointNo);
|
|
|
|
|
if (wmsProductStock != null)
|
|
|
|
|
{
|
|
|
|
|
wmsProductStock.locationCode = item.currPointNo;
|
|
|
|
|
dbContext.Update(wmsProductStock);
|
|
|
|
|
}
|
|
|
|
|
wmsProductStock.locationCode = item.endPointNo;
|
|
|
|
|
dbContext.Update(wmsProductStock);
|
|
|
|
|
}
|
|
|
|
|
dbContext.WmsBaseLocation.Where(t => t.locationId == item.currPointId).Update(t => new WmsBaseLocation
|
|
|
|
|
{
|
|
|
|
|
outstockFlag = "0",
|
|
|
|
|
locationStatus = "1",
|
|
|
|
|
containerCode = null,
|
|
|
|
|
updateTime = DateTime.Now
|
|
|
|
|
});
|
|
|
|
|
dbContext.WmsBaseLocation.Where(t => t.locationId == item.endPointId).Update(t => new WmsBaseLocation
|
|
|
|
|
{
|
|
|
|
|
instockFlag = "0",
|
|
|
|
|
locationStatus = "1",
|
|
|
|
|
containerCode = item.containerNo,
|
|
|
|
|
updateTime = DateTime.Now
|
|
|
|
|
});
|
|
|
|
|
dbContext.Remove(item);
|
|
|
|
|
dbContext.Remove(wcsCmd);
|
|
|
|
|
dbContext.WcsTaskLog.Where(t => t.objid == item.objid).Update(t => new WcsTaskLog() { taskStatus = 8 });
|
|
|
|
|
dbContext.WcsCmdLog.Where(t => t.objid == item.objid).Update(t => new WcsCmdLog() { cmdStatus = 8 });
|
|
|
|
|
transaction.Commit();
|
|
|
|
|
dbContext.SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
@ -1002,7 +762,7 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
LogManager.Error(ex);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (item.taskType == 56)
|
|
|
|
|
else if (item.taskType == 56)//废料区到周转区
|
|
|
|
|
{
|
|
|
|
|
wasteEquip.emptyCount = 0;
|
|
|
|
|
wasteEquip.equipStatus = 0;
|
|
|
|
|
@ -1012,26 +772,23 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
endEquip.containerNo = item.containerNo;
|
|
|
|
|
dbContext.Remove(item);
|
|
|
|
|
dbContext.Update(wasteEquip);
|
|
|
|
|
dbContext.Remove(wcsCmd);
|
|
|
|
|
dbContext.WcsTaskLog.Where(t => t.objid == item.objid).Update(t => new WcsTaskLog() { taskStatus = 8 });
|
|
|
|
|
dbContext.WcsCmdLog.Where(t => t.objid == item.objid).Update(t => new WcsCmdLog() { cmdStatus = 8 });
|
|
|
|
|
dbContext.SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
else if (item.taskType == 57)
|
|
|
|
|
else if (item.taskType == 57)//周转位-提升机
|
|
|
|
|
{
|
|
|
|
|
BaseEquip emptyEquip = StaticData.BaseEquip.First(t => t.objid == item.currPointId);
|
|
|
|
|
emptyEquip.emptyCount = 0;
|
|
|
|
|
emptyEquip.equipStatus = 0;
|
|
|
|
|
emptyEquip.containerNo = null;
|
|
|
|
|
item.nextPointId = 2;
|
|
|
|
|
item.taskStatus = 8;
|
|
|
|
|
dbContext.Update(item);
|
|
|
|
|
dbContext.Update(emptyEquip);
|
|
|
|
|
dbContext.Remove(wcsCmd);
|
|
|
|
|
dbContext.WcsTaskLog.Where(t => t.objid == item.objid).Update(t => new WcsTaskLog() { taskStatus = 6 });
|
|
|
|
|
dbContext.WcsCmdLog.Where(t => t.objid == item.objid).Update(t => new WcsCmdLog() { cmdStatus = 6 });
|
|
|
|
|
dbContext.SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
else if (item.taskType == 59)
|
|
|
|
|
else if (item.taskType == 59)//周转区-小包入口
|
|
|
|
|
{
|
|
|
|
|
BaseEquip startEquip = StaticData.BaseEquip.First(t => t.objid == item.currPointId);
|
|
|
|
|
startEquip.equipStatus = 0;
|
|
|
|
|
@ -1039,9 +796,7 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
startEquip.containerNo = null;
|
|
|
|
|
dbContext.Update(startEquip);
|
|
|
|
|
dbContext.Remove(item);
|
|
|
|
|
dbContext.Remove(wcsCmd);
|
|
|
|
|
dbContext.WcsTaskLog.Where(t => t.objid == item.objid).Update(t => new WcsTaskLog() { taskStatus = 8 });
|
|
|
|
|
dbContext.WcsCmdLog.Where(t => t.objid == item.objid).Update(t => new WcsCmdLog() { cmdStatus = 8 });
|
|
|
|
|
dbContext.SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|