From 29624edec3c665d23be849f304e57a5b3b5c5e06 Mon Sep 17 00:00:00 2001
From: xiaolipro <2357729423@qq.com>
Date: Mon, 30 Sep 2024 15:25:55 +0800
Subject: [PATCH] =?UTF-8?q?change=EF=BC=9A=E6=94=AF=E6=8C=81otel=20con?=
=?UTF-8?q?=EF=BC=9A=E5=AF=B9=E6=8E=A5=E5=89=8D=E7=AB=AF=EF=BC=8C=E8=BF=94?=
=?UTF-8?q?=E5=9B=9E=E9=A2=84=E8=AD=A6=E7=BC=96=E8=BE=91=E9=A1=B5=E9=9D=A2?=
=?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=8C=BA=E5=9F=9F=E7=BB=99name?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/SJZY.Track.Application/FodyWeavers.xml | 3 ++
src/SJZY.Track.Application/FodyWeavers.xsd | 26 ++++++++++
.../Helpers/ForewarningHelper.cs | 28 ++++++++--
.../SJZY.Track.Application.csproj | 1 +
.../Services/DebugApis/OTelService.cs | 51 +++++++++++++++++++
.../ForewarningNotifyService.cs | 2 +-
.../ForewarningServices/ForewarningService.cs | 13 ++++-
.../ForewarningAggregate/RuleAreaEntity.cs | 6 ---
.../Aggregates/KPIAreaAggregate.cs | 6 ---
src/SJZY.Track.Domain/FodyWeavers.xml | 3 ++
src/SJZY.Track.Domain/FodyWeavers.xsd | 31 +++++++++++
.../SJZY.Track.Domain.csproj | 7 +--
12 files changed, 151 insertions(+), 26 deletions(-)
create mode 100644 src/SJZY.Track.Application/FodyWeavers.xml
create mode 100644 src/SJZY.Track.Application/FodyWeavers.xsd
create mode 100644 src/SJZY.Track.Application/Services/DebugApis/OTelService.cs
delete mode 100644 src/SJZY.Track.Domain/Aggregates/ForewarningAggregate/RuleAreaEntity.cs
delete mode 100644 src/SJZY.Track.Domain/Aggregates/KPIAreaAggregate.cs
create mode 100644 src/SJZY.Track.Domain/FodyWeavers.xml
create mode 100644 src/SJZY.Track.Domain/FodyWeavers.xsd
diff --git a/src/SJZY.Track.Application/FodyWeavers.xml b/src/SJZY.Track.Application/FodyWeavers.xml
new file mode 100644
index 00000000..510b255f
--- /dev/null
+++ b/src/SJZY.Track.Application/FodyWeavers.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/src/SJZY.Track.Application/FodyWeavers.xsd b/src/SJZY.Track.Application/FodyWeavers.xsd
new file mode 100644
index 00000000..f35a69b7
--- /dev/null
+++ b/src/SJZY.Track.Application/FodyWeavers.xsd
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+ 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.
+
+
+
+
+ A comma-separated list of error codes that can be safely ignored in assembly verification.
+
+
+
+
+ 'false' to turn off automatic generation of the XML Schema file.
+
+
+
+
+
\ No newline at end of file
diff --git a/src/SJZY.Track.Application/Helpers/ForewarningHelper.cs b/src/SJZY.Track.Application/Helpers/ForewarningHelper.cs
index f91da6db..62243800 100644
--- a/src/SJZY.Track.Application/Helpers/ForewarningHelper.cs
+++ b/src/SJZY.Track.Application/Helpers/ForewarningHelper.cs
@@ -164,9 +164,11 @@ public class ForewarningHelper
}).ToList();
}
- public static EditWarningOutput MapWarningSummary(WarningEntity warning, List statusList)
+ public static EditWarningOutput MapWarningSummary(WarningEntity warning, List statusList,
+ List areaList)
{
var statusDic = statusList.ToDictionary(x => x.Id, x => x.Name);
+ var areaDic = areaList.ToDictionary(x => x.Id, x => x.Name);
return new EditWarningOutput
{
Name = warning.Name,
@@ -184,11 +186,27 @@ public class ForewarningHelper
? new List()
: x.NotifyMode.Split(',').Select(int.Parse).ToList(),
}).ToList(),
- WarningFactors = warning.WarningFactors.Select(x => new WarningFactorWithIdDto
+ WarningFactors = warning.WarningFactors.Select(x =>
{
- Id = x.Id,
- FactorType = (int) x.Type,
- FactorValue = JsonConvert.DeserializeObject>(x.Value)!,
+ if (x.Type == RuleFactorType.Area)
+ {
+ var areaIds = JsonConvert.DeserializeObject>(x.Value);
+ return new WarningFactorWithIdDto
+ {
+ Id = x.Id,
+ FactorType = (int) x.Type,
+ FactorValue = areaIds?
+ .Select(area => areaDic.TryGetValue(area, out var name) ? name : area.ToString())
+ .Cast