Merge branch 'refs/heads/S04轨迹预警' into test

This commit is contained in:
xiaolipro 2024-08-02 16:45:52 +08:00
commit c0cc783131
6 changed files with 46 additions and 5 deletions

View File

@ -11,7 +11,11 @@ public class TrackPushAutoMapperProfile : Profile
{
public TrackPushAutoMapperProfile()
{
CreateMap<EditTrackPushConfigInput, TrackPushConfigEntity>(MemberList.None);
CreateMap<EditTrackPushConfigInput, TrackPushConfigEntity>(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<EditTrackPushConfigInput, TrackPushPullParamsConfigEntity>(MemberList.None).Ignore(dest => dest.Id)
.ForMember(dest => dest.IsPush, opt => opt.MapFrom(source => true));
CreateMap<EditTrackPushContentInput, TrackPushContentConfigEntity>(MemberList.None);

View File

@ -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, "更新成功");
}

View File

@ -1,3 +1,17 @@
namespace SJZY.Track.Domain.Dtos.Forewarning;
public record RuleAreaBaseInfo(int SystemId, int CustomerId);
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;
}
}

View File

@ -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
/// 是否全量推送
/// </summary>
public bool IsAllPush { get; set; }
/// <summary>
/// 时间格式枚举
/// </summary>
public DateTimeFormatEnum? DateTimeFormatType { get; set; }
/// <summary>
/// 日期时间格式模板
/// </summary>
public string? DateTimeFormat { get; set; }
/// <summary>
/// 时区格式格式模板
/// </summary>
public string? TimezoneFormat { get; set; }
}

View File

@ -79,7 +79,11 @@ public class WarningQueries : ISugarRepository, IWarningQueries,
return Context.Queryable<WarningRuleEntity>()
.InnerJoin<WarningEntity>((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();
}
}

View File

@ -71,6 +71,9 @@ public class TrackPushConfigRepository : BasicRepository<TrackPushConfigEntity>,
SubSystem = system.CnName,
CustomName = externalSubject.Abbreviation,
ServiceProvider = service.Name,
DateTimeFormat = trackPush.DateTimeFormat,
DateTimeFormatType = trackPush.DateTimeFormatType== DateTimeFormatEnum.None?null:trackPush.DateTimeFormatType,
TimezoneFormat = trackPush.TimezoneFormat
}, true)
.SingleAsync();
}