This commit is contained in:
xiaolipro 2025-09-02 15:32:49 +08:00
parent 625846967b
commit 577f5aec95
18 changed files with 35 additions and 35 deletions

View File

@ -146,13 +146,13 @@ public class TrackPushService : ApplicationServiceBase
/// <summary> /// <summary>
/// 获取轨迹推送内容 /// 获取轨迹推送内容
/// </summary> /// </summary>
/// <param name="AppKey"></param> /// <param name="appKey"></param>
/// <param name="customer"></param> /// <param name="customer"></param>
/// <returns></returns> /// <returns></returns>
[HttpGet("Track/GetTrackPushContentList")] [HttpGet("Track/GetTrackPushContentList")]
public async Task<List<TrackPushContentDto>> GetTrackPushContentListAsync(string AppKey, string customer) public async Task<List<TrackPushContentDto>> GetTrackPushContentListAsync(string appKey, string customer)
{ {
var list = await _trackPushConfigRepository.GetTrackPushContentListAsync(AppKey, customer); var list = await _trackPushConfigRepository.GetTrackPushContentListAsync(appKey, customer);
var result = ObjectMapper.Map<List<GetTrackPushContentListVo>, List<TrackPushContentDto>>(list); var result = ObjectMapper.Map<List<GetTrackPushContentListVo>, List<TrackPushContentDto>>(list);

View File

@ -371,7 +371,7 @@ public partial class TrackService : ApplicationServiceBase
private async Task TrackUpsertValidation( private async Task TrackUpsertValidation(
bool isAdd, bool isAdd,
string? esId, string? esId,
string AppKey, string appKey,
int orderId, int orderId,
string orderNo, string orderNo,
string trackCode, string trackCode,
@ -424,7 +424,7 @@ public partial class TrackService : ApplicationServiceBase
#region 轨迹内容中的配置规则检查 #region 轨迹内容中的配置规则检查
var trackContent = await _trackContentRepository.GetByCodeAsync(AppKey, trackCode); var trackContent = await _trackContentRepository.GetByCodeAsync(appKey, trackCode);
if (trackContent == null) if (trackContent == null)
{ {
throw new BusinessException(message: $"轨迹代码:{trackCode}轨迹内容不存在"); throw new BusinessException(message: $"轨迹代码:{trackCode}轨迹内容不存在");

View File

@ -16,16 +16,16 @@ public class TrackPullCacheService : ITransientDependency
_objectMapper = objectMapper; _objectMapper = objectMapper;
} }
public string TrackPullKey(string AppKey, string serviceProviderCode) => public string TrackPullKey(string appKey, string serviceProviderCode) =>
$"{GlobalConst.TrackPullKeyPrefix}:{AppKey}:{serviceProviderCode}"; $"{GlobalConst.TrackPullKeyPrefix}:{appKey}:{serviceProviderCode}";
public async Task<TrackPullParamsWithContentDto?> GetPullParamsWithContentAsync(string AppKey, public async Task<TrackPullParamsWithContentDto?> GetPullParamsWithContentAsync(string appKey,
string serviceProviderCode) string serviceProviderCode)
{ {
var data = await RedisHelper.Client.GetAsync<TrackPullParamsWithContentDto>(TrackPullContentKey( var data = await RedisHelper.Client.GetAsync<TrackPullParamsWithContentDto>(TrackPullContentKey(
AppKey, serviceProviderCode)); appKey, serviceProviderCode));
var pullId = await _trackPullConfigRepository.FindIdAsync(AppKey, serviceProviderCode); var pullId = await _trackPullConfigRepository.FindIdAsync(appKey, serviceProviderCode);
data ??= await SetPullConfigAsync(pullId); data ??= await SetPullConfigAsync(pullId);
return data; return data;
@ -59,6 +59,6 @@ public class TrackPullCacheService : ITransientDependency
return data; return data;
} }
public static string TrackPullContentKey(string AppKey, string serviceProviderCode) => public static string TrackPullContentKey(string appKey, string serviceProviderCode) =>
$"{GlobalConst.TrackPullContentKeyPrefix}:{AppKey}:{serviceProviderCode}"; $"{GlobalConst.TrackPullContentKeyPrefix}:{appKey}:{serviceProviderCode}";
} }

View File

@ -59,7 +59,7 @@ public interface IOrderRepository : IBasicRepository<OrderEntity>
/// 更新推送预警单 /// 更新推送预警单
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
Task<int> PushWarnOrdersAsync(string AppKey, int pageSize, int pageindex); Task<int> PushWarnOrdersAsync(string appKey, int pageSize, int pageindex);
/// <summary> /// <summary>
/// 更新缺失标记,时区缺失和发生地缺失标记,1表示时区,2表示发生地,3表示两种 /// 更新缺失标记,时区缺失和发生地缺失标记,1表示时区,2表示发生地,3表示两种

View File

@ -6,7 +6,7 @@ namespace TrackCenter.Domain.Aggregates.TrackContentAggregate;
/// 轨迹内容映射表 /// 轨迹内容映射表
/// </summary> /// </summary>
[SugarTable("t_track_content_map")] [SugarTable("t_track_content_map")]
public class TrackContentMapEntity : FullAuditedEntity<int> public class TrackContentMapEntity : FullAuditedEntity<int, int>
{ {
/// <summary> /// <summary>
/// 自增主键 /// 自增主键

View File

@ -50,5 +50,5 @@ public interface ITrackPullConfigRepository : IBasicRepository<TrackPullConfigEn
Task<bool> UpdateContentAsync(TrackPullContentConfigEntity updateObj); Task<bool> UpdateContentAsync(TrackPullContentConfigEntity updateObj);
Task<bool> IsContentAnyAsync(Expression<Func<TrackPullContentConfigEntity, bool>> whereExpression); Task<bool> IsContentAnyAsync(Expression<Func<TrackPullContentConfigEntity, bool>> whereExpression);
Task<int> FindIdAsync(string AppKey, string serviceProviderCode); Task<int> FindIdAsync(string appKey, string serviceProviderCode);
} }

View File

@ -7,7 +7,7 @@ namespace TrackCenter.Domain.Aggregates.TrackPullAggregate;
/// 轨迹拉取内容配置表 /// 轨迹拉取内容配置表
/// </summary> /// </summary>
[SugarTable("t_track_pull_content_config")] [SugarTable("t_track_pull_content_config")]
public class TrackPullContentConfigEntity : FullAuditedEntity<int> public class TrackPullContentConfigEntity : FullAuditedEntity<int, int>
{ {
/// <summary> /// <summary>
/// 自增主键 /// 自增主键

View File

@ -7,7 +7,7 @@ namespace TrackCenter.Domain.Aggregates.TrackPushAggregate;
/// 轨迹推送内容配置表 /// 轨迹推送内容配置表
/// </summary> /// </summary>
[SugarTable("t_track_push_content_config")] [SugarTable("t_track_push_content_config")]
public class TrackPushContentConfigEntity : FullAuditedEntity<int> public class TrackPushContentConfigEntity : FullAuditedEntity<int, int>
{ {
/// <summary> /// <summary>
/// 自增主键 /// 自增主键

View File

@ -3,7 +3,7 @@ using Fake.Domain.Entities.Auditing;
namespace TrackCenter.Domain.Aggregates.WarningAggregate.Complete; namespace TrackCenter.Domain.Aggregates.WarningAggregate.Complete;
[SugarTable("t_warning_complete_rule_item", TableDescription = "完整预警规则项")] [SugarTable("t_warning_complete_rule_item", TableDescription = "完整预警规则项")]
public sealed class CompleteWarningRuleItemEntity : FullAuditedEntity<int> public sealed class CompleteWarningRuleItemEntity : FullAuditedEntity<int, int>
{ {
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)] [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)]
public int Id { get; set; } public int Id { get; set; }

View File

@ -5,7 +5,7 @@ namespace TrackCenter.Domain.Aggregates.WarningAggregate.Return;
// 预警重试推送任务 // 预警重试推送任务
[SugarTable("t_warning_return_retry_task", TableDescription = "回传预警重试推送任务")] [SugarTable("t_warning_return_retry_task", TableDescription = "回传预警重试推送任务")]
public sealed class ReturnWarningRetryPushTaskEntity : FullAuditedEntity<int> public sealed class ReturnWarningRetryPushTaskEntity : FullAuditedEntity<int, int>
{ {
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)] [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)]
public int Id { get; set; } public int Id { get; set; }

View File

@ -4,7 +4,7 @@ namespace TrackCenter.Domain.Aggregates.WarningAggregate.Return;
// 回传预警规则项 // 回传预警规则项
[SugarTable("t_warning_return_rule_item", TableDescription = "回传预警规则项")] [SugarTable("t_warning_return_rule_item", TableDescription = "回传预警规则项")]
public sealed class ReturnWarningRuleItemEntity : FullAuditedEntity<int> public sealed class ReturnWarningRuleItemEntity : FullAuditedEntity<int, int>
{ {
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)] [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)]
public int Id { get; set; } public int Id { get; set; }

View File

@ -6,7 +6,7 @@ namespace TrackCenter.Domain.Aggregates.WarningAggregate.Transport;
[SugarTable("t_warning_transport_generate_task", TableDescription = "运输时效预警明细生成任务")] [SugarTable("t_warning_transport_generate_task", TableDescription = "运输时效预警明细生成任务")]
[SugarIndex("IDX_PlanExecutionTime_IsClosed", nameof(PlanExecutionTime), OrderByType.Asc, nameof(IsClosed), OrderByType.Asc)] [SugarIndex("IDX_PlanExecutionTime_IsClosed", nameof(PlanExecutionTime), OrderByType.Asc, nameof(IsClosed), OrderByType.Asc)]
public sealed class TransportWarningDetailsGenerateTaskEntity : FullAuditedEntity<int> public sealed class TransportWarningDetailsGenerateTaskEntity : FullAuditedEntity<int, int>
{ {
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)] [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)]
public int Id { get; set; } public int Id { get; set; }

View File

@ -5,7 +5,7 @@ namespace TrackCenter.Domain.Aggregates.WarningAggregate.Transport;
// 运输时效场景 // 运输时效场景
[SugarTable("t_warning_transport_scene", TableDescription = "运输时效规则场景")] [SugarTable("t_warning_transport_scene", TableDescription = "运输时效规则场景")]
public sealed class TransportWarningSceneEntity : FullAuditedEntity<int> public sealed class TransportWarningSceneEntity : FullAuditedEntity<int, int>
{ {
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)] [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)]
public int Id { get; set; } public int Id { get; set; }

View File

@ -5,7 +5,7 @@ namespace TrackCenter.Domain.Aggregates.WarningAggregate.Transport;
// 运输时效场景规则项 // 运输时效场景规则项
[SugarTable("t_warning_transport_scene_rule_item", TableDescription = "运输时效规则场景规则项")] [SugarTable("t_warning_transport_scene_rule_item", TableDescription = "运输时效规则场景规则项")]
public sealed class TransportWarningSceneRuleItemEntity : FullAuditedEntity<int> public sealed class TransportWarningSceneRuleItemEntity : FullAuditedEntity<int, int>
{ {
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)] [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)]
public int Id { get; set; } public int Id { get; set; }

