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>
/// 客户id
/// </summary>
[Required]
public int CustomId { get; set; }
}

View File

@ -13,15 +13,7 @@ public class TrackPullAutoMapperProfile : Profile
CreateMap<EditTrackPullConfigInput, TrackPushPullParamsConfigEntity>(MemberList.None).Ignore(dest => dest.Id)
.ForMember(dest => dest.IsPush, opt => opt.MapFrom(source => false));
CreateMap<UpdateTrackPullContentInput, TrackPullContentConfigEntity>(MemberList.None)
.ForMember(dest => dest.TrackKeyword, opt =>
{
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));
});
.ForMember(dest => dest.TrackKeyword, opt => opt.MapFrom(src => string.Join(',', src.TrackKeywords)))
.ForMember(dest => dest.TrackKeywordReverse, opt => 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;
// 单号去重
input.LinkOrderNos = input.LinkOrderNos.Distinct().ToList();
// 单号去重,去空
input.LinkOrderNos = input.LinkOrderNos.Where(x => !x.IsNullOrWhiteSpace()).Distinct().ToList();
// 解绑
if (!input.IsLink) return await UnLinkOrderAsync(input);

View File

@ -2,6 +2,7 @@
using SJZY.Track.Domain.Aggregates.OrderAggregate;
using SJZY.Track.Domain.Aggregates.TrackDetailsAggregate;
using SJZY.Track.Domain.Dtos.Order;
using SJZY.UserCenter.HttpApi.Services;
namespace SJZY.Track.Application.Services.ProvideServices;
@ -42,7 +43,7 @@ public class OrderService : ApplicationService
}
order = ObjectMapper.Map<UpsertOrderInput, OrderEntity>(input);
order.SubSystemId = 1;
order.SubSystemId = CurrentUserRequest.SubSystemId;
order.OrderTemplates = ObjectMapper.Map<List<OrderTemplateInfo>, List<OrderTemplateEntity>>(input.Templates!);
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"]);
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)); });
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)
{
return await Context.Queryable<OrderLinkEntity>()
.LeftJoin<OrderLinkEntity>((a, b) => a.Id == b.OrderId)
.LeftJoin<OrderEntity>((a, b, c) => b.LinkOrderId == c.Id)
.Where(a => a.Id == orderId)
.Select((a, b, c) => new LinkedOrderVO
.LeftJoin<OrderEntity>((a, b) => a.LinkOrderId == b.Id)
.Where(a => a.OrderId == orderId)
.Select((a, b) => new LinkedOrderVO
{
OrderId = c.Id,
OrderType = c.OrderType,
OrderNo = c.OrderNo,
SubSystemId = c.SubSystemId,
IsPushCompleted = c.IsPushCompleted,
CustomId = c.CustomId
OrderId = b.Id,
OrderType = b.OrderType,
OrderNo = b.OrderNo,
SubSystemId = b.SubSystemId,
IsPushCompleted = b.IsPushCompleted,
CustomId = b.CustomId
})
.ToListAsync();
}