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