diff --git a/BasicData/Tnb.BasicData/ThirdApiRecordService.cs b/BasicData/Tnb.BasicData/ThirdApiRecordService.cs index c348f387..c288796e 100644 --- a/BasicData/Tnb.BasicData/ThirdApiRecordService.cs +++ b/BasicData/Tnb.BasicData/ThirdApiRecordService.cs @@ -169,7 +169,8 @@ namespace Tnb.BasicData JToken children = data.SelectToken("children")[0]; var responsetDtos = children.Select(x => new ErpReportDto() { - pk_wr_product = x["valueIndex"]["pk_wr_product"].ToString(), + // pk_wr_product = x["valueIndex"]["pk_wr_product"].ToString(), + pk_wr_product = x["qualityvos"][0]["pk_wr_product_q"].ToString(), pk_wr = x["valueIndex"]["pk_wr"].ToString(), report_id = reportId }).ToList(); diff --git a/ProductionMgr/Tnb.ProductionMgr/RedisDataService.cs b/ProductionMgr/Tnb.ProductionMgr/RedisDataService.cs index b1d7b694..20d10c57 100644 --- a/ProductionMgr/Tnb.ProductionMgr/RedisDataService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/RedisDataService.cs @@ -68,9 +68,17 @@ namespace Tnb.ProductionMgr // { // throw Oops.Bah("未在数据采集中设置允许称重标签点"); // } + + EqpDaq eqpDaq2 = await _repository.AsSugarClient().Queryable(). + LeftJoin((x,y)=>x.equip_id==y.id). + Where((x,y) => y.code == device && x.label_name.Contains("当前重量")).FirstAsync(); + if (eqpDaq2 == null) + { + throw Oops.Bah("未在数据采集中设置当前重量标签点"); + } string eqpcode = device; - // device = eqpDaq1.equip_code; + device = eqpDaq2.equip_code; // Dictionary dicCommand = new(StringComparer.OrdinalIgnoreCase) // { // ["DevName"] = device, @@ -82,13 +90,7 @@ namespace Tnb.ProductionMgr // var str = await HttpClientHelper.GetRequestAsync(_eleCtlCfg.WriteTagUrl, dicCommand); // Log.Information($"{device},{eqpDaq1.label_name}确认称重返回:{str}"); - 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("未在数据采集中设置当前重量标签点"); - } + bool flag = await _redisData.HashExist(device, eqpDaq2.label_name); if (!flag) diff --git a/ProductionMgr/Tnb.ProductionMgr/TimeWorkService.cs b/ProductionMgr/Tnb.ProductionMgr/TimeWorkService.cs index 382f3f32..a51dc1db 100644 --- a/ProductionMgr/Tnb.ProductionMgr/TimeWorkService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/TimeWorkService.cs @@ -855,7 +855,8 @@ namespace Tnb.ProductionMgr JToken children = data.SelectToken("children")[0]; var responsetDtos = children.Select(x => new ErpReportDto() { - pk_wr_product = x["valueIndex"]["pk_wr_product"].ToString(), + // pk_wr_product = x["valueIndex"]["pk_wr_product"].ToString(), + pk_wr_product = x["qualityvos"][0]["pk_wr_product_q"].ToString(), pk_wr = x["valueIndex"]["pk_wr"].ToString(), report_id = reportId }).ToList();