Merge branch 'S01-轨迹中台' of http://192.168.80.50:3000/Dotnet/SJZY.Track.Api into S01-轨迹中台

This commit is contained in:
moyongzhen 2024-03-05 20:06:18 +08:00
commit e510d1ce9a
6 changed files with 17 additions and 24 deletions

View File

@ -7,6 +7,7 @@ public class UpsertOrderInput : UpdateOrderInput
/// <summary> /// <summary>
/// 客户id /// 客户id
/// </summary> /// </summary>
[Required]
public int CustomId { get; set; } public int CustomId { get; set; }
} }

View File

@ -13,15 +13,7 @@ public class TrackPullAutoMapperProfile : Profile
CreateMap<EditTrackPullConfigInput, TrackPushPullParamsConfigEntity>(MemberList.None).Ignore(dest => dest.Id) CreateMap<EditTrackPullConfigInput, TrackPushPullParamsConfigEntity>(MemberList.None).Ignore(dest => dest.Id)
.ForMember(dest => dest.IsPush, opt => opt.MapFrom(source => false)); .ForMember(dest => dest.IsPush, opt => opt.MapFrom(source => false));
CreateMap<UpdateTrackPullContentInput, TrackPullContentConfigEntity>(MemberList.None) CreateMap<UpdateTrackPullContentInput, TrackPullContentConfigEntity>(MemberList.None)
.ForMember(dest => dest.TrackKeyword, opt => .ForMember(dest => dest.TrackKeyword, opt => opt.MapFrom(src => string.Join(',', src.TrackKeywords)))
{ .ForMember(dest => dest.TrackKeywordReverse, opt => opt.MapFrom(src => string.Join(',', src.TrackKeywordReverses)));
opt.Condition(src => !src.TrackKeywords.IsNullOrEmpty());
opt.MapFrom(src => string.Join(',', src.TrackKeywords));
})
.ForMember(dest => dest.TrackKeywordReverse, opt =>
{
opt.Condition(src => !src.TrackKeywordReverses.IsNullOrEmpty());
opt.MapFrom(src => string.Join(',', src.TrackKeywordReverses));
});
} }
} }

View File

@ -43,8 +43,8 @@ public class OrderLinkService : ApplicationService
if (input.LinkOrderNos.Count < 1 || input.LinkOrderType == 0) return true; if (input.LinkOrderNos.Count < 1 || input.LinkOrderType == 0) return true;
// 单号去重 // 单号去重,去空
input.LinkOrderNos = input.LinkOrderNos.Distinct().ToList(); input.LinkOrderNos = input.LinkOrderNos.Where(x => !x.IsNullOrWhiteSpace()).Distinct().ToList();
// 解绑 // 解绑
if (!input.IsLink) return await UnLinkOrderAsync(input); if (!input.IsLink) return await UnLinkOrderAsync(input);

View File

@ -2,6 +2,7 @@
using SJZY.Track.Domain.Aggregates.OrderAggregate; using SJZY.Track.Domain.Aggregates.OrderAggregate;
using SJZY.Track.Domain.Aggregates.TrackDetailsAggregate; using SJZY.Track.Domain.Aggregates.TrackDetailsAggregate;
using SJZY.Track.Domain.Dtos.Order; using SJZY.Track.Domain.Dtos.Order;
using SJZY.UserCenter.HttpApi.Services;
namespace SJZY.Track.Application.Services.ProvideServices; namespace SJZY.Track.Application.Services.ProvideServices;
@ -42,7 +43,7 @@ public class OrderService : ApplicationService
} }
order = ObjectMapper.Map<UpsertOrderInput, OrderEntity>(input); order = ObjectMapper.Map<UpsertOrderInput, OrderEntity>(input);
order.SubSystemId = 1; order.SubSystemId = CurrentUserRequest.SubSystemId;
order.OrderTemplates = ObjectMapper.Map<List<OrderTemplateInfo>, List<OrderTemplateEntity>>(input.Templates!); order.OrderTemplates = ObjectMapper.Map<List<OrderTemplateInfo>, List<OrderTemplateEntity>>(input.Templates!);
order.OrderFlights = ObjectMapper.Map<List<OrderFlightInfo>, List<OrderFlightEntity>>(input.FlightInfos!); order.OrderFlights = ObjectMapper.Map<List<OrderFlightInfo>, List<OrderFlightEntity>>(input.FlightInfos!);

View File

@ -222,7 +222,7 @@ public class TrackPullService : ApplicationService, ITransientDependency
throw new BusinessException(message: _stringLocalizer["IsTrackPullContentValueAny"]); throw new BusinessException(message: _stringLocalizer["IsTrackPullContentValueAny"]);
else if (!input.TrackKeywords.IsNullOrEmpty()) else if (!input.TrackKeywords.IsNullOrEmpty())
{ {
Expression<Func<TrackPullContentConfigEntity, bool>> trackKeywordExp = _ => true; Expression<Func<TrackPullContentConfigEntity, bool>> trackKeywordExp = _ => false;
input.TrackKeywords!.ForEach(item => { trackKeywordExp = trackKeywordExp.Or(x => SqlFunc.SplitIn(x.TrackKeyword, item)); }); input.TrackKeywords!.ForEach(item => { trackKeywordExp = trackKeywordExp.Or(x => SqlFunc.SplitIn(x.TrackKeyword, item)); });
if (await _trackPullConfigRepository.IsContentAnyAsync(isContentAnyExp.And(trackKeywordExp))) if (await _trackPullConfigRepository.IsContentAnyAsync(isContentAnyExp.And(trackKeywordExp)))

View File

@ -61,17 +61,16 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
public async Task<List<LinkedOrderVO>> GetLinkedOrdersAsync(int orderId) public async Task<List<LinkedOrderVO>> GetLinkedOrdersAsync(int orderId)
{ {
return await Context.Queryable<OrderLinkEntity>() return await Context.Queryable<OrderLinkEntity>()
.LeftJoin<OrderLinkEntity>((a, b) => a.Id == b.OrderId) .LeftJoin<OrderEntity>((a, b) => a.LinkOrderId == b.Id)
.LeftJoin<OrderEntity>((a, b, c) => b.LinkOrderId == c.Id) .Where(a => a.OrderId == orderId)
.Where(a => a.Id == orderId) .Select((a, b) => new LinkedOrderVO
.Select((a, b, c) => new LinkedOrderVO
{ {
OrderId = c.Id, OrderId = b.Id,
OrderType = c.OrderType, OrderType = b.OrderType,
OrderNo = c.OrderNo, OrderNo = b.OrderNo,
SubSystemId = c.SubSystemId, SubSystemId = b.SubSystemId,
IsPushCompleted = c.IsPushCompleted, IsPushCompleted = b.IsPushCompleted,
CustomId = c.CustomId CustomId = b.CustomId
}) })
.ToListAsync(); .ToListAsync();
} }