From f19ba6c01a3a760fefc74773f448759d5ad2a1d0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=86=9B?= <2357729423@qq.com>
Date: Wed, 13 Mar 2024 10:08:41 +0800
Subject: [PATCH 1/4] =?UTF-8?q?add=20=E5=88=A0=E9=99=A4=E5=BC=95=E5=8F=91?=
=?UTF-8?q?=E8=BD=A8=E8=BF=B9=E6=9B=B4=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../EventHandlers/UpdateOrderTrackEventHandler.cs | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/SJZY.Track.Application/EventHandlers/UpdateOrderTrackEventHandler.cs b/src/SJZY.Track.Application/EventHandlers/UpdateOrderTrackEventHandler.cs
index f2fca16a..72316cef 100644
--- a/src/SJZY.Track.Application/EventHandlers/UpdateOrderTrackEventHandler.cs
+++ b/src/SJZY.Track.Application/EventHandlers/UpdateOrderTrackEventHandler.cs
@@ -24,12 +24,15 @@ public class UpdateOrderTrackEventHandler : ITransientDependency, ICapSubscribe
{
if (@event.TrackTime == default)
{
+ if (order.LatestTrackTime == null) return;
// 删除全部轨迹导致的重置行为
order.ResetTrackInfo();
}
- else if (@event.TrackTime == order.LatestTrackTime) return;
+ else if (order.LatestTrackTime != null &&
+ order.LatestTrackTime.Value.Subtract(TimeSpan.FromHours(order.LatestTrackTimeZone ?? 0)) ==
+ @event.TrackTime.Subtract(TimeSpan.FromHours(@event.TrackTimeZone))) return;
}
- else // upsert引发的更新,需要校验发生时间是否大于最新时间
+ else // upsert引发的更新
{
if (order.LatestTrackTime != null &&
order.LatestTrackTime.Value.Subtract(TimeSpan.FromHours(order.LatestTrackTimeZone ?? 0)) >
From 6a911177f7485729146368a4711d5403b808ee70 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=86=9B?= <2357729423@qq.com>
Date: Wed, 13 Mar 2024 15:41:59 +0800
Subject: [PATCH 2/4] =?UTF-8?q?add=20=E6=A0=A1=E9=AA=8C=E8=AE=A2=E5=8D=95?=
=?UTF-8?q?=E8=87=B3=E5=B0=91=E6=9C=89=E4=B8=80=E4=B8=AA=E6=A8=A1=E6=9D=BF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Dtos/ProvideServices/UpdateOrderInput.cs | 4 ++--
.../Dtos/ProvideServices/UpsertOrderInput.cs | 1 +
src/SJZY.Track.Application/SJZY.Track.Application.csproj | 2 +-
.../Services/ProvideServices/OrderService.cs | 9 +++++----
.../Services/ProvideServices/TrackPushPullService.cs | 2 +-
src/SJZY.Track.Application/SjzyTrackApplicationModule.cs | 5 ++---
6 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpdateOrderInput.cs b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpdateOrderInput.cs
index 69ad9a0b..ebb47f17 100644
--- a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpdateOrderInput.cs
+++ b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpdateOrderInput.cs
@@ -45,10 +45,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 91ae6d11..4293ccc0 100644
--- a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpsertOrderInput.cs
+++ b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/UpsertOrderInput.cs
@@ -17,6 +17,7 @@ public class OrderTemplateInfo
/// 模板id
///
[Required]
+ [Range(1, Int32.MaxValue)]
public int TemplateId { get; set; }
///
diff --git a/src/SJZY.Track.Application/SJZY.Track.Application.csproj b/src/SJZY.Track.Application/SJZY.Track.Application.csproj
index da60d1a4..160ca752 100644
--- a/src/SJZY.Track.Application/SJZY.Track.Application.csproj
+++ b/src/SJZY.Track.Application/SJZY.Track.Application.csproj
@@ -8,7 +8,7 @@
-
+
diff --git a/src/SJZY.Track.Application/Services/ProvideServices/OrderService.cs b/src/SJZY.Track.Application/Services/ProvideServices/OrderService.cs
index 765ff6ad..712b775c 100644
--- a/src/SJZY.Track.Application/Services/ProvideServices/OrderService.cs
+++ b/src/SJZY.Track.Application/Services/ProvideServices/OrderService.cs
@@ -32,6 +32,7 @@ public partial class OrderService : ApplicationService, IOrderService
[HttpPost("Order/Upsert")]
public async Task UpsertAsync(UpsertOrderInput input)
{
+ if (input.Templates.Count == 0) throw new BusinessException(message: "至少有一个模板");
var order = await _orderRepository.GetFirstAsync(x =>
x.OrderType == input.OrderType && x.OrderNo == input.OrderNo);
if (order != default)
@@ -43,8 +44,8 @@ public partial class OrderService : ApplicationService, IOrderService
order = ObjectMapper.Map(input);
order.SubSystemId = CurrentUserRequest.SubSystemId;
- 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 "创建成功";
@@ -74,8 +75,8 @@ public partial class OrderService : ApplicationService, IOrderService
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.OrderTemplates = ObjectMapper.Map, List>(input.Templates);
+ order.OrderFlights = ObjectMapper.Map, List>(input.FlightInfos);
await _orderRepository.UpdateOrderAsync(order);
}
}
\ No newline at end of file
diff --git a/src/SJZY.Track.Application/Services/ProvideServices/TrackPushPullService.cs b/src/SJZY.Track.Application/Services/ProvideServices/TrackPushPullService.cs
index 8e32d1c1..2e1dd08b 100644
--- a/src/SJZY.Track.Application/Services/ProvideServices/TrackPushPullService.cs
+++ b/src/SJZY.Track.Application/Services/ProvideServices/TrackPushPullService.cs
@@ -49,7 +49,7 @@ public class TrackPushPullService : ApplicationService
x.OrderNo
}).ToList();
- // 批量获取轨迹 这里报错了,我先随便给个 写死的主体值
+ // 批量获取轨迹
await _httpClientProxy.Service.BatchForwardThenPushToQueueAsync(
"A012", group.Key.ServiceProviderCode, data,
GlobalConst.TrackRefreshSubscribe, JsonConvert.SerializeObject(group.Key));
diff --git a/src/SJZY.Track.Application/SjzyTrackApplicationModule.cs b/src/SJZY.Track.Application/SjzyTrackApplicationModule.cs
index ba706085..b2b2cd06 100644
--- a/src/SJZY.Track.Application/SjzyTrackApplicationModule.cs
+++ b/src/SJZY.Track.Application/SjzyTrackApplicationModule.cs
@@ -68,9 +68,8 @@ namespace SJZY.Track.Application
//用户中心
context.Services.AddHttpClientProxies(typeof(SjzyUserCenterHttpApiModule).Assembly, "UserCenter", false);
context.Services.AddHttpClient("InterfaceForward").AddHttpMessageHandler();
- context.Services.AddHttpClientProxy(
- remoteServiceConfigurationName: "InterfaceForward",
- asDefaultService: false
+ context.Services.AddHttpClientProxies(typeof(SJZYInterfaceRelayApplicationContractsModule).Assembly,
+ "InterfaceForward", false
);
//CAP
From c0b5db3ab54890f65fa09163444715aa12481ea9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9F=B3=E6=96=87=E7=BF=94?= <878130837@qq.com>
Date: Wed, 13 Mar 2024 17:16:15 +0800
Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=94=99=E8=AF=AF?=
=?UTF-8?q?=E8=AF=AD=E5=8F=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Services/TrackPull/TrackPullCacheService.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/SJZY.Track.Application/Services/TrackPull/TrackPullCacheService.cs b/src/SJZY.Track.Application/Services/TrackPull/TrackPullCacheService.cs
index 168dae3a..420c44e6 100644
--- a/src/SJZY.Track.Application/Services/TrackPull/TrackPullCacheService.cs
+++ b/src/SJZY.Track.Application/Services/TrackPull/TrackPullCacheService.cs
@@ -35,7 +35,7 @@ public class TrackPullCacheService : ApplicationService, ITrackPullCacheService,
var data = new TrackPullConfigDto();
Expression> exp = x =>
- (!id.HasValue || x.Id == id) && (id.HasValue || (x.SubSystemId == subSystemId && x.ServiceProviderId == serviceProviderId));
+ (id == null || x.Id == id) && (id != null || (x.SubSystemId == subSystemId && x.ServiceProviderId == serviceProviderId));
var trackPullConfigEntity = await _trackPullConfigRepository.GetFirstAsync(exp);
if (trackPullConfigEntity == null) return data;
From 9bd030465b129a46c8967ae01c892f5f15323765 Mon Sep 17 00:00:00 2001
From: moyongzhen <2534173414@qq.com>
Date: Wed, 13 Mar 2024 17:41:57 +0800
Subject: [PATCH 4/4] =?UTF-8?q?=E8=BD=A8=E8=BF=B9=E6=98=8E=E7=BB=86?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AE=A2=E5=8D=95=E7=B1=BB=E5=9E=8Bid?=
=?UTF-8?q?=E5=92=8C=E8=AE=A2=E5=8D=95=E5=8F=B7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Dtos/ProvideServices/GetOrderDetailsInput.cs | 10 ++++++++++
.../Dtos/Order/GetPageTrackOrderInputVO.cs | 2 +-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetOrderDetailsInput.cs b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetOrderDetailsInput.cs
index 3920f5c1..9ec96ba5 100644
--- a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetOrderDetailsInput.cs
+++ b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetOrderDetailsInput.cs
@@ -32,6 +32,16 @@ namespace SJZY.Track.Application.Contract.Dtos.ProvideServices
///
public int OrderId { set; get; }
+ ///
+ /// 订单类型(主数据枚举TrackOrderType)
+ ///
+ public int OrderType { get; set; }
+
+ ///
+ /// 订单号
+ ///
+ public string OrderNo { get; set; } = null!;
+
///
/// 轨迹代码
///
diff --git a/src/SJZY.Track.Domain/Dtos/Order/GetPageTrackOrderInputVO.cs b/src/SJZY.Track.Domain/Dtos/Order/GetPageTrackOrderInputVO.cs
index 788c9fb8..91c30797 100644
--- a/src/SJZY.Track.Domain/Dtos/Order/GetPageTrackOrderInputVO.cs
+++ b/src/SJZY.Track.Domain/Dtos/Order/GetPageTrackOrderInputVO.cs
@@ -70,7 +70,7 @@ namespace SJZY.Track.Domain.Dtos.Order
public int OrderType { get; set; }
///
- /// 订单名称
+ /// 订单类型名称
///
public string OrderTypeName { get; set; }