diff --git a/SJZY.Track.Api.sln b/SJZY.Track.Api.sln index 0c457eb0..3ed81211 100644 --- a/SJZY.Track.Api.sln +++ b/SJZY.Track.Api.sln @@ -25,6 +25,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "solution items", "solution .gitignore = .gitignore EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SJZY.Track.Shared", "src\SJZY.Track.Shared\SJZY.Track.Shared.csproj", "{CB860739-8617-48C2-80E3-9F1FBC8D6980}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -55,6 +57,10 @@ Global {073EB297-E752-49AC-BED8-B4AEBAB518F6}.Debug|Any CPU.Build.0 = Debug|Any CPU {073EB297-E752-49AC-BED8-B4AEBAB518F6}.Release|Any CPU.ActiveCfg = Release|Any CPU {073EB297-E752-49AC-BED8-B4AEBAB518F6}.Release|Any CPU.Build.0 = Release|Any CPU + {CB860739-8617-48C2-80E3-9F1FBC8D6980}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CB860739-8617-48C2-80E3-9F1FBC8D6980}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CB860739-8617-48C2-80E3-9F1FBC8D6980}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CB860739-8617-48C2-80E3-9F1FBC8D6980}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -66,6 +72,7 @@ Global {390A44FB-0DB5-4B66-86AB-7712DC3030F5} = {DAC93270-5A25-40E5-B851-E7CA398DBC31} {3A53539C-4A85-4E5D-A071-7B4B193AB0E0} = {0E2537C3-6EF3-4085-9BD2-CF923E53F82A} {073EB297-E752-49AC-BED8-B4AEBAB518F6} = {DAC93270-5A25-40E5-B851-E7CA398DBC31} + {CB860739-8617-48C2-80E3-9F1FBC8D6980} = {DAC93270-5A25-40E5-B851-E7CA398DBC31} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = { 8289A516 - 787C - 4D9D - B972 - E7047BDD206B} diff --git a/src/SJZY.Track.Application.Contract/Dtos/Forewarning/ClearRulCacheEvent.cs b/src/SJZY.Track.Application.Contract/Dtos/Forewarning/ClearRulCacheEvent.cs deleted file mode 100644 index e875e4b8..00000000 --- a/src/SJZY.Track.Application.Contract/Dtos/Forewarning/ClearRulCacheEvent.cs +++ /dev/null @@ -1,9 +0,0 @@ -using SJZY.Track.Domain.Dtos.Forewarning; - -namespace SJZY.Track.Application.Contract.Dtos.Forewarning; - - -public class ClearRulCacheEvent -{ - public List Items { get; set; } -} \ No newline at end of file diff --git a/src/SJZY.Track.Application.Contract/Dtos/Forewarning/CreateWarningInput.cs b/src/SJZY.Track.Application.Contract/Dtos/Forewarning/CreateWarningInput.cs index 0179e744..19cd4f62 100644 --- a/src/SJZY.Track.Application.Contract/Dtos/Forewarning/CreateWarningInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/Forewarning/CreateWarningInput.cs @@ -1,5 +1,5 @@ using SJZY.Track.Domain.Dtos.Forewarning; -using SJZY.Track.Domain.Enums; +using SJZY.Track.Share.Enums; namespace SJZY.Track.Application.Contract.Dtos.Forewarning; @@ -9,12 +9,12 @@ public class CreateWarningInput /// 模板名称 /// public string Name { get; set; } = null!; - + /// /// 子系统id /// public int SubSystemId { get; set; } - + /// /// 客户id /// diff --git a/src/SJZY.Track.Application.Contract/Dtos/Forewarning/EditWarningOutput.cs b/src/SJZY.Track.Application.Contract/Dtos/Forewarning/EditWarningOutput.cs index f8c65d67..c57133a9 100644 --- a/src/SJZY.Track.Application.Contract/Dtos/Forewarning/EditWarningOutput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/Forewarning/EditWarningOutput.cs @@ -1,5 +1,5 @@ using SJZY.Track.Domain.Dtos.Forewarning; -using SJZY.Track.Domain.Enums; +using SJZY.Track.Share.Enums; namespace SJZY.Track.Application.Contract.Dtos.Forewarning; diff --git a/src/SJZY.Track.Application.Contract/Dtos/Forewarning/UpdateWarningInput.cs b/src/SJZY.Track.Application.Contract/Dtos/Forewarning/UpdateWarningInput.cs index 0d00a8d3..c2a6634e 100644 --- a/src/SJZY.Track.Application.Contract/Dtos/Forewarning/UpdateWarningInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/Forewarning/UpdateWarningInput.cs @@ -1,5 +1,5 @@ using SJZY.Track.Domain.Dtos.Forewarning; -using SJZY.Track.Domain.Enums; +using SJZY.Track.Share.Enums; namespace SJZY.Track.Application.Contract.Dtos.Forewarning; @@ -9,7 +9,7 @@ public class UpdateWarningInput /// 预警id /// public int Id { get; set; } - + /// /// 模板名称 /// @@ -25,6 +25,7 @@ public class UpdateWarningInput /// public string NotifyTemplate { get; set; } = null!; + /// /// 通知列表 /// diff --git a/src/SJZY.Track.Domain/Dtos/Forewarning/WarningFactorDto.cs b/src/SJZY.Track.Application.Contract/Dtos/Forewarning/WarningFactorDto.cs similarity index 91% rename from src/SJZY.Track.Domain/Dtos/Forewarning/WarningFactorDto.cs rename to src/SJZY.Track.Application.Contract/Dtos/Forewarning/WarningFactorDto.cs index 3d4e93b9..c889dd5e 100644 --- a/src/SJZY.Track.Domain/Dtos/Forewarning/WarningFactorDto.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/Forewarning/WarningFactorDto.cs @@ -1,5 +1,5 @@ using Newtonsoft.Json.Linq; -using SJZY.Track.Domain.Enums; +using SJZY.Track.Share.Enums; namespace SJZY.Track.Domain.Dtos.Forewarning; diff --git a/src/SJZY.Track.Domain/Dtos/Forewarning/WarningNitifyDto.cs b/src/SJZY.Track.Application.Contract/Dtos/Forewarning/WarningNitifyDto.cs similarity index 100% rename from src/SJZY.Track.Domain/Dtos/Forewarning/WarningNitifyDto.cs rename to src/SJZY.Track.Application.Contract/Dtos/Forewarning/WarningNitifyDto.cs diff --git a/src/SJZY.Track.Application.Contract/Dtos/TrackPush/EditTrackPushConfigInput.cs b/src/SJZY.Track.Application.Contract/Dtos/TrackPush/EditTrackPushConfigInput.cs index bb4b0066..12186d8a 100644 --- a/src/SJZY.Track.Application.Contract/Dtos/TrackPush/EditTrackPushConfigInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/TrackPush/EditTrackPushConfigInput.cs @@ -1,4 +1,4 @@ -using SJZY.Track.Domain.Enums; +using SJZY.Track.Share.Enums; namespace SJZY.Track.Application.Contract.Dtos.TrackPush; @@ -50,17 +50,17 @@ public class EditTrackPushConfigInput /// 是否全量推送 /// public bool? IsAllPush { get; set; } - + /// /// 时间格式枚举 /// public DateTimeFormatEnum DateTimeFormatType { get; set; } - + /// /// 日期时间格式模板 /// public string? DateTimeFormat { get; set; } - + /// /// 时区格式格式模板 /// diff --git a/src/SJZY.Track.Application.Contract/Dtos/TrackPush/TrackPushContentConfigDto.cs b/src/SJZY.Track.Application.Contract/Dtos/TrackPush/TrackPushContentConfigDto.cs index 8984a769..e6f04aa7 100644 --- a/src/SJZY.Track.Application.Contract/Dtos/TrackPush/TrackPushContentConfigDto.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/TrackPush/TrackPushContentConfigDto.cs @@ -1,4 +1,4 @@ -using SJZY.Track.Domain.Enums; +using SJZY.Track.Share.Enums; namespace SJZY.Track.Application.Contract.Dtos.TrackPush; @@ -73,17 +73,17 @@ public class TrackPushContentConfigDto /// 扩展字段参数值 /// public string? ExpandFieldsValue { get; set; } - + /// /// 时间格式枚举 /// public DateTimeFormatEnum DateTimeFormatType { get; set; } - + /// /// 日期时间格式模板 /// public string? DateTimeFormat { get; set; } - + /// /// 时区格式格式模板 /// diff --git a/src/SJZY.Track.Application.Contract/SJZY.Track.Application.Contract.csproj b/src/SJZY.Track.Application.Contract/SJZY.Track.Application.Contract.csproj index f2e2a7a3..749e25a6 100644 --- a/src/SJZY.Track.Application.Contract/SJZY.Track.Application.Contract.csproj +++ b/src/SJZY.Track.Application.Contract/SJZY.Track.Application.Contract.csproj @@ -13,7 +13,10 @@ - + + + + diff --git a/src/SJZY.Track.Application/AutoMapper/TrackPullAutoMapperProfile.cs b/src/SJZY.Track.Application/AutoMapper/TrackPullAutoMapperProfile.cs index 8ca802aa..dca59bb8 100644 --- a/src/SJZY.Track.Application/AutoMapper/TrackPullAutoMapperProfile.cs +++ b/src/SJZY.Track.Application/AutoMapper/TrackPullAutoMapperProfile.cs @@ -15,7 +15,7 @@ public class TrackPullAutoMapperProfile : Profile .ForMember(dest => dest.IsPush, opt => opt.MapFrom(source => false)); CreateMap(MemberList.None) .ForMember(dest => dest.TrackKeyword, opt => opt.MapFrom(src => string.Join(',', src.TrackKeywords))) - .ForMember(dest => dest.TrackZonePlaceValue, opt => opt.MapFrom(src => string.Join(',', src.TrackTimePlaceValue))) + .ForMember(dest => dest.TrackZonePlaceValue, opt => opt.MapFrom(src => src.TrackTimePlaceValue)) .ForMember(dest => dest.TrackKeywordReverse, opt => opt.MapFrom(src => string.Join(',', src.TrackKeywordReverses))); CreateMap(MemberList.None); CreateMap(MemberList.None); diff --git a/src/SJZY.Track.Application/CAP/EventHandlers/TrackPushEventHandler.cs b/src/SJZY.Track.Application/CAP/EventHandlers/TrackPushEventHandler.cs index 369221c7..402668e3 100644 --- a/src/SJZY.Track.Application/CAP/EventHandlers/TrackPushEventHandler.cs +++ b/src/SJZY.Track.Application/CAP/EventHandlers/TrackPushEventHandler.cs @@ -1,5 +1,4 @@ -using System.Globalization; -using DotNetCore.CAP; +using DotNetCore.CAP; using Newtonsoft.Json; using SJZY.Expand.ABP.Core.PublicMethords; using SJZY.InterfaceRelay.Application.Contracts; @@ -12,6 +11,7 @@ using SJZY.Track.Domain.Aggregates.TrackDetailsAggregate; using SJZY.Track.Domain.Aggregates.TrackPushAggregate; using SJZY.Track.Domain.Consts; using SJZY.Track.Domain.Enums; +using SJZY.Track.Share.Enums; using Volo.Abp.DependencyInjection; using Volo.Abp.Http.Client.DynamicProxying; @@ -21,11 +21,11 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe { private readonly IHttpClientProxy _httpClientProxy; private readonly IOrderRepository _orderRepository; - private readonly ITrackPushCacheService _trackPushCacheService; private readonly ITrackDetailsRepository _trackDetailsRepository; + private readonly ITrackPushCacheService _trackPushCacheService; private readonly ITrackPushRecordsRepository _trackPushRecordsRepository; - private List _pushConfigs = null!; private List _orders = null!; + private List _pushConfigs = null!; public TrackPushEventHandler(IHttpClientProxy httpClientProxy, IOrderRepository orderRepository, ITrackPushCacheService trackPushCacheService, @@ -291,7 +291,7 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe return matched != null && matched.TrackCode == trackCode ? matched : default; } - + /// /// 转换推送时间格式 /// diff --git a/src/SJZY.Track.Application/Helpers/ForewarningHelper.cs b/src/SJZY.Track.Application/Helpers/ForewarningHelper.cs index a1a0e3bc..c4183489 100644 --- a/src/SJZY.Track.Application/Helpers/ForewarningHelper.cs +++ b/src/SJZY.Track.Application/Helpers/ForewarningHelper.cs @@ -2,11 +2,11 @@ using System.Dynamic; using Nest; using Newtonsoft.Json.Linq; using SJZY.Expand.ABP.Core.PublicMethords; -using SJZY.Track.Application.Contract.Dtos.Common; using SJZY.Track.Application.Contract.Dtos.Forewarning; using SJZY.Track.Domain.Aggregates.ForewarningAggregate; +using SJZY.Track.Domain.Dtos.Common; using SJZY.Track.Domain.Dtos.Forewarning; -using SJZY.Track.Domain.Enums; +using SJZY.Track.Share.Enums; namespace SJZY.Track.Application.Helpers; diff --git a/src/SJZY.Track.Application/HostServices/RedisHostService.cs b/src/SJZY.Track.Application/HostServices/RedisHostService.cs index 0a7237e8..406249e8 100644 --- a/src/SJZY.Track.Application/HostServices/RedisHostService.cs +++ b/src/SJZY.Track.Application/HostServices/RedisHostService.cs @@ -1,11 +1,8 @@ using Microsoft.Extensions.Hosting; using SJZY.Expand.ABP.Core; -using SJZY.Track.Application.Contract.Dtos.Forewarning; -using SJZY.Track.Application.Contract.Events; -using SJZY.Track.Application.Contract.Services; +using SJZY.Track.Domain.Aggregates.ForewarningAggregate; using SJZY.Track.Domain.Consts; using SJZY.Track.Domain.Dtos.Forewarning; -using SJZY.UserCenter.SharedModel.Dtos.PHP.User; namespace SJZY.Track.Application.HostServices; @@ -42,7 +39,7 @@ public class RedisHostService:IHostedService _forewarningCacheService.Clear(instance); } } - + private string GetKey() { return $"{GlobalConst.PublishNotifyChannelKey}"; diff --git a/src/SJZY.Track.Application/Services/ForewarningServices/ForewarningCacheService.cs b/src/SJZY.Track.Application/Services/ForewarningServices/ForewarningCacheService.cs index 7c3b3b00..8dbea0b3 100644 --- a/src/SJZY.Track.Application/Services/ForewarningServices/ForewarningCacheService.cs +++ b/src/SJZY.Track.Application/Services/ForewarningServices/ForewarningCacheService.cs @@ -1,8 +1,7 @@ using System.Collections.Concurrent; using SJZY.Expand.ABP.Core; using SJZY.Expand.ABP.Core.PublicMethords; -using SJZY.Track.Application.Contract.Dtos.Forewarning; -using SJZY.Track.Application.Contract.Services; +using SJZY.Track.Domain.Aggregates.ForewarningAggregate; using SJZY.Track.Domain.Aggregates.KPIAreaAggregate; using SJZY.Track.Domain.Consts; using SJZY.Track.Domain.Dtos.Forewarning; @@ -13,24 +12,19 @@ namespace SJZY.Track.Application.Services.ForewarningServices; public class ForewarningCacheService : IForewarningCacheService, ISingletonDependency { - readonly IKpiAreaRepository _kpiAreaRepository; - private readonly IWarningQueries _warningQueries; - private const string GlobalWaningLockKey = "GlobalWaningLockKey_GlobalLock"; + private readonly ConcurrentDictionary> _areas = new(); + readonly IKpiAreaRepository _kpiAreaRepository; private readonly ConcurrentDictionary> _rules = new(); - private readonly ConcurrentDictionary> _areas = new(); + private readonly IWarningQueries _warningQueries; object _lock = new object(); + public ForewarningCacheService(IKpiAreaRepository kpiAreaRepository, IWarningQueries warningQueries) { _kpiAreaRepository = kpiAreaRepository; _warningQueries = warningQueries; } - - string WarningKey(int subSystemId, int customerId) => - $"{GlobalConst.TrackWarningKeyPrefix}:{subSystemId}:{customerId}"; - - string AreaKey(int areaId) => $"{GlobalConst.TrackAreaKeyPrefix}:{areaId}"; public async Task?> GetRulesAsync(int subSystemId, int customerId) { @@ -43,6 +37,58 @@ public class ForewarningCacheService : IForewarningCacheService, ISingletonDepen return await GetRules(subSystemId, customerId); } + public Task DeleteRulesAsync(int subSystemId, int customerId) + { + _rules.Remove(WarningKey(subSystemId, customerId),out _); + + return Task.CompletedTask; + } + + public Task Clear(ClearRulCacheEvent @event) + { + foreach (var item in @event.Items) + { + DeleteRulesAsync(item.SystemId, item.CustomerId); + } + return Task.CompletedTask; + } + + public async Task ClearRedisBySystemIdAndCustomer(int subSystemId,int customerId) + { + await RedisHelper.Client.DelAsync(WarningKey(subSystemId, customerId)); + var eventModel = new ClearRulCacheEvent + { + Items = new List() + { + new RuleAreaBaseInfo(subSystemId, customerId) + } + }; + + await PublishEvent(eventModel); + } + + public async Task ClearRedisByAreaId(int areaId) + { + var baseInfos = await _warningQueries.GetWarningRuleByAreaId(areaId); + if(baseInfos==null||baseInfos.Count==0) return; + baseInfos = baseInfos.DistinctBy(val => WarningKey(val.SystemId, val.CustomerId)).ToList(); + + var willDelKeys = baseInfos.Select(val => WarningKey(val.SystemId, val.CustomerId)).ToArray(); + await RedisHelper.Client.DelAsync(willDelKeys); + await RedisHelper.Client.DelAsync(AreaKey(areaId)); + var eventModel = new ClearRulCacheEvent + { + Items = baseInfos + }; + + await PublishEvent(eventModel); + } + + string WarningKey(int subSystemId, int customerId) => + $"{GlobalConst.TrackWarningKeyPrefix}:{subSystemId}:{customerId}"; + + string AreaKey(int areaId) => $"{GlobalConst.TrackAreaKeyPrefix}:{areaId}"; + private List WriteRules(List rules) { List result = new List(); @@ -118,13 +164,6 @@ public class ForewarningCacheService : IForewarningCacheService, ISingletonDepen } } - public Task DeleteRulesAsync(int subSystemId, int customerId) - { - _rules.Remove(WarningKey(subSystemId, customerId),out _); - - return Task.CompletedTask; - } - private List? GetAreaInfoByAreaId(int areaId) { if (_areas.TryGetValue(areaId, out var areaInfos)) return areaInfos; @@ -176,46 +215,6 @@ public class ForewarningCacheService : IForewarningCacheService, ISingletonDepen return result; } - public Task Clear(ClearRulCacheEvent @event) - { - foreach (var item in @event.Items) - { - DeleteRulesAsync(item.SystemId, item.CustomerId); - } - return Task.CompletedTask; - } - - public async Task ClearRedisBySystemIdAndCustomer(int subSystemId,int customerId) - { - await RedisHelper.Client.DelAsync(WarningKey(subSystemId, customerId)); - var eventModel = new ClearRulCacheEvent - { - Items = new List() - { - new RuleAreaBaseInfo(subSystemId, customerId) - } - }; - - await PublishEvent(eventModel); - } - - public async Task ClearRedisByAreaId(int areaId) - { - var baseInfos = await _warningQueries.GetWarningRuleByAreaId(areaId); - if(baseInfos==null||baseInfos.Count==0) return; - baseInfos = baseInfos.DistinctBy(val => WarningKey(val.SystemId, val.CustomerId)).ToList(); - - var willDelKeys = baseInfos.Select(val => WarningKey(val.SystemId, val.CustomerId)).ToArray(); - await RedisHelper.Client.DelAsync(willDelKeys); - await RedisHelper.Client.DelAsync(AreaKey(areaId)); - var eventModel = new ClearRulCacheEvent - { - Items = baseInfos - }; - - await PublishEvent(eventModel); - } - private async Task PublishEvent(ClearRulCacheEvent @event) { await RedisHelper.Client.PublishAsync(GlobalConst.PublishNotifyChannelKey, @event.ToJson()); diff --git a/src/SJZY.Track.Application/Services/ForewarningServices/ForewarningNotifyService.cs b/src/SJZY.Track.Application/Services/ForewarningServices/ForewarningNotifyService.cs index efaaa7d0..ec4ff81d 100644 --- a/src/SJZY.Track.Application/Services/ForewarningServices/ForewarningNotifyService.cs +++ b/src/SJZY.Track.Application/Services/ForewarningServices/ForewarningNotifyService.cs @@ -3,7 +3,9 @@ using FreeRedis; using SJZY.Expand.ABP.Core; using SJZY.Track.Application.Contract.Dtos.Forewarning; using SJZY.Track.Application.Contract.Services; +using SJZY.Track.Domain.Aggregates.ForewarningAggregate; using SJZY.Track.Domain.Consts; +using SJZY.Track.Domain.Dtos.Forewarning; using SJZY.Track.Domain.Queries; using Volo.Abp.DependencyInjection; @@ -78,6 +80,50 @@ public class ForewarningNotifyService : IForewarningNotifyService, ITransientDep if (res == null) throw new BusinessException(message: "轨迹预警计算失败"); } + public async Task SendNotificationAsync() + { + var max = GetTimestamp(DateTime.Now); + var set = await RedisHelper.Client.ZRangeByScoreAsync(GlobalConst.ForewarningNotifyKey, 0, max); + + if (set.IsNullOrEmpty()) return; + + var entries = set.Select(x => new WarningNotifyCacheEntry(x)).ToList(); + var ruleIds = entries.Select(x => x.RuleId).ToList(); + var notifyRules = await _warningQueries.GetWarningNotifyRulesAsync(ruleIds); + + /* + * +预警名称:字节全程时效 +预警规则: +{起飞-落地+普货+12345678+美国 时效9,预警时效7,次数3} 命中订单总数:124,详情点击https://middlebusiness.pet.shijizhongyun.com/trajectoryCenter/trajectoryOrder +{清关-提货+普货+12345678+美国 时效4,预警时效3,次数1} 命中订单总数:3250,详情点击https://middlebusiness.pet.shijizhongyun.com/trajectoryCenter/trajectoryOrder +预警名称:字节全程时效 +预警规则: +{起飞-落地+普货+12345678+美国 时效9,预警时效7,次数3} 命中订单总数:124,详情点击https://middlebusiness.pet.shijizhongyun.com/trajectoryCenter/trajectoryOrder +{清关-提货+普货+12345678+美国 时效4,预警时效3,次数1} 命中订单总数:3250,详情点击https://middlebusiness.pet.shijizhongyun.com/trajectoryCenter/trajectoryOrder + */ + foreach (var group in notifyRules.GroupBy(x => new { x.NotifyMode, x.NotifyUserId })) + { + var notifyContent = new StringBuilder(); + + foreach (var warningGroup in group.GroupBy(x => x.WarningName)) + { + notifyContent.AppendLine($"预警名称:{warningGroup.Key}"); + notifyContent.AppendLine($"预警规则:"); + + foreach (var rule in warningGroup.ToList()) + { + var cnt = entries.Count(x => x.RuleId == rule.RuleId); + if (cnt > 0) + { + notifyContent.AppendLine( + $"{rule.ToString()} 命中订单总数:{cnt},详情点击https://middlebusiness.pet.shijizhongyun.com/trajectoryCenter/trajectoryOrder"); + } + } + } + } + } + private static List MatchRule(List rules, WarningOrderDto order) { @@ -137,50 +183,6 @@ public class ForewarningNotifyService : IForewarningNotifyService, ITransientDep return res; } - public async Task SendNotificationAsync() - { - var max = GetTimestamp(DateTime.Now); - var set = await RedisHelper.Client.ZRangeByScoreAsync(GlobalConst.ForewarningNotifyKey, 0, max); - - if (set.IsNullOrEmpty()) return; - - var entries = set.Select(x => new WarningNotifyCacheEntry(x)).ToList(); - var ruleIds = entries.Select(x => x.RuleId).ToList(); - var notifyRules = await _warningQueries.GetWarningNotifyRulesAsync(ruleIds); - - /* - * -预警名称:字节全程时效 -预警规则: -{起飞-落地+普货+12345678+美国 时效9,预警时效7,次数3} 命中订单总数:124,详情点击https://middlebusiness.pet.shijizhongyun.com/trajectoryCenter/trajectoryOrder -{清关-提货+普货+12345678+美国 时效4,预警时效3,次数1} 命中订单总数:3250,详情点击https://middlebusiness.pet.shijizhongyun.com/trajectoryCenter/trajectoryOrder -预警名称:字节全程时效 -预警规则: -{起飞-落地+普货+12345678+美国 时效9,预警时效7,次数3} 命中订单总数:124,详情点击https://middlebusiness.pet.shijizhongyun.com/trajectoryCenter/trajectoryOrder -{清关-提货+普货+12345678+美国 时效4,预警时效3,次数1} 命中订单总数:3250,详情点击https://middlebusiness.pet.shijizhongyun.com/trajectoryCenter/trajectoryOrder - */ - foreach (var group in notifyRules.GroupBy(x => new { x.NotifyMode, x.NotifyUserId })) - { - var notifyContent = new StringBuilder(); - - foreach (var warningGroup in group.GroupBy(x => x.WarningName)) - { - notifyContent.AppendLine($"预警名称:{warningGroup.Key}"); - notifyContent.AppendLine($"预警规则:"); - - foreach (var rule in warningGroup.ToList()) - { - var cnt = entries.Count(x => x.RuleId == rule.RuleId); - if (cnt > 0) - { - notifyContent.AppendLine( - $"{rule.ToString()} 命中订单总数:{cnt},详情点击https://middlebusiness.pet.shijizhongyun.com/trajectoryCenter/trajectoryOrder"); - } - } - } - } - } - private static long GetTimestamp(DateTime dateTime) { return new DateTimeOffset(dateTime).ToUnixTimeSeconds(); diff --git a/src/SJZY.Track.Application/Services/ForewarningServices/ForewarningService.cs b/src/SJZY.Track.Application/Services/ForewarningServices/ForewarningService.cs index 0c7be38f..fdf00f44 100644 --- a/src/SJZY.Track.Application/Services/ForewarningServices/ForewarningService.cs +++ b/src/SJZY.Track.Application/Services/ForewarningServices/ForewarningService.cs @@ -1,10 +1,10 @@ using System.ComponentModel.DataAnnotations; -using SJZY.Track.Application.Contract.Dtos.Common; using SJZY.Track.Application.Contract.Dtos.Forewarning; using SJZY.Track.Application.Contract.Services; using SJZY.Track.Application.Helpers; using SJZY.Track.Domain.Aggregates.ForewarningAggregate; using SJZY.Track.Domain.Aggregates.TrackStatusAggregate; +using SJZY.Track.Domain.Dtos.Common; using SJZY.Track.Domain.Dtos.Forewarning; using SJZY.Track.Domain.Dtos.TrackStatus; using SJZY.Track.Domain.Queries; diff --git a/src/SJZY.Track.Application/Services/ForewarningServices/KpiAreaService.cs b/src/SJZY.Track.Application/Services/ForewarningServices/KpiAreaService.cs index 4232bea7..866d3dd9 100644 --- a/src/SJZY.Track.Application/Services/ForewarningServices/KpiAreaService.cs +++ b/src/SJZY.Track.Application/Services/ForewarningServices/KpiAreaService.cs @@ -1,4 +1,4 @@ -using SJZY.Track.Application.Contract.Services; +using SJZY.Track.Domain.Aggregates.ForewarningAggregate; using SJZY.Track.Domain.Aggregates.KPIAreaAggregate; using SJZY.Track.Domain.Dtos.Forewarning; diff --git a/src/SJZY.Track.Application/Services/ProvideServices/TrackPullService.cs b/src/SJZY.Track.Application/Services/ProvideServices/TrackPullService.cs index cb7cd5e1..00715aa9 100644 --- a/src/SJZY.Track.Application/Services/ProvideServices/TrackPullService.cs +++ b/src/SJZY.Track.Application/Services/ProvideServices/TrackPullService.cs @@ -1,5 +1,8 @@ using Microsoft.AspNetCore.Authorization; +using Microsoft.Extensions.Logging; using SJZY.Expand.ABP.Core; +using SJZY.Expand.ABP.Core.Logger; +using SJZY.Expand.ABP.Core.PublicMethords; using SJZY.InterfaceRelay.Application.Contracts; using SJZY.Track.Application.Contract.Dtos.ProvideServices; using SJZY.Track.Application.Contract.Dtos.TrackPull; @@ -78,51 +81,44 @@ public class TrackPullService : ApplicationService /// [AllowAnonymous] [HttpPost("Track/RefreshForTask")] - public bool RefreshForTaskAsync() + public async Task RefreshForTaskAsync() { - Task.Run(async () => - { - var configs = await _trackPullCacheService.GetAllPullConfigsAsync(); - - foreach (var config in configs) - { - var redisKey = _trackPullCacheService.TrackPullKey(config.SubSystemId, config.ServiceProviderId); - if (await RedisHelper.Client.ExistsAsync(redisKey)) - { - continue; - } - - var page = 1; - var orders = await _provideQueries.FindOrderWithServiceProviderAsync(config.ServiceProviderId, page); - while (orders.Any()) - { - var serviceProviderCode = orders.FirstOrDefault()?.ServiceProviderCode; - var serviceProviderName = orders.FirstOrDefault()?.ServiceProviderName; - - foreach (var group in orders.GroupBy(x => - new { x.SubSystemId, x.OrderType })) - { - var data = group.Select(x => new - { - x.OrderNo - }).ToList(); - - var attach = Base64Helper.SerializeObject(new TrackRefreshAttach(config.ServiceProviderId, - serviceProviderName!, - group.Key.SubSystemId, group.Key.OrderType)); - // 批量获取轨迹 - await _httpClientProxy.Service.BatchForwardThenPushToQueueAsync( - InterfaceRelayConst.GetTrackInterfaceCode, serviceProviderCode, data, - GlobalConst.TrackRefreshSubscribe, attach); - } - - orders = await _provideQueries.FindOrderWithServiceProviderAsync(config.ServiceProviderId, ++page); - } - - await RedisHelper.Client.SetExAsync(redisKey, config.PullInterval * 60, orders.Count); - } - }); - + var configs = await _trackPullCacheService.GetAllPullConfigsAsync(); + var tasks = configs.Select(RefreshForConfigAsync).ToArray(); + await Task.WhenAll(tasks); return true; } + + private async Task RefreshForConfigAsync(TrackPullConfigDto config) + { + var redisKey = _trackPullCacheService.TrackPullKey(config.SubSystemId, config.ServiceProviderId); + if (await RedisHelper.Client.ExistsAsync(redisKey)) + { + return; + } + + var page = 1; + var orders = await _provideQueries.FindOrderWithServiceProviderAsync(config.ServiceProviderId, page, 2000); + while (orders.Any()) + { + var serviceProviderCode = orders.FirstOrDefault()?.ServiceProviderCode; + var serviceProviderName = orders.FirstOrDefault()?.ServiceProviderName; + + foreach (var group in orders.GroupBy(x => new { x.SubSystemId, x.OrderType })) + { + var data = group.Select(x => new { x.OrderNo }).ToList(); + var attach = Base64Helper.SerializeObject(new TrackRefreshAttach(config.ServiceProviderId, serviceProviderName!, group.Key.SubSystemId, group.Key.OrderType)); + var res = await _httpClientProxy.Service.BatchForwardThenPushToQueueAsync(InterfaceRelayConst.GetTrackInterfaceCode, serviceProviderCode, data, GlobalConst.TrackRefreshSubscribe, attach); + + if (res.Code != InterfaceRelayConst.SuccessCode) + { + LogHelper.Error($"刷新轨迹失败:{res.ToJson()}"); + } + } + + orders = await _provideQueries.FindOrderWithServiceProviderAsync(config.ServiceProviderId, ++page); + } + + await RedisHelper.Client.SetExAsync(redisKey, config.PullInterval * 60, orders.Count); + } } \ No newline at end of file diff --git a/src/SJZY.Track.Application/Services/ProvideServices/TrackPushService.cs b/src/SJZY.Track.Application/Services/ProvideServices/TrackPushService.cs index fe78e2dd..96c471ff 100644 --- a/src/SJZY.Track.Application/Services/ProvideServices/TrackPushService.cs +++ b/src/SJZY.Track.Application/Services/ProvideServices/TrackPushService.cs @@ -32,7 +32,6 @@ public class TrackPushService : ApplicationService _capPublisher = capPublisher; _trackPushRecordsRepository = trackPushRecordsRepository; _requestCurrentUserService = requestCurrentUserService; - } /// @@ -92,7 +91,7 @@ public class TrackPushService : ApplicationService [HttpPost("Track/PushWarnForTask")] public async Task PushWarnForTaskAsync() { - int total = 0, pageSize = 1000,waitTime = 1000; + int total = 0, pageSize = 1000, waitTime = 1000; var dateTimes = Enumerable.Range(1, 12).Select(val => DateTime.Now.AddHours(-val)).ToList(); foreach (var dateTime in dateTimes) @@ -101,11 +100,11 @@ public class TrackPushService : ApplicationService var pageindex = 1; do { - rows = await _orderRepository.PushWarnOrdersAsync(pageSize,pageindex,dateTime); - total+=rows; + rows = await _orderRepository.PushWarnOrdersAsync(pageSize, pageindex, dateTime); + total += rows; pageindex++; await Task.Delay(waitTime); - }while (rows!= pageSize); + } while (rows != pageSize); } return $"本次预警扫描了:{total}个订单"; diff --git a/src/SJZY.Track.Application.Contract/Services/IForewarningCacheService.cs b/src/SJZY.Track.Domain/Aggregates/ForewarningAggregate/IForewarningCacheService.cs similarity index 90% rename from src/SJZY.Track.Application.Contract/Services/IForewarningCacheService.cs rename to src/SJZY.Track.Domain/Aggregates/ForewarningAggregate/IForewarningCacheService.cs index 08d8fafb..c330405d 100644 --- a/src/SJZY.Track.Application.Contract/Services/IForewarningCacheService.cs +++ b/src/SJZY.Track.Domain/Aggregates/ForewarningAggregate/IForewarningCacheService.cs @@ -1,6 +1,6 @@ -using SJZY.Track.Application.Contract.Dtos.Forewarning; +using SJZY.Track.Domain.Dtos.Forewarning; -namespace SJZY.Track.Application.Contract.Services; +namespace SJZY.Track.Domain.Aggregates.ForewarningAggregate; public interface IForewarningCacheService { @@ -11,7 +11,7 @@ public interface IForewarningCacheService /// 客户id /// Task?> GetRulesAsync(int subSystemId, int customerId); - + /// /// 删除规则 /// @@ -25,7 +25,7 @@ public interface IForewarningCacheService /// /// Task Clear(ClearRulCacheEvent @event); - + /// /// 清除redis 缓存 /// diff --git a/src/SJZY.Track.Domain/Aggregates/ForewarningAggregate/WarningFactorEntity.cs b/src/SJZY.Track.Domain/Aggregates/ForewarningAggregate/WarningFactorEntity.cs index 9c342518..ef349335 100644 --- a/src/SJZY.Track.Domain/Aggregates/ForewarningAggregate/WarningFactorEntity.cs +++ b/src/SJZY.Track.Domain/Aggregates/ForewarningAggregate/WarningFactorEntity.cs @@ -1,4 +1,4 @@ -using SJZY.Track.Domain.Enums; +using SJZY.Track.Share.Enums; namespace SJZY.Track.Domain.Aggregates.ForewarningAggregate; @@ -10,7 +10,7 @@ public class WarningFactorEntity : IFullAuditedBasicEntitys, IEntity /// [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)] public int Id { get; set; } - + /// /// 预警id /// @@ -22,7 +22,7 @@ public class WarningFactorEntity : IFullAuditedBasicEntitys, IEntity /// [SugarColumn(ColumnName = "Type")] public RuleFactorType Type { get; set; } - + /// /// 预警因素值(json数组字符串) /// diff --git a/src/SJZY.Track.Domain/Aggregates/ForewarningAggregate/WarningNotifyEntity.cs b/src/SJZY.Track.Domain/Aggregates/ForewarningAggregate/WarningNotifyEntity.cs index 1b846469..2cc22f04 100644 --- a/src/SJZY.Track.Domain/Aggregates/ForewarningAggregate/WarningNotifyEntity.cs +++ b/src/SJZY.Track.Domain/Aggregates/ForewarningAggregate/WarningNotifyEntity.cs @@ -1,4 +1,5 @@ using SJZY.Track.Domain.Enums; +using SJZY.Track.Share.Enums; namespace SJZY.Track.Domain.Aggregates.ForewarningAggregate; diff --git a/src/SJZY.Track.Domain/Aggregates/ForewarningAggregate/WarningRuleEntity.cs b/src/SJZY.Track.Domain/Aggregates/ForewarningAggregate/WarningRuleEntity.cs index f6141704..4c03451c 100644 --- a/src/SJZY.Track.Domain/Aggregates/ForewarningAggregate/WarningRuleEntity.cs +++ b/src/SJZY.Track.Domain/Aggregates/ForewarningAggregate/WarningRuleEntity.cs @@ -1,3 +1,5 @@ +using SJZY.Track.Share.Enums; + namespace SJZY.Track.Domain.Aggregates.ForewarningAggregate; [SugarTable("t_warning_rule")] @@ -14,7 +16,7 @@ public class WarningRuleEntity : IFullAuditedBasicEntitys, IEntity /// [SugarColumn(ColumnName = "WarningId")] public int WarningId { get; set; } - + /// /// 时效(小时) /// @@ -38,7 +40,7 @@ public class WarningRuleEntity : IFullAuditedBasicEntitys, IEntity /// [SugarColumn(ColumnName = "StartTrackStatusId")] public int StartTrackStatusId { get; set; } - + /// /// 起始轨迹状态(冗余) /// @@ -50,7 +52,7 @@ public class WarningRuleEntity : IFullAuditedBasicEntitys, IEntity /// [SugarColumn(ColumnName = "EndTrackStatusId")] public int EndTrackStatusId { get; set; } - + /// /// 终止轨迹状态(冗余) /// @@ -92,4 +94,16 @@ public class WarningRuleEntity : IFullAuditedBasicEntitys, IEntity /// [SugarColumn(ColumnName = "ProductCode")] public string? ProductCode { get; set; } + + /// + /// 通知方式 + /// + [SugarColumn(ColumnName = "NotifyMode")] + public NotifyMode NotifyMode { get; set; } + + /// + /// 通知人 + /// + [SugarColumn(ColumnName = "NotifyUserId")] + public int NotifyUserId { get; set; } } \ No newline at end of file diff --git a/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/TrackPushConfigEntity.cs b/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/TrackPushConfigEntity.cs index 8398a0bf..e2d46c98 100644 --- a/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/TrackPushConfigEntity.cs +++ b/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/TrackPushConfigEntity.cs @@ -1,4 +1,4 @@ -using SJZY.Track.Domain.Enums; +using SJZY.Track.Share.Enums; namespace SJZY.Track.Domain.Aggregates.TrackPushAggregate; @@ -55,19 +55,19 @@ public class TrackPushConfigEntity : IFullAuditedBasicEntitys, IAggregateRoot /// [SugarColumn(ColumnName = "IsAllPush")] public bool IsAllPush { get; set; } - + /// /// 日期时间格式类型 /// [SugarColumn(ColumnName = "DateTimeFormatType")] public DateTimeFormatEnum DateTimeFormatType { get; set; } - + /// /// 日期时间格式模板 /// [SugarColumn(ColumnName = "DateTimeFormat")] public string? DateTimeFormat { get; set; } - + /// /// 时区格式格式模板 /// diff --git a/src/SJZY.Track.Application.Contract/Dtos/Common/IdWithNameDto.cs b/src/SJZY.Track.Domain/Dtos/Common/IdWithNameDto.cs similarity index 64% rename from src/SJZY.Track.Application.Contract/Dtos/Common/IdWithNameDto.cs rename to src/SJZY.Track.Domain/Dtos/Common/IdWithNameDto.cs index 7027b635..cdcaf0ce 100644 --- a/src/SJZY.Track.Application.Contract/Dtos/Common/IdWithNameDto.cs +++ b/src/SJZY.Track.Domain/Dtos/Common/IdWithNameDto.cs @@ -1,4 +1,4 @@ -namespace SJZY.Track.Application.Contract.Dtos.Common; +namespace SJZY.Track.Domain.Dtos.Common; public class IdWithNameDto { diff --git a/src/SJZY.Track.Application.Contract/Dtos/Forewarning/AreaCacheEntry.cs b/src/SJZY.Track.Domain/Dtos/Forewarning/AreaCacheEntry.cs similarity index 86% rename from src/SJZY.Track.Application.Contract/Dtos/Forewarning/AreaCacheEntry.cs rename to src/SJZY.Track.Domain/Dtos/Forewarning/AreaCacheEntry.cs index 1e87ff17..b685513c 100644 --- a/src/SJZY.Track.Application.Contract/Dtos/Forewarning/AreaCacheEntry.cs +++ b/src/SJZY.Track.Domain/Dtos/Forewarning/AreaCacheEntry.cs @@ -1,4 +1,4 @@ -namespace SJZY.Track.Application.Contract.Dtos.Forewarning; +namespace SJZY.Track.Domain.Dtos.Forewarning; public class AreaCacheEntry { @@ -6,22 +6,22 @@ public class AreaCacheEntry /// 国家或地区 /// public string Country { get; set; } = null!; - + /// /// 省份 /// public string? Province { get; set; } - + /// /// 城市 /// public string? City { get; set; } - + /// /// 开始邮编 /// public string? LeftPostcode { get; set; } - + /// /// 截止邮编 /// diff --git a/src/SJZY.Track.Domain/Dtos/Forewarning/ClearRulCacheEvent.cs b/src/SJZY.Track.Domain/Dtos/Forewarning/ClearRulCacheEvent.cs new file mode 100644 index 00000000..22bc98af --- /dev/null +++ b/src/SJZY.Track.Domain/Dtos/Forewarning/ClearRulCacheEvent.cs @@ -0,0 +1,7 @@ +namespace SJZY.Track.Domain.Dtos.Forewarning; + + +public class ClearRulCacheEvent +{ + public List Items { get; set; } +} \ No newline at end of file diff --git a/src/SJZY.Track.Application.Contract/Dtos/Forewarning/ForewarningRuleCacheEntry.cs b/src/SJZY.Track.Domain/Dtos/Forewarning/ForewarningRuleCacheEntry.cs similarity index 95% rename from src/SJZY.Track.Application.Contract/Dtos/Forewarning/ForewarningRuleCacheEntry.cs rename to src/SJZY.Track.Domain/Dtos/Forewarning/ForewarningRuleCacheEntry.cs index 6a00ddb7..8a5a3040 100644 --- a/src/SJZY.Track.Application.Contract/Dtos/Forewarning/ForewarningRuleCacheEntry.cs +++ b/src/SJZY.Track.Domain/Dtos/Forewarning/ForewarningRuleCacheEntry.cs @@ -1,4 +1,4 @@ -namespace SJZY.Track.Application.Contract.Dtos.Forewarning; +namespace SJZY.Track.Domain.Dtos.Forewarning; public class ForewarningRuleCacheEntry { @@ -11,7 +11,7 @@ public class ForewarningRuleCacheEntry /// 预警id /// public int WarningId { get; set; } - + /// /// 时效(小时) e.g. 24 /// @@ -46,7 +46,7 @@ public class ForewarningRuleCacheEntry /// 月份 /// public List? Months { get; set; } - + /// /// 区域 /// diff --git a/src/SJZY.Track.Domain/Dtos/Forewarning/GetWarningNotifiesVo.cs b/src/SJZY.Track.Domain/Dtos/Forewarning/GetWarningNotifiesVo.cs index 54ecfdb5..d54f3986 100644 --- a/src/SJZY.Track.Domain/Dtos/Forewarning/GetWarningNotifiesVo.cs +++ b/src/SJZY.Track.Domain/Dtos/Forewarning/GetWarningNotifiesVo.cs @@ -1,6 +1,6 @@ using System.Text; using NUglify.Helpers; -using SJZY.Track.Domain.Enums; +using SJZY.Track.Share.Enums; namespace SJZY.Track.Domain.Dtos.Forewarning; @@ -85,7 +85,7 @@ public class GetWarningNotifiesVo /// 通知人 /// public int NotifyUserId { get; set; } - + /// /// 因素类型排序 /// diff --git a/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushConfigDetailOutputVO.cs b/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushConfigDetailOutputVO.cs index 76420ad4..600bc2fb 100644 --- a/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushConfigDetailOutputVO.cs +++ b/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushConfigDetailOutputVO.cs @@ -1,4 +1,4 @@ -using SJZY.Track.Domain.Enums; +using SJZY.Track.Share.Enums; namespace SJZY.Track.Domain.Dtos.TrackPush; @@ -55,17 +55,17 @@ public class GetTrackPushConfigDetailOutputVO /// 是否全量推送 /// public bool IsAllPush { get; set; } - + /// /// 时间格式枚举 /// public DateTimeFormatEnum? DateTimeFormatType { get; set; } - + /// /// 日期时间格式模板 /// public string? DateTimeFormat { get; set; } - + /// /// 时区格式格式模板 /// diff --git a/src/SJZY.Track.Domain/SJZY.Track.Domain.csproj b/src/SJZY.Track.Domain/SJZY.Track.Domain.csproj index ea3705c5..ec3f3ad7 100644 --- a/src/SJZY.Track.Domain/SJZY.Track.Domain.csproj +++ b/src/SJZY.Track.Domain/SJZY.Track.Domain.csproj @@ -16,5 +16,9 @@ + + + + diff --git a/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs index 187f306e..e4d41be4 100644 --- a/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs @@ -6,6 +6,7 @@ using SJZY.Track.Domain.Dtos.Common; using SJZY.Track.Domain.Dtos.TrackPush; using SJZY.Track.Domain.Enums; using SJZY.Track.Domain.VEntities; +using SJZY.Track.Share.Enums; namespace SJZY.Track.Repository.Repositories; diff --git a/src/SJZY.Track.Repository/SJZY.Track.Repository.csproj b/src/SJZY.Track.Repository/SJZY.Track.Repository.csproj index 1c38bf3e..17771a4f 100644 --- a/src/SJZY.Track.Repository/SJZY.Track.Repository.csproj +++ b/src/SJZY.Track.Repository/SJZY.Track.Repository.csproj @@ -15,6 +15,7 @@ + diff --git a/src/SJZY.Track.Domain/Enums/DateTimeFormatEnum.cs b/src/SJZY.Track.Shared/Enums/DateTimeFormatEnum.cs similarity index 90% rename from src/SJZY.Track.Domain/Enums/DateTimeFormatEnum.cs rename to src/SJZY.Track.Shared/Enums/DateTimeFormatEnum.cs index f7d68b5e..0e75af8b 100644 --- a/src/SJZY.Track.Domain/Enums/DateTimeFormatEnum.cs +++ b/src/SJZY.Track.Shared/Enums/DateTimeFormatEnum.cs @@ -1,4 +1,4 @@ -namespace SJZY.Track.Domain.Enums; +namespace SJZY.Track.Share.Enums; /// /// 时间样式枚举 diff --git a/src/SJZY.Track.Domain/Enums/NotifyMode.cs b/src/SJZY.Track.Shared/Enums/NotifyMode.cs similarity index 83% rename from src/SJZY.Track.Domain/Enums/NotifyMode.cs rename to src/SJZY.Track.Shared/Enums/NotifyMode.cs index f5821903..ff97a5f5 100644 --- a/src/SJZY.Track.Domain/Enums/NotifyMode.cs +++ b/src/SJZY.Track.Shared/Enums/NotifyMode.cs @@ -1,4 +1,4 @@ -namespace SJZY.Track.Domain.Enums; +namespace SJZY.Track.Share.Enums; public enum NotifyMode { diff --git a/src/SJZY.Track.Domain/Enums/RuleFactorType.cs b/src/SJZY.Track.Shared/Enums/RuleFactorType.cs similarity index 94% rename from src/SJZY.Track.Domain/Enums/RuleFactorType.cs rename to src/SJZY.Track.Shared/Enums/RuleFactorType.cs index 6dd01ace..0d38426f 100644 --- a/src/SJZY.Track.Domain/Enums/RuleFactorType.cs +++ b/src/SJZY.Track.Shared/Enums/RuleFactorType.cs @@ -1,4 +1,4 @@ -namespace SJZY.Track.Domain.Enums; +namespace SJZY.Track.Share.Enums; /// diff --git a/src/SJZY.Track.Shared/SJZY.Track.Shared.csproj b/src/SJZY.Track.Shared/SJZY.Track.Shared.csproj new file mode 100644 index 00000000..c07053a6 --- /dev/null +++ b/src/SJZY.Track.Shared/SJZY.Track.Shared.csproj @@ -0,0 +1,13 @@ + + + + net7.0 + enable + enable + SJZY.Track.Share + + + + + +