diff --git a/src/SJZY.Track.Application/CAP/EventHandlers/TrackPushEventHandler.cs b/src/SJZY.Track.Application/CAP/EventHandlers/TrackPushEventHandler.cs index ed6b7522..369221c7 100644 --- a/src/SJZY.Track.Application/CAP/EventHandlers/TrackPushEventHandler.cs +++ b/src/SJZY.Track.Application/CAP/EventHandlers/TrackPushEventHandler.cs @@ -113,7 +113,6 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe var tracks = await _trackDetailsRepository.GetListAsync(@event.OrderIds, @event.TrackCode); tracks = tracks.DistinctBy(x => x.OrderId).ToList(); // 防止重复推送 - var temp=this.DateTimeFormat(DateTime.Now, -8.0, config); if (tracks.Count == 0) return; // 一个能推的轨迹都不存在 // tips:人工推送只要能推就推了,不会校验已推和顺序问题,因为可能是更新 diff --git a/src/SJZY.Track.Application/Services/TrackNode/TrackNodeService.cs b/src/SJZY.Track.Application/Services/TrackNode/TrackNodeService.cs index 851d3055..c9bd2637 100644 --- a/src/SJZY.Track.Application/Services/TrackNode/TrackNodeService.cs +++ b/src/SJZY.Track.Application/Services/TrackNode/TrackNodeService.cs @@ -1,13 +1,11 @@ -using Microsoft.Extensions.Localization; using SJZY.Track.Application.Contract.Dtos.TrackNode; using SJZY.Track.Application.Contract.Dtos.TrackStatus; -using SJZY.Track.Application.Localization; using SJZY.Track.Domain.Aggregates.TrackNodeAggregate; using SJZY.Track.Domain.Aggregates.TrackStatusAggregate; using SJZY.Track.Domain.Dtos.TrackNode; using Volo.Abp.DependencyInjection; -namespace SJZY.Track.Application.Services.TrackNodeServices +namespace SJZY.Track.Application.Services.TrackNode { /// /// 轨迹节点服务 diff --git a/src/SJZY.Track.Domain/Dtos/Forewarning/AreaInfoDto.cs b/src/SJZY.Track.Domain/Dtos/Forewarning/AreaInfoDto.cs index 75e24e5e..d78454b6 100644 --- a/src/SJZY.Track.Domain/Dtos/Forewarning/AreaInfoDto.cs +++ b/src/SJZY.Track.Domain/Dtos/Forewarning/AreaInfoDto.cs @@ -22,6 +22,11 @@ public class RuleAreaInfoDto /// public string CountryName { get; set; } + /// + /// 国家id + /// + public int CountryId { get; set; } + /// /// 省份 /// diff --git a/src/SJZY.Track.Domain/VEntities/VCountryEntity.cs b/src/SJZY.Track.Domain/VEntities/VCountryEntity.cs new file mode 100644 index 00000000..46310904 --- /dev/null +++ b/src/SJZY.Track.Domain/VEntities/VCountryEntity.cs @@ -0,0 +1,110 @@ +using SqlSugar; +using System; + +namespace SJZY.Track.Domain.VEntities; + +[SugarTable("v_country")] +public class VCountryEntity : IFullAuditedBasicEntitys +{ + /// + /// 主键 + /// + [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)] + public int Id { get; set; } + + /// + /// 区域id + /// + [SugarColumn(ColumnName = "AreaId")] + public int AreaId { get; set; } + + /// + /// 币种id + /// + [SugarColumn(ColumnName = "CurrencyId", IsNullable = true)] + public int? CurrencyId { get; set; } + + /// + /// 中文名 + /// + [SugarColumn(ColumnName = "CnName")] + public string CnName { get; set; } + + /// + /// 英文名 + /// + [SugarColumn(ColumnName = "EnName")] + public string EnName { get; set; } + + /// + /// 二字代码 + /// + [SugarColumn(ColumnName = "Digit2Code")] + public string Digit2Code { get; set; } + + /// + /// 三字代码 + /// + [SugarColumn(ColumnName = "Digit3Code", IsNullable = true)] + public string Digit3Code { get; set; } + + /// + /// 企业代码类型 + /// + [SugarColumn(ColumnName = "EnterpriseCodeType", IsNullable = true)] + public string EnterpriseCodeType { get; set; } + + /// + /// 区号 + /// + [SugarColumn(ColumnName = "CountryCode", IsNullable = true)] + public int? CountryCode { get; set; } + + /// + /// 时差 + /// + [SugarColumn(ColumnName = "JetLag")] + public int JetLag { get; set; } + + /// + /// 城市名 + /// + [SugarColumn(ColumnName = "CountryName", IsNullable = true)] + public string CountryName { get; set; } + + /// + /// 是否不可使用 + /// + [SugarColumn(ColumnName = "IsUnusable", IsNullable = false)] + public bool IsUnusable { get; set; } + + /// + /// 创建人 + /// + [SugarColumn(ColumnName = "CreateUserId", IsNullable = true)] + public int? CreateUserId { get; set; } + + /// + /// 创建时间 + /// + [SugarColumn(ColumnName = "CreateTime", IsNullable = false, DefaultValue = "CURRENT_TIMESTAMP")] + public DateTime CreateTime { get; set; } + + /// + /// 更新人 + /// + [SugarColumn(ColumnName = "UpdateUserId", IsNullable = true)] + public int? UpdateUserId { get; set; } + + /// + /// 更新时间 + /// + [SugarColumn(ColumnName = "UpdateTime", IsNullable = true)] + public DateTime? UpdateTime { get; set; } + + /// + /// 是否删除 + /// + [SugarColumn(ColumnName = "IsDeleted", IsNullable = false)] + public bool IsDeleted { get; set; } +} \ No newline at end of file diff --git a/src/SJZY.Track.Repository/Repositories/KpiAreaRepository.cs b/src/SJZY.Track.Repository/Repositories/KpiAreaRepository.cs index c1a7d22a..f6226432 100644 --- a/src/SJZY.Track.Repository/Repositories/KpiAreaRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/KpiAreaRepository.cs @@ -65,26 +65,29 @@ public class KpiAreaRepository : BasicRepository, IKpiAreaReposi /// public async Task> GetAreaInfos(QueryAreaInfoRequest query) { - var queryable = Context.Queryable(); - queryable = queryable.Where(x => x.AreaId == query.AreaId); - return await queryable.OrderBy(x => x.Id, OrderByType.Desc) - .Select(val => new RuleAreaInfoDto() + return await Context.Queryable() + .InnerJoin((x,c)=>x.CountryCode==c.Digit2Code) + .Where(x => x.AreaId == query.AreaId) + .OrderBy(x => x.UpdateTime, OrderByType.Desc) + .Select((x,c)=> new RuleAreaInfoDto() { - Id = val.Id, - AreaId = val.AreaId, - City = val.City, - CountryCode = val.CountryCode, - CountryName = val.CountryName, - LeftPostcode = val.LeftPostcode, - RightPostcode = val.RightPostcode, - Province = val.Province + Id = x.Id, + AreaId = x.AreaId, + City = x.City, + CountryId = c.Id, + CountryCode = x.CountryCode, + CountryName = x.CountryName, + LeftPostcode = x.LeftPostcode, + RightPostcode = x.RightPostcode, + Province = x.Province }) .ToPagedListAsync(query.PageIndex, query.PageSize); } public Task GetAreaInfoById(int id) { - return Context.Queryable().FirstAsync(val => val.Id == id)!; + return Context.Queryable() + .FirstAsync(val => val.Id == id)!; } ///