From b037bd1e918cfb8a55cfe557bd567a8e6665838d Mon Sep 17 00:00:00 2001 From: zhou keda <1315948824@qq.com> Date: Tue, 11 Jun 2024 14:23:24 +0800 Subject: [PATCH] bug --- ProductionMgr/Tnb.ProductionMgr/RedisDataService.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ProductionMgr/Tnb.ProductionMgr/RedisDataService.cs b/ProductionMgr/Tnb.ProductionMgr/RedisDataService.cs index df5c20a9..4f3c62d3 100644 --- a/ProductionMgr/Tnb.ProductionMgr/RedisDataService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/RedisDataService.cs @@ -69,6 +69,7 @@ namespace Tnb.ProductionMgr throw Oops.Bah("未在数据采集中设置允许称重标签点"); } + string eqpcode = device; device = eqpDaq1.equip_code; Dictionary dicCommand = new(StringComparer.OrdinalIgnoreCase) { @@ -80,7 +81,9 @@ namespace Tnb.ProductionMgr Log.Information($"确认称重参数:{JsonConvert.SerializeObject(dicCommand)}"); var str = await HttpClientHelper.GetRequestAsync(_eleCtlCfg.WriteTagUrl, dicCommand); - EqpDaq eqpDaq2 = await _repository.AsSugarClient().Queryable().Where(x => x.equip_code == device && x.label_name.Contains("当前重量")).FirstAsync(); + EqpDaq eqpDaq2 = await _repository.AsSugarClient().Queryable(). + LeftJoin((x,y)=>x.equip_id==y.id). + Where((x,y) => y.code == eqpcode && x.label_name.Contains("当前重量")).FirstAsync(); if (eqpDaq2 == null) { throw Oops.Bah("未在数据采集中设置当前重量标签点"); @@ -98,7 +101,9 @@ namespace Tnb.ProductionMgr decimal result = res != null && res["Value"] != null ? decimal.Parse(res["Value"]!.ToString()) : throw Oops.Bah("数据格式错误"); if (result > 0) { - EqpDaq eqpDaq3 = await _repository.AsSugarClient().Queryable().Where(x => x.equip_code == device && x.label_name.Contains("称重完成")).FirstAsync(); + EqpDaq eqpDaq3 = await _repository.AsSugarClient().Queryable(). + LeftJoin((x,y)=>x.equip_id==y.id). + Where((x,y) => y.code == eqpcode && x.label_name.Contains("称重完成")).FirstAsync(); if (eqpDaq3 == null) {