From e727ab26ca1a0008b30bc7ae540b773ce701f821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=9F=E5=96=9C=E6=97=BA?= Date: Fri, 2 Aug 2024 15:46:23 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=E5=A4=84=E7=90=86=E7=BC=93?= =?UTF-8?q?=E5=AD=98null=E7=9A=84=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ForewarningServices/KpiAreaService.cs | 1 - .../Dtos/Forewarning/RuleAreaBaseInfo.cs | 16 +++++++++++++++- .../Queries/WarningQueries.cs | 6 +++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/SJZY.Track.Application/Services/ForewarningServices/KpiAreaService.cs b/src/SJZY.Track.Application/Services/ForewarningServices/KpiAreaService.cs index 354e177d..8f8ecb95 100644 --- a/src/SJZY.Track.Application/Services/ForewarningServices/KpiAreaService.cs +++ b/src/SJZY.Track.Application/Services/ForewarningServices/KpiAreaService.cs @@ -113,7 +113,6 @@ public class KpiAreaService : ApplicationService await _ruleAreaRepository.UpdateAreaInfoAsync(ruleAreaEntity); await _forewarningCacheService.ClearRedisByAreaId(areaInfo.AreaId); - await RedisHelper.Client.PublishAsync(GlobalConst.PublishNotifyChannelKey, "clear local cache"); return new UnifyResultDto(true, "更新成功"); } diff --git a/src/SJZY.Track.Domain/Dtos/Forewarning/RuleAreaBaseInfo.cs b/src/SJZY.Track.Domain/Dtos/Forewarning/RuleAreaBaseInfo.cs index a8fef8d3..b7457ff5 100644 --- a/src/SJZY.Track.Domain/Dtos/Forewarning/RuleAreaBaseInfo.cs +++ b/src/SJZY.Track.Domain/Dtos/Forewarning/RuleAreaBaseInfo.cs @@ -1,3 +1,17 @@ namespace SJZY.Track.Domain.Dtos.Forewarning; -public record RuleAreaBaseInfo(int SystemId, int CustomerId); \ No newline at end of file +public class RuleAreaBaseInfo +{ + public int SystemId { get; set; } + public int CustomerId { get; set; } + + public RuleAreaBaseInfo() + { + } + + public RuleAreaBaseInfo(int systemId, int customerId) + { + SystemId = systemId; + CustomerId = customerId; + } +} \ No newline at end of file diff --git a/src/SJZY.Track.Repository/Queries/WarningQueries.cs b/src/SJZY.Track.Repository/Queries/WarningQueries.cs index e9b3ec5c..9601c19d 100644 --- a/src/SJZY.Track.Repository/Queries/WarningQueries.cs +++ b/src/SJZY.Track.Repository/Queries/WarningQueries.cs @@ -60,7 +60,11 @@ public class WarningQueries : ISugarRepository, IWarningQueries, return Context.Queryable() .InnerJoin((a, b) => a.WarningId == b.Id) .Where((a, b) => b.IsEnable && a.AreaId == areaId) - .Select((a, b) => new RuleAreaBaseInfo(b.CustomerId, b.SubSystemId)) + .Select((a, b) => new RuleAreaBaseInfo + { + CustomerId = b.CustomerId, + SystemId = b.SubSystemId + }) .ToListAsync(); } } \ No newline at end of file From 67569825ee33032b4b8e3eac6d88ed841399e8ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=9F=E5=96=9C=E6=97=BA?= Date: Fri, 2 Aug 2024 16:24:01 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat=EF=BC=9A=E5=85=9C=E5=BA=95=E8=BD=A8?= =?UTF-8?q?=E8=BF=B9=E6=97=B6=E5=8C=BA=E6=B7=BB=E5=8A=A0=E6=98=A0=E5=B0=84?= =?UTF-8?q?=E5=92=8C=E8=BF=94=E5=9B=9E=E8=AF=A6=E6=83=85=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AutoMapper/TrackPushAutoMapperProfile.cs | 6 +++++- .../GetTrackPushConfigDetailOutputVO.cs | 19 ++++++++++++++++++- .../Repositories/TrackPushConfigRepository.cs | 3 +++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/SJZY.Track.Application/AutoMapper/TrackPushAutoMapperProfile.cs b/src/SJZY.Track.Application/AutoMapper/TrackPushAutoMapperProfile.cs index 213d7872..e08a0e16 100644 --- a/src/SJZY.Track.Application/AutoMapper/TrackPushAutoMapperProfile.cs +++ b/src/SJZY.Track.Application/AutoMapper/TrackPushAutoMapperProfile.cs @@ -11,7 +11,11 @@ public class TrackPushAutoMapperProfile : Profile { public TrackPushAutoMapperProfile() { - CreateMap(MemberList.None); + CreateMap(MemberList.None) + .ForMember(val => val.DateTimeFormatType, opt => opt.MapFrom(src => src.DateTimeFormatType)) + .ForMember(val => val.DateTimeFormat, opt => opt.MapFrom(src => src.DateTimeFormat)) + .ForMember(val => val.TimezoneFormat, opt => opt.MapFrom(src => src.TimezoneFormat)); + CreateMap(MemberList.None).Ignore(dest => dest.Id) .ForMember(dest => dest.IsPush, opt => opt.MapFrom(source => true)); CreateMap(MemberList.None); diff --git a/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushConfigDetailOutputVO.cs b/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushConfigDetailOutputVO.cs index ef8ea329..a6f94e20 100644 --- a/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushConfigDetailOutputVO.cs +++ b/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushConfigDetailOutputVO.cs @@ -1,4 +1,6 @@ -namespace SJZY.Track.Domain.Dtos.TrackPush; +using SJZY.Track.Domain.Enums; + +namespace SJZY.Track.Domain.Dtos.TrackPush; public class GetTrackPushConfigDetailOutputVO { @@ -53,4 +55,19 @@ public class GetTrackPushConfigDetailOutputVO /// 是否全量推送 /// public bool IsAllPush { get; set; } + + /// + /// 时间格式枚举 + /// + public DateTimeFormatEnum DateTimeFormatType { get; set; } + + /// + /// 日期时间格式模板 + /// + public string? DateTimeFormat { get; set; } + + /// + /// 时区格式格式模板 + /// + public string? TimezoneFormat { get; set; } } \ No newline at end of file diff --git a/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs index f073f286..75a0cb5a 100644 --- a/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs @@ -71,6 +71,9 @@ public class TrackPushConfigRepository : BasicRepository, SubSystem = system.CnName, CustomName = externalSubject.Abbreviation, ServiceProvider = service.Name, + DateTimeFormat = trackPush.DateTimeFormat, + DateTimeFormatType = trackPush.DateTimeFormatType, + TimezoneFormat = trackPush.TimezoneFormat }, true) .SingleAsync(); } From f9ac2af1ef6909ea94bc27c95e6015c3d361df5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=9F=E5=96=9C=E6=97=BA?= Date: Fri, 2 Aug 2024 16:29:23 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20=E5=90=8E=E7=AB=AF=E6=9E=9A?= =?UTF-8?q?=E4=B8=BE=E6=9C=89none=EF=BC=8C=E5=89=8D=E7=AB=AF=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=85=BC=E5=AE=B9=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dtos/TrackPush/GetTrackPushConfigDetailOutputVO.cs | 2 +- .../Repositories/TrackPushConfigRepository.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushConfigDetailOutputVO.cs b/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushConfigDetailOutputVO.cs index a6f94e20..76420ad4 100644 --- a/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushConfigDetailOutputVO.cs +++ b/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushConfigDetailOutputVO.cs @@ -59,7 +59,7 @@ public class GetTrackPushConfigDetailOutputVO /// /// 时间格式枚举 /// - public DateTimeFormatEnum DateTimeFormatType { get; set; } + public DateTimeFormatEnum? DateTimeFormatType { get; set; } /// /// 日期时间格式模板 diff --git a/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs index 75a0cb5a..187f306e 100644 --- a/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs @@ -72,7 +72,7 @@ public class TrackPushConfigRepository : BasicRepository, CustomName = externalSubject.Abbreviation, ServiceProvider = service.Name, DateTimeFormat = trackPush.DateTimeFormat, - DateTimeFormatType = trackPush.DateTimeFormatType, + DateTimeFormatType = trackPush.DateTimeFormatType== DateTimeFormatEnum.None?null:trackPush.DateTimeFormatType, TimezoneFormat = trackPush.TimezoneFormat }, true) .SingleAsync();