diff --git a/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs b/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs index a5be2639..93a5e4c7 100644 --- a/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs +++ b/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs @@ -135,6 +135,18 @@ public class TrackPushService : ApplicationService return true; } + + /// + /// 获取服务商code根据客户id + /// + /// + /// + [HttpGet("GetServiceCodeByCustomerId")] + public async Task GetServiceCodeByCustomerId(int customerId) + { + return await _trackPushConfigRepository.GetServiceCodeByCustomerIdAsync(customerId); + } + /// /// 轨迹推送配置内容编辑 /// diff --git a/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/ITrackPushConfigRepository.cs b/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/ITrackPushConfigRepository.cs index ab97e52f..7784d57f 100644 --- a/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/ITrackPushConfigRepository.cs +++ b/src/SJZY.Track.Domain/Aggregates/TrackPushAggregate/ITrackPushConfigRepository.cs @@ -38,4 +38,5 @@ public interface ITrackPushConfigRepository : IBasicRepository> QueryTrackPullMappingsAsync(QueryTrackPullMappingsInputVO input); Task> GetTrackPushContentListAsync(int subSystemId, int customerId); + Task GetServiceCodeByCustomerIdAsync(int customerId); } diff --git a/src/SJZY.Track.Domain/VEntities/VExternalSubjectEntity.cs b/src/SJZY.Track.Domain/VEntities/VExternalSubjectEntity.cs index 11bfd62d..376ae476 100644 --- a/src/SJZY.Track.Domain/VEntities/VExternalSubjectEntity.cs +++ b/src/SJZY.Track.Domain/VEntities/VExternalSubjectEntity.cs @@ -1,4 +1,4 @@ -namespace SJZY.Track.Domain.VEntities; +namespace SJZY.Track.Domain.VEntities; /// /// 外部主体 @@ -125,4 +125,10 @@ public class VExternalSubjectEntity : IFullAuditedBasicEntitys /// [SugarColumn(ColumnName = "VerifiedName")] public string VerifiedName { get; set; } + + /// + /// api服务商代码 + /// + [SugarColumn(ColumnName = "ApiServiceCode")] + public string ApiServiceCode { get; set; } } diff --git a/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs index 4d890d42..62883d47 100644 --- a/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs @@ -217,4 +217,12 @@ public class TrackPushConfigRepository : BasicRepository, }) .ToListAsync(); } + + public async Task GetServiceCodeByCustomerIdAsync(int customerId) + { + return await Context.Queryable() + .Where(x => x.Id == customerId) + .Select(x => x.ApiServiceCode) + .FirstAsync(); + } }