update: 修改订单类型描述,问题类型描述从主数据中心获取
This commit is contained in:
parent
847c9fbbe6
commit
b6df543f0c
@ -21,11 +21,7 @@ public class OrderAutoMapperProfile : Profile
|
||||
CreateMap<OrderFlightInfo, OrderFlightEntity>(MemberList.None);
|
||||
|
||||
CreateMap<GetPageTrackOrderInput, GetPageTrackOrderInputVO>(MemberList.None);
|
||||
CreateMap<TrackOrderVO, TrackOrderDto>(MemberList.None)
|
||||
.ForMember(dest => dest.OrderTypeName,
|
||||
opt => opt.MapFrom(source => GetEnumDescription(2, source.OrderType)))
|
||||
.ForMember(dest => dest.QuestionTypeName,
|
||||
opt => opt.MapFrom(source => GetEnumDescription(1, source.QuestionType)));
|
||||
CreateMap<TrackOrderVO, TrackOrderDto>(MemberList.None);
|
||||
|
||||
CreateMap<UnifyPageResultDto<TrackOrderVO>, UnifyPageResultDto<TrackOrderDto>>(MemberList.None);
|
||||
CreateMap<TrackDetailsIndex, TrackOrderDetailDto>(MemberList.None).Ignore(dest => dest.TrackTimeZone)
|
||||
|
||||
@ -2,6 +2,8 @@ namespace SJZY.Track.Domain.Consts;
|
||||
|
||||
public partial class GlobalConst
|
||||
{
|
||||
public const string MainDataKey_OrderType = "TrackOrderType";
|
||||
public const string MainDataKey_TrackQuestionType = "TrackQuestionType";
|
||||
public const string SystemUser = "系统";
|
||||
public const string EmptyString = "--";
|
||||
public const int ChunkSize = 100;
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
using NUglify.Helpers;
|
||||
using SJZY.Expand.ABP.Core.Logger;
|
||||
using SJZY.Track.Domain;
|
||||
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||
@ -55,6 +56,45 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
|
||||
})
|
||||
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
||||
|
||||
//查询订单类型描述
|
||||
var orderTypes = pageList.List.Select(x => x.OrderType).Distinct().ToList();
|
||||
var questTypes = pageList.List.Select(x => x.QuestionType).Distinct().ToList();
|
||||
//从主数据中心查询类型描述
|
||||
var typeDispDict = (await Context.Queryable<VEnumValueInfoEntity>()
|
||||
.Where(x =>
|
||||
(x.Property == GlobalConst.MainDataKey_OrderType && orderTypes.Contains(x.Enumkey))
|
||||
|| (x.Property == GlobalConst.MainDataKey_TrackQuestionType && questTypes.Contains(x.Enumkey))
|
||||
)
|
||||
.Select(x => new
|
||||
{
|
||||
x.Property,
|
||||
x.Enumkey,
|
||||
x.Disp
|
||||
})
|
||||
.ToListAsync()
|
||||
)
|
||||
.GroupBy(x => x.Property)
|
||||
.ToDictionary(
|
||||
g => g.Key,
|
||||
y => y.ToDictionary(x => x.Enumkey, x => x.Disp)
|
||||
);
|
||||
|
||||
//填充数描述信息
|
||||
pageList.List.ForEach(x =>
|
||||
{
|
||||
x.OrderTypeName = typeDispDict.TryGetValue(GlobalConst.MainDataKey_OrderType, out var orderTypeDisplayDict)
|
||||
? orderTypeDisplayDict.TryGetValue(x.OrderType, out var orderTypeDisplay)
|
||||
? orderTypeDisplay
|
||||
: $"未在主数据中心找到Property:[{GlobalConst.MainDataKey_OrderType}] Enumkey:[{x.OrderType}]"
|
||||
: $"未在主数据中心找到Property:[{GlobalConst.MainDataKey_OrderType}]";
|
||||
|
||||
x.QuestionTypeName = typeDispDict.TryGetValue(GlobalConst.MainDataKey_TrackQuestionType, out var questDisplayDict)
|
||||
? questDisplayDict.TryGetValue(x.QuestionType, out var questDisplay)
|
||||
? questDisplay
|
||||
: $"未在主数据中心找到Property:[{GlobalConst.MainDataKey_OrderType}] Enumkey:[{x.OrderType}]"
|
||||
: $"未在主数据中心找到Property:[{GlobalConst.MainDataKey_TrackQuestionType}]";
|
||||
});
|
||||
|
||||
return pageList;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user