diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs index 2fb096ae..01c44be1 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs @@ -1612,10 +1612,10 @@ namespace Tnb.ProductionMgr throw Oops.Bah("载具不能为空"); } - if (string.IsNullOrEmpty((input.location_code))) - { - throw Oops.Bah("入库库位不能为空"); - } + // if (string.IsNullOrEmpty((input.location_code))) + // { + // throw Oops.Bah("入库库位不能为空"); + // } if (input.reported_qty<=0) { @@ -1649,16 +1649,16 @@ namespace Tnb.ProductionMgr else { report.warehouse_id = equip.instock_warehouse_id; - if (equip.as_location_id == null || equip.as_location_id.IsEmpty()) + if (equip.downmat_location_id == null || equip.downmat_location_id.IsEmpty()) { - throw Oops.Bah("设备未绑定入库库位"); + throw Oops.Bah("设备未绑定下料库位"); } - location = await db.Queryable().SingleAsync(x=>x.id==equip.as_location_id); + location = await db.Queryable().SingleAsync(x=>x.id==equip.downmat_location_id); report.location_code = location.location_code; } - report.location_code = input.location_code; + // report.location_code = input.location_code; report.create_id = _userManager.UserId; report.create_time = DateTime.Now; // report.batch = input.mo_task_code + DateTimeOffset.Now.ToUnixTimeSeconds().ToString(); diff --git a/ProductionMgr/Tnb.ProductionMgr/TimeWorkService.cs b/ProductionMgr/Tnb.ProductionMgr/TimeWorkService.cs index 808089ca..42562444 100644 --- a/ProductionMgr/Tnb.ProductionMgr/TimeWorkService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/TimeWorkService.cs @@ -228,7 +228,7 @@ namespace Tnb.ProductionMgr BasFactoryConfig config = await _db.Queryable().FirstAsync(x => x.enabled == 1 && x.key == FactoryConfigConst.DOMAIN); foreach (var equipment in equipments) { - EqpDaq eqpDaq = eqpDaqs.First(x => x.equip_id == equipment.id); + EqpDaq eqpDaq = eqpDaqs.FirstOrDefault(x => x.equip_id==equipment.id); if (eqpDaq == null) { Log.Error($"{equipment.name}没配置允许入空箱");