This commit is contained in:
qianhao.xu
2024-11-07 20:17:39 +08:00
parent f664b5beac
commit 54840baf1b
5 changed files with 84 additions and 5 deletions

View File

@@ -26,20 +26,27 @@ namespace DOAN.Service.PBL
item.CreatedTime= DateTime.Now;
Context.Insertable(item).ExecuteCommand();
// 2.根据总成零件号 查询对应零件号,使得对应料架亮灯
// 2.根据总成零件号 ,版本 查询对应零件号,使得对应料架亮灯
//镜壳 料架
Storagelocation MirrorshellShelf = Context.Queryable<Storagelocation>().Where(it => it.Partnumber ==
SqlFunc.Subqueryable<Billofmaterials>().Where(It => It.Productcode == light.AssemblyPartNumber).Select(it => it.MirrorshellCode)).First();
SqlFunc.Subqueryable<Billofmaterials>().Where(It => It.Productcode == light.AssemblyPartNumber&&It.Version==light.Version).Select(it => it.MirrorshellCode)).First();
//镜体 料架
Storagelocation MirrorshellBody = Context.Queryable<Storagelocation>().Where(it => it.Partnumber ==
SqlFunc.Subqueryable<Billofmaterials>().Where(It => It.Productcode == light.AssemblyPartNumber).Select(it => it.MirrorbodyCode)).First();
SqlFunc.Subqueryable<Billofmaterials>().Where(It => It.Productcode == light.AssemblyPartNumber&&It.Version == light.Version).Select(it => it.MirrorbodyCode)).First();
// 3.对应料架亮灯
//TODO PLC 交互
// 对应料架 亮灯字段
MirrorshellShelf.IsLight = 1;
MirrorshellBody.IsLight = 1;
Context.Insertable(MirrorshellShelf).ExecuteCommand();
Context.Insertable(MirrorshellBody).ExecuteCommand();
// 通知PLC
//亮灯日志
Light_Log light_Log = new Light_Log();
light_Log.Id = XUEHUA;