|
|
|
|
@ -184,6 +184,10 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
taskType = agvEquip.objid == 28 ? 66 : 55,
|
|
|
|
|
qty = 1,
|
|
|
|
|
};
|
|
|
|
|
fromLocationCode.locationStatus = "4";
|
|
|
|
|
dbContext.Update(fromLocationCode);
|
|
|
|
|
wmsBaseLocation.locationStatus = "4";
|
|
|
|
|
dbContext.Update(wmsBaseLocation);
|
|
|
|
|
dbContext.Add(wcsTask);
|
|
|
|
|
WcsTaskLog wcsTaskLog = CoreMapper.Map<WcsTaskLog>(wcsTask);
|
|
|
|
|
dbContext.Add(wcsTaskLog);
|
|
|
|
|
@ -281,6 +285,10 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
taskType = agvEquip.objid == 28 ? 66 : 67,
|
|
|
|
|
qty = 1,
|
|
|
|
|
};
|
|
|
|
|
fromLocationCode.locationStatus = "4";
|
|
|
|
|
dbContext.Update(fromLocationCode);
|
|
|
|
|
wmsBaseLocation.locationStatus = "4";
|
|
|
|
|
dbContext.Update(wmsBaseLocation);
|
|
|
|
|
dbContext.Add(wcsTask);
|
|
|
|
|
WcsTaskLog wcsTaskLog = CoreMapper.Map<WcsTaskLog>(wcsTask);
|
|
|
|
|
dbContext.Add(wcsTaskLog);
|
|
|
|
|
@ -1480,17 +1488,14 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
List<WcsTaskManual> wcsTaskManuals = dbContext.WcsTaskManual.Where(t => t.nextPointId == 11).OrderBy(t => t.createBy).ToList();
|
|
|
|
|
if (wcsTaskManuals.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
WcsOutstockLock wcsOutstockLock = dbContext.WcsOutstockLock.Where(t => t.warehouseId == 512).First();
|
|
|
|
|
int taskCount = dbContext.WcsTask.Where(t => t.nextPointId == 11).Count();
|
|
|
|
|
if (taskCount == 0 && wcsOutstockLock.qty == 0 && wcsOutstockLock.boxStatus == 0)
|
|
|
|
|
//if (taskCount == 0 && wcsOutstockLock.qty == 0 && wcsOutstockLock.boxStatus == 0)
|
|
|
|
|
if (taskCount == 0 )
|
|
|
|
|
{
|
|
|
|
|
foreach (var wcs in wcsTaskManuals.Take(6))
|
|
|
|
|
{
|
|
|
|
|
WcsTask wcsTask = CoreMapper.Map<WcsTask>(wcs);
|
|
|
|
|
WcsTaskLog wcsTaskLog = CoreMapper.Map<WcsTaskLog>(wcsTask);
|
|
|
|
|
wcsOutstockLock.qty += 1;
|
|
|
|
|
wcsOutstockLock.boxStatus = 1;
|
|
|
|
|
dbContext.Update(wcsOutstockLock);
|
|
|
|
|
dbContext.Add(wcsTask);
|
|
|
|
|
dbContext.Add(wcsTaskLog);
|
|
|
|
|
dbContext.WcsTaskManual.Where(t => t.objid == wcs.objid).Delete();
|
|
|
|
|
@ -1647,10 +1652,8 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
if (!string.IsNullOrEmpty(endStationCodeEquip.endStationCode))
|
|
|
|
|
{
|
|
|
|
|
bool CreateSuccess = false;
|
|
|
|
|
var wcsOutstockLock = dbContext.WcsOutstockLock
|
|
|
|
|
.Where(t => t.warehouseId == 512)
|
|
|
|
|
.First();
|
|
|
|
|
if (wcsOutstockLock.qty == 0 && wcsOutstockLock.boxStatus == 0)
|
|
|
|
|
bool hasTask = dbContext.WcsTask.Where(t => t.nextPointId == 11).Any();
|
|
|
|
|
if (!hasTask)
|
|
|
|
|
{
|
|
|
|
|
var orderList = rawOutStock.Where(t => t.endStationCode == endStationCodeEquip.endStationCode).ToList();
|
|
|
|
|
List<WcsTask> tasks = new();
|
|
|
|
|
@ -1790,8 +1793,6 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
location.updateBy = "WCS";
|
|
|
|
|
location.ContainerStatus = "2";
|
|
|
|
|
location.updateTime = DateTime.Now;
|
|
|
|
|
wcsOutstockLock.qty += 1;
|
|
|
|
|
wcsOutstockLock.boxStatus = 1;
|
|
|
|
|
dbContext.Update(location);
|
|
|
|
|
dbContext.Update(stock);
|
|
|
|
|
CreateSuccess = true;
|
|
|
|
|
@ -1815,7 +1816,7 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
BaseEquip startStationEquip = StaticData.BaseEquip.First(t => t.objid == 21);
|
|
|
|
|
BaseEquip bearAgvEquip = StaticData.BaseEquip.First(t => t.objid == 10);
|
|
|
|
|
BaseEquip endStationEquip = StaticData.BaseEquip.First(t => t.equipNo == item.endStationCode);
|
|
|
|
|
bool hasTask = dbContext.WcsTask.Where(t => t.taskType == 32).Any();
|
|
|
|
|
hasTask = dbContext.WcsTask.Where(t => t.taskType == 32).Any();
|
|
|
|
|
if (!hasTask)
|
|
|
|
|
{
|
|
|
|
|
WcsTask bearAgvTask = new()
|
|
|
|
|
@ -1857,7 +1858,6 @@ namespace Khd.Core.Wcs.Wcs
|
|
|
|
|
if (tasks.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
dbContext.AddRange(tasks);
|
|
|
|
|
dbContext.Update(wcsOutstockLock);
|
|
|
|
|
}
|
|
|
|
|
dbContext.SaveChanges();
|
|
|
|
|
}
|
|
|
|
|
|