diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs index 40649c44..b63bc115 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Extensions/WechatApiClientExecuteChannelsExtensions.cs @@ -2976,6 +2976,29 @@ namespace SKIT.FlurlHttpClient.Wechat.Api return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); } + /// + /// 异步调用 [POST] /channels/ec/logistics/ewaybill/biz/order/addsuborder 接口。 + /// + /// REF:
+ /// + ///
+ ///
+ /// + /// + /// + /// + public static async Task ExecuteChannelsECLogisticsEWaybillOrderAddSubOrderAsync(this WechatApiClient client, Models.ChannelsECLogisticsEWaybillOrderAddSubOrderRequest request, CancellationToken cancellationToken = default) + { + if (client is null) throw new ArgumentNullException(nameof(client)); + if (request is null) throw new ArgumentNullException(nameof(request)); + + IFlurlRequest flurlReq = client + .CreateFlurlRequest(request, HttpMethod.Post, "channels", "ec", "logistics", "ewaybill", "biz", "order", "addsuborder") + .SetQueryParam("access_token", request.AccessToken); + + return await client.SendFlurlRequestAsJsonAsync(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); + } + /// /// 异步调用 [POST] /channels/ec/logistics/ewaybill/biz/order/cancel 接口。 /// diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECLogistics/EWaybill/Order/ChannelsECLogisticsEWaybillOrderAddSubOrderRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECLogistics/EWaybill/Order/ChannelsECLogisticsEWaybillOrderAddSubOrderRequest.cs new file mode 100644 index 00000000..beaeacfb --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECLogistics/EWaybill/Order/ChannelsECLogisticsEWaybillOrderAddSubOrderRequest.cs @@ -0,0 +1,80 @@ +using System.Collections.Generic; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /channels/ec/logistics/ewaybill/biz/order/addsuborder 接口的请求。 + /// + public class ChannelsECLogisticsEWaybillOrderAddSubOrderRequest : WechatApiRequest, IInferable + { + public static class Types + { + public class SubPackage : ChannelsECLogisticsEWaybillOrderCreateRequest.Types.DeliveryInfo.Types.SubPackage + { + } + } + + /// + /// 获取或设置电子面单 ID。 + /// + [Newtonsoft.Json.JsonProperty("ewaybill_order_id")] + [System.Text.Json.Serialization.JsonPropertyName("ewaybill_order_id")] + public string EWaybillOrderId { get; set; } = string.Empty; + + /// + /// 获取或设置快递单号。 + /// + [Newtonsoft.Json.JsonProperty("waybill_id")] + [System.Text.Json.Serialization.JsonPropertyName("waybill_id")] + public string WaybillId { get; set; } = string.Empty; + + /// + /// 获取或设置快递公司 ID。 + /// + [Newtonsoft.Json.JsonProperty("delivery_id")] + [System.Text.Json.Serialization.JsonPropertyName("delivery_id")] + public string DeliveryId { get; set; } = string.Empty; + + /// + /// 获取或设置店铺 ID。 + /// + [Newtonsoft.Json.JsonProperty("shop_id")] + [System.Text.Json.Serialization.JsonPropertyName("shop_id")] + public string ShopId { get; set; } = string.Empty; + + /// + /// 获取或设置电子面单账号 ID。 + /// + [Newtonsoft.Json.JsonProperty("ewaybill_acct_id")] + [System.Text.Json.Serialization.JsonPropertyName("ewaybill_acct_id")] + public string EWaybillAccountId { get; set; } = string.Empty; + + /// + /// 获取或设置追加面单数量。 + /// + [Newtonsoft.Json.JsonProperty("add_package_quantity")] + [System.Text.Json.Serialization.JsonPropertyName("add_package_quantity")] + public int AddPackageQuantity { get; set; } + + /// + /// 获取或设置面单模板 ID。 + /// + [Newtonsoft.Json.JsonProperty("template_id")] + [System.Text.Json.Serialization.JsonPropertyName("template_id")] + public string? TemplateId { get; set; } + + /// + /// 获取或设置子件列表。 + /// + [Newtonsoft.Json.JsonProperty("subpackage_list")] + [System.Text.Json.Serialization.JsonPropertyName("subpackage_list")] + public IList? SubPackageList { get; set; } + + /// + /// 获取或设置子单额外信息。 + /// + [Newtonsoft.Json.JsonProperty("sub_order_ext_info")] + [System.Text.Json.Serialization.JsonPropertyName("sub_order_ext_info")] + public string? SubOrderExtraInfo { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECLogistics/EWaybill/Order/ChannelsECLogisticsEWaybillOrderAddSubOrderResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECLogistics/EWaybill/Order/ChannelsECLogisticsEWaybillOrderAddSubOrderResponse.cs new file mode 100644 index 00000000..760d9965 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECLogistics/EWaybill/Order/ChannelsECLogisticsEWaybillOrderAddSubOrderResponse.cs @@ -0,0 +1,50 @@ +namespace SKIT.FlurlHttpClient.Wechat.Api.Models +{ + /// + /// 表示 [POST] /channels/ec/logistics/ewaybill/biz/order/addsuborder 接口的响应。 + /// + public class ChannelsECLogisticsEWaybillOrderAddSubOrderResponse : WechatApiResponse + { + public static class Types + { + public class SubWaybill : ChannelsECLogisticsEWaybillOrderCreateResponse.Types.SubWaybill + { + } + } + + /// + /// 获取或设置电子面单 ID。 + /// + [Newtonsoft.Json.JsonProperty("ewaybill_order_id")] + [System.Text.Json.Serialization.JsonPropertyName("ewaybill_order_id")] + public string? EWaybillOrderId { get; set; } + + /// + /// 获取或设置快递单号。 + /// + [Newtonsoft.Json.JsonProperty("waybill_id")] + [System.Text.Json.Serialization.JsonPropertyName("waybill_id")] + public string? WaybillId { get; set; } + + /// + /// 获取或设置快递公司错误信息。 + /// + [Newtonsoft.Json.JsonProperty("delivery_error_msg")] + [System.Text.Json.Serialization.JsonPropertyName("delivery_error_msg")] + public string? DeliveryErrorMessage { get; set; } + + /// + /// 获取或设置打印报文信息。 + /// + [Newtonsoft.Json.JsonProperty("print_info")] + [System.Text.Json.Serialization.JsonPropertyName("print_info")] + public string? PrintInfo { get; set; } + + /// + /// 获取或设置子单列表。 + /// + [Newtonsoft.Json.JsonProperty("waybill_id_list")] + [System.Text.Json.Serialization.JsonPropertyName("waybill_id_list")] + public Types.SubWaybill[]? SubWaybillList { get; set; } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECLogistics/EWaybill/Order/ChannelsECLogisticsEWaybillOrderCreateRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECLogistics/EWaybill/Order/ChannelsECLogisticsEWaybillOrderCreateRequest.cs index 474337ea..cf424a62 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECLogistics/EWaybill/Order/ChannelsECLogisticsEWaybillOrderCreateRequest.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECLogistics/EWaybill/Order/ChannelsECLogisticsEWaybillOrderCreateRequest.cs @@ -246,7 +246,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models /// [Newtonsoft.Json.JsonProperty("ewaybill_acct_id")] [System.Text.Json.Serialization.JsonPropertyName("ewaybill_acct_id")] - public string AccountId { get; set; } = string.Empty; + public string EWaybillAccountId { get; set; } = string.Empty; /// /// 获取或设置面单模板 ID。 diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECLogistics/EWaybill/Order/ChannelsECLogisticsEWaybillOrderGetResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECLogistics/EWaybill/Order/ChannelsECLogisticsEWaybillOrderGetResponse.cs index 39f639c2..0b967fc4 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECLogistics/EWaybill/Order/ChannelsECLogisticsEWaybillOrderGetResponse.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECLogistics/EWaybill/Order/ChannelsECLogisticsEWaybillOrderGetResponse.cs @@ -194,7 +194,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models /// [Newtonsoft.Json.JsonProperty("ewaybill_acct_id")] [System.Text.Json.Serialization.JsonPropertyName("ewaybill_acct_id")] - public string AccountId { get; set; } = default!; + public string EWaybillAccountId { get; set; } = default!; /// /// 获取或设置寄件人信息。 diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECLogistics/EWaybill/Order/ChannelsECLogisticsEWaybillOrderPrecreateRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECLogistics/EWaybill/Order/ChannelsECLogisticsEWaybillOrderPrecreateRequest.cs index 0334fd24..a2765dc3 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECLogistics/EWaybill/Order/ChannelsECLogisticsEWaybillOrderPrecreateRequest.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Models/Channels/ECLogistics/EWaybill/Order/ChannelsECLogisticsEWaybillOrderPrecreateRequest.cs @@ -155,7 +155,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Api.Models /// [Newtonsoft.Json.JsonProperty("ewaybill_acct_id")] [System.Text.Json.Serialization.JsonPropertyName("ewaybill_acct_id")] - public string AccountId { get; set; } = string.Empty; + public string EWaybillAccountId { get; set; } = string.Empty; /// /// 获取或设置寄件人信息。 diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECLogistics/EWaybill/Order/ChannelsECLogisticsEWaybillOrderAddSubOrderRequest.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECLogistics/EWaybill/Order/ChannelsECLogisticsEWaybillOrderAddSubOrderRequest.json new file mode 100644 index 00000000..befa26ee --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECLogistics/EWaybill/Order/ChannelsECLogisticsEWaybillOrderAddSubOrderRequest.json @@ -0,0 +1,8 @@ +{ + "ewaybill_order_id": "xxxxxxx", + "delivery_id": "JD", + "waybill_id": "xxxxxxx", + "add_package_quantity": 1, + "shop_id": "xxxxxx", + "ewaybill_acct_id": "xxxxx" +} diff --git a/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECLogistics/EWaybill/Order/ChannelsECLogisticsEWaybillOrderAddSubOrderResponse.json b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECLogistics/EWaybill/Order/ChannelsECLogisticsEWaybillOrderAddSubOrderResponse.json new file mode 100644 index 00000000..af98e1a2 --- /dev/null +++ b/test/SKIT.FlurlHttpClient.Wechat.Api.UnitTests/ModelSamples/Channels/ECLogistics/EWaybill/Order/ChannelsECLogisticsEWaybillOrderAddSubOrderResponse.json @@ -0,0 +1,24 @@ +{ + "errcode": 0, + "errmsg": "ok", + "delivery_error_msg": "调用成功", + "waybill_id": "JDAWX0161464774", + "waybill_id_list": [ + { + "create_time": 1734508828, + "waybill_id": "JDAWX0161464774-1-3-", + "waybill_type": 2 + }, + { + "create_time": 1734508828, + "waybill_id": "JDAWX0161464774-2-3-", + "waybill_type": 2 + }, + { + "create_time": 1734508828, + "waybill_id": "JDAWX0161464774-3-3-", + "waybill_type": 2 + } + ], + "print_info": "xxxxxxx" +}