fix:拉取-轨迹状态多选,逗号分隔
fix:修复空字符串的spilt问题
This commit is contained in:
parent
651ec3131e
commit
7d583b6734
@ -10,17 +10,17 @@ public class TrackPullContentConfigDto
|
||||
/// <summary>
|
||||
/// 服务商轨迹状态参数值
|
||||
/// </summary>
|
||||
public string? TrackStatusValue { get; set; }
|
||||
public List<string> TrackStatusValues { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹关键词(正向),多个逗分隔
|
||||
/// 轨迹关键词(正向)
|
||||
/// </summary>
|
||||
public string? TrackKeyword { get; set; }
|
||||
public List<string> TrackKeywords { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹关键词(反向),多个逗分隔
|
||||
/// 轨迹关键词(反向)
|
||||
/// </summary>
|
||||
public string? TrackKeywordReverse { get; set; }
|
||||
public List<string> TrackKeywordReverses { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹发生地参数值(主数据枚举)
|
||||
|
||||
@ -21,6 +21,7 @@ public class TrackPullAutoMapperProfile : Profile
|
||||
opt => opt.MapFrom(src => string.Join(',', src.TrackKeywordReverses ?? Enumerable.Empty<string>())))
|
||||
.ForMember(dest => dest.TrackZonePlaceValue, opt => opt.MapFrom(src => src.TrackTimePlaceValue));
|
||||
CreateMap<GetTrackPullConfigDetailOutputVO, TrackPullParamConfigDto>(MemberList.None);
|
||||
|
||||
CreateMap<GetTrackPullContentListCacheVO, TrackPullContentConfigDto>(MemberList.None);
|
||||
|
||||
CreateMap<PullConfigInfo, UpdateOrderPullConfigsInputVo>(MemberList.None);
|
||||
|
||||
@ -168,7 +168,7 @@ public class TrackRefreshEventHandler : ITransientDependency, IRabbitHandler
|
||||
var trackStatus = trackToken[paramConfig.TrackStatusName!]?.Value<string>();
|
||||
if (!trackStatus.IsNullOrWhiteSpace())
|
||||
{
|
||||
matchedContentConfig = contentConfigs.FirstOrDefault(x => x.TrackStatusValue == trackStatus);
|
||||
matchedContentConfig = contentConfigs.FirstOrDefault(x => x.TrackStatusValues.Contains(trackStatus!));
|
||||
}
|
||||
}
|
||||
|
||||
@ -183,7 +183,7 @@ public class TrackRefreshEventHandler : ITransientDependency, IRabbitHandler
|
||||
// 3.2 按关键字分析轨迹内容
|
||||
foreach (var contentConfig in contentConfigs)
|
||||
{
|
||||
foreach (var keyword in contentConfig.TrackKeyword?.Split(',') ?? Enumerable.Empty<string>())
|
||||
foreach (var keyword in contentConfig.TrackKeywords)
|
||||
{
|
||||
if (trackContent.Contains(keyword, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
@ -194,8 +194,7 @@ public class TrackRefreshEventHandler : ITransientDependency, IRabbitHandler
|
||||
|
||||
if (matchedContentConfig is null) continue;
|
||||
|
||||
foreach (var keyword in contentConfig.TrackKeywordReverse?.Split(',') ??
|
||||
Enumerable.Empty<string>())
|
||||
foreach (var keyword in contentConfig.TrackKeywordReverses)
|
||||
{
|
||||
if (trackContent.Contains(keyword, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
|
||||
@ -25,7 +25,7 @@ public class TrackPullContentConfigEntity : IFullAuditedBasicEntitys, IEntity
|
||||
public int TrackContentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务商轨迹状态参数值
|
||||
/// 服务商轨迹状态参数值,多个逗分隔
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackStatusValue")]
|
||||
public string? TrackStatusValue { get; set; }
|
||||
|
||||
@ -7,11 +7,6 @@ public class GetTrackPullContentListCacheVO
|
||||
/// </summary>
|
||||
public string TrackContentCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否完成
|
||||
/// </summary>
|
||||
public bool IsCompleted { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务商轨迹状态参数值
|
||||
/// </summary>
|
||||
@ -27,6 +22,21 @@ public class GetTrackPullContentListCacheVO
|
||||
/// </summary>
|
||||
public string? TrackKeywordReverse { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务商轨迹状态参数值
|
||||
/// </summary>
|
||||
public List<string> TrackStatusValues { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹关键词(正向)
|
||||
/// </summary>
|
||||
public List<string> TrackKeywords { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹关键词(反向)
|
||||
/// </summary>
|
||||
public List<string> TrackKeywordReverses { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 兜底轨迹发生地参数值
|
||||
/// </summary>
|
||||
|
||||
@ -65,8 +65,19 @@ public class TrackPullConfigRepository : BasicRepository<TrackPullConfigEntity>,
|
||||
new GetTrackPullContentListCacheVO
|
||||
{
|
||||
TrackContentCode = trackContent.Code,
|
||||
IsCompleted = trackStutas.IsCompleted
|
||||
}, true)
|
||||
.Mapper(x =>
|
||||
{
|
||||
x.TrackKeywords = x.TrackKeyword.IsNullOrWhiteSpace()
|
||||
? new List<string>()
|
||||
: x.TrackKeyword!.Split(',').ToList();
|
||||
x.TrackKeywordReverses = x.TrackKeywordReverse.IsNullOrWhiteSpace()
|
||||
? new List<string>()
|
||||
: x.TrackKeywordReverse!.Split(',').ToList();
|
||||
x.TrackStatusValues = x.TrackStatusValue.IsNullOrWhiteSpace()
|
||||
? new List<string>()
|
||||
: x.TrackStatusValue!.Split(',').ToList();
|
||||
})
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
@ -102,8 +113,15 @@ public class TrackPullConfigRepository : BasicRepository<TrackPullConfigEntity>,
|
||||
}, true)
|
||||
.Mapper(x =>
|
||||
{
|
||||
x.TrackKeywords = x.TrackKeyword?.Split(',').ToList();
|
||||
x.TrackKeywordReverses = x.TrackKeywordReverse?.Split(',').ToList();
|
||||
x.TrackKeywords = x.TrackKeyword.IsNullOrWhiteSpace()
|
||||
? new List<string>()
|
||||
: x.TrackKeyword!.Split(',').ToList();
|
||||
x.TrackKeywordReverses = x.TrackKeywordReverse.IsNullOrWhiteSpace()
|
||||
? new List<string>()
|
||||
: x.TrackKeywordReverse!.Split(',').ToList();
|
||||
x.TrackStatusValues = x.TrackStatusValue.IsNullOrWhiteSpace()
|
||||
? new List<string>()
|
||||
: x.TrackStatusValue!.Split(',').ToList();
|
||||
})
|
||||
.SingleAsync();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user