出库分解修改

出库分拣页面修改
mes接口修改
This commit is contained in:
zgf committed 2023-11-21 04:25:49 +08:00
1 parent 26d46cad00
commit 30f1e69664
6 files changed
+88 -61

No files matched your search

@@ -7,7 +7,8 @@
<el-select v-model="type" <el-select v-model="type"
placeholder="请选择类型" placeholder="请选择类型"
style="width: 100%" style="width: 100%"
clearable> @@change="select"
>
<el-option v-for="item in taskType" <el-option v-for="item in taskType"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
@@ -109,6 +110,9 @@
this.form.batch = data.Batch; this.form.batch = data.Batch;
this.form.qty = data.Qty; this.form.qty = data.Qty;
}, },
select(data) {
this.form.code = "";
},
// 扫描料塔站台号 // 扫描料塔站台号
scanCode(data) { scanCode(data) {
var _this = this; var _this = this;
@@ -183,26 +183,43 @@ namespace HHWMS.Web
} }
} }
var station = _unitwork.FindSingle<Location>(x => x.Type.Equals(LocationTypeEnum.堆垛机工位) var station = new Location();
&& x.Status != LocationStatus.任务锁);
if (task.FromLocation == "L01") if (task.FromLocation == "L01")
{ {
// L01 优先从左边入
station = _unitwork.Find<Location>(x => x.Type.Equals(LocationTypeEnum.堆垛机工位) 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) if (station != null && count > 0)
{ {
var container = _unitwork.Find<Location>(x => x.Row == station.Row && x.Type == LocationTypeEnum.盘料库位 var container = _unitwork.Find<Location>(x => x.Row == station.Row
&& (x.Status == LocationStatus.有货 || x.Status == LocationStatus.空容器) && x.Length == Length && !x.IsStop) && x.Type == LocationTypeEnum.盘料库位
&& (x.Status == LocationStatus.有货 || x.Status == LocationStatus.空容器)
&& x.Length == Length && !x.IsStop)
.OrderByDescending(x => x.Length - x.Width).FirstOrDefault(); .OrderByDescending(x => x.Length - x.Width).FirstOrDefault();
if (Length == 23 && container == null && station.Row == 3) if (Length == 23 && container == null && station.Row == 3)
{ {
station = _unitwork.Find<Location>(x => x.Type.Equals(LocationTypeEnum.堆垛机工位) 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.盘料库位 container = _unitwork.Find<Location>(x => x.Row == station.Row
&& (x.Status == LocationStatus.有货 || x.Status == LocationStatus.空容器) && x.Length == Length && !x.IsStop) && x.Type == LocationTypeEnum.盘料库位
.OrderByDescending(x => x.Length - x.Width).FirstOrDefault(); && (x.Status == LocationStatus.有货 || x.Status == LocationStatus.空容器)
&& x.Length == Length
&& !x.IsStop)
.OrderByDescending(x => x.Length - x.Width)
.FirstOrDefault();
} }
if(station != null && container != null) if(station != null && container != null)
@@ -193,53 +193,57 @@ namespace HHWMS.Web
.FirstOrDefault(); .FirstOrDefault();
//查询料塔是否为空 //查询料塔是否为空
//if (tLoc == null) if (tLoc == null)
//{ {
// //判断是否存在此托盘的出库任务 //判断是否存在此托盘的出库任务
// var containerTask = _unitwork.Find<TaskHeader>(x => x.Status < TaskStatusEnum.已下发 var containerTask = _unitwork.Find<TaskHeader>(x => x.Status < TaskStatusEnum.已下发
// && x.ContainerCode == item.Key && x.ContainerCode == item.Key
// && x.TaskType == TaskTypeEnum.盘料出库) && x.TaskType == TaskTypeEnum.盘料出库)
// .Include(x => x.TaskDetails).FirstOrDefault(); .Include(x => x.TaskDetails)
// if (containerTask != null) .FirstOrDefault();
// { if (containerTask != null)
// foreach (var inventory in item) {
// { tLoc = _unitwork.Find<Location>(x => x.Code == containerTask.ToLocation
// if (tLoc.Height < tLoc.Length) && x.Type.Equals(LocationTypeEnum.料塔))
// { .FirstOrDefault();
// var detail = new TaskDetail foreach (var inventory in item)
// { {
// UniqueCode = inventory.UniqueCode, if (tLoc.Height < tLoc.Length)
// Lot = $"{Convert.ToInt32(location.Length)}-{tLoc.Code}", {
// FromLocation = inventory.Lot, var detail = new TaskDetail
// ToLocation = (Convert.ToInt32(tLoc.Height) + 1).ToString(), {
// Status = TaskStatusEnum.新建, UniqueCode = inventory.UniqueCode,
// ContainerCode = inventory.ContainerCode, Lot = $"{Convert.ToInt32(location.Length)}-{tLoc.Code}",
// CreateTime = DateTime.Now FromLocation = inventory.Lot,
// }; ToLocation = (Convert.ToInt32(tLoc.Height) + 1).ToString(),
// tLoc.Height += 1; Status = TaskStatusEnum.新建,
// containerTask.Status = TaskStatusEnum.待下发; ContainerCode = inventory.ContainerCode,
// containerTask.TaskDetails.Add(detail); CreateTime = DateTime.Now
// } };
// else tLoc.Height += 1;
// { containerTask.Status = TaskStatusEnum.待下发;
// break; containerTask.TaskDetails.Add(detail);
// } }
// } else
// _unitwork.Update(tLoc); {
// _unitwork.Update(containerTask); break;
// } }
// else }
// { _unitwork.Update(tLoc);
// continue; _unitwork.Update(containerTask);
// } }
//} else
//else {
continue;
}
}
else
if (tLoc != null) if (tLoc != null)
{ {
task.ZoneCode = ZoneCodeEnum.盘料库; task.ZoneCode = ZoneCodeEnum.盘料库;
task.TaskNo = _unitwork.GetSerialNumber("pout", 4); task.TaskNo = _unitwork.GetSerialNumber("pout", 4);
task.TaskType = TaskTypeEnum.盘料出库; task.TaskType = TaskTypeEnum.盘料出库;
task.Status = TaskStatusEnum.新建; task.Status = TaskStatusEnum.待下发;
task.ContainerCode = item.Key; task.ContainerCode = item.Key;
task.Priority = 100; task.Priority = 100;
task.FromLocation = _unitwork task.FromLocation = _unitwork
@@ -263,8 +263,9 @@ namespace HHWMS.Web.Controllers
if (task.TaskType == TaskTypeEnum.盘料入库 || task.TaskType == TaskTypeEnum.盘料出库) if (task.TaskType == TaskTypeEnum.盘料入库 || task.TaskType == TaskTypeEnum.盘料出库)
{ {
return FFResult().Alert($"盘料操作无法手动执行");
// 盘料起点终点 与普通任务起点终点不一样,编码未在location中保存 // 盘料起点终点 与普通任务起点终点不一样,编码未在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; start.X = beginlocation.Line;
end.X = endLocation.Line; end.X = endLocation.Line;
if (task.TaskType == TaskTypeEnum.盘料入库) if (task.TaskType == TaskTypeEnum.盘料入库)
@@ -289,7 +290,7 @@ namespace HHWMS.Web.Controllers
taskInfo.StartType = int.Parse(task.Station); taskInfo.StartType = int.Parse(task.Station);
taskInfo.StartPos = start; taskInfo.StartPos = start;
taskInfo.EndType = int.Parse(task.Station); taskInfo.EndType = int.Parse(task.Station);
taskInfo.EndPos = end; taskInfo.EndPos = end;*/
} }
else else
{ {
@@ -87,6 +87,7 @@ namespace MESTOWMSService
MaterialType = material?.MaterialType, MaterialType = material?.MaterialType,
MaterialUnit = material?.MaterialUnit, MaterialUnit = material?.MaterialUnit,
Batch = material?.Batch, Batch = material?.Batch,
DividedQty = 0,
Qty = material?.Qty, Qty = material?.Qty,
CompanyCode = item?.FACTORY, CompanyCode = item?.FACTORY,
ManufactureDate = Convert.ToDateTime(item.MESDATE), ManufactureDate = Convert.ToDateTime(item.MESDATE),
+7 -7
View File
@@ -27,18 +27,18 @@
// "Value": "Server=127.0.0.1;Port=3306;Database=8357wms;Uid=root;Password=abc123*;Character Set=utf8mb4;", // "Value": "Server=127.0.0.1;Port=3306;Database=8357wms;Uid=root;Password=abc123*;Character Set=utf8mb4;",
// "DBType": "mysql" // "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", "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", "DbContext": "DataContext",
"DBType": "sqlserver" //DataBase, you can choose mysql,sqlserver,pgsql,sqlite,oracle "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前缀 "CookiePre": "HHWMS", //cookie前缀
"IsQuickDebug": true, //是否启用debug模式 "IsQuickDebug": true, //是否启用debug模式