出库分解修改
出库分拣页面修改 mes接口修改
This commit is contained in:
1 parent
26d46cad00
commit
30f1e69664
6 files changed
+89
-62
No files matched your search
@@ -182,27 +182,44 @@ namespace HHWMS.Web
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
var station = _unitwork.FindSingle<Location>(x => x.Type.Equals(LocationTypeEnum.堆垛机工位)
|
||||
&& x.Status != LocationStatus.任务锁);
|
||||
|
||||
var station = new Location();
|
||||
if (task.FromLocation == "L01")
|
||||
{
|
||||
// L01 优先从左边入
|
||||
station = _unitwork.Find<Location>(x => x.Type.Equals(LocationTypeEnum.堆垛机工位)
|
||||
&& x.Status != LocationStatus.任务锁).OrderByDescending(x => x.Row).FirstOrDefault();
|
||||
&& x.Status != LocationStatus.任务锁)
|
||||
.OrderByDescending(x => x.Row)
|
||||
.FirstOrDefault();
|
||||
}
|
||||
else
|
||||
{
|
||||
// L02 只能入右边 row=1
|
||||
station = _unitwork.FindSingle<Location>(x => x.Type.Equals(LocationTypeEnum.堆垛机工位)
|
||||
&&x.Row == 1
|
||||
&& x.Status != LocationStatus.任务锁);
|
||||
}
|
||||
if (station != null && count > 0)
|
||||
{
|
||||
var container = _unitwork.Find<Location>(x => x.Row == station.Row && x.Type == LocationTypeEnum.盘料库位
|
||||
&& (x.Status == LocationStatus.有货 || x.Status == LocationStatus.空容器) && x.Length == Length && !x.IsStop)
|
||||
var container = _unitwork.Find<Location>(x => x.Row == station.Row
|
||||
&& x.Type == LocationTypeEnum.盘料库位
|
||||
&& (x.Status == LocationStatus.有货 || x.Status == LocationStatus.空容器)
|
||||
&& x.Length == Length && !x.IsStop)
|
||||
.OrderByDescending(x => x.Length - x.Width).FirstOrDefault();
|
||||
if (Length == 23 && container == null && station.Row == 3)
|
||||
{
|
||||
station = _unitwork.Find<Location>(x => x.Type.Equals(LocationTypeEnum.堆垛机工位)
|
||||
&& x.Status != LocationStatus.任务锁 && x.Row == 1).FirstOrDefault();
|
||||
&& x.Status != LocationStatus.任务锁
|
||||
&& x.Row == 1)
|
||||
.FirstOrDefault();
|
||||
|
||||
container = _unitwork.Find<Location>(x => x.Row == station.Row && x.Type == LocationTypeEnum.盘料库位
|
||||
&& (x.Status == LocationStatus.有货 || x.Status == LocationStatus.空容器) && x.Length == Length && !x.IsStop)
|
||||
.OrderByDescending(x => x.Length - x.Width).FirstOrDefault();
|
||||
container = _unitwork.Find<Location>(x => x.Row == station.Row
|
||||
&& x.Type == LocationTypeEnum.盘料库位
|
||||
&& (x.Status == LocationStatus.有货 || x.Status == LocationStatus.空容器)
|
||||
&& x.Length == Length
|
||||
&& !x.IsStop)
|
||||
.OrderByDescending(x => x.Length - x.Width)
|
||||
.FirstOrDefault();
|
||||
|
||||
}
|
||||
if(station != null && container != null)
|
||||
|
||||
@@ -193,53 +193,57 @@ namespace HHWMS.Web
|
||||
.FirstOrDefault();
|
||||
|
||||
//查询料塔是否为空
|
||||
//if (tLoc == null)
|
||||
//{
|
||||
// //判断是否存在此托盘的出库任务
|
||||
// var containerTask = _unitwork.Find<TaskHeader>(x => x.Status < TaskStatusEnum.已下发
|
||||
// && x.ContainerCode == item.Key
|
||||
// && x.TaskType == TaskTypeEnum.盘料出库)
|
||||
// .Include(x => x.TaskDetails).FirstOrDefault();
|
||||
// if (containerTask != null)
|
||||
// {
|
||||
// foreach (var inventory in item)
|
||||
// {
|
||||
// if (tLoc.Height < tLoc.Length)
|
||||
// {
|
||||
// var detail = new TaskDetail
|
||||
// {
|
||||
// UniqueCode = inventory.UniqueCode,
|
||||
// Lot = $"{Convert.ToInt32(location.Length)}-{tLoc.Code}",
|
||||
// FromLocation = inventory.Lot,
|
||||
// ToLocation = (Convert.ToInt32(tLoc.Height) + 1).ToString(),
|
||||
// Status = TaskStatusEnum.新建,
|
||||
// ContainerCode = inventory.ContainerCode,
|
||||
// CreateTime = DateTime.Now
|
||||
// };
|
||||
// tLoc.Height += 1;
|
||||
// containerTask.Status = TaskStatusEnum.待下发;
|
||||
// containerTask.TaskDetails.Add(detail);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// _unitwork.Update(tLoc);
|
||||
// _unitwork.Update(containerTask);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// continue;
|
||||
// }
|
||||
//}
|
||||
//else
|
||||
if (tLoc == null)
|
||||
{
|
||||
//判断是否存在此托盘的出库任务
|
||||
var containerTask = _unitwork.Find<TaskHeader>(x => x.Status < TaskStatusEnum.已下发
|
||||
&& x.ContainerCode == item.Key
|
||||
&& x.TaskType == TaskTypeEnum.盘料出库)
|
||||
.Include(x => x.TaskDetails)
|
||||
.FirstOrDefault();
|
||||
if (containerTask != null)
|
||||
{
|
||||
tLoc = _unitwork.Find<Location>(x => x.Code == containerTask.ToLocation
|
||||
&& x.Type.Equals(LocationTypeEnum.料塔))
|
||||
.FirstOrDefault();
|
||||
foreach (var inventory in item)
|
||||
{
|
||||
if (tLoc.Height < tLoc.Length)
|
||||
{
|
||||
var detail = new TaskDetail
|
||||
{
|
||||
UniqueCode = inventory.UniqueCode,
|
||||
Lot = $"{Convert.ToInt32(location.Length)}-{tLoc.Code}",
|
||||
FromLocation = inventory.Lot,
|
||||
ToLocation = (Convert.ToInt32(tLoc.Height) + 1).ToString(),
|
||||
Status = TaskStatusEnum.新建,
|
||||
ContainerCode = inventory.ContainerCode,
|
||||
CreateTime = DateTime.Now
|
||||
};
|
||||
tLoc.Height += 1;
|
||||
containerTask.Status = TaskStatusEnum.待下发;
|
||||
containerTask.TaskDetails.Add(detail);
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
_unitwork.Update(tLoc);
|
||||
_unitwork.Update(containerTask);
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (tLoc != null)
|
||||
{
|
||||
task.ZoneCode = ZoneCodeEnum.盘料库;
|
||||
task.TaskNo = _unitwork.GetSerialNumber("pout", 4);
|
||||
task.TaskType = TaskTypeEnum.盘料出库;
|
||||
task.Status = TaskStatusEnum.新建;
|
||||
task.Status = TaskStatusEnum.待下发;
|
||||
task.ContainerCode = item.Key;
|
||||
task.Priority = 100;
|
||||
task.FromLocation = _unitwork
|
||||
|
||||
Reference in new issue
Block a user