From 9d8cdadc9c52dd759238738c9848d453f84f559f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=B3=E6=96=87=E7=BF=94?= <878130837@qq.com> Date: Tue, 5 Mar 2024 10:50:07 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=92=8C=E6=8F=90=E7=A4=BA=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/TrackPull/TrackPullService.cs | 29 +++++++++++-------- .../Services/TrackPush/TrackPushService.cs | 23 ++++++++------- .../GetTrackPushContentDetailOutputVO.cs | 2 +- .../Enums/EnumPropertyEnums.cs | 5 ++++ .../Repositories/TrackPushConfigRepository.cs | 12 +++++--- 5 files changed, 44 insertions(+), 27 deletions(-) diff --git a/src/SJZY.Track.Application/Services/TrackPull/TrackPullService.cs b/src/SJZY.Track.Application/Services/TrackPull/TrackPullService.cs index 47baadb0..a562670d 100644 --- a/src/SJZY.Track.Application/Services/TrackPull/TrackPullService.cs +++ b/src/SJZY.Track.Application/Services/TrackPull/TrackPullService.cs @@ -209,20 +209,25 @@ public class TrackPullService : ApplicationService, ITransientDependency [HttpPost("UpdateContent")] public async Task UpdateContentAsync([FromBody] UpdateTrackPullContentInput input) { - Expression> isContentAnyExp = x => x.Id != input.Id && x.TrackPullConfigId == input.TrackPullConfigId; + var isContentAnyExp = Expressionable.Create() + .And(x => x.Id != input.Id && x.TrackPullConfigId == input.TrackPullConfigId); - var trackKeywordExp = Expressionable.Create() - .And(x => x.TrackContentId == input.TrackContentId - || (input.TrackContentCodeValue != null && x.TrackContentCodeValue == input.TrackContentCodeValue) - || (input.TrackStatusValue != null && x.TrackStatusValue == input.TrackStatusValue) - || (input.TrackContentValue != null && x.TrackContentValue == input.TrackContentValue)); - - input.TrackKeywords?.ForEach(item => { trackKeywordExp.Or(x => SqlFunc.SplitIn(x.TrackKeyword, item)); }); - - isContentAnyExp = isContentAnyExp.And(trackKeywordExp.ToExpression()); - - if (await _trackPullConfigRepository.IsContentAnyAsync(isContentAnyExp)) + if (await _trackPullConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => x.TrackContentId == input.TrackContentId).ToExpression())) throw new BusinessException(message: _stringLocalizer["IsTrackPullContentAny"]); + else if (!input.TrackContentCodeValue.IsNullOrWhiteSpace() && await _trackPullConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => x.TrackContentCodeValue == input.TrackContentCodeValue).ToExpression())) + throw new BusinessException(message: _stringLocalizer["IsTrackPullContentCodeValueAny"]); + else if (!input.TrackStatusValue.IsNullOrWhiteSpace() && await _trackPullConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => x.TrackStatusValue == input.TrackStatusValue).ToExpression())) + throw new BusinessException(message: _stringLocalizer["IsTrackPullContentStatusValueAny"]); + else if (!input.TrackContentValue.IsNullOrWhiteSpace() && await _trackPullConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => x.TrackContentValue == input.TrackContentValue).ToExpression())) + throw new BusinessException(message: _stringLocalizer["IsTrackPullContentValueAny"]); + else if (!input.TrackKeywords.IsNullOrEmpty()) + { + var trackKeywordExp = Expressionable.Create(); + input.TrackKeywords!.ForEach(item => { trackKeywordExp.Or(x => SqlFunc.SplitIn(x.TrackKeyword, item)); }); + + if (await _trackPullConfigRepository.IsContentAnyAsync(isContentAnyExp.And(trackKeywordExp.ToExpression()).ToExpression())) + throw new BusinessException(message: _stringLocalizer["IsTrackPullContentKeywordsAny"]); + } var oldTrackPullContentEntity = await _trackPullConfigRepository.GetContentByIdAsync(input.Id) ?? throw new BusinessException(message: _stringLocalizer["NotFindData"]); diff --git a/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs b/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs index fa106f23..a66a58c0 100644 --- a/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs +++ b/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs @@ -111,7 +111,7 @@ public class TrackPushService : ApplicationService, ITransientDependency if (input.Options == OptionTypeNoNull.修改) isAnyExp = isAnyExp.And(x => x.Id != input.Id); var trackTemplateIdExp = Expressionable.Create(); - foreach (var trackTemplateId in input.TrackTemplateIds) { trackTemplateIdExp.Or(x => SqlFunc.SplitIn(x.TrackTemplateId, trackTemplateId.ToString())); } + input.TrackTemplateIds?.ForEach(item => { trackTemplateIdExp.Or(x => SqlFunc.SplitIn(x.TrackTemplateId, item.ToString())); }); isAnyExp = isAnyExp.And(trackTemplateIdExp.ToExpression()); @@ -202,17 +202,20 @@ public class TrackPushService : ApplicationService, ITransientDependency { if (input.Options != OptionTypeNoNull.删除) { - Expression> isContentAnyExp = x => - x.TrackPushConfigId == input.TrackPushConfigId - && (x.TrackContentId == input.TrackContentId - || (input.TrackContentCodeValue != null && x.TrackContentCodeValue == input.TrackContentCodeValue) - || (input.TrackStatusValue != null && x.TrackStatusValue == input.TrackStatusValue) - || (input.TrackContentValue != null && x.TrackContentValue == input.TrackContentValue) - || (input.TrackEnContentValue != null && x.TrackEnContentValue == input.TrackEnContentValue)); - if (input.Options == OptionTypeNoNull.修改) isContentAnyExp = isContentAnyExp.And(x => x.Id != input.Id); + var isContentAnyExp = Expressionable.Create() + .And(x => x.TrackPushConfigId == input.TrackPushConfigId); + if (input.Options == OptionTypeNoNull.修改) isContentAnyExp.And(x => x.Id != input.Id); - if (await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp)) + if (await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => x.TrackContentId == input.TrackContentId).ToExpression())) throw new BusinessException(message: _stringLocalizer["IsTrackPushContentAny"]); + else if (!input.TrackContentCodeValue.IsNullOrWhiteSpace() && await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => x.TrackContentCodeValue == input.TrackContentCodeValue).ToExpression())) + throw new BusinessException(message: _stringLocalizer["IsTrackPushContentCodeValueAny"]); + else if (!input.TrackStatusValue.IsNullOrWhiteSpace() && await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => x.TrackStatusValue == input.TrackStatusValue).ToExpression())) + throw new BusinessException(message: _stringLocalizer["IsTrackPushContentStatusValueAny"]); + else if (!input.TrackContentValue.IsNullOrWhiteSpace() && await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => x.TrackContentValue == input.TrackContentValue).ToExpression())) + throw new BusinessException(message: _stringLocalizer["IsTrackPushContentValueAny"]); + else if (!input.TrackEnContentValue.IsNullOrWhiteSpace() && await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => x.TrackEnContentValue == input.TrackEnContentValue).ToExpression())) + throw new BusinessException(message: _stringLocalizer["IsTrackPushEnContentValueAny"]); } switch (input.Options) diff --git a/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushContentDetailOutputVO.cs b/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushContentDetailOutputVO.cs index f0980524..ace2b3df 100644 --- a/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushContentDetailOutputVO.cs +++ b/src/SJZY.Track.Domain/Dtos/TrackPush/GetTrackPushContentDetailOutputVO.cs @@ -47,7 +47,7 @@ public class GetTrackPushContentDetailOutputVO /// /// 轨迹推送配置id /// - public int TrackPullConfigId { get; set; } + public int TrackPushConfigId { get; set; } /// /// 推送轨迹状态 diff --git a/src/SJZY.Track.Domain/Enums/EnumPropertyEnums.cs b/src/SJZY.Track.Domain/Enums/EnumPropertyEnums.cs index e1c08aaf..a0b74b22 100644 --- a/src/SJZY.Track.Domain/Enums/EnumPropertyEnums.cs +++ b/src/SJZY.Track.Domain/Enums/EnumPropertyEnums.cs @@ -11,4 +11,9 @@ public enum EnumPropertyEnums /// 节点 /// [Description("ServiceNode")] 节点, + + /// + /// 单号类型 + /// + [Description("TrackOrderType")] 单号类型 } \ No newline at end of file diff --git a/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs index 2531f141..f6a325fd 100644 --- a/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/TrackPushConfigRepository.cs @@ -1,9 +1,11 @@ -using SJZY.Track.Domain.Aggregates.TrackContentAggregate; +using SJZY.Expand.ABP.Core.PublicMethords; +using SJZY.Track.Domain.Aggregates.TrackContentAggregate; using SJZY.Track.Domain.Aggregates.TrackPullAggregate; using SJZY.Track.Domain.Aggregates.TrackPushAggregate; using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate; using SJZY.Track.Domain.Dtos.Common; using SJZY.Track.Domain.Dtos.TrackPush; +using SJZY.Track.Domain.Enums; using SJZY.Track.Domain.VEntities; using SJZY.Track.Repository.VData.Entitys; using System.Linq.Expressions; @@ -44,12 +46,14 @@ public class TrackPushConfigRepository : BasicRepository, { return await Context.Queryable() .InnerJoin((pushContent, trackContent) => pushContent.TrackContentId == trackContent.Id) + .LeftJoin((pushContent, trackContent, enumValue) => enumValue.Property == EnumPropertyEnums.单号类型.GetDescription() && pushContent.OrderNoType == enumValue.Enumkey && !enumValue.IsDeleted) .Where(pushContent => pushContent.TrackPushConfigId == input.TrackPushConfigId) - .OrderBy((pushContent, trackContent) => pushContent.Sort) - .Select((pushContent, trackContent) => new GetTrackPushContentPageOutputVO + .OrderBy(pushContent => pushContent.Sort) + .Select((pushContent, trackContent, enumValue) => new GetTrackPushContentPageOutputVO { Id = pushContent.Id, - Sort = pushContent.Sort + Sort = pushContent.Sort, + OrderNoType = enumValue.Disp }, true) .ToPagedListAsync(input.PageIndex, input.PageSize); } From d21c83243921c74c7e85699f0ed60f40ead30844 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=B3=E6=96=87=E7=BF=94?= <878130837@qq.com> Date: Tue, 5 Mar 2024 11:18:49 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/TrackPull/TrackPullService.cs | 20 +++++++++---------- .../Services/TrackPush/TrackPushService.cs | 15 +++++++------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/src/SJZY.Track.Application/Services/TrackPull/TrackPullService.cs b/src/SJZY.Track.Application/Services/TrackPull/TrackPullService.cs index a562670d..df09c551 100644 --- a/src/SJZY.Track.Application/Services/TrackPull/TrackPullService.cs +++ b/src/SJZY.Track.Application/Services/TrackPull/TrackPullService.cs @@ -1,4 +1,5 @@ -using System.Linq.Expressions; +using System; +using System.Linq.Expressions; using Microsoft.Extensions.Localization; using SJZY.Expand.ABP.Core.Localization; using SJZY.Expand.ABP.Core.PublicMethords; @@ -209,23 +210,22 @@ public class TrackPullService : ApplicationService, ITransientDependency [HttpPost("UpdateContent")] public async Task UpdateContentAsync([FromBody] UpdateTrackPullContentInput input) { - var isContentAnyExp = Expressionable.Create() - .And(x => x.Id != input.Id && x.TrackPullConfigId == input.TrackPullConfigId); + Expression> isContentAnyExp = x => x.Id != input.Id && x.TrackPullConfigId == input.TrackPullConfigId; - if (await _trackPullConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => x.TrackContentId == input.TrackContentId).ToExpression())) + if (await _trackPullConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => x.TrackContentId == input.TrackContentId))) throw new BusinessException(message: _stringLocalizer["IsTrackPullContentAny"]); - else if (!input.TrackContentCodeValue.IsNullOrWhiteSpace() && await _trackPullConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => x.TrackContentCodeValue == input.TrackContentCodeValue).ToExpression())) + else if (!input.TrackContentCodeValue.IsNullOrWhiteSpace() && await _trackPullConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => x.TrackContentCodeValue == input.TrackContentCodeValue))) throw new BusinessException(message: _stringLocalizer["IsTrackPullContentCodeValueAny"]); - else if (!input.TrackStatusValue.IsNullOrWhiteSpace() && await _trackPullConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => x.TrackStatusValue == input.TrackStatusValue).ToExpression())) + else if (!input.TrackStatusValue.IsNullOrWhiteSpace() && await _trackPullConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => x.TrackStatusValue == input.TrackStatusValue))) throw new BusinessException(message: _stringLocalizer["IsTrackPullContentStatusValueAny"]); - else if (!input.TrackContentValue.IsNullOrWhiteSpace() && await _trackPullConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => x.TrackContentValue == input.TrackContentValue).ToExpression())) + else if (!input.TrackContentValue.IsNullOrWhiteSpace() && await _trackPullConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => x.TrackContentValue == input.TrackContentValue))) throw new BusinessException(message: _stringLocalizer["IsTrackPullContentValueAny"]); else if (!input.TrackKeywords.IsNullOrEmpty()) { - var trackKeywordExp = Expressionable.Create(); - input.TrackKeywords!.ForEach(item => { trackKeywordExp.Or(x => SqlFunc.SplitIn(x.TrackKeyword, item)); }); + Expression> trackKeywordExp = _ => true; + input.TrackKeywords!.ForEach(item => { trackKeywordExp = trackKeywordExp.Or(x => SqlFunc.SplitIn(x.TrackKeyword, item)); }); - if (await _trackPullConfigRepository.IsContentAnyAsync(isContentAnyExp.And(trackKeywordExp.ToExpression()).ToExpression())) + if (await _trackPullConfigRepository.IsContentAnyAsync(isContentAnyExp.And(trackKeywordExp))) throw new BusinessException(message: _stringLocalizer["IsTrackPullContentKeywordsAny"]); } diff --git a/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs b/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs index a66a58c0..1b009a95 100644 --- a/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs +++ b/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs @@ -202,19 +202,18 @@ public class TrackPushService : ApplicationService, ITransientDependency { if (input.Options != OptionTypeNoNull.删除) { - var isContentAnyExp = Expressionable.Create() - .And(x => x.TrackPushConfigId == input.TrackPushConfigId); - if (input.Options == OptionTypeNoNull.修改) isContentAnyExp.And(x => x.Id != input.Id); + Expression> isContentAnyExp = x => x.TrackPushConfigId == input.TrackPushConfigId; + if (input.Options == OptionTypeNoNull.修改) isContentAnyExp = isContentAnyExp.And(x => x.Id != input.Id); - if (await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => x.TrackContentId == input.TrackContentId).ToExpression())) + if (await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => x.TrackContentId == input.TrackContentId))) throw new BusinessException(message: _stringLocalizer["IsTrackPushContentAny"]); - else if (!input.TrackContentCodeValue.IsNullOrWhiteSpace() && await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => x.TrackContentCodeValue == input.TrackContentCodeValue).ToExpression())) + else if (!input.TrackContentCodeValue.IsNullOrWhiteSpace() && await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => x.TrackContentCodeValue == input.TrackContentCodeValue))) throw new BusinessException(message: _stringLocalizer["IsTrackPushContentCodeValueAny"]); - else if (!input.TrackStatusValue.IsNullOrWhiteSpace() && await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => x.TrackStatusValue == input.TrackStatusValue).ToExpression())) + else if (!input.TrackStatusValue.IsNullOrWhiteSpace() && await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => x.TrackStatusValue == input.TrackStatusValue))) throw new BusinessException(message: _stringLocalizer["IsTrackPushContentStatusValueAny"]); - else if (!input.TrackContentValue.IsNullOrWhiteSpace() && await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => x.TrackContentValue == input.TrackContentValue).ToExpression())) + else if (!input.TrackContentValue.IsNullOrWhiteSpace() && await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => x.TrackContentValue == input.TrackContentValue))) throw new BusinessException(message: _stringLocalizer["IsTrackPushContentValueAny"]); - else if (!input.TrackEnContentValue.IsNullOrWhiteSpace() && await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => x.TrackEnContentValue == input.TrackEnContentValue).ToExpression())) + else if (!input.TrackEnContentValue.IsNullOrWhiteSpace() && await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => x.TrackEnContentValue == input.TrackEnContentValue))) throw new BusinessException(message: _stringLocalizer["IsTrackPushEnContentValueAny"]); } From 415360ef8d68d45e7b379f71ab1ee99b280b3c2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=86=9B?= <2357729423@qq.com> Date: Tue, 5 Mar 2024 11:34:29 +0800 Subject: [PATCH 3/7] =?UTF-8?q?change=20=E8=88=AA=E7=8F=AD=E3=80=81?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=20=E5=8F=AF=E4=BC=A0null?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dtos/ProvideServices/UpdateOrderInput.cs | 4 ++-- .../Dtos/ProvideServices/UpsertOrderInput.cs | 2 +- .../AutoMapper/OrderAutoMapperProfile.cs | 4 +--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpdateOrderInput.cs b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpdateOrderInput.cs index a6faf08b..7d9feb90 100644 --- a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpdateOrderInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpdateOrderInput.cs @@ -35,10 +35,10 @@ public class UpdateOrderInput : OrderNoInfo /// /// 订单模板(传全量) /// - public List Templates { get; set; } = new(); + public List? Templates { get; set; } = new(); /// /// 订单航班信息 /// - public List FlightInfos { get; set; } = new(); + public List? FlightInfos { get; set; } = new(); } \ No newline at end of file diff --git a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpsertOrderInput.cs b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpsertOrderInput.cs index f6c7cb78..880c43a5 100644 --- a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpsertOrderInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpsertOrderInput.cs @@ -24,7 +24,7 @@ public class OrderTemplateInfo public int? ServiceProviderId { get; set; } } -public class OrderFligthInfo +public class OrderFlightInfo { /// /// 航班号 diff --git a/src/SJZY.Track.Application/AutoMapper/OrderAutoMapperProfile.cs b/src/SJZY.Track.Application/AutoMapper/OrderAutoMapperProfile.cs index d0ead552..f79ef0b8 100644 --- a/src/SJZY.Track.Application/AutoMapper/OrderAutoMapperProfile.cs +++ b/src/SJZY.Track.Application/AutoMapper/OrderAutoMapperProfile.cs @@ -1,10 +1,8 @@ using AutoMapper; -using AutoMapper.Internal.Mappers; using SJZY.Track.Application.Contract.Dtos.ProvideServices; using SJZY.Track.Domain.Aggregates.OrderAggregate; using SJZY.Track.Domain.Aggregates.TrackDetailsAggregate; using SJZY.Track.Domain.Dtos.Order; -using System.Diagnostics; namespace SJZY.Track.Application.AutoMapper; @@ -18,7 +16,7 @@ public class OrderAutoMapperProfile : Profile CreateMap(MemberList.None) .ForMember(dest => dest.ServiceProviderId, opt => opt.MapFrom(m => m.ServiceProviderId ?? 0)) .ForMember(dest => dest.TrackTemplateId, opt => opt.MapFrom(m => m.TemplateId)); - CreateMap(MemberList.None); + CreateMap(MemberList.None); CreateMap(MemberList.None); CreateMap(MemberList.None); From f62cb2cf56b52aeec10e9beb4c10c644ccf9c6a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=86=9B?= <2357729423@qq.com> Date: Tue, 5 Mar 2024 11:36:56 +0800 Subject: [PATCH 4/7] attach --- .../Services/ProvideServices/OrderService.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/SJZY.Track.Application/Services/ProvideServices/OrderService.cs b/src/SJZY.Track.Application/Services/ProvideServices/OrderService.cs index 42c94f23..b05e3f68 100644 --- a/src/SJZY.Track.Application/Services/ProvideServices/OrderService.cs +++ b/src/SJZY.Track.Application/Services/ProvideServices/OrderService.cs @@ -43,8 +43,8 @@ public class OrderService : ApplicationService order = ObjectMapper.Map(input); order.SubSystemId = 1; - order.OrderTemplates = ObjectMapper.Map, List>(input.Templates); - order.OrderFlights = ObjectMapper.Map, List>(input.FlightInfos); + order.OrderTemplates = ObjectMapper.Map, List>(input.Templates!); + order.OrderFlights = ObjectMapper.Map, List>(input.FlightInfos!); await _orderRepository.CreateOrderAsync(order); return "创建成功"; @@ -94,6 +94,7 @@ public class OrderService : ApplicationService #endregion #region 轨迹订单列表 + /// /// 获取分页的轨迹订单 /// @@ -108,13 +109,14 @@ public class OrderService : ApplicationService ObjectMapper.Map, UnifyPageResultDto>(pageList); return pageResultDto; } + #endregion private async Task UpdateOrderAsync(UpdateOrderInput input, OrderEntity order) { order = ObjectMapper.Map(input, order); order.OrderTemplates = ObjectMapper.Map, List>(input.Templates); - order.OrderFlights = ObjectMapper.Map, List>(input.FlightInfos); + order.OrderFlights = ObjectMapper.Map, List>(input.FlightInfos); await _orderRepository.UpdateOrderAsync(order); } } \ No newline at end of file From 86ae365a817a9f0b812b80807f7a39c2902e48a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=86=9B?= <2357729423@qq.com> Date: Tue, 5 Mar 2024 11:39:44 +0800 Subject: [PATCH 5/7] =?UTF-8?q?fix=E3=80=90S1-=E6=96=B0=E5=A2=9E=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E8=BD=A8=E8=BF=B9=E6=8E=A5=E5=8F=A3=EF=BC=8C=E6=8C=89?= =?UTF-8?q?=E7=85=A7=E6=96=87=E6=A1=A3=EF=BC=8C=E8=BD=A8=E8=BF=B9=E5=8F=91?= =?UTF-8?q?=E7=94=9F=E6=97=B6=E9=97=B4=E5=92=8C=E6=97=B6=E5=8C=BA=E9=83=BD?= =?UTF-8?q?=E6=98=AF=E5=BF=85=E5=A1=AB=EF=BC=8C=E4=BD=86=E6=98=AF=E5=AE=9E?= =?UTF-8?q?=E9=99=85=E4=B8=8D=E5=A1=AB=E5=86=99=E4=B9=9F=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=88=90=E5=8A=9F=E4=BA=86=E3=80=91https://www.tapd.cn/6086384?= =?UTF-8?q?9/bugtrace/bugs/view=3Fbug=5Fid=3D1160863849001029729?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dtos/ProvideServices/UpsertTrackInput.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpsertTrackInput.cs b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpsertTrackInput.cs index ef0e67a4..c2c7b4c6 100644 --- a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpsertTrackInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpsertTrackInput.cs @@ -1,24 +1,32 @@ -namespace SJZY.Track.Application.Contract.Dtos.ProvideServices; +using System.ComponentModel.DataAnnotations; + +namespace SJZY.Track.Application.Contract.Dtos.ProvideServices; public class UpsertTrackInput : OrderNoInfo { /// /// 轨迹内容代码 /// + [Required] + [MaxLength(50)] public string TrackCode { get; set; } = null!; /// /// 轨迹发生地 /// + [Required] + [MaxLength(200)] public string TrackPlace { get; set; } = null!; /// /// 轨迹发生时间 /// + [Required] public DateTime TrackTime { get; set; } /// /// 轨迹发生时区 /// + [Required] public float TraceTimeZone { get; set; } } \ No newline at end of file From 8f2d9cf708771be4a48480c4b13fc30e2d770465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=86=9B?= <2357729423@qq.com> Date: Tue, 5 Mar 2024 11:43:15 +0800 Subject: [PATCH 6/7] =?UTF-8?q?fix=E3=80=90S1-=E5=88=9B=E5=BB=BA=E8=BD=A8?= =?UTF-8?q?=E8=BF=B9=E8=AE=A2=E5=8D=95=E6=97=B6=EF=BC=8C=E7=9B=AE=E7=9A=84?= =?UTF-8?q?=E5=9B=BD=E5=AE=B6=E3=80=81=E7=9B=AE=E7=9A=84=E5=9F=8E=E5=B8=82?= =?UTF-8?q?=E3=80=81=E8=B5=B7=E8=BF=90=E5=9B=BD=E5=AE=B6=E3=80=81=E8=B5=B7?= =?UTF-8?q?=E8=BF=90=E5=9F=8E=E5=B8=82=E8=BF=994=E4=B8=AA=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E9=83=BD=E6=98=AF=E5=BF=85=E5=A1=AB=E7=9A=84=EF=BC=8C?= =?UTF-8?q?=E4=BD=86=E6=98=AF=E4=B8=8D=E5=A1=AB=E5=86=99=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E9=83=BD=E5=8F=AF=E4=BB=A5=E5=88=9B=E5=BB=BA=E6=88=90=E5=8A=9F?= =?UTF-8?q?=E3=80=91https://www.tapd.cn/60863849/bugtrace/bugs/view=3Fbug?= =?UTF-8?q?=5Fid=3D1160863849001029724?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dtos/ProvideServices/UpdateOrderInput.cs | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpdateOrderInput.cs b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpdateOrderInput.cs index 7d9feb90..69ad9a0b 100644 --- a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpdateOrderInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpdateOrderInput.cs @@ -1,4 +1,6 @@ -namespace SJZY.Track.Application.Contract.Dtos.ProvideServices; +using System.ComponentModel.DataAnnotations; + +namespace SJZY.Track.Application.Contract.Dtos.ProvideServices; public class UpdateOrderInput : OrderNoInfo { @@ -15,22 +17,30 @@ public class UpdateOrderInput : OrderNoInfo /// /// 目的国家,必填 /// - public string ArrivalCountry { get; set; } + [Required] + [MaxLength(200)] + public string ArrivalCountry { get; set; } = null!; /// /// 起运国家,必填 /// - public string LeaveCountry { get; set; } + [Required] + [MaxLength(200)] + public string LeaveCountry { get; set; } = null!; /// /// 目的城市,必填 /// - public string ArrivalCity { get; set; } + [Required] + [MaxLength(200)] + public string ArrivalCity { get; set; } = null!; /// /// 起运城市,必填 /// - public string LeaveCity { get; set; } + [Required] + [MaxLength(200)] + public string LeaveCity { get; set; } = null!; /// /// 订单模板(传全量) From c2e06e1201eaeb63db94d3e2a77d1c1308f49898 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=86=9B?= <2357729423@qq.com> Date: Tue, 5 Mar 2024 11:49:16 +0800 Subject: [PATCH 7/7] =?UTF-8?q?fix=E3=80=90S1-=E8=B0=83=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E8=BD=A8=E8=BF=B9=E8=AE=A2=E5=8D=95=E6=8E=A5=E5=8F=A3=EF=BC=8C?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=88=90=E5=8A=9F=E4=BA=86=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E7=9B=B8=E5=90=8C=E5=8D=95=E5=8F=B7=E4=B8=94=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E4=B8=BA=E7=A9=BA=E7=9A=84=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E3=80=91https://www.tapd.cn/60863849/bugtrace/bugs/view=3Fbug?= =?UTF-8?q?=5Fid=3D1160863849001029721?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dtos/ProvideServices/OrderNoInfo.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/OrderNoInfo.cs b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/OrderNoInfo.cs index b4283022..eda65e4a 100644 --- a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/OrderNoInfo.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/OrderNoInfo.cs @@ -8,6 +8,7 @@ public class OrderNoInfo /// 订单类型,必填 /// [Required] + [Range(1, int.MaxValue)] public int OrderType { get; set; } ///