View File

@ -36,22 +36,22 @@ public sealed class WarningRuleEntity : FullAuditedAggregateRoot<int, int>
{ {
} }
public WarningRuleEntity(int id, string name, string AppKey, string customer, bool isEnabled, int warningType, string version) public WarningRuleEntity(int id, string name, string appKey, string customer, bool isEnabled, int warningType, string version)
{ {
Id = id; Id = id;
Name = name; Name = name;
AppKey = AppKey; AppKey = appKey;
Customer = customer; Customer = customer;
IsEnabled = isEnabled; IsEnabled = isEnabled;
WarningType = warningType; WarningType = warningType;
Version = version; Version = version;
} }
public WarningRuleEntity(int id, string name, string AppKey, string customer, bool isEnabled, int warningType) public WarningRuleEntity(int id, string name, string appKey, string customer, bool isEnabled, int warningType)
{ {
Id = id; Id = id;
Name = name; Name = name;
AppKey = AppKey; AppKey = appKey;
Customer = customer; Customer = customer;
IsEnabled = isEnabled; IsEnabled = isEnabled;
WarningType = warningType; WarningType = warningType;
@ -59,8 +59,8 @@ public sealed class WarningRuleEntity : FullAuditedAggregateRoot<int, int>
} }
// 应用+客户id确定命中规则主体 // 应用+客户id确定命中规则主体
public bool CanHitRule(string AppKey, string customer) public bool CanHitRule(string appKey, string customer)
{ {
return AppKey == AppKey && Customer == customer; return AppKey == appKey && Customer == customer;
} }
} }

