|
|
|
|
@ -28,6 +28,7 @@ namespace Khd.Core.Application
|
|
|
|
|
.FirstOrDefault();
|
|
|
|
|
return entity;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public WcsTask Add(WcsTask model)
|
|
|
|
|
{
|
|
|
|
|
var entity = _dbContext.Add(model);
|
|
|
|
|
@ -35,11 +36,13 @@ namespace Khd.Core.Application
|
|
|
|
|
return entity.Entity;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public WcsTask Update(WcsTask model)
|
|
|
|
|
{
|
|
|
|
|
var list = _dbContext.WcsTask.Where(t => t.objid == model.objid).Update(a => model);
|
|
|
|
|
return model;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 接收agv接收任务通知接口
|
|
|
|
|
/// </summary>
|
|
|
|
|
@ -153,6 +156,7 @@ namespace Khd.Core.Application
|
|
|
|
|
return reponseagvCallbackDto;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 入库完成
|
|
|
|
|
/// </summary>
|
|
|
|
|
@ -161,6 +165,7 @@ namespace Khd.Core.Application
|
|
|
|
|
{
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 出库完成
|
|
|
|
|
/// </summary>
|
|
|
|
|
@ -184,7 +189,10 @@ namespace Khd.Core.Application
|
|
|
|
|
BaseEquip baseEquip = _dbContext.BaseEquip.FirstOrDefault(t => t.equipNo == agvCompeletedRequest.endStationCode);
|
|
|
|
|
if (baseEquip != null)
|
|
|
|
|
{
|
|
|
|
|
var wcsCmd = _dbContext.WcsCmd.Where(t => t.nextPointId == baseEquip.objid).Where(t => t.cmdStatus == 5).FirstOrDefault();
|
|
|
|
|
var wcsCmd = _dbContext.WcsCmd
|
|
|
|
|
.Where(t => t.cmdType == 32 || t.cmdType == 48)
|
|
|
|
|
.Where(t => t.nextPointId == baseEquip.objid || t.currPointId == baseEquip.objid)
|
|
|
|
|
.FirstOrDefault();
|
|
|
|
|
if (wcsCmd != null)
|
|
|
|
|
{
|
|
|
|
|
WcsTask wcsTask = _dbContext.WcsTask.FirstOrDefault(t => t.objid == wcsCmd.taskId);
|
|
|
|
|
@ -192,7 +200,6 @@ namespace Khd.Core.Application
|
|
|
|
|
{
|
|
|
|
|
if (wcsTask.taskType != 48)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
wcsCmd.cmdStatus = 7;
|
|
|
|
|
wcsTask.taskStatus = 7;
|
|
|
|
|
_dbContext.WcsCmd.Update(wcsCmd);
|
|
|
|
|
@ -205,7 +212,6 @@ namespace Khd.Core.Application
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
wcsCmd.cmdStatus = 4;
|
|
|
|
|
wcsTask.taskStatus = 4;
|
|
|
|
|
_dbContext.WcsCmd.Update(wcsCmd);
|
|
|
|
|
@ -217,6 +223,11 @@ namespace Khd.Core.Application
|
|
|
|
|
agvCompeletedResponse.message = "成功";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
agvCompeletedResponse.code = "1";
|
|
|
|
|
agvCompeletedResponse.message = "未找到当前任务";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
@ -227,7 +238,7 @@ namespace Khd.Core.Application
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
agvCompeletedResponse.code = "1";
|
|
|
|
|
agvCompeletedResponse.message = "未找到当前设备";
|
|
|
|
|
agvCompeletedResponse.message = "未找到当前工位";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
@ -277,6 +288,7 @@ namespace Khd.Core.Application
|
|
|
|
|
}
|
|
|
|
|
return compeletedResponse;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 柜体拆分区通知返库
|
|
|
|
|
/// </summary>
|
|
|
|
|
@ -465,5 +477,32 @@ namespace Khd.Core.Application
|
|
|
|
|
}
|
|
|
|
|
return reponseMessage;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ReponseMessage AGVTaskComplete()
|
|
|
|
|
{
|
|
|
|
|
ReponseMessage reponseMessage = new ReponseMessage();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
_dbContext.ChangeTracker.Entries().ToList().ForEach(e => e.Reload());
|
|
|
|
|
bool hasTask = _dbContext.WcsTask.Where(t => t.taskType == 41).Any();
|
|
|
|
|
if (hasTask)
|
|
|
|
|
{
|
|
|
|
|
reponseMessage.code = "0";
|
|
|
|
|
reponseMessage.message = "成功";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
reponseMessage.code = "1";
|
|
|
|
|
reponseMessage.message = "当前无任务";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
reponseMessage.code = "1";
|
|
|
|
|
reponseMessage.message = ex.Message;
|
|
|
|
|
LogManager.Error(ex);
|
|
|
|
|
}
|
|
|
|
|
return reponseMessage;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|