【 1. 轨迹拉取内容页面:新增和编辑弹窗页面去除是否完结的字段】
https://www.tapd.cn/60863849/prong/tasks/view/1160863849001027884
This commit is contained in:
parent
bd0287dfb0
commit
1f8a0d2f93
@ -2,32 +2,12 @@ namespace SJZY.Track.Application.Contract.Dtos.TrackPull;
|
||||
|
||||
public class EditTrackPullConfigInput
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作类型
|
||||
/// </summary>
|
||||
public OptionTypeNoNull Options { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 拉取轨迹订单号
|
||||
/// </summary>
|
||||
public string? OrderNoName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 返参解析对象
|
||||
/// </summary>
|
||||
public int? ParseMethod { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 定时任务(分钟)
|
||||
/// </summary>
|
||||
public int? PullInterval { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务商id
|
||||
/// </summary>
|
||||
public int? ServiceProviderId { get; set; }
|
||||
public int? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 子系统id
|
||||
@ -35,46 +15,62 @@ public class EditTrackPullConfigInput
|
||||
public int? SubSystemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 拉取轨迹时区
|
||||
/// 服务商id
|
||||
/// </summary>
|
||||
public string? TrackTimeZoneName { get; set; }
|
||||
public int? ServiceProviderId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 拉取轨迹内容代码
|
||||
/// 服务商拉取频率(分钟)
|
||||
/// </summary>
|
||||
public string? TrackContentCodeName { get; set; }
|
||||
public int PullInterval { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 拉取轨迹内容
|
||||
/// 解析方式,1取接口通返参映射后的,2取服务商原返参
|
||||
/// </summary>
|
||||
public string? TrackContentName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 拉取轨迹发生地
|
||||
/// </summary>
|
||||
public string? TrackPlaceName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 拉取轨迹状态
|
||||
/// </summary>
|
||||
public string? TrackStatusName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 拉取轨迹发生时间
|
||||
/// </summary>
|
||||
public string? TrackTimeName { get; set; }
|
||||
public int ParseMethod { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单路径
|
||||
/// </summary>
|
||||
public string? OrderPath { get; set; }
|
||||
public string OrderPath { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// 单号参数名
|
||||
/// </summary>
|
||||
public string? TrackDetailsPath { get; set; }
|
||||
public string OrderNoName { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹内容code
|
||||
/// 轨迹明细路径
|
||||
/// </summary>
|
||||
public string? TrackContentCode { get; set; }
|
||||
public string TrackDetailsPath { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹状态参数名
|
||||
/// </summary>
|
||||
public string? TrackStatusName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹代码参数名
|
||||
/// </summary>
|
||||
public string? TrackContentCodeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹内容参数名
|
||||
/// </summary>
|
||||
public string? TrackContentName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹发生地参数名
|
||||
/// </summary>
|
||||
public string? TrackPlaceName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹发生时间参数名
|
||||
/// </summary>
|
||||
public string? TrackTimeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹时区参数名
|
||||
/// </summary>
|
||||
public string? TrackTimeZoneName { get; set; }
|
||||
}
|
||||
|
||||
@ -7,21 +7,16 @@ public class TrackPullContentConfigDto
|
||||
/// </summary>
|
||||
public string TrackContentCode { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// 是否完结
|
||||
/// </summary>
|
||||
public bool IsCompleted { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务商轨迹状态参数值
|
||||
/// </summary>
|
||||
public string? TrackStatusValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务商轨迹代码参数值
|
||||
/// </summary>
|
||||
public string? TrackContentCodeValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务商轨迹内容参数值
|
||||
/// </summary>
|
||||
public string? TrackContentValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹关键词(正向),多个逗分隔
|
||||
/// </summary>
|
||||
@ -37,11 +32,6 @@ public class TrackPullContentConfigDto
|
||||
/// </summary>
|
||||
public int? TrackPlaceValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单是否完成(由轨迹刷新配置决定)
|
||||
/// </summary>
|
||||
public bool IsCompleted { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹时区发生地参数值
|
||||
/// </summary>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
namespace SJZY.Track.Application.Contract.Dtos.TrackPull;
|
||||
|
||||
public class TrackPullParamWithContentConfigDto
|
||||
public class TrackPullParamsWithContentDto
|
||||
{
|
||||
public TrackPullParamConfigDto ParamConfig { get; set; } = new();
|
||||
|
||||
|
||||
@ -19,8 +19,8 @@ public interface ITrackPullCacheService
|
||||
/// <param name="subSystemId">子系统id</param>
|
||||
/// <param name="serviceProviderId">服务商id</param>
|
||||
/// <returns></returns>
|
||||
Task<TrackPullParamWithContentConfigDto?>
|
||||
GetPullParamWithContentConfigAsync(int subSystemId, int serviceProviderId);
|
||||
Task<TrackPullParamsWithContentDto?>
|
||||
GetPullParamsWithContentAsync(int subSystemId, int serviceProviderId);
|
||||
|
||||
/// <summary>
|
||||
/// 设置拉取配置缓存
|
||||
@ -29,6 +29,6 @@ public interface ITrackPullCacheService
|
||||
/// <param name="subSystemId">子系统id</param>
|
||||
/// <param name="serviceProviderId">服务商id</param>
|
||||
/// <returns></returns>
|
||||
Task<TrackPullParamWithContentConfigDto?> SetPullConfigAsync(int? id = null, int? subSystemId = null,
|
||||
Task<TrackPullParamsWithContentDto?> SetPullConfigAsync(int? id = null, int? subSystemId = null,
|
||||
int? serviceProviderId = null);
|
||||
}
|
||||
|
||||
@ -2,7 +2,6 @@ using AutoMapper;
|
||||
using SJZY.Track.Application.Contract.Dtos.TrackPull;
|
||||
using SJZY.Track.Domain.Aggregates.TrackPullAggregate;
|
||||
using SJZY.Track.Domain.Dtos.TrackPull;
|
||||
using Volo.Abp.AutoMapper;
|
||||
|
||||
namespace SJZY.Track.Application.AutoMapper;
|
||||
|
||||
@ -11,8 +10,6 @@ public class TrackPullAutoMapperProfile : Profile
|
||||
public TrackPullAutoMapperProfile()
|
||||
{
|
||||
CreateMap<EditTrackPullConfigInput, TrackPullConfigEntity>(MemberList.None);
|
||||
CreateMap<EditTrackPullConfigInput, TrackPushPullParamsConfigEntity>(MemberList.None).Ignore(dest => dest.Id)
|
||||
.ForMember(dest => dest.IsPush, opt => opt.MapFrom(source => false));
|
||||
CreateMap<EditTrackPullContentInput, TrackPullContentConfigEntity>(MemberList.None)
|
||||
.ForMember(dest => dest.TrackKeyword, opt => opt.MapFrom(src => string.Join(',', src.TrackKeywords)))
|
||||
.ForMember(dest => dest.TrackZonePlaceValue, opt => opt.MapFrom(src => src.TrackTimePlaceValue))
|
||||
|
||||
@ -1,9 +1,7 @@
|
||||
using AutoMapper;
|
||||
using SJZY.Track.Application.Contract.Dtos.TrackPush;
|
||||
using SJZY.Track.Domain.Aggregates.TrackPullAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackPushAggregate;
|
||||
using SJZY.Track.Domain.Dtos.TrackPush;
|
||||
using Volo.Abp.AutoMapper;
|
||||
|
||||
namespace SJZY.Track.Application.AutoMapper;
|
||||
|
||||
@ -16,8 +14,6 @@ public class TrackPushAutoMapperProfile : Profile
|
||||
.ForMember(val => val.DateTimeFormat, opt => opt.MapFrom(src => src.DateTimeFormat))
|
||||
.ForMember(val => val.TimezoneFormat, opt => opt.MapFrom(src => src.TimezoneFormat));
|
||||
|
||||
CreateMap<EditTrackPushConfigInput, TrackPushPullParamsConfigEntity>(MemberList.None).Ignore(dest => dest.Id)
|
||||
.ForMember(dest => dest.IsPush, opt => opt.MapFrom(source => true));
|
||||
CreateMap<EditTrackPushContentInput, TrackPushContentConfigEntity>(MemberList.None);
|
||||
CreateMap<TrackPushContentConfigVO, TrackPushContentConfigDto>(MemberList.None);
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ public class TrackChangeAfterUpdateOrderEventHandler : ITransientDependency, ICa
|
||||
if (!string.IsNullOrEmpty(@event.TrackCode) && providerDic.TryGetValue(order.Id, out var provider))
|
||||
{
|
||||
var config =
|
||||
await _trackPullCacheService.GetPullParamWithContentConfigAsync(provider.SubSystemId,
|
||||
await _trackPullCacheService.GetPullParamsWithContentAsync(provider.SubSystemId,
|
||||
provider.ServiceProviderId);
|
||||
|
||||
if (!string.IsNullOrEmpty(config?.ParamConfig.TrackContentCode) &&
|
||||
|
||||
@ -80,7 +80,7 @@ public class TrackRefreshEventHandler : ITransientDependency, IRabbitHandler
|
||||
return;
|
||||
}
|
||||
|
||||
var config = await _trackPullCacheService.GetPullParamWithContentConfigAsync(attach.SubSystemId,
|
||||
var config = await _trackPullCacheService.GetPullParamsWithContentAsync(attach.SubSystemId,
|
||||
attach.ServiceProviderId);
|
||||
if (config == null)
|
||||
{
|
||||
@ -104,10 +104,10 @@ public class TrackRefreshEventHandler : ITransientDependency, IRabbitHandler
|
||||
}
|
||||
}
|
||||
|
||||
private async Task HandleOrderAsync(JToken orderToken, TrackPullParamWithContentConfigDto paramWithContentConfig,
|
||||
private async Task HandleOrderAsync(JToken orderToken, TrackPullParamsWithContentDto paramsWithContent,
|
||||
TrackRefreshAttach attach)
|
||||
{
|
||||
var paramConfig = paramWithContentConfig.ParamConfig;
|
||||
var paramConfig = paramsWithContent.ParamConfig;
|
||||
var orderNo = orderToken[paramConfig.OrderNoName]?.Value<string>();
|
||||
if (orderNo.IsNullOrWhiteSpace()) return;
|
||||
|
||||
@ -139,16 +139,16 @@ public class TrackRefreshEventHandler : ITransientDependency, IRabbitHandler
|
||||
{
|
||||
foreach (var item in trackTokens)
|
||||
{
|
||||
await HandleTrackAsync(item, paramWithContentConfig, context);
|
||||
await HandleTrackAsync(item, paramsWithContent, context);
|
||||
}
|
||||
}
|
||||
else if (trackToken is JObject)
|
||||
{
|
||||
await HandleTrackAsync(trackToken, paramWithContentConfig, context);
|
||||
await HandleTrackAsync(trackToken, paramsWithContent, context);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task HandleTrackAsync(JToken trackToken, TrackPullParamWithContentConfigDto paramWithContentConfig,
|
||||
private async Task HandleTrackAsync(JToken trackToken, TrackPullParamsWithContentDto paramsWithContent,
|
||||
TrackRefreshContext context)
|
||||
{
|
||||
var originTrackDataHash = StringHelper.GetHash(JsonConvert.SerializeObject(trackToken));
|
||||
@ -158,21 +158,14 @@ public class TrackRefreshEventHandler : ITransientDependency, IRabbitHandler
|
||||
return;
|
||||
}
|
||||
|
||||
var paramConfig = paramWithContentConfig.ParamConfig;
|
||||
var contentConfigs = paramWithContentConfig.ContentConfigs;
|
||||
var paramConfig = paramsWithContent.ParamConfig;
|
||||
var contentConfigs = paramsWithContent.ContentConfigs;
|
||||
TrackPullContentConfigDto? matchedContentConfig = null;
|
||||
|
||||
// 1、匹配轨迹代码
|
||||
if (!paramConfig.TrackContentCodeName.IsNullOrWhiteSpace())
|
||||
{
|
||||
var trackCode = trackToken[paramConfig.TrackContentCodeName!]?.Value<string>();
|
||||
if (!trackCode.IsNullOrWhiteSpace())
|
||||
{
|
||||
matchedContentConfig = contentConfigs.FirstOrDefault(x => x.TrackContentCodeValue == trackCode);
|
||||
}
|
||||
}
|
||||
|
||||
// 2、匹配轨迹状态
|
||||
else if (!paramConfig.TrackStatusName.IsNullOrWhiteSpace())
|
||||
if (!paramConfig.TrackStatusName.IsNullOrWhiteSpace())
|
||||
{
|
||||
var trackStatus = trackToken[paramConfig.TrackStatusName!]?.Value<string>();
|
||||
if (!trackStatus.IsNullOrWhiteSpace())
|
||||
@ -188,7 +181,6 @@ public class TrackRefreshEventHandler : ITransientDependency, IRabbitHandler
|
||||
{
|
||||
Debug.Assert(trackContent != null, nameof(trackContent) + " != null");
|
||||
// 3.1 按内容直接匹配
|
||||
matchedContentConfig = contentConfigs.FirstOrDefault(x => x.TrackContentValue == trackContent);
|
||||
|
||||
// 3.2 按关键字分析轨迹内容
|
||||
if (matchedContentConfig is null)
|
||||
|
||||
@ -36,10 +36,10 @@ public class TrackPullCacheService : ApplicationService, ITrackPullCacheService
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
public async Task<TrackPullParamWithContentConfigDto?> GetPullParamWithContentConfigAsync(int subSystemId,
|
||||
public async Task<TrackPullParamsWithContentDto?> GetPullParamsWithContentAsync(int subSystemId,
|
||||
int serviceProviderId)
|
||||
{
|
||||
var data = await RedisHelper.Client.GetAsync<TrackPullParamWithContentConfigDto>(TrackPullContentKey(
|
||||
var data = await RedisHelper.Client.GetAsync<TrackPullParamsWithContentDto>(TrackPullContentKey(
|
||||
subSystemId,
|
||||
serviceProviderId));
|
||||
|
||||
@ -49,7 +49,7 @@ public class TrackPullCacheService : ApplicationService, ITrackPullCacheService
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
public async Task<TrackPullParamWithContentConfigDto?> SetPullConfigAsync(int? id = null, int? subSystemId = null,
|
||||
public async Task<TrackPullParamsWithContentDto?> SetPullConfigAsync(int? id = null, int? subSystemId = null,
|
||||
int? serviceProviderId = null)
|
||||
{
|
||||
Expression<Func<TrackPullConfigEntity, bool>> exp = x => true;
|
||||
@ -64,13 +64,13 @@ public class TrackPullCacheService : ApplicationService, ITrackPullCacheService
|
||||
var trackPullContentList = await _trackPullConfigRepository.GetContentListCacheAsync(trackPullConfigEntity.Id);
|
||||
if (trackPullContentList.Count == 0) return null;
|
||||
|
||||
var data = new TrackPullParamWithContentConfigDto();
|
||||
|
||||
data.ParamConfig =
|
||||
ObjectMapper.Map<GetTrackPullConfigDetailOutputVO, TrackPullParamConfigDto>(trackPullConfigDetail);
|
||||
data.ContentConfigs =
|
||||
ObjectMapper.Map<List<GetTrackPullContentListCacheVO>, List<TrackPullContentConfigDto>>(
|
||||
trackPullContentList);
|
||||
var data = new TrackPullParamsWithContentDto
|
||||
{
|
||||
ParamConfig =
|
||||
ObjectMapper.Map<GetTrackPullConfigDetailOutputVO, TrackPullParamConfigDto>(trackPullConfigDetail),
|
||||
ContentConfigs = ObjectMapper.Map<List<GetTrackPullContentListCacheVO>, List<TrackPullContentConfigDto>>(
|
||||
trackPullContentList)
|
||||
};
|
||||
|
||||
await RedisHelper.Client.SetAsync(
|
||||
TrackPullContentKey(trackPullConfigEntity.SubSystemId, trackPullConfigEntity.ServiceProviderId), data);
|
||||
|
||||
@ -103,20 +103,8 @@ public class TrackPullService : ApplicationService
|
||||
case OptionTypeNoNull.新增:
|
||||
{
|
||||
var trackPullEntity = ObjectMapper.Map<EditTrackPullConfigInput, TrackPullConfigEntity>(input);
|
||||
var trackPullParamsEntity =
|
||||
ObjectMapper.Map<EditTrackPullConfigInput, TrackPushPullParamsConfigEntity>(input);
|
||||
|
||||
int id;
|
||||
|
||||
using (var ts = TransactionScopeHelper.Create())
|
||||
{
|
||||
id = await _trackPullConfigRepository.InsertReturnIdentityAsync(trackPullEntity);
|
||||
|
||||
trackPullParamsEntity.PullOrPushConfigId = id;
|
||||
await _trackPullConfigRepository.InsertParamsAsync(trackPullParamsEntity);
|
||||
|
||||
ts.Complete();
|
||||
}
|
||||
var id = await _trackPullConfigRepository.InsertReturnIdentityAsync(trackPullEntity);
|
||||
|
||||
await _trackPullCacheService.SetPullConfigAsync(id);
|
||||
}
|
||||
@ -127,20 +115,9 @@ public class TrackPullService : ApplicationService
|
||||
var oldTrackPullEntity = await _trackPullConfigRepository.GetFirstAsync(x => x.Id == input.Id) ??
|
||||
throw new BusinessException(message: _stringLocalizer["NotFindData"]);
|
||||
|
||||
var oldTrackPullParamsEntity =
|
||||
await _trackPullConfigRepository.GetParamsSingleAsync(x =>
|
||||
x.PullOrPushConfigId == input.Id && !x.IsPush);
|
||||
|
||||
ObjectMapper.Map(input, oldTrackPullEntity);
|
||||
ObjectMapper.Map(input, oldTrackPullParamsEntity);
|
||||
|
||||
using (var ts = TransactionScopeHelper.Create())
|
||||
{
|
||||
await _trackPullConfigRepository.UpdateAsync(oldTrackPullEntity);
|
||||
await _trackPullConfigRepository.UpdateParamsAsync(oldTrackPullParamsEntity);
|
||||
|
||||
ts.Complete();
|
||||
}
|
||||
await _trackPullConfigRepository.UpdateAsync(oldTrackPullEntity);
|
||||
|
||||
await _trackPullCacheService.SetPullConfigAsync(input.Id);
|
||||
}
|
||||
@ -150,8 +127,7 @@ public class TrackPullService : ApplicationService
|
||||
using (var ts = TransactionScopeHelper.Create())
|
||||
{
|
||||
await _trackPullConfigRepository.SoftDeleteAsync(x => x.Id == input.Id);
|
||||
await _trackPullConfigRepository.SoftDeleteParamsAsync(x =>
|
||||
x.PullOrPushConfigId == input.Id && !x.IsPush);
|
||||
|
||||
await _trackPullConfigRepository.SoftDeleteContentAsync(x => x.TrackPullConfigId == input.Id);
|
||||
|
||||
await _trackPullCacheService.SetPullConfigAsync(input.Id);
|
||||
|
||||
@ -40,19 +40,10 @@ public interface ITrackPullConfigRepository : IBasicRepository<TrackPullConfigEn
|
||||
/// <returns></returns>
|
||||
Task<GetTrackPullContentDetailOutputVO> GetContentDetailAsync(int id);
|
||||
|
||||
Task<bool> InsertParamsAsync(TrackPushPullParamsConfigEntity insertObj);
|
||||
|
||||
Task<bool> InsertContentAsync(TrackPullContentConfigEntity insertObj);
|
||||
|
||||
Task<TrackPushPullParamsConfigEntity> GetParamsSingleAsync(
|
||||
Expression<Func<TrackPushPullParamsConfigEntity, bool>> whereExpression);
|
||||
|
||||
Task<bool> UpdateParamsAsync(TrackPushPullParamsConfigEntity updateObj);
|
||||
|
||||
Task<bool> SoftDeleteContentAsync(Expression<Func<TrackPullContentConfigEntity, bool>> whereExpression);
|
||||
|
||||
Task<bool> SoftDeleteParamsAsync(Expression<Func<TrackPushPullParamsConfigEntity, bool>> whereExpression);
|
||||
|
||||
Task<TrackPullContentConfigEntity> GetContentByIdAsync(int id);
|
||||
|
||||
Task<bool> UpdateContentAsync(TrackPullContentConfigEntity updateObj);
|
||||
|
||||
@ -13,16 +13,10 @@ public class TrackPullConfigEntity : IFullAuditedBasicEntitys, IAggregateRoot
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 解析方式,1取接口通返参映射后的,2取服务商原返参
|
||||
/// 子系统id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "ParseMethod")]
|
||||
public int ParseMethod { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务商拉取频率(分钟)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "PullInterval")]
|
||||
public int PullInterval { get; set; }
|
||||
[SugarColumn(ColumnName = "SubSystemId")]
|
||||
public int SubSystemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务商id
|
||||
@ -31,8 +25,68 @@ public class TrackPullConfigEntity : IFullAuditedBasicEntitys, IAggregateRoot
|
||||
public int ServiceProviderId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 子系统id
|
||||
/// 服务商拉取频率(分钟)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "SubSystemId")]
|
||||
public int SubSystemId { get; set; }
|
||||
[SugarColumn(ColumnName = "PullInterval")]
|
||||
public int PullInterval { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 解析方式,1取接口通返参映射后的,2取服务商原返参
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "ParseMethod")]
|
||||
public int ParseMethod { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单路径
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "OrderPath")]
|
||||
public string OrderPath { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// 单号参数名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "OrderNoName")]
|
||||
public string OrderNoName { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹明细路径
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackDetailsPath")]
|
||||
public string TrackDetailsPath { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹状态参数名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackStatusName")]
|
||||
public string? TrackStatusName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹代码参数名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackContentCodeName")]
|
||||
public string? TrackContentCodeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹内容参数名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackContentName")]
|
||||
public string? TrackContentName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹发生地参数名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackPlaceName")]
|
||||
public string? TrackPlaceName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹发生时间参数名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackTimeName")]
|
||||
public string? TrackTimeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹时区参数名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackTimeZoneName")]
|
||||
public string? TrackTimeZoneName { get; set; }
|
||||
}
|
||||
|
||||
@ -13,10 +13,10 @@ public class TrackPullContentConfigEntity : IFullAuditedBasicEntitys, IEntity
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务商轨迹代码参数值
|
||||
/// 轨迹拉取配置id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackContentCodeValue")]
|
||||
public string? TrackContentCodeValue { get; set; }
|
||||
[SugarColumn(ColumnName = "TrackPullConfigId")]
|
||||
public int TrackPullConfigId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹内容id
|
||||
@ -24,12 +24,36 @@ public class TrackPullContentConfigEntity : IFullAuditedBasicEntitys, IEntity
|
||||
[SugarColumn(ColumnName = "TrackContentId")]
|
||||
public int TrackContentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务商轨迹状态参数值
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackStatusValue")]
|
||||
public string? TrackStatusValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务商轨迹代码参数值
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackContentCodeValue")]
|
||||
public string? TrackContentCodeValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务商轨迹内容参数值
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackContentValue")]
|
||||
public string? TrackContentValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹发生地参数值(主数据枚举)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackPlaceValue")]
|
||||
public int? TrackPlaceValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹时区GMT
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackTimeZone")]
|
||||
public float? TrackTimeZone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹关键词(正向),多个逗分隔
|
||||
/// </summary>
|
||||
@ -42,36 +66,6 @@ public class TrackPullContentConfigEntity : IFullAuditedBasicEntitys, IEntity
|
||||
[SugarColumn(ColumnName = "TrackKeywordReverse")]
|
||||
public string? TrackKeywordReverse { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹发生地参数值(主数据枚举)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackPlaceValue")]
|
||||
public int? TrackPlaceValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹拉取配置id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackPullConfigId")]
|
||||
public int TrackPullConfigId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务商轨迹状态参数值
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackStatusValue")]
|
||||
public string? TrackStatusValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹时区GMT
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackTimeZone")]
|
||||
public float? TrackTimeZone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否完结
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "IsCompleted")]
|
||||
public bool IsCompleted { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹时区发生地参数值
|
||||
/// </summary>
|
||||
|
||||
@ -1,98 +0,0 @@
|
||||
namespace SJZY.Track.Domain.Aggregates.TrackPullAggregate;
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹拉取/推送参数配置
|
||||
/// </summary>
|
||||
[SugarTable("t_track_push_pull_params_config")]
|
||||
public class TrackPushPullParamsConfigEntity : IFullAuditedBasicEntitys, IEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 自增主键
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)]
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 推拉模式,0拉取,1推送
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "IsPush")]
|
||||
public bool IsPush { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单号参数名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "OrderNoName")]
|
||||
public string OrderNoName { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// 推拉配置id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "PullOrPushConfigId")]
|
||||
public int PullOrPushConfigId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹时区参数名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackTimeZoneName")]
|
||||
public string? TrackTimeZoneName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹代码参数名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackContentCodeName")]
|
||||
public string? TrackContentCodeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹内容参数名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackContentName")]
|
||||
public string? TrackContentName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹内容英文参数名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackEnContentName")]
|
||||
public string? TrackEnContentName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹发生地参数名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackPlaceName")]
|
||||
public string? TrackPlaceName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹状态参数名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackStatusName")]
|
||||
public string? TrackStatusName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹发生时间参数名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackTimeName")]
|
||||
public string? TrackTimeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单路径
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "OrderPath")]
|
||||
public string? OrderPath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹明细路径
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackDetailsPath")]
|
||||
public string? TrackDetailsPath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 扩展字段参数名
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "ExpandFieldsName")]
|
||||
public string? ExpandFieldsName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹内容代码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackContentCode")]
|
||||
public string? TrackContentCode { get; set; }
|
||||
}
|
||||
@ -41,4 +41,11 @@ public class TrackStatusEntity : IFullAuditedBasicEntitys, IAggregateRoot
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "EnStatus")]
|
||||
public string EnStatus { get; set; } = null!;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 是否完结
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "IsCompleted")]
|
||||
public bool IsCompleted { get; set; }
|
||||
}
|
||||
|
||||
@ -78,9 +78,4 @@ public class GetTrackPullConfigDetailOutputVO
|
||||
/// 轨迹明细路径
|
||||
/// </summary>
|
||||
public string TrackDetailsPath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹内容代码
|
||||
/// </summary>
|
||||
public string? TrackContentCode { get; set; }
|
||||
}
|
||||
|
||||
@ -7,21 +7,16 @@ public class GetTrackPullContentListCacheVO
|
||||
/// </summary>
|
||||
public string TrackContentCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否完成
|
||||
/// </summary>
|
||||
public bool IsCompleted { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务商轨迹状态参数值
|
||||
/// </summary>
|
||||
public string? TrackStatusValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务商轨迹代码参数值
|
||||
/// </summary>
|
||||
public string? TrackContentCodeValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务商轨迹内容参数值
|
||||
/// </summary>
|
||||
public string? TrackContentValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹关键词(正向),多个逗分隔
|
||||
/// </summary>
|
||||
@ -33,27 +28,12 @@ public class GetTrackPullContentListCacheVO
|
||||
public string? TrackKeywordReverse { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹发生地参数值(主数据枚举)
|
||||
/// 兜底轨迹发生地参数值
|
||||
/// </summary>
|
||||
public int? TrackPlaceValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 兜底时区轨迹发生地参数值(TrackLocationValue)
|
||||
/// </summary>
|
||||
public int? TrackTimePlaceValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹时区GMT
|
||||
/// </summary>
|
||||
public float? TrackTimeZone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单是否完成(由轨迹刷新配置决定)
|
||||
/// </summary>
|
||||
public bool IsCompleted { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹时区发生地参数值
|
||||
/// 兜底轨迹时区所属发生地参数值
|
||||
/// </summary>
|
||||
public int? TrackZonePlaceValue { get; set; }
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ using System.Linq.Expressions;
|
||||
using SJZY.Expand.ABP.Core.PublicMethords;
|
||||
using SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackPullAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackStatusAggregate;
|
||||
using SJZY.Track.Domain.Dtos.Common;
|
||||
using SJZY.Track.Domain.Dtos.TrackPull;
|
||||
using SJZY.Track.Domain.Enums;
|
||||
@ -59,12 +60,15 @@ public class TrackPullConfigRepository : BasicRepository<TrackPullConfigEntity>,
|
||||
{
|
||||
return await Context.Queryable<TrackPullContentConfigEntity>()
|
||||
.InnerJoin<TrackContentEntity>((pullContent, trackContent) => pullContent.TrackContentId == trackContent.Id)
|
||||
.LeftJoin<TrackStatusEntity>((pullContent, trackContent, trackStutas) =>
|
||||
trackContent.TrackStatusId == trackStutas.Id)
|
||||
.Where(pullContent => pullContent.TrackPullConfigId == trackPullConfigId)
|
||||
.Select(
|
||||
(pullContent, trackContent) =>
|
||||
(pullContent, trackContent, trackStutas) =>
|
||||
new GetTrackPullContentListCacheVO
|
||||
{
|
||||
TrackContentCode = trackContent.Code
|
||||
TrackContentCode = trackContent.Code,
|
||||
IsCompleted = trackStutas.IsCompleted
|
||||
}, true)
|
||||
.ToListAsync();
|
||||
}
|
||||
@ -75,17 +79,14 @@ public class TrackPullConfigRepository : BasicRepository<TrackPullConfigEntity>,
|
||||
.LeftJoin<VSystemEntity>((trackPull, system) => trackPull.SubSystemId == system.Id && !system.IsDeleted)
|
||||
.LeftJoin<VServiceProviderEntity>((trackPull, system, service) =>
|
||||
trackPull.ServiceProviderId == service.Id && !service.IsDeleted)
|
||||
.InnerJoin<TrackPushPullParamsConfigEntity>((trackPull, system, service, paramsConfig) =>
|
||||
trackPull.Id == paramsConfig.PullOrPushConfigId && !paramsConfig.IsPush && !paramsConfig.IsDeleted)
|
||||
.Filter(null, true)
|
||||
.Where(trackPull => trackPull.Id == id && !trackPull.IsDeleted)
|
||||
.Select(
|
||||
(trackPull, system, service, paramsConfig) => new GetTrackPullConfigDetailOutputVO
|
||||
(trackPull, system, service) => new GetTrackPullConfigDetailOutputVO
|
||||
{
|
||||
Id = trackPull.Id,
|
||||
SubSystem = system.CnName,
|
||||
ServiceProvider = service.Name,
|
||||
TrackContentCode = paramsConfig.TrackContentCode
|
||||
}, true)
|
||||
.SingleAsync();
|
||||
}
|
||||
@ -110,27 +111,12 @@ public class TrackPullConfigRepository : BasicRepository<TrackPullConfigEntity>,
|
||||
.SingleAsync();
|
||||
}
|
||||
|
||||
public async Task<bool> InsertParamsAsync(TrackPushPullParamsConfigEntity insertObj)
|
||||
{
|
||||
return await Context.Insertable(insertObj).ExecuteCommandAsync() > 0;
|
||||
}
|
||||
|
||||
public async Task<bool> InsertContentAsync(TrackPullContentConfigEntity insertObj)
|
||||
{
|
||||
return await Context.Insertable(insertObj).ExecuteCommandAsync() > 0;
|
||||
}
|
||||
|
||||
public async Task<TrackPushPullParamsConfigEntity> GetParamsSingleAsync(
|
||||
Expression<Func<TrackPushPullParamsConfigEntity, bool>> whereExpression)
|
||||
{
|
||||
return await Context.Queryable<TrackPushPullParamsConfigEntity>().SingleAsync(whereExpression);
|
||||
}
|
||||
|
||||
public async Task<bool> UpdateParamsAsync(TrackPushPullParamsConfigEntity updateObj)
|
||||
{
|
||||
return await Context.Updateable(updateObj).ExecuteCommandHasChangeAsync();
|
||||
}
|
||||
|
||||
public async Task<bool> SoftDeleteContentAsync(Expression<Func<TrackPullContentConfigEntity, bool>> whereExpression)
|
||||
{
|
||||
return await Context.Updateable<TrackPullContentConfigEntity>()
|
||||
@ -139,14 +125,6 @@ public class TrackPullConfigRepository : BasicRepository<TrackPullConfigEntity>,
|
||||
.ExecuteCommandHasChangeAsync();
|
||||
}
|
||||
|
||||
public async Task<bool> SoftDeleteParamsAsync(
|
||||
Expression<Func<TrackPushPullParamsConfigEntity, bool>> whereExpression)
|
||||
{
|
||||
return await Context.Updateable<TrackPushPullParamsConfigEntity>()
|
||||
.Where(whereExpression)
|
||||
.SetColumns(nameof(ISoftDeleteBasicEntity.IsDeleted), true)
|
||||
.ExecuteCommandHasChangeAsync();
|
||||
}
|
||||
|
||||
public async Task<TrackPullContentConfigEntity> GetContentByIdAsync(int id)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user