出库分解修改

出库分拣页面修改
mes接口修改
This commit is contained in:
zgf 2023-11-21 04:25:49 +08:00
parent 26d46cad00
commit 30f1e69664
6 changed files with 89 additions and 62 deletions

View File

@ -7,7 +7,8 @@
<el-select v-model="type"
placeholder="请选择类型"
style="width: 100%"
clearable>
@@change="select"
>
<el-option v-for="item in taskType"
:key="item.value"
:label="item.label"
@ -109,6 +110,9 @@
this.form.batch = data.Batch;
this.form.qty = data.Qty;
},
select(data) {
this.form.code = "";
},
// 扫描料塔站台号
scanCode(data) {
var _this = this;

View File

@ -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)

View File

@ -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

View File

@ -263,8 +263,9 @@ namespace HHWMS.Web.Controllers
if (task.TaskType == TaskTypeEnum.盘料入库 || task.TaskType == TaskTypeEnum.盘料出库)
{
return FFResult().Alert($"盘料操作无法手动执行");
// 盘料起点终点 与普通任务起点终点不一样,编码未在location中保存
var taskdel = task.TaskDetails.FirstOrDefault(x => x.Status.Equals(TaskStatusEnum.新建));
/*var taskdel = task.TaskDetails.FirstOrDefault(x => x.Status.Equals(TaskStatusEnum.新建));
start.X = beginlocation.Line;
end.X = endLocation.Line;
if (task.TaskType == TaskTypeEnum.盘料入库)
@ -289,7 +290,7 @@ namespace HHWMS.Web.Controllers
taskInfo.StartType = int.Parse(task.Station);
taskInfo.StartPos = start;
taskInfo.EndType = int.Parse(task.Station);
taskInfo.EndPos = end;
taskInfo.EndPos = end;*/
}
else
{

View File

@ -87,6 +87,7 @@ namespace MESTOWMSService
MaterialType = material?.MaterialType,
MaterialUnit = material?.MaterialUnit,
Batch = material?.Batch,
DividedQty = 0,
Qty = material?.Qty,
CompanyCode = item?.FACTORY,
ManufactureDate = Convert.ToDateTime(item.MESDATE),

View File

@ -27,18 +27,18 @@
// "Value": "Server=127.0.0.1;Port=3306;Database=8357wms;Uid=root;Password=abc123*;Character Set=utf8mb4;",
// "DBType": "mysql"
//}
//{
// "Key": "default",
// "Value": "Data Source=.;Initial Catalog=8357wms;User=sa;Password=abc123*;Persist Security Info=True",
// "DbContext": "DataContext",
// "DBType": "sqlserver" //DataBase, you can choose mysql,sqlserver,pgsql,sqlite,oracle
//}
{
"Key": "default",
"Value": "Data Source=10.18.106.4;Initial Catalog=8357wms;User=wms;Password=abc123*;Persist Security Info=True",
"Value": "Data Source=.;Initial Catalog=8357wms;User=sa;Password=abc123*;Persist Security Info=True",
"DbContext": "DataContext",
"DBType": "sqlserver" //DataBase, you can choose mysql,sqlserver,pgsql,sqlite,oracle
}
//{
// "Key": "default",
// "Value": "Data Source=10.18.106.4;Initial Catalog=8357wms;User=wms;Password=abc123*;Persist Security Info=True",
// "DbContext": "DataContext",
// "DBType": "sqlserver" //DataBase, you can choose mysql,sqlserver,pgsql,sqlite,oracle
//}
],
"CookiePre": "HHWMS", //cookie前缀
"IsQuickDebug": true, //是否启用debug模式