View File

@ -6,7 +6,7 @@ namespace TrackCenter.Domain.VEntities;
/// 服务商主表 /// 服务商主表
/// </summary> /// </summary>
[SugarTable("v_service_provider")] [SugarTable("v_service_provider")]
public class VServiceProviderEntity : FullAuditedEntity<int> public class VServiceProviderEntity : FullAuditedEntity<int, int>
{ {
/// <summary> /// <summary>
/// 自增主键 /// 自增主键

View File

@ -308,14 +308,14 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
/// <summary> /// <summary>
/// 更新推送预警单 /// 更新推送预警单
/// </summary> /// </summary>
/// <param name="AppKey"></param> /// <param name="appKey"></param>
/// <param name="pageSize"></param> /// <param name="pageSize"></param>
/// <param name="pageindex"></param> /// <param name="pageindex"></param>
/// <returns></returns> /// <returns></returns>
public async Task<int> PushWarnOrdersAsync(string AppKey, int pageSize, int pageindex) public async Task<int> PushWarnOrdersAsync(string appKey, int pageSize, int pageindex)
{ {
var ordersToUpdate = await Context.Queryable<OrderEntity>() var ordersToUpdate = await Context.Queryable<OrderEntity>()
.Where(b => b.AppKey == AppKey && !b.IsCompleted && b.QuestionType != TrackProblemType.Error) .Where(b => b.AppKey == appKey && !b.IsCompleted && b.QuestionType != TrackProblemType.Error)
.Select(b => new .Select(b => new
{ {
b.LatestPushTime, b.LatestPushTime,

View File

@ -152,11 +152,11 @@ public class TrackPullConfigRepository : BasicRepository<TrackPullConfigEntity>,
return await Context.Queryable<TrackPullContentConfigEntity>().Where(whereExpression).AnyAsync(); return await Context.Queryable<TrackPullContentConfigEntity>().Where(whereExpression).AnyAsync();
} }
public async Task<int> FindIdAsync(string AppKey, string serviceProviderCode) public async Task<int> FindIdAsync(string appKey, string serviceProviderCode)
{ {
return await AsQueryable() return await AsQueryable()
.LeftJoin<VServiceProviderEntity>((trackPull, service) => trackPull.ServiceProviderId == service.Id) .LeftJoin<VServiceProviderEntity>((trackPull, service) => trackPull.ServiceProviderId == service.Id)
.Where((trackPull, service) => trackPull.AppKey == AppKey && service.Code == serviceProviderCode) .Where((trackPull, service) => trackPull.AppKey == appKey && service.Code == serviceProviderCode)
.Select(trackPull => trackPull.Id) .Select(trackPull => trackPull.Id)
.FirstAsync(); .FirstAsync();
} }