diff --git a/MasstransferExporter/DataExporter/SystemParamsService.cs b/MasstransferExporter/DataExporter/SystemParamsService.cs index 2cce4fd..3e988d9 100644 --- a/MasstransferExporter/DataExporter/SystemParamsService.cs +++ b/MasstransferExporter/DataExporter/SystemParamsService.cs @@ -134,6 +134,7 @@ public class SystemParamsService }; await MessageQueueHelper.Publish(Topics.ReportConfigData, systemParams); + await MessageQueueHelper.Publish(Topics.ReportConfigData, systemParams); } catch (Exception e) { diff --git a/MasstransferInfrastructure/Process/Client/ProcessHelper.cs b/MasstransferInfrastructure/Process/Client/ProcessHelper.cs index 2999f40..d09b218 100644 --- a/MasstransferInfrastructure/Process/Client/ProcessHelper.cs +++ b/MasstransferInfrastructure/Process/Client/ProcessHelper.cs @@ -64,7 +64,6 @@ public class ProcessHelper if (dictionary == null) return; var topic = dictionary["Topic"] as string; - var data = dictionary["Data"]; if (!Subscribers.TryGetValue(topic, out var subscribers)) return; @@ -75,9 +74,21 @@ public class ProcessHelper var methodInfo = subscriber.Method; var parameters = methodInfo.GetParameters(); if (parameters.Length != 2) continue; - var type = parameters[1].ParameterType; + + var dataType = parameters[1].ParameterType; + + var type = typeof(Message<>).MakeGenericType(dataType); + + var payload = JsonUtil.FromJson(type, message); + + if (payload == null) continue; + + var property = type.GetProperty("Data"); + + var data = property?.GetValue(payload); + // 通知订阅者 - subscriber.DynamicInvoke(topic, JsonUtil.FromJson(type, message)); + subscriber.DynamicInvoke(topic, data); } catch (Exception exception) {