盘料出1个盘料盒对多次料塔
散料出库扫描 站台码
This commit is contained in:
1 parent
2cae99cb34
commit
b833415dbf
5 files changed
+86
-91
No files matched your search
@@ -204,7 +204,9 @@ namespace HHWMS.Web
|
|||||||
.Include(x => x.TaskDetails).FirstOrDefault();
|
.Include(x => x.TaskDetails).FirstOrDefault();
|
||||||
if (plrTask != null)
|
if (plrTask != null)
|
||||||
{
|
{
|
||||||
var details = plrTask.TaskDetails.Where(x => !string.IsNullOrEmpty(x.ContainerCode) && x.ContainerCode.Equals(task.ContainerCode));
|
var details = plrTask.TaskDetails.Where(x => !string.IsNullOrEmpty(x.ContainerCode)
|
||||||
|
&& x.ContainerCode.Equals(task.ContainerCode)
|
||||||
|
&& !string.IsNullOrEmpty(x.ToLocation));
|
||||||
foreach (var detail in details)
|
foreach (var detail in details)
|
||||||
{
|
{
|
||||||
detail.Status = TaskStatusEnum.待下发;
|
detail.Status = TaskStatusEnum.待下发;
|
||||||
|
|||||||
@@ -41,33 +41,22 @@ public class ShipOutController : BaseController
|
|||||||
Location box = new Location();
|
Location box = new Location();
|
||||||
if (code.Contains("C"))
|
if (code.Contains("C"))
|
||||||
{
|
{
|
||||||
box = _unitWork.FindSingle<Location>(x => x.ContainerCode.Equals(code) && x.Type == LocationTypeEnum.散料库站台);
|
box = _unitWork.FindSingle<Location>(x => x.Code.Equals(code) && x.Type == LocationTypeEnum.散料库站台);
|
||||||
}
|
}
|
||||||
else if (code.Contains("L"))
|
else if (code.Contains("L"))
|
||||||
{
|
{
|
||||||
box = _unitWork.FindSingle<Location>(x => x.Code.Equals(code));
|
box = _unitWork.FindSingle<Location>(x => x.Code.Equals(code) && x.Type == LocationTypeEnum.料塔);
|
||||||
}
|
}
|
||||||
// 判断箱号是否合理
|
// 判断箱号是否合理
|
||||||
if (box != null)
|
if (box != null)
|
||||||
{
|
{
|
||||||
if (box.Type == LocationTypeEnum.散料库站台 || box.Type == LocationTypeEnum.料塔)
|
var inv = _unitWork.Find<Inventory>(x => x.LocationCode.Equals(code));
|
||||||
{
|
return JsonMore(inv);
|
||||||
var inv = _unitWork.Find<Inventory>(x => x.LocationCode.Equals(code));
|
|
||||||
if (code.Contains("C"))
|
|
||||||
{
|
|
||||||
inv = _unitWork.Find<Inventory>(x => x.ContainerCode.Equals(code));
|
|
||||||
}
|
|
||||||
return JsonMore(inv);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return JsonMore(null, 500, $"{code}不在站台!");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return JsonMore(null, 500, $"{code}不正确!");
|
return JsonMore(null, 500, $"站台信息 {code} 不正确,请检查后重新扫描!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,7 @@
|
|||||||
},
|
},
|
||||||
type: "",
|
type: "",
|
||||||
taskType: [
|
taskType: [
|
||||||
{ label: "散料箱", value: "slbox" },
|
{ label: "散料站台", value: "slbox" },
|
||||||
{ label: "料塔周转箱", value: "lt" },
|
{ label: "料塔周转箱", value: "lt" },
|
||||||
{ label: "唯一码", value: "uniqueCode" },
|
{ label: "唯一码", value: "uniqueCode" },
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -96,9 +96,9 @@ namespace HHWMS.Web
|
|||||||
var taskUniques = _unitwork.Find<TaskDetail>(x => x.Status > TaskStatusEnum.新建)
|
var taskUniques = _unitwork.Find<TaskDetail>(x => x.Status > TaskStatusEnum.新建)
|
||||||
.Select(x => x.UniqueCode).ToList();
|
.Select(x => x.UniqueCode).ToList();
|
||||||
var taskInvs = _unitwork.Find<Inventory>(x => taskUniques.Contains(x.UniqueCode)).ToList();
|
var taskInvs = _unitwork.Find<Inventory>(x => taskUniques.Contains(x.UniqueCode)).ToList();
|
||||||
shiInventorys.Except(lockInvs);
|
var newList = shiInventorys.Except(taskInvs).ToList();
|
||||||
shiInventorys.DistinctBy(x => x.UniqueCode);
|
newList = newList.DistinctBy(x => x.UniqueCode).ToList();
|
||||||
var inventoryList = shiInventorys.GroupBy(x => x.ContainerCode)
|
var inventoryList = newList.GroupBy(x => x.ContainerCode)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
//散料库
|
//散料库
|
||||||
@@ -176,9 +176,11 @@ namespace HHWMS.Web
|
|||||||
var gLoc = _unitwork.Find<Location>(x => x.ContainerCode == item.Key
|
var gLoc = _unitwork.Find<Location>(x => x.ContainerCode == item.Key
|
||||||
&& x.Row == location.Row
|
&& x.Row == location.Row
|
||||||
&& x.Type.Equals(LocationTypeEnum.堆垛机工位)).FirstOrDefault();
|
&& x.Type.Equals(LocationTypeEnum.堆垛机工位)).FirstOrDefault();
|
||||||
if (gLoc != null)
|
var cTask = _unitwork.Find<TaskHeader>(x => x.ContainerCode == item.Key
|
||||||
|
&& x.TaskType == TaskTypeEnum.盘料盒出库).FirstOrDefault();
|
||||||
|
if (gLoc != null || cTask != null)
|
||||||
{
|
{
|
||||||
//盘料箱已在堆垛机工位,直接生成盘料出库任务
|
//盘料箱已在堆垛机工位,或者有此料箱的出库任务,直接生成盘料出库任务
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -197,6 +199,7 @@ namespace HHWMS.Web
|
|||||||
ContainerCode = item.Key,
|
ContainerCode = item.Key,
|
||||||
FromLocation = location.ContainerCode,
|
FromLocation = location.ContainerCode,
|
||||||
ToLocation = gLoc.Code,
|
ToLocation = gLoc.Code,
|
||||||
|
Station = "1",
|
||||||
Status = TaskStatusEnum.待下发,
|
Status = TaskStatusEnum.待下发,
|
||||||
Priority = 0,
|
Priority = 0,
|
||||||
CreateTime = DateTime.Now,
|
CreateTime = DateTime.Now,
|
||||||
@@ -212,79 +215,73 @@ namespace HHWMS.Web
|
|||||||
var tLoc = _unitwork.Find<Location>(x => string.IsNullOrEmpty(x.ContainerCode)
|
var tLoc = _unitwork.Find<Location>(x => string.IsNullOrEmpty(x.ContainerCode)
|
||||||
&& x.Row == row
|
&& x.Row == row
|
||||||
&& x.Type.Equals(LocationTypeEnum.料塔))
|
&& x.Type.Equals(LocationTypeEnum.料塔))
|
||||||
.FirstOrDefault();
|
.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)
|
||||||
{
|
{
|
||||||
//判断是否存在此托盘的出库任务
|
tLoc = _unitwork.Find<Location>(x => x.Code == containerTask.ToLocation
|
||||||
var containerTask = _unitwork.Find<TaskHeader>(x => x.Status < TaskStatusEnum.已下发
|
&& x.Type.Equals(LocationTypeEnum.料塔))
|
||||||
&& x.ContainerCode == item.Key
|
.FirstOrDefault();
|
||||||
&& x.TaskType == TaskTypeEnum.盘料出库)
|
foreach (var inventory in item)
|
||||||
.Include(x => x.TaskDetails)
|
|
||||||
.FirstOrDefault();
|
|
||||||
if (containerTask != null)
|
|
||||||
{
|
{
|
||||||
tLoc = _unitwork.Find<Location>(x => x.Code == containerTask.ToLocation
|
if (tLoc.Height < tLoc.Length)
|
||||||
&& x.Type.Equals(LocationTypeEnum.料塔))
|
|
||||||
.FirstOrDefault();
|
|
||||||
foreach (var inventory in item)
|
|
||||||
{
|
{
|
||||||
if (tLoc.Height < tLoc.Length)
|
// 库存不在已建任务明细中,新增任务明细
|
||||||
|
if (!containerTask.TaskDetails.Any(x => x.UniqueCode.Equals(inventory.UniqueCode)))
|
||||||
{
|
{
|
||||||
// 库存不在已建任务明细中,新增任务明细
|
containerTask.TaskDetails.Add(new TaskDetail
|
||||||
if (!containerTask.TaskDetails.Any(x => x.UniqueCode.Equals(inventory.UniqueCode)))
|
|
||||||
{
|
{
|
||||||
containerTask.TaskDetails.Add(new TaskDetail
|
UniqueCode = inventory.UniqueCode,
|
||||||
{
|
Lot = $"{Convert.ToInt32(location.Length)}-{tLoc.Code}",
|
||||||
UniqueCode = inventory.UniqueCode,
|
FromLocation = inventory.Lot,
|
||||||
Lot = $"{Convert.ToInt32(location.Length)}-{tLoc.Code}",
|
ToLocation = (Convert.ToInt32(tLoc.Height) + 1).ToString(),
|
||||||
FromLocation = inventory.Lot,
|
Status = TaskStatusEnum.待下发,
|
||||||
ToLocation = (Convert.ToInt32(tLoc.Height) + 1).ToString(),
|
ContainerCode = inventory.ContainerCode,
|
||||||
Status = TaskStatusEnum.待下发,
|
CreateTime = DateTime.Now
|
||||||
ContainerCode = inventory.ContainerCode,
|
});
|
||||||
CreateTime = DateTime.Now
|
tLoc.Height += 1;
|
||||||
});
|
|
||||||
tLoc.Height += 1;
|
|
||||||
}
|
|
||||||
//存在
|
|
||||||
else
|
|
||||||
{
|
|
||||||
foreach (var i in containerTask.TaskDetails.Where(x => x.Status == TaskStatusEnum.新建))
|
|
||||||
{
|
|
||||||
i.Lot = $"{Convert.ToInt32(location.Length)}-{tLoc.Code}";
|
|
||||||
i.ToLocation = (Convert.ToInt32(tLoc.Height) + 1).ToString();
|
|
||||||
i.Status = TaskStatusEnum.待下发;
|
|
||||||
tLoc.Height += 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
containerTask.Status = TaskStatusEnum.待下发;
|
|
||||||
}
|
}
|
||||||
|
//存在
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// 库存不在已建任务明细中,新增任务明细
|
var i = containerTask.TaskDetails.Where(x => x.Status == TaskStatusEnum.新建
|
||||||
if (!containerTask.TaskDetails.Any(x => x.UniqueCode.Equals(inventory.UniqueCode)))
|
&& x.UniqueCode == inventory.UniqueCode)
|
||||||
|
.FirstOrDefault();
|
||||||
|
|
||||||
|
i.Lot = $"{Convert.ToInt32(location.Length)}-{tLoc.Code}";
|
||||||
|
i.ToLocation = (Convert.ToInt32(tLoc.Height) + 1).ToString();
|
||||||
|
i.Status = TaskStatusEnum.待下发;
|
||||||
|
tLoc.Height += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// 库存不在已建任务明细中,新增任务明细
|
||||||
|
if (!containerTask.TaskDetails.Any(x => x.UniqueCode.Equals(inventory.UniqueCode)))
|
||||||
|
{
|
||||||
|
containerTask.TaskDetails.Add(new TaskDetail
|
||||||
{
|
{
|
||||||
containerTask.TaskDetails.Add(new TaskDetail
|
UniqueCode = inventory.UniqueCode,
|
||||||
{
|
FromLocation = inventory.Lot,
|
||||||
UniqueCode = inventory.UniqueCode,
|
Status = TaskStatusEnum.新建,
|
||||||
FromLocation = inventory.Lot,
|
ContainerCode = inventory.ContainerCode,
|
||||||
Status = TaskStatusEnum.新建,
|
CreateTime = DateTime.Now
|
||||||
ContainerCode = inventory.ContainerCode,
|
});
|
||||||
CreateTime = DateTime.Now
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_unitwork.Update(tLoc);
|
|
||||||
_unitwork.Update(containerTask);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
containerTask.Status = TaskStatusEnum.待下发;
|
||||||
|
tLoc.ContainerCode = tLoc.Code;
|
||||||
|
_unitwork.Update(tLoc);
|
||||||
|
_unitwork.Update(containerTask);
|
||||||
}
|
}
|
||||||
else if (tLoc != null)
|
else
|
||||||
{
|
{
|
||||||
task.ZoneCode = ZoneCodeEnum.盘料库;
|
task.ZoneCode = ZoneCodeEnum.盘料库;
|
||||||
task.TaskNo = _unitwork.GetSerialNumber("pout", 4);
|
task.TaskNo = _unitwork.GetSerialNumber("pout", 4);
|
||||||
@@ -316,7 +313,14 @@ namespace HHWMS.Web
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
break;
|
task.TaskDetails.Add(new TaskDetail
|
||||||
|
{
|
||||||
|
UniqueCode = inventory.UniqueCode,
|
||||||
|
FromLocation = inventory.Lot,
|
||||||
|
Status = TaskStatusEnum.新建,
|
||||||
|
ContainerCode = inventory.ContainerCode,
|
||||||
|
CreateTime = DateTime.Now
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_unitwork.Add(task);
|
_unitwork.Add(task);
|
||||||
|
|||||||
@@ -27,21 +27,21 @@
|
|||||||
// "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": false, //是否启用debug模式
|
"IsQuickDebug": true, //是否启用debug模式
|
||||||
"EnableTenant": false, //是否启动多租户
|
"EnableTenant": false, //是否启动多租户
|
||||||
"SyncDb": true, //是否自动同步数据库
|
"SyncDb": true, //是否自动同步数据库
|
||||||
"EncryptKey": "", //加密密钥
|
"EncryptKey": "", //加密密钥
|
||||||
|
|||||||
Reference in new issue
Block a user