diff --git a/ProductionMgr/Tnb.ProductionMgr/TimeWorkService.cs b/ProductionMgr/Tnb.ProductionMgr/TimeWorkService.cs index 7bb42985..3dc77241 100644 --- a/ProductionMgr/Tnb.ProductionMgr/TimeWorkService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/TimeWorkService.cs @@ -267,6 +267,18 @@ namespace Tnb.ProductionMgr bool? cs01 = await _redisData.TryGetValueByKeyField("YTCS", "AllowAgvEmptyOut_CS01"); bool? cs03 = await _redisData.TryGetValueByKeyField("YTCS", "AllowAgvEmptyOut_CS03"); string startLocationCode = cs01==true ? "ZSSSXCTU01" : cs03==true ? "ZSSSXCTU02" : ""; + if (cs01==true && cs03==true) + { + string last_fixed_point_delivery = _redisData.Exists("last_fixed_point_delivery") ? _redisData.Get("last_fixed_point_delivery") : ""; + if (string.IsNullOrEmpty(last_fixed_point_delivery)) + { + startLocationCode = "ZSSSXCTU01"; + } + else + { + startLocationCode = "ZSSSXCTU01ZSSSXCTU02".Replace(last_fixed_point_delivery, ""); + } + } if (startLocationCode.IsEmpty()) { Log.Error($"输送线无空载具"); @@ -289,6 +301,7 @@ namespace Tnb.ProductionMgr msg += $"{equipment.name}注塑定点配送成功,"; Log.Information($"【FixedPointDelivery】{equipment.name}注塑定点配送成功"); _redisData.Set($"{eqpDaq.equip_code}_{eqpDaq.label_name}_flag", true, TimeSpan.FromMinutes(20)); + _redisData.Set($"last_fixed_point_delivery", startLocationCode); } else {