From f188a7ceb562113496e1ba460cd1d95784398bb7 Mon Sep 17 00:00:00 2001 From: hardstylewyl <827778732@qq.com> Date: Mon, 24 Feb 2025 11:29:44 +0800 Subject: [PATCH] =?UTF-8?q?add-interface:=E5=A2=9E=E5=8A=A0=E8=BD=A8?= =?UTF-8?q?=E8=BF=B9=E5=86=85=E5=AE=B9=E9=80=9A=E8=BF=87=E5=AD=90=E7=B3=BB?= =?UTF-8?q?=E7=BB=9Fid=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dtos/TrackContents/TrackContentOutput.cs | 79 +++++++++++++++++++ .../SJZY.Track.Application.Contract.csproj | 2 +- .../Services/ITrackContentService.cs | 3 + .../TrackContentAutoMapperProfile.cs | 4 +- .../ProvideServices/TrackContentService.cs | 34 ++++++++ .../Aggregates/OrderAggregate/OrderEntity.cs | 2 +- .../Repositories/TrackContentRepository.cs | 1 + 7 files changed, 121 insertions(+), 4 deletions(-) create mode 100644 src/SJZY.Track.Application.Contract/Dtos/TrackContents/TrackContentOutput.cs create mode 100644 src/SJZY.Track.Application/Services/ProvideServices/TrackContentService.cs diff --git a/src/SJZY.Track.Application.Contract/Dtos/TrackContents/TrackContentOutput.cs b/src/SJZY.Track.Application.Contract/Dtos/TrackContents/TrackContentOutput.cs new file mode 100644 index 00000000..c1b85a88 --- /dev/null +++ b/src/SJZY.Track.Application.Contract/Dtos/TrackContents/TrackContentOutput.cs @@ -0,0 +1,79 @@ +namespace SJZY.Track.Application.Contract.Dtos.TrackContents; + +public sealed class TrackContentOutput +{ + /// + /// 子系统Id + /// + public int SubSystemId { get; set; } + + /// + /// 子系统代码 + /// + public string SubSystemCode { get; set; } + + /// + /// 轨迹状态Id + /// + public int TrackStatusId { get; set; } + + /// + /// 轨迹状态 + /// + public string TrackStatus { get; set; } = null!; + + /// + /// 轨迹内容Id + /// + public int TrackContentId { get; set; } + + /// + /// 轨迹内容 + /// + public string TrackContent { get; set; } = null!; + + /// + /// 轨迹内容英文 + /// + public string TrackEnContent { get; set; } = null!; + + /// + /// 是否完成态 + /// + public bool IsCompleted { get; set; } + + /// + /// 轨迹状态代码 + /// + public string TrackStatusCode { get; set; } + + /// + /// 是否可重复 + /// + public bool IsRepeatable { get; set; } + + /// + /// 是否允许手动修改 + /// + public bool IsAllowManuallyUpdate { get; set; } + + /// + /// 是否允许手动创建 + /// + public bool IsAllowManuallyCreate { get; set; } + + /// + /// 是否广播 + /// + public bool IsToMq { get; set; } + + /// + /// 是否对外 + /// + public bool IsExternal { get; set; } + + /// + /// 轨迹内容code + /// + public string TrackContentCode { 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 f0778d54..40071dee 100644 --- a/src/SJZY.Track.Application.Contract/SJZY.Track.Application.Contract.csproj +++ b/src/SJZY.Track.Application.Contract/SJZY.Track.Application.Contract.csproj @@ -5,7 +5,7 @@ net7.0 True - 7.0.14 + 7.0.15 True diff --git a/src/SJZY.Track.Application.Contract/Services/ITrackContentService.cs b/src/SJZY.Track.Application.Contract/Services/ITrackContentService.cs index b24b807c..919f2e65 100644 --- a/src/SJZY.Track.Application.Contract/Services/ITrackContentService.cs +++ b/src/SJZY.Track.Application.Contract/Services/ITrackContentService.cs @@ -1,5 +1,8 @@ +using SJZY.Track.Application.Contract.Dtos.TrackContents; + namespace SJZY.Track.Application.Contract.Services; public interface ITrackContentService { + Task> GetTrackContentsAsync(int subSystemId); } diff --git a/src/SJZY.Track.Application/AutoMapper/TrackContentAutoMapperProfile.cs b/src/SJZY.Track.Application/AutoMapper/TrackContentAutoMapperProfile.cs index a161314e..6b1703fb 100644 --- a/src/SJZY.Track.Application/AutoMapper/TrackContentAutoMapperProfile.cs +++ b/src/SJZY.Track.Application/AutoMapper/TrackContentAutoMapperProfile.cs @@ -17,9 +17,9 @@ public class TrackContentAutoMapperProfile : Profile CreateMap, UnifyPageResultDto>( MemberList.None); CreateMap(MemberList.None); + CreateMap(MemberList.None); CreateMap(MemberList.None).ReverseMap(); - CreateMap< SJZY.Track.Domain.Aggregates.TrackDetailsAggregate.FileItem, SJZY.Track.Application.Contract.Dtos.TrackContents.FileItem>(MemberList.None).ReverseMap(); - + CreateMap(MemberList.None).ReverseMap(); } } diff --git a/src/SJZY.Track.Application/Services/ProvideServices/TrackContentService.cs b/src/SJZY.Track.Application/Services/ProvideServices/TrackContentService.cs new file mode 100644 index 00000000..2494e060 --- /dev/null +++ b/src/SJZY.Track.Application/Services/ProvideServices/TrackContentService.cs @@ -0,0 +1,34 @@ +using SJZY.Track.Application.Contract.Dtos.TrackContents; +using SJZY.Track.Application.Contract.Services; +using SJZY.Track.Domain.Aggregates.TrackContentAggregate; +using SJZY.Track.Domain.Dtos.TrackContents; + +namespace SJZY.Track.Application.Services.ProvideServices; + +/// +/// 轨迹内容服务 +/// +[ApiExplorerSettings(GroupName = "提供接口")] +[Route("/ProviderService")] +public class TrackContentService : ApplicationService, ITrackContentService +{ + private readonly ITrackContentRepository _trackContentRepository; + + public TrackContentService(ITrackContentRepository trackContentRepository) + { + _trackContentRepository = trackContentRepository; + } + + /// + /// 根据子系统id获取轨迹内容列表 + /// + /// + /// + [HttpPost("Track/GetTrackContents")] + public async Task> GetTrackContentsAsync(int subSystemId) + { + var res = await _trackContentRepository.GetTrackContentBySyetemIdAsync(subSystemId); + var result = ObjectMapper.Map, List>(res); + return result; + } +} diff --git a/src/SJZY.Track.Domain/Aggregates/OrderAggregate/OrderEntity.cs b/src/SJZY.Track.Domain/Aggregates/OrderAggregate/OrderEntity.cs index ce05158f..a137cffe 100644 --- a/src/SJZY.Track.Domain/Aggregates/OrderAggregate/OrderEntity.cs +++ b/src/SJZY.Track.Domain/Aggregates/OrderAggregate/OrderEntity.cs @@ -198,7 +198,7 @@ public class OrderEntity : IFullAuditedBasicEntitys, IAggregateRoot /// 冗余订单第三方订单号(创建订单,更新订单时维护) /// [SugarColumn(ColumnName = "ThirdPartyOrderNumber")] - public string? ThirdPartyOrderNumber { get; set; } // + public string? ThirdPartyOrderNumber { get; set; } [SugarColumn(IsIgnore = true)] public List OrderFlights { get; set; } diff --git a/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs index 2c49ff0e..34dd608e 100644 --- a/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs @@ -257,6 +257,7 @@ public class TrackContentRepository : BasicRepository, ITrac .Where(x => x.SubSystemId == subSystemId) .Select((x, y, z) => new TrackContentVO { + SubSystemId = x.SubSystemId, SubSystemCode = z.Key, TrackStatusId = x.TrackStatusId, TrackStatus = y.Status,