From 291d170ee61ad6b02c4eb9321f8527ed7442ab86 Mon Sep 17 00:00:00 2001 From: "AERWEN\\26795" <123456789a> Date: Fri, 20 Oct 2023 21:58:42 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E6=B7=BB=E5=8A=A0=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Vo/Api/OrderManage/Orders/OrderApiVo.cs | 12 +- .../Vo/Api/OrderManage/Orders/Trajectory.cs | 48 + .../Api/OrderManage/Orders/TrajectoryNode.cs | 43 + .../Vo/Api/OrderManage/Orders/TrajectoryVo.cs | 36 + .../GoodsManager/Goodss/GoodsServiceApi.cs | 9 +- .../OrderManage/Orders/OrderServiceApi.cs | 144 +- .../Business/SubscribeTask_Job.cs | 2 +- .../OrderManage/Orders/OrderController.cs | 36 +- ARW.WebApi/appsettings.json | 8 + .../Kuaidi100/Common/ApiInfoConstant.cs | 250 ++++ .../Kuaidi100/Common/Kuaidi100Config.cs | 42 + .../BOrderOfficialCancelParam.cs | 25 + .../BOrderOfficialOrderParam.cs | 116 ++ .../BOrderOfficialQueryDetailParam.cs | 17 + .../BOrderOfficialQueryPriceParam.cs | 32 + .../Kuaidi100/Common/Request/BaseReq.cs | 26 + .../Request/Border/BOrderCallBackParam.cs | 35 + .../Request/Border/BOrderCallBackParamData.cs | 37 + .../Request/Border/BOrderCallBackReq.cs | 20 + .../Request/Border/BOrderCancelParam.cs | 25 + .../Request/Border/BOrderGetCodeParam.cs | 21 + .../Common/Request/Border/BOrderParam.cs | 66 + .../Common/Request/Border/BOrderQueryParam.cs | 18 + .../Request/Bsamecity/BsamecityAddfeeParam.cs | 31 + .../Request/Bsamecity/BsamecityCancelParam.cs | 31 + .../Request/Bsamecity/BsamecityOrderParam.cs | 162 +++ .../Common/Request/Bsamecity/Goods.cs | 26 + .../Common/Request/Cloud/AttachmentParam.cs | 48 + .../Common/Request/Cloud/CommandParam.cs | 28 + .../Common/Request/Cloud/CustomParam.cs | 40 + .../Common/Request/Cloud/DevStatusParam.cs | 16 + .../Common/Request/Cloud/ImageInfo.cs | 28 + .../Common/Request/Cloud/ParcelsBillsParam.cs | 37 + .../Common/Request/Cloud/PrintOldParam.cs | 16 + .../Request/Corder/COrderCancelParam.cs | 25 + .../Common/Request/Corder/COrderParam.cs | 94 ++ .../Request/Corder/COrderQueryPriceParam.cs | 28 + .../Common/Request/Electronic/CancelPrint.cs | 55 + .../Request/Electronic/Html/PrintHtmlParam.cs | 131 ++ .../Request/Electronic/Html/PrintHtmlReq.cs | 26 + .../Request/Electronic/Image/PrintImgParam.cs | 160 +++ .../Request/Electronic/Image/PrintImgReq.cs | 25 + .../Common/Request/Electronic/ManInfo.cs | 29 + .../Electronic/Print/PrintCloudParam.cs | 144 ++ .../Request/Electronic/Print/PrintCloudReq.cs | 26 + .../Common/Request/Electronic/ocr/OcrParam.cs | 39 + .../Common/Request/Label/CustomPrintParam.cs | 49 + .../Common/Request/Label/DeliveryTimeParam.cs | 41 + .../Common/Request/Label/OrderParam.cs | 375 +++++ .../Common/Request/Label/RepeatPrintParam.cs | 23 + .../Common/Request/QueryTrackParam.cs | 47 + .../Kuaidi100/Common/Request/QueryTrackReq.cs | 19 + .../Common/Request/Sms/SendSmsReq.cs | 39 + .../Request/Subscribe/SubscribeParam.cs | 37 + .../Request/Subscribe/SubscribeParameters.cs | 59 + .../Common/Request/Subscribe/SubscribeReq.cs | 14 + .../internationalshipment/CancelReq.cs | 38 + .../internationalshipment/CustomsClearance.cs | 28 + .../internationalshipment/ExportInfo.cs | 66 + .../internationalshipment/InterManInfo.cs | 82 ++ .../internationalshipment/InvoiceInfo.cs | 39 + .../internationalshipment/PackageInfo.cs | 34 + .../Request/internationalshipment/Payment.cs | 23 + .../internationalshipment/ShipmentReq.cs | 147 ++ .../internationalshipment/ValidateInfo.cs | 34 + .../reachable/ExpressReachableParam.cs | 42 + .../Common/Request/samecity/OrderGoods.cs | 30 + .../Request/samecity/SameCityAuthParam.cs | 26 + .../Request/samecity/SameCityCancelParam.cs | 27 + .../Request/samecity/SameCityOrderParam.cs | 118 ++ .../Request/samecity/SameCityQueryParam.cs | 22 + .../Request/thirdPlatform/BranchInfoParam.cs | 30 + .../Request/thirdPlatform/CommitTaskParam.cs | 42 + .../thirdPlatform/PlatformAuthParam.cs | 30 + .../Request/thirdPlatform/StoreAuthParam.cs | 26 + .../Request/thirdPlatform/UploadNumParam.cs | 34 + Infrastructure/Kuaidi100/Core/AutoNum.cs | 12 + Infrastructure/Kuaidi100/Core/BOrder.cs | 79 ++ .../Kuaidi100/Core/BOrderOfficial.cs | 78 + .../Kuaidi100/Core/BsamecityOrder.cs | 95 ++ Infrastructure/Kuaidi100/Core/COrder.cs | 64 + Infrastructure/Kuaidi100/Core/CloudPrint.cs | 106 ++ .../Kuaidi100/Core/ExpressReachable.cs | 27 + .../Kuaidi100/Core/InternationalShipment.cs | 29 + Infrastructure/Kuaidi100/Core/LabelV2.cs | 78 + Infrastructure/Kuaidi100/Core/Ocr.cs | 18 + Infrastructure/Kuaidi100/Core/PrintCloud.cs | 37 + Infrastructure/Kuaidi100/Core/PrintHtml.cs | 19 + Infrastructure/Kuaidi100/Core/PrintImg.cs | 19 + Infrastructure/Kuaidi100/Core/QueryTrack.cs | 21 + .../Kuaidi100/Core/QueryTrackWithMap.cs | 21 + Infrastructure/Kuaidi100/Core/SameCity.cs | 78 + Infrastructure/Kuaidi100/Core/SendSms.cs | 19 + Infrastructure/Kuaidi100/Core/Subscribe.cs | 22 + .../Kuaidi100/Core/SubscribeWithMap.cs | 22 + .../Kuaidi100/Core/ThirdPlatformOrder.cs | 93 ++ Infrastructure/Kuaidi100/Kuaidi100.cs | 1254 +++++++++++++++++ Infrastructure/Kuaidi100/Utils/DateUtils.cs | 13 + Infrastructure/Kuaidi100/Utils/HttpUtils.cs | 79 ++ .../Utils/ObjectToDictionaryUtils.cs | 33 + Infrastructure/Kuaidi100/Utils/SignUtils.cs | 17 + 101 files changed, 6237 insertions(+), 30 deletions(-) create mode 100644 ARW.Model/Vo/Api/OrderManage/Orders/Trajectory.cs create mode 100644 ARW.Model/Vo/Api/OrderManage/Orders/TrajectoryNode.cs create mode 100644 ARW.Model/Vo/Api/OrderManage/Orders/TrajectoryVo.cs create mode 100644 Infrastructure/Kuaidi100/Common/ApiInfoConstant.cs create mode 100644 Infrastructure/Kuaidi100/Common/Kuaidi100Config.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/BOrderOfficial/BOrderOfficialCancelParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/BOrderOfficial/BOrderOfficialOrderParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/BOrderOfficial/BOrderOfficialQueryDetailParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/BOrderOfficial/BOrderOfficialQueryPriceParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/BaseReq.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Border/BOrderCallBackParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Border/BOrderCallBackParamData.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Border/BOrderCallBackReq.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Border/BOrderCancelParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Border/BOrderGetCodeParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Border/BOrderParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Border/BOrderQueryParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Bsamecity/BsamecityAddfeeParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Bsamecity/BsamecityCancelParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Bsamecity/BsamecityOrderParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Bsamecity/Goods.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Cloud/AttachmentParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Cloud/CommandParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Cloud/CustomParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Cloud/DevStatusParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Cloud/ImageInfo.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Cloud/ParcelsBillsParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Cloud/PrintOldParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Corder/COrderCancelParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Corder/COrderParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Corder/COrderQueryPriceParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Electronic/CancelPrint.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Electronic/Html/PrintHtmlParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Electronic/Html/PrintHtmlReq.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Electronic/Image/PrintImgParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Electronic/Image/PrintImgReq.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Electronic/ManInfo.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Electronic/Print/PrintCloudParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Electronic/Print/PrintCloudReq.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Electronic/ocr/OcrParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Label/CustomPrintParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Label/DeliveryTimeParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Label/OrderParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Label/RepeatPrintParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/QueryTrackParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/QueryTrackReq.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Sms/SendSmsReq.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Subscribe/SubscribeParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Subscribe/SubscribeParameters.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/Subscribe/SubscribeReq.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/internationalshipment/CancelReq.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/internationalshipment/CustomsClearance.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/internationalshipment/ExportInfo.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/internationalshipment/InterManInfo.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/internationalshipment/InvoiceInfo.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/internationalshipment/PackageInfo.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/internationalshipment/Payment.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/internationalshipment/ShipmentReq.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/internationalshipment/ValidateInfo.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/reachable/ExpressReachableParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/samecity/OrderGoods.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/samecity/SameCityAuthParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/samecity/SameCityCancelParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/samecity/SameCityOrderParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/samecity/SameCityQueryParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/thirdPlatform/BranchInfoParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/thirdPlatform/CommitTaskParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/thirdPlatform/PlatformAuthParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/thirdPlatform/StoreAuthParam.cs create mode 100644 Infrastructure/Kuaidi100/Common/Request/thirdPlatform/UploadNumParam.cs create mode 100644 Infrastructure/Kuaidi100/Core/AutoNum.cs create mode 100644 Infrastructure/Kuaidi100/Core/BOrder.cs create mode 100644 Infrastructure/Kuaidi100/Core/BOrderOfficial.cs create mode 100644 Infrastructure/Kuaidi100/Core/BsamecityOrder.cs create mode 100644 Infrastructure/Kuaidi100/Core/COrder.cs create mode 100644 Infrastructure/Kuaidi100/Core/CloudPrint.cs create mode 100644 Infrastructure/Kuaidi100/Core/ExpressReachable.cs create mode 100644 Infrastructure/Kuaidi100/Core/InternationalShipment.cs create mode 100644 Infrastructure/Kuaidi100/Core/LabelV2.cs create mode 100644 Infrastructure/Kuaidi100/Core/Ocr.cs create mode 100644 Infrastructure/Kuaidi100/Core/PrintCloud.cs create mode 100644 Infrastructure/Kuaidi100/Core/PrintHtml.cs create mode 100644 Infrastructure/Kuaidi100/Core/PrintImg.cs create mode 100644 Infrastructure/Kuaidi100/Core/QueryTrack.cs create mode 100644 Infrastructure/Kuaidi100/Core/QueryTrackWithMap.cs create mode 100644 Infrastructure/Kuaidi100/Core/SameCity.cs create mode 100644 Infrastructure/Kuaidi100/Core/SendSms.cs create mode 100644 Infrastructure/Kuaidi100/Core/Subscribe.cs create mode 100644 Infrastructure/Kuaidi100/Core/SubscribeWithMap.cs create mode 100644 Infrastructure/Kuaidi100/Core/ThirdPlatformOrder.cs create mode 100644 Infrastructure/Kuaidi100/Kuaidi100.cs create mode 100644 Infrastructure/Kuaidi100/Utils/DateUtils.cs create mode 100644 Infrastructure/Kuaidi100/Utils/HttpUtils.cs create mode 100644 Infrastructure/Kuaidi100/Utils/ObjectToDictionaryUtils.cs create mode 100644 Infrastructure/Kuaidi100/Utils/SignUtils.cs diff --git a/ARW.Model/Vo/Api/OrderManage/Orders/OrderApiVo.cs b/ARW.Model/Vo/Api/OrderManage/Orders/OrderApiVo.cs index 35e2b38..0bfc0ec 100644 --- a/ARW.Model/Vo/Api/OrderManage/Orders/OrderApiVo.cs +++ b/ARW.Model/Vo/Api/OrderManage/Orders/OrderApiVo.cs @@ -124,7 +124,7 @@ namespace ARW.Model.Vo.Api.OrderManage.Orders /// - /// 订单状态 + /// 订单状态(1: 待付款 2: 待发货 3: 待收货 4: 已完成 5:待取消) /// public int OrderStatus { get; set; } @@ -177,10 +177,16 @@ namespace ARW.Model.Vo.Api.OrderManage.Orders public Logistics LogisticsVO { get; set; } - /// + /// + /// 物流状态 + /// + public TrajectoryVo TrajectoryVos { get; set; } + + + /// /// 自动取消时间 /// - public DateTime AutoCancelTime { get; set; } + public DateTime? AutoCancelTime { get; set; } /// diff --git a/ARW.Model/Vo/Api/OrderManage/Orders/Trajectory.cs b/ARW.Model/Vo/Api/OrderManage/Orders/Trajectory.cs new file mode 100644 index 0000000..e0f7c99 --- /dev/null +++ b/ARW.Model/Vo/Api/OrderManage/Orders/Trajectory.cs @@ -0,0 +1,48 @@ +using Newtonsoft.Json; +using OfficeOpenXml.Attributes; +using SqlSugar; +using System; +using System.Collections.Generic; + +namespace ARW.Model.Vo.Api.OrderManage.Orders +{ + /// + /// 物流状态展示对象Api + /// + /// @author lwh + /// @date 2023-10-19 + /// + public class Trajectory + { + + /// + /// 描述 : 标题 + /// + public string Title { get; set; } + + + /// + /// 描述 : 图标 + /// + public string Icon { get; set; } + + + /// + /// 描述 : 物流节点 + /// + public List Nodes { get; set; } + + + /// + /// 描述 : 是否展示 + /// + public bool IsShow { get; set; } = true; + + + /// + /// 排序 + /// + public int Sort { get; set; } + } + +} diff --git a/ARW.Model/Vo/Api/OrderManage/Orders/TrajectoryNode.cs b/ARW.Model/Vo/Api/OrderManage/Orders/TrajectoryNode.cs new file mode 100644 index 0000000..77f06e5 --- /dev/null +++ b/ARW.Model/Vo/Api/OrderManage/Orders/TrajectoryNode.cs @@ -0,0 +1,43 @@ +using Newtonsoft.Json; +using OfficeOpenXml.Attributes; +using SqlSugar; +using System; +using System.Collections.Generic; + +namespace ARW.Model.Vo.Api.OrderManage.Orders +{ + /// + /// 物流状态详情对象Api + /// + /// @author lwh + /// @date 2023-10-19 + /// + public class TrajectoryNode + { + + /// + /// 描述 : 描述 + /// + public string Status { get; set; } + + + /// + /// 描述 : 时间 + /// + public DateTime? Timestamp { get; set; } + + + /// + /// 描述 : 备注 + /// + public string Remark { get; set; } + + + /// + /// 排序 + /// + public int Sort { get; set; } + + } + +} diff --git a/ARW.Model/Vo/Api/OrderManage/Orders/TrajectoryVo.cs b/ARW.Model/Vo/Api/OrderManage/Orders/TrajectoryVo.cs new file mode 100644 index 0000000..5a48c77 --- /dev/null +++ b/ARW.Model/Vo/Api/OrderManage/Orders/TrajectoryVo.cs @@ -0,0 +1,36 @@ +using Newtonsoft.Json; +using OfficeOpenXml.Attributes; +using SqlSugar; +using System; +using System.Collections.Generic; + +namespace ARW.Model.Vo.Api.OrderManage.Orders +{ + /// + /// 物流状态展示对象Api + /// + /// @author lwh + /// @date 2023-10-20 + /// + public class TrajectoryVo + { + + /// + /// 描述 : 快递单号 + /// + public string LogisticsCompanyCode { get; set; } + + /// + /// 描述 : 物流公司名称 + /// + public string LogisticsCompanyName { get; set; } + + + /// + /// 描述 : 物流节点 + /// + public List Trajectorys { get; set; } + + } + +} diff --git a/ARW.Service/Api/BusinessService/GoodsManager/Goodss/GoodsServiceApi.cs b/ARW.Service/Api/BusinessService/GoodsManager/Goodss/GoodsServiceApi.cs index 986d566..560dfb1 100644 --- a/ARW.Service/Api/BusinessService/GoodsManager/Goodss/GoodsServiceApi.cs +++ b/ARW.Service/Api/BusinessService/GoodsManager/Goodss/GoodsServiceApi.cs @@ -132,7 +132,14 @@ namespace ARW.Service.Api.BusinessService.GoodsManager.Goodss }); - return await query.ToPageAsync(parm); + var list = await query.ToPageAsync(parm); + + foreach (var item in list.Result) + { + item.Thumb = item.Images.Split(",").First(); + } + + return list; } diff --git a/ARW.Service/Api/BusinessService/OrderManage/Orders/OrderServiceApi.cs b/ARW.Service/Api/BusinessService/OrderManage/Orders/OrderServiceApi.cs index b88b9ec..54836b4 100644 --- a/ARW.Service/Api/BusinessService/OrderManage/Orders/OrderServiceApi.cs +++ b/ARW.Service/Api/BusinessService/OrderManage/Orders/OrderServiceApi.cs @@ -22,13 +22,13 @@ using ARW.Model.Models.Business.GoodsManager.GoodsComments; using ARW.Repository.Business.GoodsManager.GoodsComments; using ARW.Repository.Business.ShopManager.Shops; using ARW.Model.Models.Business.ShopManager.Shops; -using System.Security.Cryptography.X509Certificates; -using ARW.Model.Vo.Api.GoodsManager.Goodss; using Newtonsoft.Json; using Senparc.CO2NET.Extensions; using ARW.Repository.Business.OrderManage.OrderCustomerAddreses; -using ARW.Repository.Business.Custom.Regions; using ARW.Service.Business.IBusinessService.Custom.Regions; +using Infrastructure.Kuaidi100; +using ARW.Model.Models.Business.LogisticsManage.LogisticsCompanys; +using ARW.Repository.Business.LogisticsManage.LogisticsCompanys; namespace ARW.Service.Api.BusinessService.OrderManage.Orders { @@ -50,9 +50,10 @@ namespace ARW.Service.Api.BusinessService.OrderManage.Orders private readonly SpecRepository _SpecRepository; private readonly SpecValueRepository _SpecValueRepository; private readonly ShopRepository _ShopRepository; + private readonly LogisticsCompanyRepository _LogisticsCompanyRepository; private readonly IRegionService _RegionService; - public OrderServiceImplApi(OrderRepository OrderRepository, OrderGoodsRepository orderGoodsRepository, GoodsRepository goodsRepository, GoodsSkuRepository goodsSkuRepository, SpecRepository specRepository, SpecValueRepository specValueRepository, GoodsCommentRepository goodsCommentRepository, ShopRepository shopRepository, OrderCustomerAddressRepository orderCustomerAddressRepository, IRegionService regionService) + public OrderServiceImplApi(OrderRepository OrderRepository, OrderGoodsRepository orderGoodsRepository, GoodsRepository goodsRepository, GoodsSkuRepository goodsSkuRepository, SpecRepository specRepository, SpecValueRepository specValueRepository, GoodsCommentRepository goodsCommentRepository, ShopRepository shopRepository, OrderCustomerAddressRepository orderCustomerAddressRepository, IRegionService regionService, LogisticsCompanyRepository logisticsCompanyRepository) { this._OrderRepository = OrderRepository; _OrderGoodsRepository = orderGoodsRepository; @@ -64,6 +65,7 @@ namespace ARW.Service.Api.BusinessService.OrderManage.Orders _ShopRepository = shopRepository; _OrderCustomerAddressRepository = orderCustomerAddressRepository; _RegionService = regionService; + _LogisticsCompanyRepository = logisticsCompanyRepository; } #region Api接口代码 @@ -282,7 +284,7 @@ namespace ARW.Service.Api.BusinessService.OrderManage.Orders TotalAmount = s.OrderAmount, GoodsAmount = s.GoodsTotalAmoun, PaymentAmount = s.PayPrice, - FreightFee = s.OrderAmount, + FreightFee = s.ExpressPrice, CouponAmount = s.CouponMoney, Remark = s.OrderRemark, }).Take(1); @@ -296,6 +298,8 @@ namespace ARW.Service.Api.BusinessService.OrderManage.Orders json = json.Substring(0, json.Length - 1); var data = JsonConvert.DeserializeObject(json); + var order = await _OrderRepository.GetFirstAsync(s => s.OrderGuid == data.OrderGuid); + // 订单商品 var orderItemList = new List(); var orderGoodsList = await _OrderGoodsRepository.GetListAsync(s => s.OrderGuid == data.OrderGuid); @@ -337,11 +341,13 @@ namespace ARW.Service.Api.BusinessService.OrderManage.Orders data.LogisticsVO = logistics; } - // 处理订单状态 - //if () - //{ + /* 处理物流状态 */ + data = GetTrajectory(order, data); + + /* 处理订单状态 */ + data = GetOrderStatus(order, data); + - //} json = data.ToJson(); } @@ -351,6 +357,126 @@ namespace ARW.Service.Api.BusinessService.OrderManage.Orders + /// + /// 处理物流状态 + /// + /// + /// + public OrderApiDetailsVo GetTrajectory(Order order, OrderApiDetailsVo data) + { + data.TrajectoryVos = new TrajectoryVo(); + var trajectoryList = new List(); + + // 已下单(待发货) + if (order.OrderStatus == 1) + { + var trajectoryNodeList1 = new List { GetTrajectoryNode("订单已提交", order.Create_time) }; + var trajectory1 = GetTrajectory("", "", trajectoryNodeList1, 3); + trajectoryList.Add(trajectory1); + + var trajectoryNodeList2 = new List { GetTrajectoryNode("订单已经支付成功,支付方式为:微信支付", order.PayTime) }; + var trajectory2 = GetTrajectory("已下单", "https://cdn-we-retail.ym.tencent.com/web/trajectoryIcons/ordered.svg", trajectoryNodeList2, 2); + trajectoryList.Add(trajectory2); + + // 运输中(已发货,待收货) + if (order.DeliveryStatus == 2 && order.ReceiptStatus == 1 && order.PayStatus == 2 && order.OrderStatus == 1) + { + data.TrajectoryVos.LogisticsCompanyCode = order.LogisticsTrackingNumber; + data.TrajectoryVos.LogisticsCompanyName = order.LogisticsCompany; + + var trajectoryNodeList3 = new List { GetTrajectoryNode($"商家已发货,物流承运商:{order.LogisticsCompany}", order.DeliveryTime) }; + + // 对接快递100接口 + //var company = _LogisticsCompanyRepository.GetFirst(s => s.LogisticsCompanyGuid == order.LogisticsCompanyGuid); + //var trackRes = Kuaidi100.GetQueryTrack(company.LogisticsCompanyCode, order.LogisticsTrackingNumber); + + var trajectory3 = GetTrajectory("已发货", "deliver", trajectoryNodeList3, 1); + trajectoryList.Add(trajectory3); + } + } + + //foreach (var item in trajectoryList) + //{ + // item.Nodes = item.Nodes.OrderBy(s => s.Sort).ToList(); + //} + trajectoryList = trajectoryList.OrderBy(s => s.Sort).ToList(); + data.TrajectoryVos.Trajectorys = trajectoryList; + return data; + } + + + public Trajectory GetTrajectory(string title, string icon, List trajectoryNodeList, int sort) + { + var trajectory = new Trajectory(); + trajectory.Title = title; + trajectory.Icon = icon; + trajectory.Nodes = trajectoryNodeList; + trajectory.Sort = sort; + + return trajectory; + } + + + public TrajectoryNode GetTrajectoryNode(string status, DateTime? time) + { + var trajectoryNode = new TrajectoryNode(); + trajectoryNode.Status = status; + trajectoryNode.Timestamp = time; + return trajectoryNode; + } + + + + /// + /// 处理订单状态 + /// + /// + /// + public OrderApiDetailsVo GetOrderStatus(Order order, OrderApiDetailsVo data) + { + // 待付款 + if (order.PayStatus == 1 && order.OrderStatus == 1) + { + data.AutoCancelTime = order.Create_time.AddMinutes(30); ; + data.OrderStatus = 1; + data.OrderStatusName = "待付款"; + } + // 待发货 + if (order.DeliveryStatus == 1 && order.PayStatus == 2 && order.OrderStatus == 1) + { + data.OrderStatus = 2; + data.OrderStatusName = "待发货"; + } + // 待收货 + if (order.DeliveryStatus == 2 && order.ReceiptStatus == 1 && order.PayStatus == 2 && order.OrderStatus == 1) + { + data.OrderStatus = 2; + data.OrderStatusName = "待收货"; + } + // 已完成 + if (order.PayStatus == 2 && order.OrderStatus == 4) + { + data.OrderStatus = 2; + data.OrderStatusName = "已完成"; + } + // 已取消 + if (order.OrderStatus == 2) + { + data.OrderStatus = 2; + data.OrderStatusName = "已取消"; + } + // 待取消 + if (order.OrderStatus == 3) + { + data.OrderStatus = 5; + data.OrderStatusName = "待取消"; + } + + return data; + } + + + #region 业务方法调用 diff --git a/ARW.Tasks/TaskScheduler/Business/SubscribeTask_Job.cs b/ARW.Tasks/TaskScheduler/Business/SubscribeTask_Job.cs index ec3bd98..48a5274 100644 --- a/ARW.Tasks/TaskScheduler/Business/SubscribeTask_Job.cs +++ b/ARW.Tasks/TaskScheduler/Business/SubscribeTask_Job.cs @@ -71,7 +71,7 @@ namespace ARW.Tasks.TaskScheduler.Business { logger.Info("执行到了这里" + item.OpenId); logger.Info("一共有" + waitPushList.Count + "个"); - var res = await Subscribe.SubscribeMessage(item.TemplateId, item.OpenId, templateMessageData); + var res = await Infrastructure.WeChat.SubScribe.Subscribe.SubscribeMessage(item.TemplateId, item.OpenId, templateMessageData); logger.Info("推送结果:" + res); if (res == "消息已发送,请注意查收") diff --git a/ARW.WebApi/Controllers/Business/OrderManage/Orders/OrderController.cs b/ARW.WebApi/Controllers/Business/OrderManage/Orders/OrderController.cs index 0bcc0de..5b3ecde 100644 --- a/ARW.WebApi/Controllers/Business/OrderManage/Orders/OrderController.cs +++ b/ARW.WebApi/Controllers/Business/OrderManage/Orders/OrderController.cs @@ -154,25 +154,29 @@ namespace ARW.WebApi.Controllers.Business.OrderManage.Orders var order = await _OrderService.GetFirstAsync(s => s.OrderGuid == parm.OrderGuid); var payment = await _PaymentService.GetFirstAsync(s => s.PaymentGuid == order.PaymentGuid); - Pay pay = new Pay(_httpClient); - var transactionId = payment.PaymentWeixinNumber; - string paymentRefundNumber = ""; - if (!string.IsNullOrEmpty(payment.PaymentRefundNumber)) + if (parm.IsAgree) { - paymentRefundNumber = payment.PaymentRefundNumber; - } - - var totalFee = payment.PaymentMoney * 100; - var canleRes = await pay.Refund(transactionId, totalFee, paymentRefundNumber,"商品退款"); - if (canleRes.ResultCode.Success == false) - throw new CustomException("订单退款失败!"); - else - { - var respones = _PaymentService.UpdateAsync(f => new Payment + Pay pay = new Pay(_httpClient); + var transactionId = payment.PaymentWeixinNumber; + string paymentRefundNumber = ""; + if (!string.IsNullOrEmpty(payment.PaymentRefundNumber)) { - PaymentRefundNumber = canleRes.out_refund_no, - }, f => f.PaymentNumber == canleRes.out_trade_no); + paymentRefundNumber = payment.PaymentRefundNumber; + } + + var totalFee = payment.PaymentMoney * 100; + var canleRes = await pay.Refund(transactionId, totalFee, paymentRefundNumber, "商品退款"); + if (canleRes.ResultCode.Success == false) + throw new CustomException("订单退款失败!"); + else + { + var respones = _PaymentService.UpdateAsync(f => new Payment + { + PaymentRefundNumber = canleRes.out_refund_no, + }, f => f.PaymentNumber == canleRes.out_trade_no); + } } + var res = await _OrderService.CancelOrder(parm); return SUCCESS(res); diff --git a/ARW.WebApi/appsettings.json b/ARW.WebApi/appsettings.json index fd59a49..5b727c1 100644 --- a/ARW.WebApi/appsettings.json +++ b/ARW.WebApi/appsettings.json @@ -121,6 +121,14 @@ } ] }, + "Kuaidi100Setting": { + "key": "QsJHChwz3944", //授权key + "customer": "5279A349F41783B3ECF3140056E76FAB", //customer + "secret": "fcf0f7ae2f484d62be34a402f15cec3d", //secret + "userid": "ff5c88135d414a13aa0c2b21e893fd46", //userid + "siid": "", // 快递100打印机或者云盒设备码(使用电子面单打印接口或云打印相关接口必填) + "tid": "" // 短信模板id + }, //Senparc.Weixin SDK 设置 "SenparcWeixinSetting": { //以下为 Senparc.Weixin 的 SenparcWeixinSetting 微信配置 diff --git a/Infrastructure/Kuaidi100/Common/ApiInfoConstant.cs b/Infrastructure/Kuaidi100/Common/ApiInfoConstant.cs new file mode 100644 index 0000000..b075b88 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/ApiInfoConstant.cs @@ -0,0 +1,250 @@ +using System; + + +namespace Common +{ + public class ApiInfoConstant + { + /// + /// 查询url + /// + public const string QUERY_URL = "http://poll.kuaidi100.com/poll/query.do"; + + /// + /// 订阅url + /// + public const string SUBSCRIBE_URL = "https://poll.kuaidi100.com/poll"; + /// + /// 地图轨迹查询url + /// + public const string QUERY_URL_WITH_MAP = "https://poll.kuaidi100.com/poll/maptrack.do"; + + /// + /// 地图轨迹订阅url + /// + public const string SUBSCRIBE_URL_WITH_MAP = "http://poll.kuaidi100.com/pollmap"; + /// + /// 订阅SCHEMA + /// + public const string SUBSCRIBE_SCHEMA = "json"; + /// + /// 智能单号识别url + /// + public const string AUTO_NUM_URL = "http://www.kuaidi100.com/autonumber/auto?num={0}&key={1}"; + /// + /// 电子面单html url + /// + public const string ELECTRONIC_ORDER_HTML_URL = "http://poll.kuaidi100.com/eorderapi.do"; + /// + /// 电子面单html方法 + /// + public const string ELECTRONIC_ORDER_HTML_METHOD = "getElecOrder"; + /// + /// 电子面单获取图片 url + /// + public const string ELECTRONIC_ORDER_PIC_URL = "https://poll.kuaidi100.com/printapi/printtask.do"; + /// + /// 电子面单获取图片 + /// + public const string ELECTRONIC_ORDER_PIC_METHOD = "getPrintImg"; + /// + /// 电子面单打印 url + /// + public const string ELECTRONIC_ORDER_PRINT_URL = "https://poll.kuaidi100.com/printapi/printtask.do"; + /// + /// 电子面单打印方法 + /// + public const string ELECTRONIC_ORDER_PRINT_METHOD = "eOrder"; + /// + /// 菜鸟淘宝账号授权 + /// + public const string AUTH_THIRD_URL = "https://poll.kuaidi100.com/printapi/authThird.do"; + /// + /// 云打印url + /// + public const string CLOUD_PRINT_URL = "http://poll.kuaidi100.com/printapi/printtask.do?method={0}&t={1}&key={2}&sign={3}¶m={4}"; + /// + /// 自定义打印方法 + /// + public const string CLOUD_PRINT_CUSTOM_METHOD = "printOrder"; + /// + /// 附件打印方法 + /// + public const string CLOUD_PRINT_ATTACHMENT_METHOD = "imgOrder"; + /// + /// 复打方法 + /// + public const string CLOUD_PRINT_OLD_METHOD = "printOld"; + /// + /// 硬件状态接口方法 + /// + public const string CLOUD_PRINT_DEV_STATUS = "devstatus"; + /// + /// 短信url + /// + public const string SEND_SMS_URL = "http://apisms.kuaidi100.com:9502/sms/send.do"; + /// + /// 商家寄件 + /// + public const string B_ORDER_URL = "https://order.kuaidi100.com/order/borderbestapi.do"; + /// + /// 商家寄件查询运力 + /// + public const string B_ORDER_QUERY_TRANSPORT_CAPACITY_METHOD = "querymkt"; + /// + /// 商家寄件下单 + /// + public const string B_ORDER_SEND_METHOD = "bOrderBest"; + /// + /// 商家寄件获取验证码 + /// + public const string B_ORDER_CODE_METHOD = "getCode"; + /// + /// 商家寄件取消 + /// + public const string B_ORDER_CANCEL_METHOD = "cancelBest"; + /// + /// 商家寄件(官方寄件)请求url + /// + public const string B_ORDER_OFFICIAL_URL = "https://poll.kuaidi100.com/order/borderapi.do"; + /// + /// 商家寄件(官方寄件)下单 + /// + public const string B_ORDER_OFFICIAL_ORDER_METHOD = "bOrder"; + /// + /// 商家寄件(官方寄件)取消 + /// + public const string B_ORDER_OFFICIAL_CANCEL_METHOD = "cancel"; + /// + /// 商家寄件(官方寄件)查询价格 + /// + public const string B_ORDER_OFFICIAL_PRICE_METHOD = "Price"; + + /// + /// 同城配送请求url + /// + public const string SAME_CITY_ORDER_URL = "https://order.kuaidi100.com/sameCity/order"; + /// + /// 同城配送授权方法 + /// + public const string SAME_CITY_AUTH_METHOD = "auth"; + /// + /// 同城配送下单方法 + /// + public const string SAME_CITY_ORDER_METHOD = "order"; + /// + /// 同城配送查询订单方法 + /// + public const string SAME_CITY_QUERY_METHOD = "query"; + /// + /// 同城配送取消订单方法 + /// + public const string SAME_CITY_CANCEL_METHOD = "cancel"; + /// + /// 取消方法 + /// + public const string CANCEL_METHOD = "cancel"; + /// + /// 快递预估时效 + /// + public const string TIME = "time"; + /// + /// 指令打印方法 + /// + public const string CLOUD_PRINT_COMMAND = "printCommand"; + /// + /// 指令打印 + /// + public const string INTERNATIONAL_SHIPMENT_URL = "http://api.kuaidi100.com/sendAssistant/order/apiCall"; + /// + /// 订单导入授权url + /// + public const string THIRD_PLATFORM_ORDER_SHOP_AUTHORIZE_url = "https://api.kuaidi100.com/ent/shop/authorize"; + /// + /// 订单导入提交订单获取任务接口 + /// + public const string THIRD_PLATFORM_ORDER_COMMIT_TASK = "https://api.kuaidi100.com/ent/order/task"; + /// + /// 订单导入提交订单回填单号 + /// + public const string THIRD_PLATFORM_ORDER_UPLOAD_NUM = "https://api.kuaidi100.com/ent/logistics/send"; + /// + /// 发货单接口url + /// + public const string BILL_PARCELS_URL = "https://poll.kuaidi100.com/print/billparcels.do"; + /// + /// 发货单接口方法 + /// + public const string BILL_PARCELS_METHOD = "billparcels"; + + /// + /// 面单余额接口方法 + /// + public const string THIRD_PLATFORM_BRANCH_INFO_METHOD = "getThirdInfo"; + + /// + /// 快递面单OCR识别接口 + /// + public const string OCR_URL = "http://api.kuaidi100.com/elec/detocr"; + /// + /// 新模板编辑器请求url + /// + public const string NEW_TEMPLATE_URL = "https://api.kuaidi100.com/label/order"; + /// + /// 下单 + /// + public const String ORDER = "order"; + /// + /// 自定义 + /// + public const String CUSTOM = "custom"; + /// + /// 详情 + /// + public const String DETAIL = "detail"; + /// + /// C端寄件下单接口url + /// + public const string C_ORDER_URL = "https://order.kuaidi100.com/order/corderapi.do"; + /// + /// 价格 + /// + public const string PRICE = "price"; + /// + /// cOrder + /// + public const string CORDER = "cOrder"; + /// + /// 快递可用性接口url + /// + public const string EXPRESS_REACHABLE_URL = "http://api.kuaidi100.com/reachable.do"; + /// + /// 快递可用性接口方法 + /// + public const string EXPRESS_REACHABLE_METHOD = "reachable"; + /// + /// 同城寄件接口url + /// + public const string BSAMECITY_EXPRESS_URL = "https://api.kuaidi100.com/bsamecity/order"; + /// + /// 同城寄件-预下单方法 + /// + public const string BSAMECITY_EXPRESS_PRICE = "price"; + /// + /// 同城寄件-下单方法 + /// + public const string BSAMECITY_EXPRESS_ORDER = "order"; + /// + /// 同城寄件-预取消方法 + /// + public const string BSAMECITY_EXPRESS_PRECANCEL = "precancel"; + /// + /// 同城寄件-取消方法 + /// + public const string BSAMECITY_EXPRESS_CANCEL = "cancel"; + /// + /// 同城寄件-加小费方法 + /// + public const string BSAMECITY_EXPRESS_ADDFEE = "addfee"; + } +} diff --git a/Infrastructure/Kuaidi100/Common/Kuaidi100Config.cs b/Infrastructure/Kuaidi100/Common/Kuaidi100Config.cs new file mode 100644 index 0000000..3a29732 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Kuaidi100Config.cs @@ -0,0 +1,42 @@ + +namespace Common{ + /// + /// 快递100的基础账号信息,可以在这里获取 + /// https://poll.kuaidi100.com/manager/page/myinfo/enterprise + /// + public class KuaiDi100Config + { + /// + /// 授权key + /// + public string key { get; set; } + /// + /// customer + /// + public string customer { get; set; } + /// + /// secret + /// + public string secret { get; set; } + /// + /// 快递100打印机或者云盒设备码(使用电子面单打印接口或云打印相关接口必填) + /// + public string siid { get; set; } + /// + /// userid + /// + public string userid { get; set; } + /// + /// 短信模板id + /// + public string tid { get; set; } + /// + /// 电子面单快递公司账号信息(月结账号) + /// + public string partnerId { get; set; } + /// + /// 电子面单快递公司账号信息(账号密码) + /// + public string partnerKey { get; set; } + } +} diff --git a/Infrastructure/Kuaidi100/Common/Request/BOrderOfficial/BOrderOfficialCancelParam.cs b/Infrastructure/Kuaidi100/Common/Request/BOrderOfficial/BOrderOfficialCancelParam.cs new file mode 100644 index 0000000..515051b --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/BOrderOfficial/BOrderOfficialCancelParam.cs @@ -0,0 +1,25 @@ +using Newtonsoft.Json; + +namespace Common.Request.BorderOfficial +{ + public class BOrderOfficialCancelParam { + /// + /// 任务ID + /// + public string taskId {get; set;} + /// + /// 订单ID + /// + public string orderId {get; set;} + /// + /// 取消原因,例:暂时不寄件 + /// + public string cancelMsg {get; set;} + + public override string ToString() + { + return JsonConvert.SerializeObject(this,Formatting.Indented,new JsonSerializerSettings(){NullValueHandling = NullValueHandling.Ignore}); + } + } + +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/BOrderOfficial/BOrderOfficialOrderParam.cs b/Infrastructure/Kuaidi100/Common/Request/BOrderOfficial/BOrderOfficialOrderParam.cs new file mode 100644 index 0000000..7742bba --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/BOrderOfficial/BOrderOfficialOrderParam.cs @@ -0,0 +1,116 @@ +using Newtonsoft.Json; + +namespace Common.Request.BorderOfficial +{ + public class BOrderOfficialOrderParam { + + + /// + /// 快递公司的编码,一律用小写字母,见《快递公司编码》 + /// + public string kuaidicom {get; set;} + /// + /// 收件人姓名 + /// + public string recManName {get; set;} + /// + /// 收件人的手机号,手机号和电话号二者其一必填 + /// + public string recManMobile {get; set;} + /// + /// 收件人所在完整地址,如广东深圳市深圳市南山区科技南十二路2号金蝶软件园 + /// + public string recManPrintAddr {get; set;} + /// + /// 寄件人姓名 + /// + public string sendManName {get; set;} + /// + /// 寄件人的手机号,手机号和电话号二者其一必填 + /// + public string sendManMobile {get; set;} + /// + /// 寄件人所在的完整地址,如广东深圳市深圳市南山区科技南十二路2号金蝶软件园B10 + /// + public string sendManPrintAddr {get; set;} + /// + /// 物品名称,例:文件 + /// + public string cargo {get; set;} + /// + /// 重量 + /// + public string weight {get; set;} + /// + /// 备注 + /// + public string remark {get; set;} + /// + /// 签名用随机字符串 + /// + public string salt {get; set;} + /// + /// callBackUrl订单信息回调 + /// + public string callBackUrl {get; set;} + /// + /// 快递业务服务类型,例:标准快递,默认为标准快递 + /// + public string serviceType {get; set;} + /// + /// 预约日期,例如:今天/明天/后天 + /// + public string dayType {get; set;} + /// + /// 预约起始时间,24小时制(HH:mm),例如:09:00 + /// + public string pickupStartTime {get; set;} + /// + /// 预约截止时间,24小时制(HH:mm),例如:10:00 + /// + public string pickupEndTime {get; set;} + /// + /// 保价额度,单位:元 + /// + public string valinsPay {get; set;} + /// + /// 是否口令签收,Y:需要 N: 不需要,默认值为N(德邦快递专属参数) + /// + public string passwordSigning {get; set;} + /// + /// 是否开启订阅功能 0:不开启(默认) 1:开启 说明开启订阅功能时:pollCallBackUrl必须填入 此功能只针对有快递单号的单 + /// + public string op {get; set;} + /// + /// 如果op设置为1时,pollCallBackUrl必须填入,用于跟踪回调 + /// + public string pollCallBackUrl {get; set;} + /// + /// 添加此字段表示开通行政区域解析功能 。 + /// 0:关闭(默认) + /// 1:开通行政区域解析功能以及物流轨迹增加物流状态名称 + /// 4:开通行政解析功能以及物流轨迹增加物流高级状态名称、状态值并且返回出发、目的及当前城市信息(详见:快递信息推送接口文档) + /// + public string resultv2 {get; set;} + /// + /// 面单返回类型,默认为空,不返回面单内容。10:设备打印,20:生成图片短链回调。 + /// + public string returnType {get; set;} + /// + /// 设备码,returnType为10时必填 + /// + public string siid {get; set;} + /// + /// 模板编码,通过管理后台的电子面单模板信息获取 ,returnType不为空时必填 + /// + public string tempid {get; set;} + /// + /// 打印状态回调地址,returnType为10时必填 + /// + public string printCallBackUrl {get; set;} + public override string ToString() + { + return JsonConvert.SerializeObject(this,Formatting.Indented,new JsonSerializerSettings(){NullValueHandling = NullValueHandling.Ignore}); + } + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/BOrderOfficial/BOrderOfficialQueryDetailParam.cs b/Infrastructure/Kuaidi100/Common/Request/BOrderOfficial/BOrderOfficialQueryDetailParam.cs new file mode 100644 index 0000000..a6ad315 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/BOrderOfficial/BOrderOfficialQueryDetailParam.cs @@ -0,0 +1,17 @@ +using Newtonsoft.Json; + +namespace Common.Request.BorderOfficial +{ + public class BOrderOfficialQueryDetailParam { + /// + /// 任务ID + /// + public string taskId {get; set;} + + public override string ToString() + { + return JsonConvert.SerializeObject(this,Formatting.Indented,new JsonSerializerSettings(){NullValueHandling = NullValueHandling.Ignore}); + } + } + +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/BOrderOfficial/BOrderOfficialQueryPriceParam.cs b/Infrastructure/Kuaidi100/Common/Request/BOrderOfficial/BOrderOfficialQueryPriceParam.cs new file mode 100644 index 0000000..f68418e --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/BOrderOfficial/BOrderOfficialQueryPriceParam.cs @@ -0,0 +1,32 @@ +using Newtonsoft.Json; + +namespace Common.Request.BorderOfficial +{ + public class BOrderOfficialQueryPriceParam { + /// + /// 快递公司编码 + /// + public string kuaidiCom {get; set;} + /// + /// 出发地地址,最小颗粒到市级,例如:广东省深圳市 + /// + public string sendManPrintAddr {get; set;} + /// + /// 目的地地址,最小颗粒到市级,例如:广东省深圳市 + /// + public string recManPrintAddr {get; set;} + /// + /// 重量 + /// + public string weight {get; set;} + /// + /// 业务类型 + /// + public string serviceType {get; set;} + + public override string ToString() + { + return JsonConvert.SerializeObject(this,Formatting.Indented,new JsonSerializerSettings(){NullValueHandling = NullValueHandling.Ignore}); + } + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/BaseReq.cs b/Infrastructure/Kuaidi100/Common/Request/BaseReq.cs new file mode 100644 index 0000000..8f3dc8a --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/BaseReq.cs @@ -0,0 +1,26 @@ +namespace Common.Request +{ + public class BaseReq{ + + /// + /// 业务类型 + /// + public string method {get; set;} + /// + /// 快递100分配给贵司的的授权key + /// + public string key {get; set;} + /// + /// 加密签名信息:MD5(param+t+key+secret);加密后字符串转大写 + /// + public string sign {get; set;} + /// + /// 当前请求时间戳 + /// + public string t {get; set;} + /// + /// 其他参数 + /// + public T param {get; set;} + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Border/BOrderCallBackParam.cs b/Infrastructure/Kuaidi100/Common/Request/Border/BOrderCallBackParam.cs new file mode 100644 index 0000000..d31693a --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Border/BOrderCallBackParam.cs @@ -0,0 +1,35 @@ +using Newtonsoft.Json; + +namespace Common.Request.Border +{ + public class BOrderCallBackParam { + /// + /// 快递公司的编码,一律用小写字母,见《快递公司编码》,选填。 + /// + public string kuaidicom {get; set;} + /// + /// 快递单号,单号的最大长度是32个字符。 + /// + public string kuaidinum {get; set;} + /// + /// 状态码 + /// + public string status {get; set;} + + /// + /// 状态描述 + /// + public string message {get; set;} + + /// + /// 订单内容 + /// + public BOrderCallBackParamData data {get; set;} + + public override string ToString() + { + return JsonConvert.SerializeObject(this,Formatting.Indented,new JsonSerializerSettings(){NullValueHandling = NullValueHandling.Ignore}); + } + } + +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Border/BOrderCallBackParamData.cs b/Infrastructure/Kuaidi100/Common/Request/Border/BOrderCallBackParamData.cs new file mode 100644 index 0000000..ed60a60 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Border/BOrderCallBackParamData.cs @@ -0,0 +1,37 @@ +using Newtonsoft.Json; + +namespace Common.Request.Border +{ + public class BOrderCallBackParamData { + /// + /// 平台订单ID + /// + public string orderId {get; set;} + /// + /// 订单状态: 1,‘已接单’, 2,‘收件中’, 3,‘改派’, 7,‘快递员修改订单信息’, 9,‘用户主动取消’, 10,‘已取件’, 15,‘已结算’, 99,‘订单已取消’ + /// + public string status {get; set;} + /// + /// 快递员姓名 + /// + public string courierName {get; set;} + /// + /// 快递员电话 + /// + public string courierMobile {get; set;} + /// + /// 重量 + /// + public string weight {get; set;} + /// + /// 运费 + /// + public string freight {get; set;} + + public override string ToString() + { + return JsonConvert.SerializeObject(this,Formatting.Indented,new JsonSerializerSettings(){NullValueHandling = NullValueHandling.Ignore}); + } + } + +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Border/BOrderCallBackReq.cs b/Infrastructure/Kuaidi100/Common/Request/Border/BOrderCallBackReq.cs new file mode 100644 index 0000000..ef66056 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Border/BOrderCallBackReq.cs @@ -0,0 +1,20 @@ +namespace Common.Request.Border +{ + public class BOrderCallBackReq{ + /// + /// 任务id + /// + /// + public string taskId {get; set;} + /// + /// 签名 + /// + /// + public string sign {get; set;} + /// + /// 参数主体 + /// + /// + public BOrderCallBackParam param {get; set;} + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Border/BOrderCancelParam.cs b/Infrastructure/Kuaidi100/Common/Request/Border/BOrderCancelParam.cs new file mode 100644 index 0000000..beae96c --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Border/BOrderCancelParam.cs @@ -0,0 +1,25 @@ +using Newtonsoft.Json; + +namespace Common.Request.Border +{ + public class BOrderCancelParam { + /// + /// 任务ID + /// + public string taskId {get; set;} + /// + /// 订单ID + /// + public string orderId {get; set;} + /// + /// 取消原因,例:暂时不寄件了 + /// + public string cancelMsg {get; set;} + + public override string ToString() + { + return JsonConvert.SerializeObject(this,Formatting.Indented,new JsonSerializerSettings(){NullValueHandling = NullValueHandling.Ignore}); + } + } + +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Border/BOrderGetCodeParam.cs b/Infrastructure/Kuaidi100/Common/Request/Border/BOrderGetCodeParam.cs new file mode 100644 index 0000000..ce5b137 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Border/BOrderGetCodeParam.cs @@ -0,0 +1,21 @@ +using Newtonsoft.Json; + +namespace Common.Request.Border +{ + public class BOrderGetCodeParam { + /// + /// 任务ID + /// + public string taskId {get; set;} + /// + /// 订单ID + /// + public string orderId {get; set;} + + public override string ToString() + { + return JsonConvert.SerializeObject(this,Formatting.Indented,new JsonSerializerSettings(){NullValueHandling = NullValueHandling.Ignore}); + } + } + +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Border/BOrderParam.cs b/Infrastructure/Kuaidi100/Common/Request/Border/BOrderParam.cs new file mode 100644 index 0000000..1a1e571 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Border/BOrderParam.cs @@ -0,0 +1,66 @@ +using Newtonsoft.Json; + +namespace Common.Request.Border +{ + public class BOrderParam { + + + /// + /// 快递公司的编码,一律用小写字母,见《快递公司编码》 + /// + public string kuaidicom {get; set;} + /// + /// 收件人姓名 + /// + public string recManName {get; set;} + /// + /// 收件人的手机号,手机号和电话号二者其一必填 + /// + public string recManMobile {get; set;} + /// + /// 收件人所在完整地址,如广东深圳市深圳市南山区科技南十二路2号金蝶软件园 + /// + public string recManPrintAddr {get; set;} + /// + /// 寄件人姓名 + /// + public string sendManName {get; set;} + /// + /// 寄件人的手机号,手机号和电话号二者其一必填 + /// + public string sendManMobile {get; set;} + /// + /// 寄件人所在的完整地址,如广东深圳市深圳市南山区科技南十二路2号金蝶软件园B10 + /// + public string sendManPrintAddr {get; set;} + /// + /// 物品名称,例:文件 + /// + public string cargo {get; set;} + /// + /// + /// + public string weight {get; set;} + /// + /// 备注 + /// + public string remark {get; set;} + /// + /// 签名用随机字符串 + /// + public string salt {get; set;} + /// + /// callBackUrl订单信息回调 + /// + public string callBackUrl {get; set;} + /// + /// 快递业务服务类型,例:标准快递,默认为标准快递 + /// + public string serviceType {get; set;} + + public override string ToString() + { + return JsonConvert.SerializeObject(this,Formatting.Indented,new JsonSerializerSettings(){NullValueHandling = NullValueHandling.Ignore}); + } + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Border/BOrderQueryParam.cs b/Infrastructure/Kuaidi100/Common/Request/Border/BOrderQueryParam.cs new file mode 100644 index 0000000..e78c7db --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Border/BOrderQueryParam.cs @@ -0,0 +1,18 @@ +using Newtonsoft.Json; + +namespace Common.Request.Border +{ + public class BOrderQueryParam { + /// + /// 寄件地址 + /// + /// + public string sendAddr {get; set;} + + public override string ToString() + { + return JsonConvert.SerializeObject(this,Formatting.Indented,new JsonSerializerSettings(){NullValueHandling = NullValueHandling.Ignore}).Replace("\r\n","").Replace(" ",""); + } + } + +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Bsamecity/BsamecityAddfeeParam.cs b/Infrastructure/Kuaidi100/Common/Request/Bsamecity/BsamecityAddfeeParam.cs new file mode 100644 index 0000000..72f46d8 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Bsamecity/BsamecityAddfeeParam.cs @@ -0,0 +1,31 @@ +using Newtonsoft.Json; +namespace Common.Request.Bsamecity +{ + public class BsamecityAddfeeParam{ + /// + /// 下单时返回的orderId + /// + /// + public string orderId {get; set;} + /// + /// 下单时返回的taskId + /// + /// + public string taskId {get; set;} + /// + /// 订单小费,单位元 + /// + /// + public string tips {get; set;} + /// + /// 备注 + /// + /// + public string remark {get; set;} + + public override string ToString() + { + return JsonConvert.SerializeObject(this,Formatting.Indented,new JsonSerializerSettings(){NullValueHandling = NullValueHandling.Ignore}); + } + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Bsamecity/BsamecityCancelParam.cs b/Infrastructure/Kuaidi100/Common/Request/Bsamecity/BsamecityCancelParam.cs new file mode 100644 index 0000000..da8fd2e --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Bsamecity/BsamecityCancelParam.cs @@ -0,0 +1,31 @@ +using Newtonsoft.Json; +namespace Common.Request.Bsamecity +{ + public class BsamecityCancelParam{ + /// + /// 下单时返回的taskId + /// + /// + public string taskId {get; set;} + /// + /// 订单id + /// + /// + public string orderId {get; set;} + /// + /// 取消原因类型 + /// + /// + public int cancelMsgType {get; set;} + /// + /// 取消原因 + /// + /// + public string cancelMsg {get; set;} + + public override string ToString() + { + return JsonConvert.SerializeObject(this,Formatting.Indented,new JsonSerializerSettings(){NullValueHandling = NullValueHandling.Ignore}); + } + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Bsamecity/BsamecityOrderParam.cs b/Infrastructure/Kuaidi100/Common/Request/Bsamecity/BsamecityOrderParam.cs new file mode 100644 index 0000000..a27727a --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Bsamecity/BsamecityOrderParam.cs @@ -0,0 +1,162 @@ +using System.Collections.Generic; +using Newtonsoft.Json; +namespace Common.Request.Bsamecity +{ + public class BsamecityOrderParam{ + /// + /// 快递公司的编码,一律用小写字母,见《快递公司编码》 + /// + /// + public string kuaidicom {get; set;} + /// + /// 坐标类型(1:百度坐标,2:高德坐标 ,默认2) + /// + /// + public int lbsType {get; set;} + /// + /// 收件人姓名,长度最大20 + /// + /// + public string recManName {get; set;} + /// + /// 收件人的手机号(有手机号和固话正则校验) + /// + /// + public string recManMobile {get; set;} + /// + /// 收件人所在的省,长度最大20 + /// + /// + public string recManProvince {get; set;} + /// + /// 收件人所在的市,长度最大20 + /// + /// + public string recManCity {get; set;} + /// + /// 收件人所在的区,长度最大20 + /// + /// + public string recManDistrict {get; set;} + /// + /// 收件人所在的完整地址,如 科技南十二路2号金蝶软件园B10,长度最大100 + /// + /// + public string recManAddr {get; set;} + /// + /// 收件人地址纬度,默认高德坐标,长度最大10 + /// + /// + public string recManLat {get; set;} + /// + /// 收件人地址经度,默认高德坐标,长度最大10 + /// + /// + public string recManLng {get; set;} + /// + /// 寄件人姓名,长度最大20 + /// + /// + public string sendManName {get; set;} + /// + /// 寄件人的手机号(有手机号和固话正则校验) + /// + /// + public string sendManMobile {get; set;} + /// + /// 寄件人所在的省,长度最大20 + /// + /// + public string sendManProvince {get; set;} + /// + /// 寄件人所在的市,长度最大20 + /// + /// + public string sendManCity {get; set;} + /// + /// 寄件人所在的区,长度最大20 + /// + /// + public string sendManDistrict {get; set;} + /// + /// 寄件人所在的完整地址,如 科技南十二路2号金蝶软件园B10,长度最大100 + /// + /// + public string sendManAddr {get; set;} + /// + /// 寄件人地址纬度,默认高德坐标,长度最大10 + /// + /// + public string sendManLat {get; set;} + /// + /// 寄件人地址经度,默认高德坐标,长度最大10 + /// + /// + public string sendManLng {get; set;} + /// + /// 物品总重量KG,例:1.5,单位kg + /// + /// + public string weight {get; set;} + /// + /// 备注,例:测试寄件,长度最多255 + /// + /// + public string remark {get; set;} + /// + /// 体积cm3,长度最多20 + /// + /// + public string volume {get; set;} + /// + /// 0:无需预约 1:预约单送达时间 2:预约单上门时间 默认为0 + /// + /// + public int orderType {get; set;} + /// + /// 取货时间,orderType=2时必填,例子:2020-02-02 22:00 + /// + /// + public string expectPickupTime {get; set;} + /// + /// 期望送达时间,orderType=1时必填(例子:2020-02-02 22:00) + /// + /// + public string expectFinishTime {get; set;} + /// + /// 保价物品金额 + /// + /// + public string insurance {get; set;} + /// + /// 物品总金额,例:100.23 + /// + /// + public string price {get; set;} + /// + /// 是否为专人直送订单,0为否,1为是 + /// + /// + public int directDelivery {get; set;} + /// + /// 商品详情 + /// + /// + public List goods {get; set;} + /// + /// 下单结果回调地址 + /// + /// + public string callbackUrl {get; set;} + /// + /// 签名用随机字符串,长度最多20 + /// + /// + public string salt {get; set;} + + public override string ToString() + { + return JsonConvert.SerializeObject(this,Formatting.Indented,new JsonSerializerSettings(){NullValueHandling = NullValueHandling.Ignore}); + } + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Bsamecity/Goods.cs b/Infrastructure/Kuaidi100/Common/Request/Bsamecity/Goods.cs new file mode 100644 index 0000000..bf6515d --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Bsamecity/Goods.cs @@ -0,0 +1,26 @@ +using Newtonsoft.Json; + +namespace Common.Request.Bsamecity +{ + public class Goods + { + + /** + * 商品名称 + */ + public string name; + /** + * 商品类型,参考物品类型 + */ + public string type; + /** + * 商品数量 + */ + public int count; + + public override string ToString() + { + return JsonConvert.SerializeObject(this,Formatting.Indented,new JsonSerializerSettings(){NullValueHandling = NullValueHandling.Ignore}); + } + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Cloud/AttachmentParam.cs b/Infrastructure/Kuaidi100/Common/Request/Cloud/AttachmentParam.cs new file mode 100644 index 0000000..ef2d75e --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Cloud/AttachmentParam.cs @@ -0,0 +1,48 @@ +using Newtonsoft.Json; + +namespace Common.Request.cloud +{ + public class AttachmentParam { + /// + /// 贵司内部自定义的订单编号,需要保证唯一性,非必填 + /// + public string orderId {get; set;} + /// + /// 打印设备,通过打印机输出的设备码进行获取 + /// + public string siid {get; set;} + /// + /// 打印纸的高度 + /// + public string height {get; set;} + /// + /// 打印纸的宽度 + /// + public string width {get; set;} + /// + /// 打印状态回调地址 + /// + public string callBackUrl {get; set;} + /// + /// 签名用随机字符串 + /// + public string salt {get; set;} + /// + /// 需要打印的份数,默认是一份 + /// + public string copyNum {get; set;} + /// + /// 打印范围,起始页,仅对多页文件支持,默认是打印整个文档 + /// + public string startPage {get; set;} + /// + /// 打印范围,结束页,仅对多页文件支持,默认是打印整个文档 + /// + public string endPage {get; set;} + + public override string ToString() + { + return JsonConvert.SerializeObject(this,Formatting.Indented,new JsonSerializerSettings(){NullValueHandling = NullValueHandling.Ignore}); + } + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Cloud/CommandParam.cs b/Infrastructure/Kuaidi100/Common/Request/Cloud/CommandParam.cs new file mode 100644 index 0000000..f9c9afa --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Cloud/CommandParam.cs @@ -0,0 +1,28 @@ +using Newtonsoft.Json; + +namespace Common.Request.cloud +{ + public class CommandParam { + /// + /// 可识别打印指令,内容需我司硬件指令进行协商确定 + /// + public string content {get; set;} + /// + /// 打印设备,通过打印机输出的设备码进行获取 + /// + public string siid {get; set;} + /// + /// 签名用随机字符串 + /// + public string salt {get; set;} + /// + /// 打印状态回调地址 + /// + public string callBackUrl {get; set;} + + public override string ToString() + { + return JsonConvert.SerializeObject(this,Formatting.Indented,new JsonSerializerSettings(){NullValueHandling = NullValueHandling.Ignore}); + } + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Cloud/CustomParam.cs b/Infrastructure/Kuaidi100/Common/Request/Cloud/CustomParam.cs new file mode 100644 index 0000000..75e3c61 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Cloud/CustomParam.cs @@ -0,0 +1,40 @@ +using Newtonsoft.Json; + +namespace Common.Request.cloud +{ + public class CustomParam { + /// + /// 贵司内部自定义的订单编号,需要保证唯一性,非必填 + /// + public string orderId {get; set;} + /// + /// 通过管理后台的打印摸版配置信息获取 + /// + public string tempid {get; set;} + /// + /// 打印设备,通过打印机输出的设备码进行获取 + /// + public string siid {get; set;} + /// + /// 打印纸的高度 + /// + public string height {get; set;} + /// + /// 打印纸的宽度 + /// + public string width {get; set;} + /// + /// 打印状态回调地址 + /// + public string callBackUrl {get; set;} + /// + /// 签名用随机字符串 + /// + public string salt {get; set;} + + public override string ToString() + { + return JsonConvert.SerializeObject(this,Formatting.Indented,new JsonSerializerSettings(){NullValueHandling = NullValueHandling.Ignore}); + } + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Cloud/DevStatusParam.cs b/Infrastructure/Kuaidi100/Common/Request/Cloud/DevStatusParam.cs new file mode 100644 index 0000000..ec09db6 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Cloud/DevStatusParam.cs @@ -0,0 +1,16 @@ +using Newtonsoft.Json; + +namespace Common.Request.cloud +{ + public class DevStatusParam { + /// + /// 设备码 + /// + public string siid {get; set;} + + public override string ToString() + { + return JsonConvert.SerializeObject(this,Formatting.Indented,new JsonSerializerSettings(){NullValueHandling = NullValueHandling.Ignore}); + } + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Cloud/ImageInfo.cs b/Infrastructure/Kuaidi100/Common/Request/Cloud/ImageInfo.cs new file mode 100644 index 0000000..2d166b7 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Cloud/ImageInfo.cs @@ -0,0 +1,28 @@ +using Newtonsoft.Json; + +namespace Common.Request.cloud +{ + public class ImageInfo { + /// + /// BASE_64:base64 图片格式;URL:图片地址;QR_CODE:二维码;CODE_128:code128格式的条形码 + /// + public string type {get; set;} + /// + /// 图片内容 + /// + public string content {get; set;} + /// + /// 图片宽度 + /// + public string width {get; set;} + /// + /// 图片高度 + /// + public string height {get; set;} + + public override string ToString() + { + return JsonConvert.SerializeObject(this,Formatting.Indented,new JsonSerializerSettings(){NullValueHandling = NullValueHandling.Ignore}); + } + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Cloud/ParcelsBillsParam.cs b/Infrastructure/Kuaidi100/Common/Request/Cloud/ParcelsBillsParam.cs new file mode 100644 index 0000000..76311e1 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Cloud/ParcelsBillsParam.cs @@ -0,0 +1,37 @@ +using Newtonsoft.Json; +using System.Collections.Generic; + +namespace Common.Request.cloud +{ + public class ParcelsBillsParam { + /// + /// 打印设备,通过打印机输出的设备码进行获取 + /// + public string siid {get; set;} + + /// + /// 通过管理后台的打印发货单模板配置信息获取 + /// + public string tempid {get; set;} + + /// + /// 设备码 + /// + public List tb0 {get; set;} + + /// + /// 设备码 + /// + public ImageInfo img0 {get; set;} + + /// + /// 打印状态回调地址,默认仅支持http + /// + public string callBackUrl {get; set;} + + public override string ToString() + { + return JsonConvert.SerializeObject(this,Formatting.Indented,new JsonSerializerSettings(){NullValueHandling = NullValueHandling.Ignore}); + } + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Cloud/PrintOldParam.cs b/Infrastructure/Kuaidi100/Common/Request/Cloud/PrintOldParam.cs new file mode 100644 index 0000000..5ab497b --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Cloud/PrintOldParam.cs @@ -0,0 +1,16 @@ +using Newtonsoft.Json; + +namespace Common.Request.cloud +{ + public class PrintOldParam { + /// + /// 任务id + /// + public string taskId {get; set;} + + public override string ToString() + { + return JsonConvert.SerializeObject(this,Formatting.Indented,new JsonSerializerSettings(){NullValueHandling = NullValueHandling.Ignore}); + } + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Corder/COrderCancelParam.cs b/Infrastructure/Kuaidi100/Common/Request/Corder/COrderCancelParam.cs new file mode 100644 index 0000000..0a9f866 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Corder/COrderCancelParam.cs @@ -0,0 +1,25 @@ +using Newtonsoft.Json; + +namespace Common.Request.Corder +{ + public class COrderCancelParam { + /// + /// 任务ID + /// + public string taskId {get; set;} + /// + /// 订单ID + /// + public string orderId {get; set;} + /// + /// 取消原因,例:暂时不寄件 + /// + public string cancelMsg {get; set;} + + public override string ToString() + { + return JsonConvert.SerializeObject(this,Formatting.Indented,new JsonSerializerSettings(){NullValueHandling = NullValueHandling.Ignore}); + } + } + +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Corder/COrderParam.cs b/Infrastructure/Kuaidi100/Common/Request/Corder/COrderParam.cs new file mode 100644 index 0000000..227e1b5 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Corder/COrderParam.cs @@ -0,0 +1,94 @@ +using Newtonsoft.Json; + +namespace Common.Request.Corder +{ + public class COrderParam { + + + /// + /// 快递公司的编码,一律用小写字母,见《快递公司编码》 + /// + public string kuaidicom {get; set;} + /// + /// 收件人姓名 + /// + public string recManName {get; set;} + /// + /// 收件人的手机号,手机号和电话号二者其一必填 + /// + public string recManMobile {get; set;} + /// + /// 收件人所在完整地址,如广东深圳市深圳市南山区科技南十二路2号金蝶软件园 + /// + public string recManPrintAddr {get; set;} + /// + /// 寄件人姓名 + /// + public string sendManName {get; set;} + /// + /// 寄件人的手机号,手机号和电话号二者其一必填 + /// + public string sendManMobile {get; set;} + /// + /// 寄件人所在的完整地址,如广东深圳市深圳市南山区科技南十二路2号金蝶软件园B10 + /// + public string sendManPrintAddr {get; set;} + /// + /// 物品名称,例:文件 + /// + public string cargo {get; set;} + /// + /// 重量 + /// + public string weight {get; set;} + /// + /// 备注 + /// + public string remark {get; set;} + /// + /// 签名用随机字符串 + /// + public string salt {get; set;} + /// + /// callBackUrl订单信息回调 + /// + public string callBackUrl {get; set;} + /// + /// 预约日期,例如:今天/明天/后天 + /// + public string dayType {get; set;} + + /// + /// 预约起始时间,24小时制(HH:mm),例如:09:00 + /// + public string pickupStartTime {get; set;} + + /// + /// 预约截止时间,24小时制(HH:mm),例如:10:00 + /// + public string pickupEndTime {get; set;} + + /// + /// 是否开启订阅功能 0:不开启(默认) 1:开启 说明开启订阅功能时:pollCallBackUrl必须填入 此功能只针对有快递单号的单 + /// + public string op {get; set;} + + /// + /// 如果op设置为1时,pollCallBackUrl必须填入,用于跟踪回调 + /// + public string pollCallBackUrl {get; set;} + + /// + /// 添加此字段表示开通行政区域解析功能 。 + /// 0:关闭(默认) + /// 1:开通行政区域解析功能以及物流轨迹增加物流状态名称 + /// 4:开通行政解析功能以及物流轨迹增加物流高级状态名称、状态值并且返回出发、目的及当前城市信息(详见:快递信息推送接口文档) + /// + public string resultv2 {get; set;} + + public override string ToString() + { + return JsonConvert.SerializeObject(this,Formatting.Indented,new JsonSerializerSettings(){NullValueHandling = NullValueHandling.Ignore}); + } + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Corder/COrderQueryPriceParam.cs b/Infrastructure/Kuaidi100/Common/Request/Corder/COrderQueryPriceParam.cs new file mode 100644 index 0000000..ddd6fde --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Corder/COrderQueryPriceParam.cs @@ -0,0 +1,28 @@ +using Newtonsoft.Json; + +namespace Common.Request.Corder +{ + public class COrderQueryPriceParam { + /// + /// 快递公司编码 + /// + public string kuaidicom {get; set;} + /// + /// 出发地地址,最小颗粒到市级,例如:广东省深圳市 + /// + public string sendManPrintAddr {get; set;} + /// + /// 目的地地址,最小颗粒到市级,例如:广东省深圳市 + /// + public string recManPrintAddr {get; set;} + /// + /// 重量 + /// + public string weight {get; set;} + + public override string ToString() + { + return JsonConvert.SerializeObject(this,Formatting.Indented,new JsonSerializerSettings(){NullValueHandling = NullValueHandling.Ignore}); + } + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Electronic/CancelPrint.cs b/Infrastructure/Kuaidi100/Common/Request/Electronic/CancelPrint.cs new file mode 100644 index 0000000..860e23b --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Electronic/CancelPrint.cs @@ -0,0 +1,55 @@ +using Newtonsoft.Json; + +namespace Common.Request.Electronic +{ + public class CancelPrint + { + + /// + /// 电子面单客户账户或月结账号,需贵司向当地快递公司网点申请 + /// + public string partnerId { get; set; } + /// + /// 电子面单密码,需贵司向当地快递公司网点申请 + /// + public string partnerKey { get; set; } + /// + /// 电子面单密钥,需贵司向当地快递公司网点申请; 是否必填该属性,请查看参数字典 + /// + public string partnerSecret { get; set; } + /// + /// 电子面单客户账户名称,需贵司向当地快递公司网点申请; 是否必填该属性,请查看参数字典 + /// + public string partnerName { get; set; } + /// + /// 收件网点名称,由快递公司当地网点分配, 若使用淘宝授权填入(taobao),使用菜鸟授权填入(cainiao) + /// + public string net { get; set; } + /// + /// 电子面单承载编号,需贵司向当地快递公司网点申请; 是否必填该属性,请查看参数字典 + /// + public string code { get; set; } + /// + /// 快递公司的编码,一律用小写字母 + /// + public string kuaidicom { get; set; } + /// + /// 快递公司订单号(对应下单时返回的kdComOrderNum,如果没有可以不传,否则必传) + /// + public string orderId { get; set; } + /// + /// 快递单号 + /// + public string kuaidinum { get; set; } + /// + /// 取消原因 + /// + public string reason { get; set; } + + public override string ToString() + { + return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); + } + } + +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Electronic/Html/PrintHtmlParam.cs b/Infrastructure/Kuaidi100/Common/Request/Electronic/Html/PrintHtmlParam.cs new file mode 100644 index 0000000..49751e2 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Electronic/Html/PrintHtmlParam.cs @@ -0,0 +1,131 @@ +using Newtonsoft.Json; + +namespace Common.Request.Electronic.Html +{ + public class PrintHtmlParam + { + /** + * 电子面单客户账户或月结账号,需贵司向当地快递公司网点申请 + */ + public string partnerId {get; set;} + /** + * 电子面单密码,需贵司向当地快递公司网点申请 + */ + public string partnerKey {get; set;} + /** + * 收件网点名称,由快递公司当地网点分配, + * 若使用淘宝授权填入(taobao),使用菜鸟授权填入(cainiao) + */ + public string net {get; set;} + /** + * 快递公司的编码,一律用小写字母 + */ + public string kuaidicom {get; set;} + /** + * 收件人信息 + */ + public ManInfo recMan {get; set;} + /** + * 收件人信息 + */ + public ManInfo sendMan {get; set;} + /** + * 物品名称(部分快递公司必填) + */ + public string cargo {get; set;} + /** + * 物品总数量。 + * 另外该属性与子单有关,如果需要子单(指同一个订单打印出多张电子面单,即同一个订单返回多个面单号), + * needChild = 1、count 需要大于1,如count = 2 则一个主单 一个子单, + * count = 3则一个主单 二个子单;返回的子单号码见返回结果的childNum字段 + */ + public string count {get; set;} + /** + * 物品总重量,单位:KG (例子:0.5) + */ + public string weight {get; set;} + /** + * 支付方式: + * SHIPPER:寄方付(默认) + * CONSIGNEE:到付 + * MONTHLY:月结 + * THIRDPARTY:第三方支付 + */ + public string payType {get; set;} + /** + * 快递类型: + * 标准快递(默认) + * 顺丰特惠 + * EMS经济 + */ + public string expType {get; set;} + /** + * 备注 + */ + public string remark {get; set;} + /** + * 保价额度 + */ + public string valinsPay {get; set;} + /** + * 代收货款额度 + */ + public string collection {get; set;} + /** + * 是否需要子单(支持子单的快递公司才可以用,是否支持可以参考参数字典) + * 1:需要 + * 0:不需要(默认) + * 如果需要子单(指同一个订单打印出多张电子面单,即同一个订单返回多个面单号); + * needChild = 1、count 需要大于1,如count = 2 一个主单 一个子单, + * count = 3 一个主单 二个子单,返回的子单号码见返回结果的childNum字段 + */ + public string needChild {get; set;} + /** + * 是否需要回单(支持回单的快递公司才可以用,是否支持可以参考参数字典) + * 1:需要 + * 0:不需要(默认) + * 返回的回单号见返回结果的returnNum字段 + */ + public string needBack {get; set;} + /** + * 贵司内部自定义的订单编号,需要保证唯一性 + */ + public string orderId {get; set;} + /** + * 是否返回面单 + * 0:不需要(默认) + * 1:需要 + * 如果需要,则返回要打印的模版的HTML代码,贵司可以直接将之显示到IE等浏览器,然后通过浏览器进行打印 + */ + public string needTemplate {get; set;} + /** + * 签名用随机字符串 + */ + public string salt {get; set;} + /** + * 是否开启订阅功能: + * 0:不开启(默认) + * 1:开启 + * 说明开启订阅功能时:pollCallBackUrl必须填入 + * 此功能只针对有快递单号的单 + */ + public string op {get; set;} + /** + * 如果op设置为1时,pollCallBackUrl必须填入,用于跟踪回调 + */ + public string pollCallBackUrl {get; set;} + /** + * 添加此字段表示开通行政区域解析功能:0:关闭(默认);1:开通行政区域解析功能 + */ + public string resultv2 {get; set;} + /** + * 该字段为申通专用,其他公司勿传;申通的需要传 44 + */ + public string code {get; set;} + + public override string ToString() + { + return JsonConvert.SerializeObject(this,Formatting.Indented,new JsonSerializerSettings(){NullValueHandling = NullValueHandling.Ignore}); + } + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Electronic/Html/PrintHtmlReq.cs b/Infrastructure/Kuaidi100/Common/Request/Electronic/Html/PrintHtmlReq.cs new file mode 100644 index 0000000..9e9a55f --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Electronic/Html/PrintHtmlReq.cs @@ -0,0 +1,26 @@ +namespace Common.Request.Electronic.Html +{ + public class PrintHtmlReq + { + /** + * 业务类型(默认:getPrintImg) + */ + public string method {get; set;} + /** + * 快递100分配给贵司的的授权key + */ + public string key {get; set;} + /** + * 加密签名信息:MD5(param+t+key+secret);加密后字符串转大写 + */ + public string sign {get; set;} + /** + * 当前请求时间戳 + */ + public string t {get; set;} + /** + * 其他参数组合成的json对象 + */ + public PrintHtmlParam param {get; set;} + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Electronic/Image/PrintImgParam.cs b/Infrastructure/Kuaidi100/Common/Request/Electronic/Image/PrintImgParam.cs new file mode 100644 index 0000000..5aeaa8f --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Electronic/Image/PrintImgParam.cs @@ -0,0 +1,160 @@ +using Newtonsoft.Json; + +namespace Common.Request.Electronic.Image +{ + public class PrintImgParam { + /** + * 业务类型,默认为10 + */ + public string type {get; set;} + /** + * 电子面单客户账户或月结账号,需贵司向当地快递公司网点申请 + */ + public string partnerId {get; set;} + /** + * 电子面单密码,需贵司向当地快递公司网点申请 + */ + public string partnerKey {get; set;} + /** + * 收件网点名称,由快递公司当地网点分配, + * 若使用淘宝授权填入(taobao),使用菜鸟授权填入(cainiao) + */ + public string net {get; set;} + /** + * 快递公司的编码,一律用小写字母 + */ + public string kuaidicom {get; set;} + /** + * 收件人姓名 + */ + public string recManName {get; set;} + /** + * 收件人的手机号 + */ + public string recManMobile {get; set;} + /** + * 收件人所在完整地址 + */ + public string recManPrintAddr {get; set;} + /** + * 寄件人姓名 + */ + public string sendManName {get; set;} + /** + * 寄件人的手机号 + */ + public string sendManMobile {get; set;} + /** + * 寄件人所在的完整地址 + */ + public string sendManPrintAddr {get; set;} + /** + * 打印电子面单模板编码(登录快递100管理后台查看) + */ + public string tempid {get; set;} + /** + * 物品名称(部分快递公司必填) + */ + public string cargo {get; set;} + /** + * 物品总数量。 + * 另外该属性与子单有关,如果需要子单(指同一个订单打印出多张电子面单,即同一个订单返回多个面单号), + * needChild = 1、count 需要大于1,如count = 2 则一个主单 一个子单, + * count = 3则一个主单 二个子单;返回的子单号码见返回结果的childNum字段 + */ + public string count {get; set;} + /** + * 物品总重量,单位:KG (例子:0.5) + */ + public string weight {get; set;} + /** + * 支付方式: + * SHIPPER:寄方付(默认) + * CONSIGNEE:到付 + * MONTHLY:月结 + * THIRDPARTY:第三方支付 + */ + public string payType {get; set;} + /** + * 快递类型: + * 标准快递(默认) + * 顺丰特惠 + * EMS经济 + */ + public string expType {get; set;} + /** + * 备注 + */ + public string remark {get; set;} + /** + * 保价额度 + */ + public string valinsPay {get; set;} + /** + * 代收货款额度 + */ + public string collection {get; set;} + /** + * 是否需要子单(支持子单的快递公司才可以用,是否支持可以参考参数字典) + * 1:需要 + * 0:不需要(默认) + * 如果需要子单(指同一个订单打印出多张电子面单,即同一个订单返回多个面单号); + * needChild = 1、count 需要大于1,如count = 2 一个主单 一个子单, + * count = 3 一个主单 二个子单,返回的子单号码见返回结果的childNum字段 + */ + public string needChild {get; set;} + /** + * 是否需要回单(支持回单的快递公司才可以用,是否支持可以参考参数字典) + * 1:需要 + * 0:不需要(默认) + * 返回的回单号见返回结果的returnNum字段 + */ + public string needBack {get; set;} + /** + * 贵司内部自定义的订单编号,需要保证唯一性 + */ + public string orderId {get; set;} + /** + * 生成图片的高,以mm为单位(默认100) + */ + public string height {get; set;} + /** + * 生成图片的宽,以mm为单位(默认180) + */ + public string width {get; set;} + /** + * 签名用随机字符串 + */ + public string salt {get; set;} + /** + * 是否开启订阅功能: + * 0:不开启(默认) + * 1:开启 + * 说明开启订阅功能时:pollCallBackUrl必须填入 + * 此功能只针对有快递单号的单 + */ + public string op {get; set;} + /** + * 如果op设置为1时,pollCallBackUrl必须填入,用于跟踪回调 + */ + public string pollCallBackUrl {get; set;} + /** + * 添加此字段表示开通行政区域解析功能:0:关闭(默认);1:开通行政区域解析功能 + */ + public string resultv2 {get; set;} + /** + * 该字段为申通专用,其他公司勿传;申通的需要传 44 + */ + public string code {get; set;} + /** + * 打印时间 + */ + public string printTime {get; set;} + + public override string ToString() + { + return JsonConvert.SerializeObject(this,Formatting.Indented,new JsonSerializerSettings(){NullValueHandling = NullValueHandling.Ignore}); + } + } +} + diff --git a/Infrastructure/Kuaidi100/Common/Request/Electronic/Image/PrintImgReq.cs b/Infrastructure/Kuaidi100/Common/Request/Electronic/Image/PrintImgReq.cs new file mode 100644 index 0000000..5126fc5 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Electronic/Image/PrintImgReq.cs @@ -0,0 +1,25 @@ +namespace Common.Request.Electronic.Image +{ + public class PrintImgReq { + /** + * 业务类型(默认:getPrintImg) + */ + public string method {get; set;} + /** + * 快递100分配给贵司的的授权key + */ + public string key {get; set;} + /** + * 加密签名信息:MD5(param+t+key+secret);加密后字符串转大写 + */ + public string sign {get; set;} + /** + * 当前请求时间戳 + */ + public string t {get; set;} + /** + * 其他参数组合成的json对象 + */ + public PrintImgParam param {get; set;} + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Electronic/ManInfo.cs b/Infrastructure/Kuaidi100/Common/Request/Electronic/ManInfo.cs new file mode 100644 index 0000000..6d911cc --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Electronic/ManInfo.cs @@ -0,0 +1,29 @@ +using Newtonsoft.Json; + +namespace Common.Request.Electronic +{ + public class ManInfo + { + /** + * 收件人姓名 (必填) + */ + public string name {get; set;} + /** + * 收件人的手机号,手机号和电话号二者其一必填 (必填) + */ + public string mobile {get; set;} + /** + * 收件人所在完整地址 (必填) + */ + public string printAddr {get; set;} + /** + * 收件人所在公司名称(可选) + */ + public string company {get; set;} + + public override string ToString() + { + return JsonConvert.SerializeObject(this,Formatting.Indented,new JsonSerializerSettings(){NullValueHandling = NullValueHandling.Ignore}); + } + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Electronic/Print/PrintCloudParam.cs b/Infrastructure/Kuaidi100/Common/Request/Electronic/Print/PrintCloudParam.cs new file mode 100644 index 0000000..0ec9be2 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Electronic/Print/PrintCloudParam.cs @@ -0,0 +1,144 @@ +using Newtonsoft.Json; + +namespace Common.Request.Electronic.Print +{ + public class PrintCloudParam + { + /** + * 业务类型,默认为10 + */ + public string type {get; set;} + /** + * 电子面单客户账户或月结账号,需贵司向当地快递公司网点申请 + */ + public string partnerId {get; set;} + /** + * 电子面单密码,需贵司向当地快递公司网点申请 + */ + public string partnerKey {get; set;} + /** + * 收件网点名称,由快递公司当地网点分配, + * 若使用淘宝授权填入(taobao),使用菜鸟授权填入(cainiao) + */ + public string net {get; set;} + /** + * 快递公司的编码,一律用小写字母 + */ + public string kuaidicom {get; set;} + /** + * 收件人信息 + */ + public ManInfo recMan {get; set;} + /** + * 收件人信息 + */ + public ManInfo sendMan {get; set;} + /** + * 物品名称(部分快递公司必填) + */ + public string cargo {get; set;} + /** + * 物品总数量。 + * 另外该属性与子单有关,如果需要子单(指同一个订单打印出多张电子面单,即同一个订单返回多个面单号), + * needChild = 1、count 需要大于1,如count = 2 则一个主单 一个子单, + * count = 3则一个主单 二个子单;返回的子单号码见返回结果的childNum字段 + */ + public string count {get; set;} + /** + * 物品总重量,单位:KG (例子:0.5) + */ + public string weight {get; set;} + /** + * 支付方式: + * SHIPPER:寄方付(默认) + * CONSIGNEE:到付 + * MONTHLY:月结 + * THIRDPARTY:第三方支付 + */ + public string payType {get; set;} + /** + * 快递类型: + * 标准快递(默认) + * 顺丰特惠 + * EMS经济 + */ + public string expType {get; set;} + /** + * 备注 + */ + public string remark {get; set;} + /** + * 电子面单模板编码 + */ + public string tempid {get; set;} + /** + * 打印设备编码。通过打印机输出的设备码进行获取 + */ + public string siid {get; set;} + /** + * 保价额度 + */ + public string valinsPay {get; set;} + /** + * 代收货款额度 + */ + public string collection {get; set;} + /** + * 是否需要子单(支持子单的快递公司才可以用,是否支持可以参考参数字典) + * 1:需要 + * 0:不需要(默认) + * 如果需要子单(指同一个订单打印出多张电子面单,即同一个订单返回多个面单号); + * needChild = 1、count 需要大于1,如count = 2 一个主单 一个子单, + * count = 3 一个主单 二个子单,返回的子单号码见返回结果的childNum字段 + */ + public string needChild {get; set;} + /** + * 是否需要回单(支持回单的快递公司才可以用,是否支持可以参考参数字典) + * 1:需要 + * 0:不需要(默认) + * 返回的回单号见返回结果的returnNum字段 + */ + public string needBack {get; set;} + /** + * 贵司内部自定义的订单编号,需要保证唯一性 + */ + public string orderId {get; set;} + /** + * 生成图片的高,以mm为单位(默认100) + */ + public string height {get; set;} + /** + * 生成图片的宽,以mm为单位(默认180) + */ + public string width {get; set;} + /** + * 签名用随机字符串 + */ + public string salt {get; set;} + /** + * 是否开启订阅功能: + * 0:不开启(默认) + * 1:开启 + * 说明开启订阅功能时:pollCallBackUrl必须填入 + * 此功能只针对有快递单号的单 + */ + public string op {get; set;} + /** + * 如果op设置为1时,pollCallBackUrl必须填入,用于跟踪回调 + */ + public string pollCallBackUrl {get; set;} + /** + * 添加此字段表示开通行政区域解析功能:0:关闭(默认);1:开通行政区域解析功能 + */ + public string resultv2 {get; set;} + /** + * 该字段为申通专用,其他公司勿传;申通的需要传 44 + */ + public string code {get; set;} + + public override string ToString() + { + return JsonConvert.SerializeObject(this,Formatting.Indented,new JsonSerializerSettings(){NullValueHandling = NullValueHandling.Ignore}); + } + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Electronic/Print/PrintCloudReq.cs b/Infrastructure/Kuaidi100/Common/Request/Electronic/Print/PrintCloudReq.cs new file mode 100644 index 0000000..f7ca0da --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Electronic/Print/PrintCloudReq.cs @@ -0,0 +1,26 @@ +namespace Common.Request.Electronic.Print +{ + public class PrintCloudReq + { + /** + * 业务类型(默认:getPrintImg) + */ + public string method {get; set;} + /** + * 快递100分配给贵司的的授权key + */ + public string key {get; set;} + /** + * 加密签名信息:MD5(param+t+key+secret);加密后字符串转大写 + */ + public string sign {get; set;} + /** + * 当前请求时间戳 + */ + public string t {get; set;} + /** + * 其他参数组合成的json对象 + */ + public PrintCloudParam param {get; set;} + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Electronic/ocr/OcrParam.cs b/Infrastructure/Kuaidi100/Common/Request/Electronic/ocr/OcrParam.cs new file mode 100644 index 0000000..dfe3229 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Electronic/ocr/OcrParam.cs @@ -0,0 +1,39 @@ +using Newtonsoft.Json; + +namespace Common.Request.Electronic.ocr +{ + public class OcrParam + { + /// + /// 图像数据,base64编码,要求base64编码后大小不超过4M,支持jpg/jpeg/png/bmp格式 + /// + /// + public string image {get; set;} + /// + /// 是否兼容图像倾斜,true:是;false:否,默认不检测,即:false + /// + /// + public bool enableTilt {get; set;} + /// + /// 图片URL。image、imageUrl、pdfUrl三者必填其一,优先顺序:image>imageUrl>pdfUrl,最大长度不超过1024b,下载超时默认为2s + /// + /// + public string imageUrl {get; set;} + + /// + /// 需要检测识别的面单元素。取值范围:barcode,qrcode,receiver,sender,bulkpen。不传或者 null 则默认为 ["barcode", "receiver", "sender"] + /// + /// + public string[] include {get; set;} + /// + /// PDF文件URL。image、imageUrl、pdfUrl三者必填其一,优先顺序:image>imageUrl>pdfUrl,最大长度不超过1024b,下载超时默认为2s + /// + /// + public string pdfUrl {get; set;} + + public override string ToString() + { + return JsonConvert.SerializeObject(this,Formatting.Indented,new JsonSerializerSettings(){NullValueHandling = NullValueHandling.Ignore}); + } + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Label/CustomPrintParam.cs b/Infrastructure/Kuaidi100/Common/Request/Label/CustomPrintParam.cs new file mode 100644 index 0000000..df993c6 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Label/CustomPrintParam.cs @@ -0,0 +1,49 @@ +using Newtonsoft.Json; +using System.Collections.Generic; + +namespace Common.Request.Label +{ + public class CustomPrintParam + { + /// + /// 自定义参数,优先级高于系统生成值,即出现相同key时,使用该参数的value + /// + /// + public Dictionary customParam; + /// + /// 打印方向(默认0) 0-正方向 1-反方向 + /// + /// + public string direction; + /// + /// 打印设备,通过打印机输出的设备码进行获取 + /// + /// + public string siid; + /// + /// 打印状态回调地址 + /// + /// + public string callBackUrl; + /// + /// 快递100模板url + /// + /// + public string tempId; + /// + /// 打印类型(HTML,IMAGE,CMD,CLOUD,NON) + /// NON:只下单不打印(默认) + /// HTML:生成html短链 + /// IMAGE:生成图片短链 + /// CMD:生成打印指令 + /// CLOUD:使用快递100云打印机打印,使用CLOUD时siid必填 + /// + /// + public string printType; + + public override string ToString() + { + return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); + } + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Label/DeliveryTimeParam.cs b/Infrastructure/Kuaidi100/Common/Request/Label/DeliveryTimeParam.cs new file mode 100644 index 0000000..7e5c039 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Label/DeliveryTimeParam.cs @@ -0,0 +1,41 @@ +using Newtonsoft.Json; + +/// +/// 快递预估时效查询接口请求参数 +/// +namespace Common.Request.Label +{ + public class DeliveryTimeParam + { + /// + /// 快递公司编码 + /// + /// + public string kuaidicom; + /// + /// 出发地(地址需包含3级及以上),例如:广东深圳南山区 + /// + /// + public string from; + /// + /// 目的地(地址需包含3级及以上),例如:北京海淀区 + /// + /// + public string to; + /// + /// 下单时间,格式要求yyyy-MM-dd HH:mm:ss, 例如:2023-08-08 08:08:08 + /// + /// + public string orderTime; + /// + /// 产品类型 + /// + /// + public string expType; + + public override string ToString() + { + return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); + } + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Label/OrderParam.cs b/Infrastructure/Kuaidi100/Common/Request/Label/OrderParam.cs new file mode 100644 index 0000000..a314eed --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Label/OrderParam.cs @@ -0,0 +1,375 @@ +using Common.Request.Electronic; +using Newtonsoft.Json; +using System.Collections.Generic; + +namespace Common.Request.Label +{ + public class OrderParam + { + /// + /// 收件人信息 + /// + /// + public ManInfo recMan; + /// + /// 寄件人信息 + /// + /// + public ManInfo sendMan; + /// + /// 快递公司编码 + /// + /// + public string kuaidicom; + /// + /// 快递公司单号 + /// + /// + public string kuaidinum; + /// + /// 订单号 + /// + /// + public string orderId; + /// + /// SHIPPER:寄方付 CONSIGNEE:到付 MONTHLY:月结 THIRDPARTY:第三方支付 + /// + /// + public string payType = "MONTHLY"; + /// + /// 快递类型: 标准快递 顺丰特惠 电商特惠 EMS经济 + /// + /// + public string expType; + /// + /// 重量 + /// + /// + public double weight; + /// + /// 体积(长 /// 宽 /// 高) + /// + /// + public string volume; + /// + /// 物品总数量 + /// + /// + public int count = 1; + /// + /// 备注 + /// + /// + public string remark; + /// + /// 保价额度 + /// + /// + public double valinsPay; + /// + /// 代收货款 + /// + /// + public double collection; + /// + /// 物品名称,例:文件 + /// + /// + public string cargo; + /// + /// 是否需要子单: 1:需要 0:不需要(默认) 如果需要子单(指同一个订单打印出多张电子面单,即同一个订单返回多个面单号); needChild = 1、count 需要大于1,如count = 2 一个主单 一个子单,count = 3 一个主单 二个子单,返回的子单号码见返回结果的childNum字段 + /// + /// + public string needChild; + /// + /// 是否需要回单: 1:需要 0:不需要(默认) 返回的回单号见返回结果的returnNum字段 + /// + /// + public string needBack; + /// + /// 电子面单客户账户或月结账号 + /// + /// + public string partnerId; + /// + /// 电子面单密码 + /// + /// + public string partnerKey; + /// + /// 电子面单密钥 + /// + /// + public string net; + /// + /// 电子面单承载编号 + /// + /// + public string code; + /// + /// 电子面单客户账户名称 + /// + /// + public string partnerName; + /// + /// 电子面单承载快递员名 + /// + /// + public string checkMan; + /// + /// 电子面单密钥,需贵司向当地快递公司网点申请 + /// + /// + public string partnerSecret; + /// + /// 在使用菜鸟/淘宝/拼多多授权电子面单时,若月结账号下存在多个网点,则tbNet="网点名称,网点编号" ,注意此处为英文逗号 + /// + /// + public string tbNet; + /// + /// 邮费 + /// + /// + public double freight; + /// + /// 京东增值服务用 + /// + /// + public string expressExtra; + /// + /// 增值服务 {"backnum":{"value":"无需返单"}} + /// + /// + public string addService; + /// + /// 订单类型;京东订单-JINGDONG;淘宝订单-TAOBAOSENT + /// + /// + public string recordType; + /// + /// 预约取件开始时间 + /// + /// + public long startGotTime; + /// + /// 预约取件结束时间 + /// + /// + public long endGotTime; + /// + /// 代收账户 + /// + /// + public string colAcctNumber; + /// + /// 代收账户名 + /// + /// + public string colAcctName; + /// + /// 顺丰电子验收 + /// + /// + // public int elecValidateType ; + /// + /// 顺丰电子验收图片熟悉数量 + /// + /// + // public int elecPicCount; + /// + /// 顺丰手持设备扫描设置 + /// + /// + public int scanSupport ; + /// + /// 文件url + /// + /// + public string fileUrl; + /// + /// 取件方式 + /// + /// + public string pickMethod; + /// + /// 是否外发,1-外发,0不外发 + /// + /// + public int isOut = 0; + /// + /// 是否合伙人自提:1-是,0-否 + /// + /// + public int isPickupSelf = 0; + /// + /// 是否接受仅镇中心派送:1-是,0-否 + /// + /// + public int isCenterDelivery = 0; + /// + /// 第三方平台订单号 + /// + /// + public string thirdOrderId; + /// + /// 开放地址ID 淘宝订单收件人ID (Open Addressee ID),长度不超过128个字符,淘宝订单加密情况用于解密。 + /// + /// + public string oaid; + /// + /// 菜鸟地址ID,针对电商平台加密订单场景使用,淘系订单使用oaid,非淘使用caid。 + /// + /// + public string caid; + + /// + /// normal-常规的字母单,multi-一票多件 + /// + /// + public string childNumType = "normal"; + /// + /// 回单数量 + /// + /// + public int backSign; + /// + /// 第三方平台模板url + /// + /// + public string thirdTemplateURL; + /// + /// 京东快运站点揽收字段 + /// + /// + public int siteCollect; + /// + /// 京东快运站点派送字段 + /// + /// + public int siteDelivery; + /// + /// 回单号 + /// + /// + public string returnNum; + /// + /// 车辆类型名称(京东快运整车需要) + /// + /// + public string vehicleTypeName; + /// + /// 车辆类型编码(京东快运整车需要) + /// + /// + public string vehicleTypeNo; + /// + /// 整车单号(京东快运整车需要) + /// + /// + public string vehicleOrderNo; + /// + /// 自定义参数,优先级高于系统生成值,即出现相同key时,使用该参数的value + /// + /// + public Dictionary customParam; + /// + /// 打印方向(默认0) 0-正方向 1-反方向 + /// + /// + public string direction; + /// + /// 打印设备,通过打印机输出的设备码进行获取 + /// + /// + public string siid; + /// + /// 打印状态回调地址 + /// + /// + public string callBackUrl; + /// + /// 签名用随机字符串,用于验证签名sign。salt值不为null时,推送数据将包含该加密签名,加密方式:md5(param+salt)。注意: salt值为空串时,推送的数据也会包含sign,此时可忽略sign的校验。 + /// + /// + public string salt; + /// + /// 是否开启订阅功能 false:不开启(默认) true:开启 说明开启订阅功能时:pollCallBackUrl必须填入 此功能只针对有快递单号的单 + /// + /// + public bool needSubscribe; + /// + /// 如果op设置为1时,pollCallBackUrl必须填入,用于跟踪回调 + /// + /// + public string pollCallBackUrl; + /// + /// 添加此字段表示开通行政区域解析或地图轨迹功能 。 + /// 0:关闭(默认) + /// 1:开通行政区域解析功能 + /// 3:开通地图轨迹及时效返回 + /// + /// + public string resultv2; + /// + /// 快递100模板url + /// + /// + public string tempId; + /// + /// 快递100子单模板url() + /// + /// + public string childTempId; + /// + /// 快递100回单模板url + /// + /// + public string backTempId; + /// + /// 是否脱敏 false:关闭(默认)true:开启 + /// + /// + public bool needDesensitization; + /// + /// 是否需要logo false:关闭(默认)true:开启 + /// + /// + public bool needLogo; + /// + /// 打印类型(HTML,IMAGE,CMD,CLOUD,NON) + /// NON:只下单不打印(默认) + /// HTML:生成html短链 + /// IMAGE:生成图片短链 + /// CMD:生成打印指令 + /// CLOUD:使用快递100云打印机打印,使用CLOUD时siid必填 + /// + /// + public string printType; + + /// + /// 第三方平台订单是否需要ocr,开启后将会通过推送方式推送 false:关闭(默认)true:开启 + /// + /// + public bool needOcr; + + /// + /// 需要检测识别的面单元素。取值范围:barcode,qrcode,receiver,sender,bulkpen。不传或者 null 则默认为 ["barcode", "receiver", "sender"] + /// + /// + public string[] ocrInclude; + + public string height; + + public string width; + /// + /// 第三方平台自定义区域模板地址 + /// + /// + public string thirdCustomTemplateUrl; + + public override string ToString() + { + return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); + } + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Label/RepeatPrintParam.cs b/Infrastructure/Kuaidi100/Common/Request/Label/RepeatPrintParam.cs new file mode 100644 index 0000000..528b1f5 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Label/RepeatPrintParam.cs @@ -0,0 +1,23 @@ +using Newtonsoft.Json; + +namespace Common.Request.Label +{ + public class RepeatPrintParam + { + /// + /// 任务ID,对应下单时返回的taskId + /// + /// + public string taskId; + /// + /// 快递100打印机,不填默认为下单时填入的siid + /// + /// + public string siid; + + public override string ToString() + { + return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); + } + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/QueryTrackParam.cs b/Infrastructure/Kuaidi100/Common/Request/QueryTrackParam.cs new file mode 100644 index 0000000..817decb --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/QueryTrackParam.cs @@ -0,0 +1,47 @@ + +using Newtonsoft.Json; + +namespace Common.Request +{ + public class QueryTrackParam + { + /** + * 查询的快递公司的编码,一律用小写字母 + */ + public string com {get; set;} + /** + * 查询的快递单号, 单号的最大长度是32个字符 + */ + public string num {get; set;} + /** + * 收件人或寄件人的手机号或固话 + */ + public string phone {get; set;} + /** + * 出发地城市,省-市-区 + */ + public string from {get; set;} + /** + * 目的地城市,省-市-区 + */ + public string to {get; set;} + /** + * 添加此字段表示开通行政区域解析功能。0:关闭(默认),1:开通行政区域解析功能,2:开通行政解析功能并且返回出发、目的及当前城市信息 + */ + public string resultv2 {get; set;} + /** + * 返回数据格式。0:json(默认),1:xml,2:html,3:text + */ + public string show {get; set;} + /** + * 返回结果排序方式。desc:降序(默认),asc:升序 + */ + public string order {get; set;} + + public override string ToString() + { + return JsonConvert.SerializeObject(this,Formatting.Indented,new JsonSerializerSettings(){NullValueHandling = NullValueHandling.Ignore}); + } + + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/QueryTrackReq.cs b/Infrastructure/Kuaidi100/Common/Request/QueryTrackReq.cs new file mode 100644 index 0000000..43154e5 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/QueryTrackReq.cs @@ -0,0 +1,19 @@ +using System ; +namespace Common.Request +{ + public class QueryTrackReq + { + /** + * 我方分配给贵司的的公司编号, 点击查看账号信息 + */ + public string customer {get; set;} + /** + * 签名, 用于验证身份, 按param + key + customer 的顺序进行MD5加密(注意加密后字符串要转大写), 不需要“+”号 + */ + public string sign {get; set;} + /** + * 其他参数组合成的json对象 + */ + public QueryTrackParam param {get; set;} + } +} diff --git a/Infrastructure/Kuaidi100/Common/Request/Sms/SendSmsReq.cs b/Infrastructure/Kuaidi100/Common/Request/Sms/SendSmsReq.cs new file mode 100644 index 0000000..d935473 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Sms/SendSmsReq.cs @@ -0,0 +1,39 @@ +namespace Common.Request.Sms +{ + public class SendSmsReq + { + /** + * 加密签名信息:MD5(key + userid);加密后字符串转大写 + */ + public string sign {get; set;} + /** + * 我方分配给贵司的的短信接口用户ID,点击查看账号信息 + */ + public string userid {get; set;} + /** + * 商户名称签名;最好用简称,该字段信息会在短信标签处显示。不要超过5个字符 + */ + public string seller {get; set;} + /** + * 接收短信手机号 + */ + public string phone {get; set;} + /** + * 短信模板ID + */ + public string tid {get; set;} + /** + * 短信模板替换内容 + */ + public string content {get; set;} + /** + * 外部订单号:当该短信发送模板有回调地址时,外部订单号会返回给调用者,方便用户更新数据 + */ + public string outorder {get; set;} + /** + * 回调地址:如果客户在发送短信时填写该参数,将按照这个参数回调短信发送状态; + * 如果为空,将按照模板配置的地址回调短信发送状态;如果两个参数都不填写,将不会回调通知状态 + */ + public string callback {get; set;} + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Subscribe/SubscribeParam.cs b/Infrastructure/Kuaidi100/Common/Request/Subscribe/SubscribeParam.cs new file mode 100644 index 0000000..c8b83fa --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Subscribe/SubscribeParam.cs @@ -0,0 +1,37 @@ +using Newtonsoft.Json; + +namespace Common.Request.Subscribe +{ + public class SubscribeParam + { + /** + * 订阅的快递公司的编码,一律用小写字母 + */ + public string company {get; set;} + /** + * 订阅的快递单号,单号的最大长度是32个字符 + */ + public string number {get; set;} + /** + * 出发地城市,省-市-区,非必填,填了有助于提升签收状态的判断的准确率,请尽量提供 + */ + public string from {get; set;} + /** + * 目的地城市,省-市-区,非必填,填了有助于提升签收状态的判断的准确率,且到达目的地后会加大监控频率,请尽量提供 + */ + public string to {get; set;} + /** + * 我方分配给贵司的的授权key + */ + public string key {get; set;} + /** + * 附加参数信息 + */ + public SubscribeParameters parameters {get; set;} + + public override string ToString() + { + return JsonConvert.SerializeObject(this,Formatting.Indented,new JsonSerializerSettings(){NullValueHandling = NullValueHandling.Ignore}); + } + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Subscribe/SubscribeParameters.cs b/Infrastructure/Kuaidi100/Common/Request/Subscribe/SubscribeParameters.cs new file mode 100644 index 0000000..261c629 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Subscribe/SubscribeParameters.cs @@ -0,0 +1,59 @@ +using Newtonsoft.Json; + +namespace Common.Request.Subscribe +{ + public class SubscribeParameters + { + /** + * 回调接口的地址。如果需要在推送信息回传自己业务参数,可以在回调地址URL后面拼接上去,如示例中的orderId + * http://www.xxxxx.com/callback?orderId=123 + */ + public string callbackurl{get; set;} + /** + * 签名用随机字符串。32位自定义字符串。添加该参数,则推送的时候会增加sign给贵司校验消息的可靠性 + */ + public string salt{get; set;} + /** + * 添加此字段表示开通行政区域解析功能。0:关闭(默认),1:开通行政区域解析功能 + */ + public string resultv2{get; set;} + /** + * 添加此字段且将此值设为1,则表示开始智能判断单号所属公司的功能, + * 开启后,company字段可为空,即只传运单号(number字段),我方收到后会根据单号判断出其所属的快递公司(即company字段)。 + * 建议只有在无法知道单号对应的快递公司(即company的值)的情况下才开启此功能。 + */ + public string autoCom{get; set;} + /** + * 添加此字段表示开启国际版 + * 开启后,若订阅的单号(即number字段)属于国际单号,会返回出发国与目的国两个国家的跟踪信息{get; set;} + * 本功能暂时只支持邮政体系(国际类的邮政小包、EMS)内的快递公司{get; set;} + * 若单号我方识别为非国际单,即使添加本字段,也不会返回destResult元素组. + */ + public string interCom{get; set;} + /** + * 出发国家编码 + */ + public string departureCountry{get; set;} + /** + * 出发国家快递公司的编码 + */ + public string departureCom{get; set;} + /** + * 目的国家编码 + */ + public string destinationCountry{get; set;} + /** + * 目的国家快递公司的编码 + */ + public string destinationCom{get; set;} + /** + * 收件人或寄件人的手机号或固话(顺丰单号必填,也可以填写后四位,如果是固话,请不要上传分机号) + */ + public string phone{get; set;} + + public override string ToString() + { + return JsonConvert.SerializeObject(this,Formatting.Indented,new JsonSerializerSettings(){NullValueHandling = NullValueHandling.Ignore}); + } + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/Subscribe/SubscribeReq.cs b/Infrastructure/Kuaidi100/Common/Request/Subscribe/SubscribeReq.cs new file mode 100644 index 0000000..a1e4cde --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/Subscribe/SubscribeReq.cs @@ -0,0 +1,14 @@ +namespace Common.Request.Subscribe +{ + public class SubscribeReq + { + /** + * 返回数据格式(json、xml、text) + */ + public string schema {get; set;} + /** + * 其他参数 + */ + public SubscribeParam param {get; set;} + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/internationalshipment/CancelReq.cs b/Infrastructure/Kuaidi100/Common/Request/internationalshipment/CancelReq.cs new file mode 100644 index 0000000..529b71c --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/internationalshipment/CancelReq.cs @@ -0,0 +1,38 @@ +using Newtonsoft.Json; + +namespace Common.Request.internationalshipment +{ + public class CancelReq + { + /// + /// 快遞單號 + /// + public string kuaidicom { get; set; } + /// + /// 快遞單號 + /// + public string kuaidinum { get; set; } + /// + /// 訂單id + /// + public string orderId { get; set; } + /// + /// 驗證信息 + /// + public ValidateInfo vi { get; set; } + /// + /// 驗證信息 + /// + public string openid { get; set; } + /// + /// 取消原因 + /// + public string reason { get; set; } + + public override string ToString() + { + return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); + } + } + +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/internationalshipment/CustomsClearance.cs b/Infrastructure/Kuaidi100/Common/Request/internationalshipment/CustomsClearance.cs new file mode 100644 index 0000000..adcf600 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/internationalshipment/CustomsClearance.cs @@ -0,0 +1,28 @@ +using Newtonsoft.Json; + +namespace Common.Request.internationalshipment +{ + public class CustomsClearance + { + /// + /// 用途(具体参考每个快递公司) + /// GIFT + /// NOT_SOLD + /// PERSONAL_EFFECTS + /// REPAIR_AND_RETURN + /// SAMPLE + /// SOLD + /// + public string purpose { get; set; } + /// + /// 是否是文件(默认 true 文件) + /// + public bool isDocument { get; set; } + + public override string ToString() + { + return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); + } + } + +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/internationalshipment/ExportInfo.cs b/Infrastructure/Kuaidi100/Common/Request/internationalshipment/ExportInfo.cs new file mode 100644 index 0000000..48c1158 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/internationalshipment/ExportInfo.cs @@ -0,0 +1,66 @@ +using Newtonsoft.Json; + +namespace Common.Request.internationalshipment +{ + public class ExportInfo + { + /// + /// 净重 + /// + public double netWeight { get; set; } + /// + /// 毛重 + /// + public double grossWeight { get; set; } + /// + /// 原产国国家代码,中国-CN,美国-US + /// + public string manufacturingCountryCode { get; set; } + /// + /// 单位价格 + /// + public double unitPrice { get; set; } + /// + /// 商品数量,INT 1 -1000000000,必须整数,小数dhl会报错,且不返回具体错误 + /// + public int quantity { get; set; } + /// + /// 计数单位,件-PCS {get; set;}双-PRS {get; set;}千克-KG {get; set;}默认件 + /// + public string quantityUnitOfMeasurement { get; set; } + /// + /// 物品描述 + /// + public string desc { get; set; } + /// + /// 进口商品编码 + /// + public string importCommodityCode { get; set; } + /// + /// 出口商品编码 + /// + public string exportCommodityCode { get; set; } + /// + /// 件数 + /// + public int numberOfPieces { get; set; } + /// + /// sku + /// + public string sku { get; set; } + /// + /// 产品的中文名 + /// + public string zhName { get; set; } + /// + /// 产品的英文名 + /// + public string enName { get; set; } + + public override string ToString() + { + return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); + } + } + +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/internationalshipment/InterManInfo.cs b/Infrastructure/Kuaidi100/Common/Request/internationalshipment/InterManInfo.cs new file mode 100644 index 0000000..5db5c23 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/internationalshipment/InterManInfo.cs @@ -0,0 +1,82 @@ +using Newtonsoft.Json; + +namespace Common.Request.internationalshipment +{ + public class InterManInfo + { + /// + /// 姓名 + /// + public string name { get; set; } + /// + /// 手机号,手机号和电话号二者其一必填 + /// + public string mobile { get; set; } + /// + /// 电话号,手机号和电话号二者其一必填 + /// + public string tel { get; set; } + /// + /// 城市 + /// + public string city { get; set; } + /// + /// 收件人所在完整地址 + /// + public string addr { get; set; } + /// + /// 州|省,可作为收件地址补充 + /// + public string province { get; set; } + /// + /// 郡|县,可作为收件地址补充 + /// + public string district { get; set; } + /// + /// 公司名称 + /// + public string company { get; set; } + /// + /// 邮编 + /// + public string zipcode { get; set; } + /// + /// 国家代号 CN-中国 ,US-美国等, 详见字典表 + /// + public string countryCode { get; set; } + /// + /// 邮箱 + /// + public string email { get; set; } + /// + /// 州或省代号,美国必填,例如纽约州-NY + /// + public string stateOrProvinceCode { get; set; } + /// + /// 税号 + /// + public string taxId { get; set; } + /// + /// 纳税人类型 + /// + public string taxType { get; set; } + /// + /// VAT税号(数字或字母);欧盟国家(含英国)使用的增值税号; + /// + public string vatNum { get; set; } + /// + /// EORI号码(数字或字母);欧盟入关时需要EORI号码,用于商品货物的清关 + /// + public string eoriNum { get; set; } + /// + /// IOSS号码 + /// + public string iossNum { get; set; } + + public override string ToString() + { + return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); + } + } + +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/internationalshipment/InvoiceInfo.cs b/Infrastructure/Kuaidi100/Common/Request/internationalshipment/InvoiceInfo.cs new file mode 100644 index 0000000..f28329c --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/internationalshipment/InvoiceInfo.cs @@ -0,0 +1,39 @@ +using Newtonsoft.Json; + +namespace Common.Request.internationalshipment +{ + public class InvoiceInfo + { + /// + /// 发票日期(格式:yyyy-MM-dd) + /// + public string date { get; set; } + /// + /// 发票号 + /// + public string number { get; set; } + /// + /// 发票类型 + /// + public string type { get; set; } + /// + /// 发票抬头,base64字符或常规字符,不同快递公司要求不一样 + /// + public string title { get; set; } + + /// + /// 发票签名(BASE64字符串) + /// + public string signature { get; set; } + /// + /// 是否启用无纸化贸易 + /// + public bool pltEnable { get; set; } + + public override string ToString() + { + return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); + } + } + +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/internationalshipment/PackageInfo.cs b/Infrastructure/Kuaidi100/Common/Request/internationalshipment/PackageInfo.cs new file mode 100644 index 0000000..e7bb682 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/internationalshipment/PackageInfo.cs @@ -0,0 +1,34 @@ +using Newtonsoft.Json; + +namespace Common.Request.internationalshipment +{ + public class PackageInfo + { + /// + /// 高度 {get; set;}单位厘米,默认1.0 + /// + public double height { get; set; } + /// + /// 宽度 {get; set;}单位厘米, 默认10.0 + /// + public double width { get; set; } + /// + /// 长度 {get; set;}单位厘米默认10.0 + /// + public double length { get; set; } + /// + /// 重量 {get; set;} 单位千克,默认0.1 + /// + public double weight { get; set; } + /// + /// 该包裹的备注信息之类 + /// + public string packageReference { get; set; } + + public override string ToString() + { + return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); + } + } + +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/internationalshipment/Payment.cs b/Infrastructure/Kuaidi100/Common/Request/internationalshipment/Payment.cs new file mode 100644 index 0000000..703cbe6 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/internationalshipment/Payment.cs @@ -0,0 +1,23 @@ +using Newtonsoft.Json; + +namespace Common.Request.internationalshipment +{ + public class Payment + { + /// + /// 运费支付方式(支付方式:SHIPPER-寄方付 {get; set;}CONSIGNEE-收方付 默认SHIPPER) + /// 关税(支付方式:DDU-寄方支付 {get; set;}DDP-收方支付 {get; set;}默认DDP) + /// + public string paymentType { get; set; } + /// + /// 账号 + /// + public string account { get; set; } + + public override string ToString() + { + return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); + } + } + +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/internationalshipment/ShipmentReq.cs b/Infrastructure/Kuaidi100/Common/Request/internationalshipment/ShipmentReq.cs new file mode 100644 index 0000000..de5bfe4 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/internationalshipment/ShipmentReq.cs @@ -0,0 +1,147 @@ +using Newtonsoft.Json; +using System.Collections.Generic; +namespace Common.Request.internationalshipment +{ + public class ShipmentReq + { + /// + /// 收件人信息 + /// + public InterManInfo recMan { get; set; } + /// + /// 寄件人信息 + /// + public InterManInfo sendMan { get; set; } + /// + /// 快递公司的编码,一律用小写字母,见参数字典) + /// + public string kuaidicom { get; set; } + /// + /// 产品类型: 默认标准快递,请参考参数字典) + /// + public string expType { get; set; } + /// + /// 物品总重量 + /// + public double weight { get; set; } + /// + /// 包裹数 + /// + public int count { get; set; } + /// + /// 备注 + /// + public string remark { get; set; } + /// + /// 货物描述 + /// + public string cargo { get; set; } + /// + /// 月结或支付账号,详见字典表 + /// + public string partnerId { get; set; } + /// + /// 月结账号密钥,详见字典表 + /// + public string partnerKey { get; set; } + /// + /// 账号参数,详见字典表 + /// + public string code { get; set; } + /// + /// 月结账号用户名,详见字典表 + /// + public string partnerName { get; set; } + /// + /// 月结账号用户密码,详见字典表 + /// + public string partnerSecret { get; set; } + /// + /// 贸易条款 {get; set;}CFR,DAP等,国际贸易规范用于,默认DAP + /// + public string tradeTerm { get; set; } + /// + /// 申报价值,包裹类必填,货币单位根据currency确定,人民币单位是元 + /// + public double customsValue { get; set; } + /// + /// 包裹信息集合 + /// + public List packageInfos { get; set; } + /// + /// 出口信息集合,一般包裹类要求必填,文件类不用填,用于清关报备 + /// + public List exportInfos { get; set; } + /// + /// 货币单位,CNY-人民币 {get; set;}USD-美元 {get; set;}默认CNY + /// + public string currency { get; set; } + /// + /// 关税支付方式,默认收件人支付 + /// + public Payment dutiesPaymentType { get; set; } + /// + /// 运费支付方式(默认寄件人支付)SHIPPER:寄方付 CONSIGNEE:到付 MONTHLY:月结 THIRDPARTY:第三方支付 + /// + public Payment freightPaymentType { get; set; } + /// + /// 下单时间(格式:yyyy-MM-dd HH:mm:ss,不传或者格式不正确默认当前时间) + /// + public string shipTime { get; set; } + /// + /// 打包方式:默认用户自行打包 + /// + public string packagingType { get; set; } + /// + /// 商业发票信息 + /// + public InvoiceInfo invoiceInfo { get; set; } + /// + /// 是否需要发票 + /// + public bool needInvoice { get; set; } + /// + /// 清关信息 + /// + public CustomsClearance customsClearance { get; set; } + /// + /// 时区,默认东八区时间 'GMT+8'预留 + /// + public string timezone { get; set; } + /// + /// SI表示千克和厘米组合;SU表示磅和英寸组合 + /// + public string unitOfMeasurement { get; set; } + /// + /// 路线ID(极兔国际必填) + /// + public string routeId { get; set; } + /// + /// 是否需要通知 + /// + public bool needNotification { get; set; } + /// + /// 通知郵箱 + /// + public string notifyEmail { get; set; } + /// + /// 送达确认签名 (0-不需要签名 1-需提供签名 2-要求成年人签名) + /// + public int needDeliveryConfirmation { get; set; } + /// + /// 是否周六交貨 + /// + public bool needSaturdayDelivery { get; set; } + /// + /// 是否包含电池 + /// + public bool butterFlag { get; set; } + + public override string ToString() + { + return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); + } + + } + +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/internationalshipment/ValidateInfo.cs b/Infrastructure/Kuaidi100/Common/Request/internationalshipment/ValidateInfo.cs new file mode 100644 index 0000000..9004ae4 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/internationalshipment/ValidateInfo.cs @@ -0,0 +1,34 @@ +using Newtonsoft.Json; + +namespace Common.Request.internationalshipment +{ + public class ValidateInfo + { + /// + /// 月结或支付账号,详见字典表 + /// + public string partnerId; + /// + /// 月结账号用户名,详见字典表 + /// + public string partnerName; + /// + /// 月结账号密钥,详见字典表 + /// + public string partnerKey; + /// + /// 月结账号用户密码,详见字典表 + /// + public string partnerSecret; + /// + /// 账号参数,详见字典表 + /// + public string code; + + public override string ToString() + { + return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); + } + } + +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/reachable/ExpressReachableParam.cs b/Infrastructure/Kuaidi100/Common/Request/reachable/ExpressReachableParam.cs new file mode 100644 index 0000000..fbe0f30 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/reachable/ExpressReachableParam.cs @@ -0,0 +1,42 @@ +using Newtonsoft.Json; + +namespace Common.Request.reachable +{ + public class ExpressReachableParam { + + + /// + /// 快递公司的编码,一律用小写字母,见《快递公司编码》 + /// + public string kuaidicom {get; set;} + /// + /// 收件人姓名 + /// + public string recManName {get; set;} + /// + /// 收件人的手机号,手机号和电话号二者其一必填 + /// + public string recManMobile {get; set;} + /// + /// 收件人所在完整地址,如广东深圳市深圳市南山区科技南十二路2号金蝶软件园 + /// + public string recManPrintAddr {get; set;} + /// + /// 寄件人姓名 + /// + public string sendManName {get; set;} + /// + /// 寄件人的手机号,手机号和电话号二者其一必填 + /// + public string sendManMobile {get; set;} + /// + /// 寄件人所在的完整地址,如广东深圳市深圳市南山区科技南十二路2号金蝶软件园B10 + /// + public string sendManPrintAddr {get; set;} + + public override string ToString() + { + return JsonConvert.SerializeObject(this,Formatting.Indented,new JsonSerializerSettings(){NullValueHandling = NullValueHandling.Ignore}); + } + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/samecity/OrderGoods.cs b/Infrastructure/Kuaidi100/Common/Request/samecity/OrderGoods.cs new file mode 100644 index 0000000..b5a785a --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/samecity/OrderGoods.cs @@ -0,0 +1,30 @@ +using Newtonsoft.Json; + +namespace Common.Request.samecity +{ + public class OrderGoods + { + /// + /// 商品名称 + /// + public string name { get; set; } + /// + /// 商品价格(分) + /// + public int price { get; set; } + /// + /// 商品数量 + /// + public int count { get; set; } + /// + /// 商品单位 + /// + public string unit { get; set; } + + public override string ToString() + { + return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); + } + } + +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/samecity/SameCityAuthParam.cs b/Infrastructure/Kuaidi100/Common/Request/samecity/SameCityAuthParam.cs new file mode 100644 index 0000000..fb15e6e --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/samecity/SameCityAuthParam.cs @@ -0,0 +1,26 @@ +using Newtonsoft.Json; + +namespace Common.Request.samecity +{ + public class SameCityAuthParam + { + /// + /// 快递公司,一律用小写字母,见参数字典 + /// + public string com { get; set; } + /// + /// 授权店铺id + /// + public string storeId { get; set; } + /// + /// 授权后信息的信息回调地址 + /// + public string callbackUrl { get; set; } + + public override string ToString() + { + return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); + } + } + +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/samecity/SameCityCancelParam.cs b/Infrastructure/Kuaidi100/Common/Request/samecity/SameCityCancelParam.cs new file mode 100644 index 0000000..92ece16 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/samecity/SameCityCancelParam.cs @@ -0,0 +1,27 @@ +using Newtonsoft.Json; + +namespace Common.Request.samecity +{ + public class SameCityCancelParam + { + + /// + /// 任务ID + /// + public string taskId { get; set; } + /// + /// 订单ID + /// + public string orderId { get; set; } + /// + /// 取消原因 + /// + public string cancelMsg { get; set; } + + public override string ToString() + { + return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); + } + } + +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/samecity/SameCityOrderParam.cs b/Infrastructure/Kuaidi100/Common/Request/samecity/SameCityOrderParam.cs new file mode 100644 index 0000000..c585755 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/samecity/SameCityOrderParam.cs @@ -0,0 +1,118 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; + +namespace Common.Request.samecity +{ + public class SameCityOrderParam + { + /// + /// 快递公司的编码,一律用小写字母,见《快递公司编码》 + /// + public string com { get; set; } + /// + /// 收件人姓名 + /// + public string recManName { get; set; } + /// + /// 收件人的手机号,手机号和电话号二者其一必填 + /// + public string recManMobile { get; set; } + /// + /// 收件人所在完整地址,如广东深圳市深圳市南山区科技南十二路2号金蝶软件园 + /// + public string recManPrintAddr { get; set; } + /// + /// 寄件人姓名 + /// + public string sendManName { get; set; } + /// + /// 寄件人的手机号,手机号和电话号二者其一必填 + /// + public string sendManMobile { get; set; } + /// + /// 寄件人所在的完整地址,如广东深圳市深圳市南山区科技南十二路2号金蝶软件园B10 + /// + public string sendManPrintAddr { get; set; } + /// + /// 服务类型 + /// + public string serviceType { get; set; } + /// + /// 物品总重量KG,例:1.5,单位kg + /// + public double weight { get; set; } + /// + /// 备注 + /// + public string remark { get; set; } + /// + /// 签名用随机字符串 + /// + public string salt { get; set; } + /// + /// callBackUrl订单信息回调 + /// + public string callbackUrl { get; set; } + /// + /// 订单类型,默认为0 0: 立即单 1: 预约单 + /// + public int orderType { get; set; } + /// + /// 取货时间(2020-02-02 22:00,指的是预约取件时间) + /// + + public string pickupTime { get; set; } + /// + /// 支付方式,SHIPPER: 寄付(默认),CONSIGNEE: 到付 + /// + public string payment { get; set; } + /// + /// 对应商家版物品来源流水号 + /// + public string orderSourceNo { get; set; } + /// + /// 物品来源 + /// + public string orderSourceType { get; set; } + /// + /// 店铺ID + /// + public string storeId { get; set; } + /// + /// 小费(分) + /// + public int additionFee { get; set; } + /// + /// 保险费用(闪送支持) + /// + public int insurance { get; set; } + /// + /// 保险产品ID(闪送支持) + /// + public string insuranceProId { get; set; } + /// + /// 商品价格 + /// + public int price { get; set; } + /// + /// 代收价格 + /// + public int CollectionPrice { get; set; } + + public string partnerId { get; set; } + + public string partnerKey { get; set; } + + /// + /// 商品详情(强烈建议提供,方便骑手在取货时确认货品信息 ;顺丰时必填) + /// + public List goods { get; set; } + + public override string ToString() + { + return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); + } + } + +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/samecity/SameCityQueryParam.cs b/Infrastructure/Kuaidi100/Common/Request/samecity/SameCityQueryParam.cs new file mode 100644 index 0000000..7a4daac --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/samecity/SameCityQueryParam.cs @@ -0,0 +1,22 @@ +using Newtonsoft.Json; + +namespace Common.Request.samecity +{ + public class SameCityQueryParam + { + /// + /// 任务ID + /// + public string taskId { get; set; } + /// + /// 订单ID + /// + public string orderId { get; set; } + + public override string ToString() + { + return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); + } + } + +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/thirdPlatform/BranchInfoParam.cs b/Infrastructure/Kuaidi100/Common/Request/thirdPlatform/BranchInfoParam.cs new file mode 100644 index 0000000..7bd8ef2 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/thirdPlatform/BranchInfoParam.cs @@ -0,0 +1,30 @@ +using Newtonsoft.Json; + +namespace Common.Request.thirdPlatform +{ + public class BranchInfoParam + { + /// + /// 调用菜鸟或淘宝第三方授权接口后获取到的partnerId值 + /// + public string partnerId { get; set; } + /// + /// 调用菜鸟或淘宝第三方授权接口后获取到的partnerKey值 + /// + public string partnerKey { get; set; } + /// + /// 菜鸟:cainiao,淘宝:taobao,京东无界:jdalpha,拼多多:pinduoduoWx,抖店:douyin + /// + public string net { get; set; } + /// + /// 快递公司编号 + /// + public string com { get; set; } + + public override string ToString() + { + return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); + } + } + +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/thirdPlatform/CommitTaskParam.cs b/Infrastructure/Kuaidi100/Common/Request/thirdPlatform/CommitTaskParam.cs new file mode 100644 index 0000000..1206349 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/thirdPlatform/CommitTaskParam.cs @@ -0,0 +1,42 @@ +using Newtonsoft.Json; + +namespace Common.Request.thirdPlatform +{ + public class CommitTaskParam + { + /// + /// 店铺类型,TAOBAO:淘宝,JINGDONG:京东,TOUTIAO:抖店,PINDUODUO:拼多多 + /// + public string shopType { get; set; } + /// + /// 店铺ID + /// + public string shopId { get; set; } + /// + /// 订单状态,UNPAY:未付款;UNSHIP:待发货(默认值);SHIPED:等待卖家确认收货;FINISH:交易成功/完成;CLOSE:交易关闭/取消 + /// + public string orderStatus { get; set; } + /// + /// 订单更新的最小时间,格式:yyyy-MM-dd HH:mm:ss + /// + public string updateAtMin { get; set; } + /// + /// 订单更新的最大时间,格式:yyyy-MM-dd HH:mm:ss + /// + public string updateAtMax { get; set; } + /// + /// 调参数sign的加密参数,非空时回调才会有sign参数 + /// + public string salt { get; set; } + /// + /// 授权后信息的信息回调地址 + /// + public string callbackUrl { get; set; } + + public override string ToString() + { + return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); + } + } + +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/thirdPlatform/PlatformAuthParam.cs b/Infrastructure/Kuaidi100/Common/Request/thirdPlatform/PlatformAuthParam.cs new file mode 100644 index 0000000..3accf7d --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/thirdPlatform/PlatformAuthParam.cs @@ -0,0 +1,30 @@ +using Newtonsoft.Json; + +namespace Common.Request.thirdPlatform +{ + public class PlatformAuthParam + { + /// + /// 请求的第三方平台,仅主账号可授权。淘宝:taobao,菜鸟:cainiao,京东:jdalpha,拼多多:pinduoduoWx,抖店:douyin + /// + public string net { get; set; } + /// + /// 已经授权完需要重新获取授权信息 + /// + public string partnerId { get; set; } + /// + /// 授权后信息的信息回调地址 + /// + public string callbackUrl { get; set; } + /// + /// web(默认),wap(只有淘宝和菜鸟可以使用) + /// + public string view { get; set; } + + public override string ToString() + { + return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); + } + } + +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/thirdPlatform/StoreAuthParam.cs b/Infrastructure/Kuaidi100/Common/Request/thirdPlatform/StoreAuthParam.cs new file mode 100644 index 0000000..3b7b425 --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/thirdPlatform/StoreAuthParam.cs @@ -0,0 +1,26 @@ +using Newtonsoft.Json; + +namespace Common.Request.thirdPlatform +{ + public class StoreAuthParam + { + /// + /// 店铺类型,TAOBAO:淘宝,JINGDONG:京东,TOUTIAO:抖店,PINDUODUO:拼多多 + /// + public string shopType { get; set; } + /// + /// 调参数sign的加密参数,非空时回调才会有sign参数 + /// + public string salt { get; set; } + /// + /// 授权后信息的信息回调地址 + /// + public string callBackUrl { get; set; } + + public override string ToString() + { + return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); + } + } + +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Common/Request/thirdPlatform/UploadNumParam.cs b/Infrastructure/Kuaidi100/Common/Request/thirdPlatform/UploadNumParam.cs new file mode 100644 index 0000000..b710eeb --- /dev/null +++ b/Infrastructure/Kuaidi100/Common/Request/thirdPlatform/UploadNumParam.cs @@ -0,0 +1,34 @@ +using Newtonsoft.Json; + +namespace Common.Request.thirdPlatform +{ + public class UploadNumParam + { + /// + /// 店铺类型,TAOBAO:淘宝,JINGDONG:京东,TOUTIAO:抖店,PINDUODUO:拼多多 + /// + public string shopType { get; set; } + /// + /// 店铺ID + /// + public string shopId { get; set; } + /// + /// 订单号,需要填写正确,否则会被电商平台的风控系统拦截 + /// + public string orderNum { get; set; } + /// + /// 快递公司编码,需要填写正确,否则会被电商平台的风控系统拦截,编码请查看参数字典 + /// + public string kuaidiCom { get; set; } + /// + /// 快递单号,需要填写正确,否则会被电商平台的风控系统拦截 + /// + public string kuaidiNum { get; set; } + + public override string ToString() + { + return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); + } + } + +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Core/AutoNum.cs b/Infrastructure/Kuaidi100/Core/AutoNum.cs new file mode 100644 index 0000000..2063121 --- /dev/null +++ b/Infrastructure/Kuaidi100/Core/AutoNum.cs @@ -0,0 +1,12 @@ +using Common; +using Utils; + +public static class AutoNum +{ + public static string query(string num, string key) + { + var url = string.Format(ApiInfoConstant.AUTO_NUM_URL,num,key); + var result = HttpUtils.doGet(url); + return result; + } +} diff --git a/Infrastructure/Kuaidi100/Core/BOrder.cs b/Infrastructure/Kuaidi100/Core/BOrder.cs new file mode 100644 index 0000000..2bdfa09 --- /dev/null +++ b/Infrastructure/Kuaidi100/Core/BOrder.cs @@ -0,0 +1,79 @@ +using Common.Request.Border; +using Common.Request; +using Utils; +using Common; +using System; +/// +/// 商家寄件(优选)接口已弃用 +/// +[Obsolete] +public static class Border +{ + /// + /// 查询运力 + /// + /// + /// + public static string transportCapacity(BaseReq param){ + + param.method = ApiInfoConstant.B_ORDER_QUERY_TRANSPORT_CAPACITY_METHOD; + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.B_ORDER_URL,request); + return result; + } + + /// + /// 下单 + /// + /// + /// + public static string order(BaseReq param){ + + param.method = ApiInfoConstant.B_ORDER_SEND_METHOD; + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.B_ORDER_URL,request); + return result; + } + + /// + /// 获取验证码 + /// + /// + /// + public static string getCode(BaseReq param){ + + param.method = ApiInfoConstant.B_ORDER_CODE_METHOD; + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.B_ORDER_URL,request); + return result; + } + + /// + /// 取消下单 + /// + /// + /// + public static string cancel(BaseReq param){ + + param.method = ApiInfoConstant.B_ORDER_CANCEL_METHOD; + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.B_ORDER_URL,request); + return result; + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Core/BOrderOfficial.cs b/Infrastructure/Kuaidi100/Core/BOrderOfficial.cs new file mode 100644 index 0000000..f83b281 --- /dev/null +++ b/Infrastructure/Kuaidi100/Core/BOrderOfficial.cs @@ -0,0 +1,78 @@ +using Common.Request; +using Common.Request.BorderOfficial; +using Utils; +using Common; +/// +/// 商家寄件(官方快递) +/// +public static class BOrderOfficial +{ + + /// + /// 下单 + /// + /// + /// + public static string order(BaseReq param){ + + param.method = ApiInfoConstant.B_ORDER_OFFICIAL_ORDER_METHOD; + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.B_ORDER_OFFICIAL_URL,request); + return result; + } + + /// + /// 商家寄件下单价格接口 + /// + /// + /// + public static string queryPrice(BaseReq param){ + + param.method = ApiInfoConstant.B_ORDER_OFFICIAL_PRICE_METHOD; + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.B_ORDER_OFFICIAL_URL,request); + return result; + } + + /// + /// 取消下单 + /// + /// + /// + public static string cancel(BaseReq param){ + + param.method = ApiInfoConstant.B_ORDER_OFFICIAL_CANCEL_METHOD; + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.B_ORDER_OFFICIAL_URL,request); + return result; + } + + /// + /// 查看订单详情 + /// + /// + /// + public static string queryDetail(BaseReq param){ + + param.method = ApiInfoConstant.DETAIL; + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.B_ORDER_OFFICIAL_URL,request); + return result; + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Core/BsamecityOrder.cs b/Infrastructure/Kuaidi100/Core/BsamecityOrder.cs new file mode 100644 index 0000000..00b1e13 --- /dev/null +++ b/Infrastructure/Kuaidi100/Core/BsamecityOrder.cs @@ -0,0 +1,95 @@ +using Common.Request; +using Common.Request.Bsamecity; +using Utils; +using Common; +/// +/// 同城寄件 +/// +public static class BsamecityOrder +{ + + /// + /// 预下单 + /// + /// + /// + public static string price(BaseReq param){ + + param.method = ApiInfoConstant.BSAMECITY_EXPRESS_PRICE; + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.BSAMECITY_EXPRESS_URL,request); + return result; + } + + /// + /// 下单 + /// + /// + /// + public static string order(BaseReq param){ + + param.method = ApiInfoConstant.BSAMECITY_EXPRESS_ORDER; + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.BSAMECITY_EXPRESS_URL,request); + return result; + } + + /// + /// 预取消 + /// + /// + /// + public static string precancel(BaseReq param){ + + param.method = ApiInfoConstant.BSAMECITY_EXPRESS_PRECANCEL; + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.BSAMECITY_EXPRESS_URL,request); + return result; + } + + /// + /// 取消 + /// + /// + /// + public static string cancel(BaseReq param){ + + param.method = ApiInfoConstant.BSAMECITY_EXPRESS_CANCEL; + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.BSAMECITY_EXPRESS_URL,request); + return result; + } + + /// + /// 加小费 + /// + /// + /// + public static string addfee(BaseReq param){ + + param.method = ApiInfoConstant.BSAMECITY_EXPRESS_ADDFEE; + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.BSAMECITY_EXPRESS_URL,request); + return result; + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Core/COrder.cs b/Infrastructure/Kuaidi100/Core/COrder.cs new file mode 100644 index 0000000..371a5c7 --- /dev/null +++ b/Infrastructure/Kuaidi100/Core/COrder.cs @@ -0,0 +1,64 @@ +using Common.Request.Corder; +using Common.Request; +using Utils; +using Common; +using System; +/// +/// c端寄件 +/// +public static class Corder +{ + + /// + /// 下单 + /// + /// + /// + public static string order(BaseReq param){ + + param.method = ApiInfoConstant.CORDER; + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.C_ORDER_URL,request); + return result; + } + + + + /// + /// C端寄件下单取消接口 + /// + /// + /// + public static string cancel(BaseReq param){ + + param.method = ApiInfoConstant.CANCEL_METHOD; + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.C_ORDER_URL,request); + return result; + } + + /// + /// C端寄件价格查询接口 + /// + /// + /// + public static string queryPrice(BaseReq param){ + + param.method = ApiInfoConstant.PRICE; + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.C_ORDER_URL,request); + return result; + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Core/CloudPrint.cs b/Infrastructure/Kuaidi100/Core/CloudPrint.cs new file mode 100644 index 0000000..7d8d86b --- /dev/null +++ b/Infrastructure/Kuaidi100/Core/CloudPrint.cs @@ -0,0 +1,106 @@ +using Common.Request; +using Common.Request.cloud; +using Utils; +using Common; +/// +/// 订单导入 +/// +public static class CloudPrint +{ + + /// + /// 自定义打印接口 + /// + /// + /// + public static string custom(BaseReq param){ + param.method = ApiInfoConstant.CLOUD_PRINT_CUSTOM_METHOD; + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doGet(HttpUtils.buildUrl(ApiInfoConstant.CLOUD_PRINT_URL,param)); + return result; + } + + /// + /// 附件打印接口 + /// + /// + /// + public static string attachment(BaseReq param,string filePath,string filename){ + param.method = ApiInfoConstant.CLOUD_PRINT_ATTACHMENT_METHOD; + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostMultipartFormData(HttpUtils.buildUrl(ApiInfoConstant.CLOUD_PRINT_URL,param),filePath,filename); + return result; + } + + /// + /// 硬件状态接口 + /// + /// + /// + public static string devStatus(BaseReq param){ + param.method = ApiInfoConstant.CLOUD_PRINT_DEV_STATUS; + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doGet(HttpUtils.buildUrl(ApiInfoConstant.CLOUD_PRINT_URL,param)); + return result; + } + + /// + /// 复打 + /// + /// + /// + public static string printOld(BaseReq param){ + param.method = ApiInfoConstant.CLOUD_PRINT_OLD_METHOD; + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.ELECTRONIC_ORDER_PIC_URL,request); + return result; + } + + /// + /// 指令打印接口 + /// + /// + /// + public static string commandPrint(BaseReq param){ + param.method = ApiInfoConstant.CLOUD_PRINT_COMMAND; + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.ELECTRONIC_ORDER_PRINT_URL,request); + return result; + } + + /// + /// 发货单接口 + /// + /// + /// + public static string billParcels(BaseReq> param){ + param.method = ApiInfoConstant.BILL_PARCELS_METHOD; + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.BILL_PARCELS_URL,request); + return result; + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Core/ExpressReachable.cs b/Infrastructure/Kuaidi100/Core/ExpressReachable.cs new file mode 100644 index 0000000..097e4b4 --- /dev/null +++ b/Infrastructure/Kuaidi100/Core/ExpressReachable.cs @@ -0,0 +1,27 @@ +using Common.Request; +using Common.Request.reachable; +using Utils; +using Common; +/// +/// 商家寄件(官方快递) +/// +public static class ExpressReachable +{ + + /// + /// 可用性查询 + /// + /// + /// + public static string query(BaseReq param){ + + param.method = ApiInfoConstant.EXPRESS_REACHABLE_METHOD; + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.EXPRESS_REACHABLE_URL,request); + return result; + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Core/InternationalShipment.cs b/Infrastructure/Kuaidi100/Core/InternationalShipment.cs new file mode 100644 index 0000000..2488faa --- /dev/null +++ b/Infrastructure/Kuaidi100/Core/InternationalShipment.cs @@ -0,0 +1,29 @@ +using Common.Request; +using Common.Request.internationalshipment; +using Utils; +using Common; +/// +/// 国际电子面单API +/// +public static class InternationalShipment +{ + + /// + /// 获取面单 + /// + /// + /// + public static string getLabel(BaseReq param){ + + + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.INTERNATIONAL_SHIPMENT_URL,request); + return result; + } + + +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Core/LabelV2.cs b/Infrastructure/Kuaidi100/Core/LabelV2.cs new file mode 100644 index 0000000..5174309 --- /dev/null +++ b/Infrastructure/Kuaidi100/Core/LabelV2.cs @@ -0,0 +1,78 @@ +using Common.Request; +using Common.Request.Label; +using Utils; +using Common; +/// +/// 商家寄件(官方快递) +/// +public static class LabelV2 +{ + + /// + /// 下单 + /// + /// + /// + public static string order(BaseReq param){ + + param.method = ApiInfoConstant.ORDER; + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.NEW_TEMPLATE_URL,request); + return result; + } + + /// + /// 复打 + /// + /// + /// + public static string repeatPrint(BaseReq param){ + + param.method = ApiInfoConstant.CLOUD_PRINT_OLD_METHOD; + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.NEW_TEMPLATE_URL,request); + return result; + } + + /// + /// 自定义打印 + /// + /// + /// + public static string customPrint(BaseReq param){ + + param.method = ApiInfoConstant.CUSTOM; + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.NEW_TEMPLATE_URL,request); + return result; + } + + /// + /// 快递预估时效查询 + /// + /// + /// + public static string deliveryTime(BaseReq param){ + + param.method = ApiInfoConstant.TIME; + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.NEW_TEMPLATE_URL,request); + return result; + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Core/Ocr.cs b/Infrastructure/Kuaidi100/Core/Ocr.cs new file mode 100644 index 0000000..418fc3f --- /dev/null +++ b/Infrastructure/Kuaidi100/Core/Ocr.cs @@ -0,0 +1,18 @@ +using Common; +using Utils; +using Common.Request; +using Common.Request.Electronic.ocr; + +public static class Ocr +{ + public static string ocr(BaseReq param) + { + + var request = ObjectToDictionaryUtils.ObjectToMap(param); + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.OCR_URL,request); + return result; + } +} diff --git a/Infrastructure/Kuaidi100/Core/PrintCloud.cs b/Infrastructure/Kuaidi100/Core/PrintCloud.cs new file mode 100644 index 0000000..c8da572 --- /dev/null +++ b/Infrastructure/Kuaidi100/Core/PrintCloud.cs @@ -0,0 +1,37 @@ + +using Utils; +using Common; +using Common.Request; +using Common.Request.Electronic; +using Common.Request.Electronic.Print; + +public class PrintCloud{ + + + public static string query(PrintCloudReq param){ + + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.ELECTRONIC_ORDER_PRINT_URL,request); + return result; + } + + /// + /// 面单取消 + /// + /// + /// + public static string cancel(BaseReq param){ + param.method = ApiInfoConstant.CANCEL_METHOD; + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.ELECTRONIC_ORDER_HTML_URL,request); + return result; + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Core/PrintHtml.cs b/Infrastructure/Kuaidi100/Core/PrintHtml.cs new file mode 100644 index 0000000..798e0e1 --- /dev/null +++ b/Infrastructure/Kuaidi100/Core/PrintHtml.cs @@ -0,0 +1,19 @@ + +using Utils; +using Common; +using Common.Request.Electronic.Html; + +public class PrintHtml{ + + + public static string query(PrintHtmlReq param){ + + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.ELECTRONIC_ORDER_HTML_URL,request); + return result; + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Core/PrintImg.cs b/Infrastructure/Kuaidi100/Core/PrintImg.cs new file mode 100644 index 0000000..3643cd2 --- /dev/null +++ b/Infrastructure/Kuaidi100/Core/PrintImg.cs @@ -0,0 +1,19 @@ + +using Utils; +using Common; +using Common.Request.Electronic.Image; + +public class PrintImg{ + + + public static string query(PrintImgReq param){ + + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.ELECTRONIC_ORDER_PRINT_URL,request); + return result; + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Core/QueryTrack.cs b/Infrastructure/Kuaidi100/Core/QueryTrack.cs new file mode 100644 index 0000000..4578277 --- /dev/null +++ b/Infrastructure/Kuaidi100/Core/QueryTrack.cs @@ -0,0 +1,21 @@ + +using System.Collections; +using Newtonsoft.Json; +using System.Collections.Generic; +using Utils; +using Common; +using Common.Request; + +public class QueryTrack{ + + + public static string query(QueryTrackReq query){ + + var request = ObjectToDictionaryUtils.ObjectToMap(query); + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.QUERY_URL,request); + return result; + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Core/QueryTrackWithMap.cs b/Infrastructure/Kuaidi100/Core/QueryTrackWithMap.cs new file mode 100644 index 0000000..ed0c4e9 --- /dev/null +++ b/Infrastructure/Kuaidi100/Core/QueryTrackWithMap.cs @@ -0,0 +1,21 @@ + +using System.Collections; +using Newtonsoft.Json; +using System.Collections.Generic; +using Utils; +using Common; +using Common.Request; + +public class QueryTrackWithMap{ + + + public static string query(QueryTrackReq query){ + + var request = ObjectToDictionaryUtils.ObjectToMap(query); + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.QUERY_URL_WITH_MAP,request); + return result; + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Core/SameCity.cs b/Infrastructure/Kuaidi100/Core/SameCity.cs new file mode 100644 index 0000000..d86bb0e --- /dev/null +++ b/Infrastructure/Kuaidi100/Core/SameCity.cs @@ -0,0 +1,78 @@ +using Common.Request; +using Common.Request.samecity; +using Utils; +using Common; +/// +/// 同城配送 +/// +public static class SameCity +{ + + /// + /// 同城配送账号授权接口 + /// + /// + /// + public static string auth(BaseReq param){ + + param.method = ApiInfoConstant.SAME_CITY_AUTH_METHOD; + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.SAME_CITY_ORDER_URL,request); + return result; + } + + /// + /// 同城配送下单 + /// + /// + /// + public static string order(BaseReq param){ + + param.method = ApiInfoConstant.SAME_CITY_ORDER_METHOD; + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.SAME_CITY_ORDER_URL,request); + return result; + } + + /// + /// 同城配送查询订单 + /// + /// + /// + public static string query(BaseReq param){ + + param.method = ApiInfoConstant.SAME_CITY_QUERY_METHOD; + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.SAME_CITY_ORDER_URL,request); + return result; + } + + /// + /// 取消下单 + /// + /// + /// + public static string cancel(BaseReq param){ + + param.method = ApiInfoConstant.SAME_CITY_CANCEL_METHOD; + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.SAME_CITY_ORDER_URL,request); + return result; + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Core/SendSms.cs b/Infrastructure/Kuaidi100/Core/SendSms.cs new file mode 100644 index 0000000..21c66ee --- /dev/null +++ b/Infrastructure/Kuaidi100/Core/SendSms.cs @@ -0,0 +1,19 @@ + +using Utils; +using Common; +using Common.Request; +using Common.Request.Sms; + +public class SendSms{ + + + public static string query(SendSmsReq query){ + + var request = ObjectToDictionaryUtils.ObjectToMap(query); + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.SEND_SMS_URL,request); + return result; + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Core/Subscribe.cs b/Infrastructure/Kuaidi100/Core/Subscribe.cs new file mode 100644 index 0000000..6bbf093 --- /dev/null +++ b/Infrastructure/Kuaidi100/Core/Subscribe.cs @@ -0,0 +1,22 @@ + +using System.Collections; +using Newtonsoft.Json; +using System.Collections.Generic; +using Utils; +using Common; +using Common.Request.Subscribe; + +public class Subscribe{ + + + public static string subscribe(SubscribeReq subscribeReq){ + + var request = ObjectToDictionaryUtils.ObjectToMap(subscribeReq); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.SUBSCRIBE_URL,request); + return result; + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Core/SubscribeWithMap.cs b/Infrastructure/Kuaidi100/Core/SubscribeWithMap.cs new file mode 100644 index 0000000..51472a5 --- /dev/null +++ b/Infrastructure/Kuaidi100/Core/SubscribeWithMap.cs @@ -0,0 +1,22 @@ + +using System.Collections; +using Newtonsoft.Json; +using System.Collections.Generic; +using Utils; +using Common; +using Common.Request.Subscribe; + +public class SubscribeWithMap{ + + + public static string subscribe(SubscribeReq subscribeReq){ + + var request = ObjectToDictionaryUtils.ObjectToMap(subscribeReq); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.SUBSCRIBE_URL_WITH_MAP,request); + return result; + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Core/ThirdPlatformOrder.cs b/Infrastructure/Kuaidi100/Core/ThirdPlatformOrder.cs new file mode 100644 index 0000000..9d19b53 --- /dev/null +++ b/Infrastructure/Kuaidi100/Core/ThirdPlatformOrder.cs @@ -0,0 +1,93 @@ +using Common.Request; +using Common.Request.thirdPlatform; +using Utils; +using Common; +/// +/// 订单导入 +/// +public static class ThirdPlatformOrder +{ + + /// + /// 获取店铺授权超链接接口 + /// + /// + /// + public static string auth(BaseReq param){ + + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.THIRD_PLATFORM_ORDER_SHOP_AUTHORIZE_url,request); + return result; + } + + /// + /// 提交订单获取任务接口 + /// + /// + /// + public static string commitTask(BaseReq param){ + + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.THIRD_PLATFORM_ORDER_COMMIT_TASK,request); + return result; + } + + /// + /// 快递单号回传及订单发货接口 + /// + /// + /// + public static string uploadNum(BaseReq param){ + + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.THIRD_PLATFORM_ORDER_UPLOAD_NUM,request); + return result; + } + + /// + /// 第三方电商平台账号授权 + /// + /// + /// + public static string platformAuth(BaseReq param){ + + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.AUTH_THIRD_URL,request); + return result; + } + + /// + /// 面单余额 + /// + /// + /// + public static string branchInfo(BaseReq param){ + + param.method = ApiInfoConstant.THIRD_PLATFORM_BRANCH_INFO_METHOD; + var request = ObjectToDictionaryUtils.ObjectToMap(param); + + if(request == null){ + return null; + } + var result = HttpUtils.doPostForm(ApiInfoConstant.ELECTRONIC_ORDER_HTML_URL,request); + return result; + } + + +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Kuaidi100.cs b/Infrastructure/Kuaidi100/Kuaidi100.cs new file mode 100644 index 0000000..5a38a85 --- /dev/null +++ b/Infrastructure/Kuaidi100/Kuaidi100.cs @@ -0,0 +1,1254 @@ + +using System; +using Common; +using Common.Request; +using Common.Request.Subscribe; +using Utils; +using Newtonsoft.Json; +using Common.Request.Electronic.Image; +using Common.Request.Electronic.Html; +using Common.Request.Electronic; +using Common.Request.Electronic.Print; +using Common.Request.Sms; +using Common.Request.BorderOfficial; +using Common.Request.internationalshipment; +using Common.Request.cloud; +using Common.Request.samecity; +using Common.Request.thirdPlatform; +using System.Collections; +using System.Collections.Generic; +using Common.Request.Electronic.ocr; +using Common.Request.Label; +using Common.Request.Corder; +using Common.Request.reachable; +using Common.Request.Bsamecity; + + +namespace Infrastructure.Kuaidi100; +public static class Kuaidi100 +{ + + + //快递100的基础账号信息,可以在这里获取 (需要填写完整才能测试) + //https://api.kuaidi100.com/manager/v2/myinfo/enterprise + + private static KuaiDi100Config config = new() + { + key = AppSettings.GetConfig("Kuaidi100Setting:key"), + customer = AppSettings.GetConfig("Kuaidi100Setting:customer"), + secret = AppSettings.GetConfig("Kuaidi100Setting:secret"), + userid = AppSettings.GetConfig("Kuaidi100Setting:userid"), + siid = AppSettings.GetConfig("Kuaidi100Setting:siid"), + tid = AppSettings.GetConfig("Kuaidi100Setting:tid"), + }; + + /// + /// 轨迹物流查询 + /// + /// 物流公司code + /// 物流单号 + /// 电话号码 + public static string GetQueryTrack(string com,string num,string phone = "") + { + var queryTrackParam = new QueryTrackParam() + { + com = com, + num = num, + phone = phone + }; + + var res = QueryTrack.query(new QueryTrackReq() + { + customer = config.customer, + sign = SignUtils.GetMD5(queryTrackParam.ToString() + config.key + config.customer), + param = queryTrackParam + }); + + return res; + } + + /// + /// 轨迹订阅 + /// + static void testSubscribe() + { + var subscribeParameters = new SubscribeParameters() + { + phone = "159*****256", + resultv2 = "1", + callbackurl = "http://www.xxxx.com" + }; + + var subscribeParam = new SubscribeParam() + { + company = "zhongtong", + number = "7537****693697", + key = config.key, + parameters = subscribeParameters + }; + + Subscribe.subscribe(new SubscribeReq() + { + schema = ApiInfoConstant.SUBSCRIBE_SCHEMA, + param = subscribeParam, + }); + } + + /// + /// 地图轨迹物流查询 + /// + static void testQueryTrackWithMap() + { + var queryTrackParam = new QueryTrackParam() + { + com = "zhongtong", + num = "7537****693697", + phone = "159****8256", + from = "北京海淀区", + to = "深圳南山区" + }; + + QueryTrackWithMap.query(new QueryTrackReq() + { + customer = config.customer, + sign = SignUtils.GetMD5(queryTrackParam.ToString() + config.key + config.customer), + param = queryTrackParam + }); + } + + /// + /// 地图轨迹订阅 + /// + static void testSubscribeWithMap() + { + var subscribeParameters = new SubscribeParameters() + { + phone = "159****8256", + resultv2 = "1", + callbackurl = "http://www.xxxx.com" + }; + + var subscribeParam = new SubscribeParam() + { + company = "zhongtong", + number = "7537****3697", + key = config.key, + parameters = subscribeParameters, + from = "北京海淀区", + to = "深圳南山区" + }; + + SubscribeWithMap.subscribe(new SubscribeReq() + { + schema = ApiInfoConstant.SUBSCRIBE_SCHEMA, + param = subscribeParam, + }); + } + + /// + /// 电子面单V2打印接口 + /// + static void testLabelOrder() + { + var orderParam = new OrderParam() + { + kuaidicom = "zhaijisong", + sendMan = new ManInfo() + { + name = "张三", + mobile = "15****98256", + printAddr = "西藏日喀则市定日县珠穆朗玛峰", + }, + recMan = new ManInfo() + { + name = "李四", + mobile = "15****98256", + printAddr = "西藏日喀则市定日县珠穆朗玛峰", + }, + count = 1, + siid = config.siid, + tempId = "60f6c17c7c223700131d8bc3", + printType = "CLOUD" + }; + + var timestamp = DateUtils.GetTimestamp(); + LabelV2.order(new BaseReq() + { + method = ApiInfoConstant.ORDER, + key = config.key, + t = timestamp, + sign = SignUtils.GetMD5(orderParam.ToString() + timestamp + config.key + config.secret), + param = orderParam, + }); + } + + /// + /// 电子面单V2复打接口 + /// + static void testLabelRepeatPrint() + { + var orderParam = new RepeatPrintParam() + { + + taskId = "638687EEB4744396A40F693541114E44" + }; + + var timestamp = DateUtils.GetTimestamp(); + LabelV2.repeatPrint(new BaseReq() + { + method = ApiInfoConstant.CLOUD_PRINT_OLD_METHOD, + key = config.key, + t = timestamp, + sign = SignUtils.GetMD5(orderParam.ToString() + timestamp + config.key + config.secret), + param = orderParam, + }); + } + + /// + /// 自定义接口 + /// + static void testLabelCustomPrint() + { + + var customParam = new Dictionary(); + customParam.Add("qrcode", "888888888"); + var orderParam = new CustomPrintParam() + { + + siid = config.siid, + tempId = "41b9d19ee56b45b5a23d7b6ace4f9029", + printType = "IMAGE", + customParam = customParam + }; + + var timestamp = DateUtils.GetTimestamp(); + LabelV2.customPrint(new BaseReq() + { + method = ApiInfoConstant.CUSTOM, + key = config.key, + t = timestamp, + sign = SignUtils.GetMD5(orderParam.ToString() + timestamp + config.key + config.secret), + param = orderParam, + }); + } + + /// + /// 快递预估时效查询接口 + /// + static void testDeliveryTime() + { + + var deliveryTimeParam = new DeliveryTimeParam() + { + + kuaidicom = "jd", + from = "广东省深圳市南山区", + to = "广东省深圳市南山区", + orderTime = "2023-10-12 10:00:00", + expType = "特惠送" + }; + + var timestamp = DateUtils.GetTimestamp(); + LabelV2.deliveryTime(new BaseReq() + { + method = ApiInfoConstant.TIME, + key = config.key, + t = timestamp, + sign = SignUtils.GetMD5(deliveryTimeParam.ToString() + timestamp + config.key + config.secret), + param = deliveryTimeParam, + }); + } + + /// + /// 电子面单图片接口(v1版本示例,建议使用v2) + /// + static void testPrintImg() + { + var printImgParam = new PrintImgParam() + { + kuaidicom = "zhaijisong", + sendManName = "张三", + sendManMobile = "159****8256", + sendManPrintAddr = "广东省深圳市南山区科技南十二路", + recManName = "李四", + recManMobile = "159****8256", + recManPrintAddr = "北京市海淀区xxx路", + type = "10", + tempid = "180c7c8f646742ca871a92c976392b05", + count = "1", + width = "76", + height = "130", + }; + + var timestamp = DateUtils.GetTimestamp(); + PrintImg.query(new PrintImgReq() + { + method = ApiInfoConstant.ELECTRONIC_ORDER_PIC_METHOD, + key = config.key, + t = timestamp, + sign = SignUtils.GetMD5(printImgParam.ToString() + timestamp + config.key + config.secret), + param = printImgParam, + }); + } + + /// + /// 电子面单html接口(v1版本示例,建议使用v2) + /// + static void testPrintHtml() + { + var printHtmlParam = new PrintHtmlParam() + { + kuaidicom = "zhaijisong", + sendMan = new ManInfo() + { + name = "张三", + mobile = "159****8256", + printAddr = "广东省深圳市南山区科技南十二路", + }, + recMan = new ManInfo() + { + name = "李四", + mobile = "159****8256", + printAddr = "北京市海淀区xxx路", + }, + count = "1", + needTemplate = "1", //如果需要返回电子面单,需要设置 + }; + + var timestamp = DateUtils.GetTimestamp(); + PrintHtml.query(new PrintHtmlReq() + { + method = ApiInfoConstant.ELECTRONIC_ORDER_HTML_METHOD, + key = config.key, + t = timestamp, + sign = SignUtils.GetMD5(printHtmlParam.ToString() + timestamp + config.key + config.secret), + param = printHtmlParam, + }); + } + + /// + /// 电子面单打印接口(v1版本示例,建议使用v2) + /// + static void testPrintCloud() + { + var printCloudParam = new PrintCloudParam() + { + kuaidicom = "zhaijisong", + sendMan = new ManInfo() + { + name = "张三", + mobile = "15****98256", + printAddr = "广东省深圳市南山区科技南十二路", + }, + recMan = new ManInfo() + { + name = "李四", + mobile = "15****98256", + printAddr = "北京市海淀区xxx路", + }, + count = "1", + siid = config.siid, + tempid = "180c7c8f646742ca871a92c976392b05", + width = "76", + height = "130" + }; + + var timestamp = DateUtils.GetTimestamp(); + PrintCloud.query(new PrintCloudReq() + { + method = ApiInfoConstant.ELECTRONIC_ORDER_PRINT_METHOD, + key = config.key, + t = timestamp, + sign = SignUtils.GetMD5(printCloudParam.ToString() + timestamp + config.key + config.secret), + param = printCloudParam, + }); + } + + /// + /// 发送短信 + /// + static void testSendSms() + { + var content = new Hashtable(); + content.Add("username", "测试用户"); + + SendSms.query(new SendSmsReq() + { + content = JsonConvert.SerializeObject(content), + phone = "xxx", + seller = "测试", + userid = config.userid, + tid = config.tid, + sign = SignUtils.GetMD5(config.key + config.userid) + }); + } + + /// + /// 智能识别 + /// + static void testAutoNum() + { + AutoNum.query("773039762404825", config.key); + } + + /// + /// 商家寄件查询价格 + /// + static void testBOrderQuery() + { + var timestamp = DateUtils.GetTimestamp(); + var baseParam = new BOrderOfficialQueryPriceParam() + { + sendManPrintAddr = "福田区华强北", + kuaidiCom = "jtexpress", + recManPrintAddr = "北京海淀区" + }; + BaseReq baseReq = new BaseReq() + { + key = config.key, + t = timestamp, + sign = SignUtils.GetMD5(baseParam.ToString() + timestamp + config.key + config.secret), + param = baseParam + }; + BOrderOfficial.queryPrice(baseReq); + } + + /// + /// 商家寄件下单 + /// 注意保存一下返回值(taskId和orderId),用于获取验证码或者取消订单 + /// + static void testBOrder() + { + var timestamp = DateUtils.GetTimestamp(); + var baseParam = new BOrderOfficialOrderParam() + { + kuaidicom = "jtexpress", + recManName = "张三", + recManMobile = "159953225555", + recManPrintAddr = "西藏日喀则市定日县珠穆朗玛峰", + sendManName = "李四", + sendManMobile = "15333333333", + sendManPrintAddr = "西藏日喀则市定日县珠穆朗玛峰", + cargo = "文件", + weight = "1", + remark = "测试单,待会取消", + salt = "123", + callBackUrl = "http://www.xxxx.com", + serviceType = "标准快递" + }; + BaseReq baseReq = new BaseReq() + { + key = config.key, + t = timestamp, + sign = SignUtils.GetMD5(baseParam.ToString() + timestamp + config.key + config.secret), + param = baseParam + }; + BOrderOfficial.order(baseReq); + } + + /// + /// 商家寄件取消寄件 + /// 入参为下单接口返回的taskId和orderId + /// + static void testBOrderCancel() + { + var timestamp = DateUtils.GetTimestamp(); + var baseParam = new BOrderOfficialCancelParam() + { + taskId = "9406BFCD6******1E0E00D23047FFB", + orderId = "169**740", + cancelMsg = "测试单" + }; + BaseReq baseReq = new BaseReq() + { + key = config.key, + t = timestamp, + sign = SignUtils.GetMD5(baseParam.ToString() + timestamp + config.key + config.secret), + param = baseParam + }; + BOrderOfficial.cancel(baseReq); + } + + /// + /// 国际电子面单API + /// + static void testInternationalShipment() + { + var timestamp = DateUtils.GetTimestamp(); + List packageInfoList = new List(); + var packageInfo = new PackageInfo() + { + length = 10.00, + width = 20.00, + height = 10.00, + weight = 50.00 + }; + packageInfoList.Add(packageInfo); + List exportInfoList = new List(); + var exportInfo = new ExportInfo() + { + desc = "test", + grossWeight = 50.00, + quantity = 1, + quantityUnitOfMeasurement = "PCS", + manufacturingCountryCode = "CN", + unitPrice = 100 + }; + exportInfoList.Add(exportInfo); + var baseParam = new ShipmentReq() + { + partnerId = "", + partnerKey = "", + partnerSecret = "", + code = "", + kuaidicom = "fedex", + cargo = "invoice", + expType = "FedEx International First®", + unitOfMeasurement = "SU", + weight = 50.00, + customsValue = 1000.00, + sendMan = new InterManInfo() + { + name = "test", + mobile = "1688888888", + countryCode = "CN", + city = "SHENZHEN", + addr = "Hi-tech Park,Nanshang District", + zipcode = "518057", + email = "TEST@QQ.COM" + }, + recMan = new InterManInfo() + { + name = "test", + mobile = "1688888888", + countryCode = "US", + city = "NEW YORK", + addr = " 70 Washington Square South", + zipcode = "10012", + stateOrProvinceCode = "NY", + email = "TEST@QQ.COM" + }, + packageInfos = packageInfoList, + exportInfos = exportInfoList, + customsClearance = new CustomsClearance() + { + purpose = "GIFT", + isDocument = true, + } + }; + BaseReq baseReq = new BaseReq() + { + key = config.key, + t = timestamp, + sign = SignUtils.GetMD5(baseParam.ToString() + timestamp + config.key + config.secret), + param = baseParam + }; + InternationalShipment.getLabel(baseReq); + } + + /// + /// 自定义打印接口(v1版本示例,建议使用v2) + /// + static void testCloudPrintCustom() + { + var timestamp = DateUtils.GetTimestamp(); + var baseParam = new CustomParam() + { + tempid = "180c7c8f646742ca871a92c976392b05", + callBackUrl = "http://www.xxxx.com", + siid = config.siid, + }; + BaseReq baseReq = new BaseReq() + { + key = config.key, + t = timestamp, + sign = SignUtils.GetMD5(baseParam.ToString() + timestamp + config.key + config.secret), + param = baseParam + }; + CloudPrint.custom(baseReq); + } + + /// + /// 云打印附件 + /// + static void testCloudAttachment() + { + string filePath = "C:\\Users\\Administrator.-20171106WFEKLN\\Desktop\\2.png"; + string filename = "2.png"; + var timestamp = DateUtils.GetTimestamp(); + var baseParam = new AttachmentParam() + { + callBackUrl = "http://www.xxxx.com", + siid = config.siid, + }; + BaseReq baseReq = new BaseReq() + { + key = config.key, + t = timestamp, + sign = SignUtils.GetMD5(baseParam.ToString() + timestamp + config.key + config.secret), + param = baseParam + }; + CloudPrint.attachment(baseReq, filePath, filename); + } + + /// + /// 复打 + /// + static void testCloudPrintOld() + { + + var timestamp = DateUtils.GetTimestamp(); + var baseParam = new PrintOldParam() + { + taskId = "0E0D2AC5D******463DAF1DA5F9" + }; + BaseReq baseReq = new BaseReq() + { + key = config.key, + t = timestamp, + sign = SignUtils.GetMD5(baseParam.ToString() + timestamp + config.key + config.secret), + param = baseParam + }; + CloudPrint.printOld(baseReq); + } + + /// + /// 指令打印接口 + /// + static void testCloudPrintCommand() + { + + var timestamp = DateUtils.GetTimestamp(); + var baseParam = new CommandParam() + { + content = "H4sIAAAAAAAAAO1cXWwdx3We9RpZQpC0BvoQPQhdgnnoDxbW3fu71yC48V9RAbWTWmoa9CmF0aIB4oQOApQBBO7SBMo8FOZr3whKD7ULu7Ajyo5t2VzqKr4KFYuUFVEBWld7tU2IBjG0FB80lFczPefs7uXey2Vs0kaBtneku3O038y3M2fOnDkzu9CJ43/15LBVKj1cGn7uOdOyE+HQgSeOP/Pk4yePf+3p4dKhA4//2YlDBx47fvKpR78+bNVNq1Jrms26aZfMkikHaZAGaZAGaZAGaZAG6f9oCqVsQRbDbwbEjpRzXawNPyOSoTCk1KWM9sk/LaXPmJHxz0gxyrTY5nijy3/QQf7Z2P08/AFjmtS6/N6QEimeTvxDxr75Pabn+AOmEP8ElyzHf1DfF7/HmMuYTnLGr4pRp80nuAB+0o/HXHmY2jDLlH3xc8pUOd2RyH/UmeF8XDT5FrafASh1A/iPqvvgn9Rllx/GtyNDfpBpkc+MH+b5F/fLf8qRszzmxA+knZWM//fZ0Bbqh00aHMFIxuqex9eXMfIn7YfM6LSB35lJ+an9n4+fM4349ZmQ+KdD0H87xw/2k/JDQ/bKz1ziB/0Q/2G3E6honwHnMrCVbH7FmowYky/Cb4/8Tq794tSk07lD/D7w+0e69rl/fiPWZzL++NSY0RFaxv/CkBIz5nwe/vgr+n3gR/8GKo5HRx3wQALmG/ALbU4iP8w6lyvEP00+aQ+Jf0WTwA8UBvCLMdsF/jjl1+eghHBwDkaKFG5HqHvlj56dzvOfGnNBtIeY4oNX8qBH0H72bCQ7DOx4KX5gr/oJwiXJNF16KupHxGOygL8VyaUhNzZa++YXMO9hfBP/xiaOMGU14Uf9qEsd2RpyhDEdH94r/3QYoH/zj3I95Qf1T46VZAT8MxJnnBNGS1IF//wlXc7O7lH/aidy9ODLvh3380t02K2EX5XaYdDhPvgZG3L1wOoEWwbwy0iHOweBX43u3wfnpxI/14R+WJWeIWe1PfL/iB2EpXsj1b/0FOIfBX7+LeTf+kfXCWONG/qU9MERtvbI/0/sMPCH/LBC9kNuFPllFI27qJ8XKwa0nzt6i9rf3uv8grUR+H1do/n74LAB9ybth2QUcAfGN3rxIT2MFOQXYE2z63vkx/UdiJeGyP8HR20NXAK3mRItxQboZ2Pmr2dV5o9BI7wH2FEdoov98K+zr8IyqEanxoi/5CnRtED773jKDPC7yK8DP98Hv8c0wcZ1UFMUOzrx+0rUFtj+TV9ZUdUI+X3DH9W5vnd+TLo0gB/XSilU/kNwTOsSxpdQbU5ggZYUsFAae+RP0+L+qg3SIA3SIA3SIA3SIA3SF5O6L4YbNcu0yw2zZlZ3vhcW3UvcvUTdyy28vICXgwgexfun4OLhXlyL6WgBNlgSLk5yiZKLcGTQvfjpxZWejF3JaCcPxQVeYiY3YIsAl4hBLOozCEI9JtuwD6EzHWnAjk3AzpnxUbjAnpAxH36s2796qWzaFcusmpUy9S8yYNOK+3cIxKdb8CxoBRuX8UO25KeOyAj6EfEh2Yl+JFsdHzZVLWHo7dgxZvmkY/DRSSNisXOLcXd9KpLtqCXbfAZ+upzhhpyGAHoKuuFxDNuBXUU1oBakNPJ6t8qVnnb5WJBBU0BpimdEEMgHjtAC6apLwpmeFs4S/DqacAL4Rfr2jxuC4W8CtpYY/eMvwh90MIDdUjAt5dKSlFM+NCNwhRYZHLYhgYFbf4lHd76y3a5ao2Q2G2WzblarOXvYomsgu4NP19sycgWeq0DLe66ER3ITr+4G/tvDh6XXxZC2Ay3i8Ry0MTo2xHMaGHKHgaYUyR1SmYO3AchfsYaDhvmeg1ob67sacf911zK04TFwZwzXwKFOIj1YXPF8sc1mvWLCfKkn1pQcZ9CxARgqdQN1INHABHXZRXMDa5aw9RMabq9oiLCHaBFTMsLH+m7gdu7CwwMZgsLcJcy4MyXDEMpRFhvTcbguhTETh4EidC0O/SSbnaVsLsukrsehNofZrT+gLFyHDLB1g7JNA0uqGw5kXOWu0Gf472E2fT+EzJiGraYR42MDnRvQlpkp7gTylt6JoJ2hEQZu5ISoq7QP1KMpPIXE/gmFeiuZm0w1sEyDhheHLs1SZcV4MIoGQBqU6VG5h+Xx1D8ZERpxyZOj5TQTajIyWu/oVGv29uhkaT3J1J6stZ3dxWNceZOjcTGjOMOWxJitJFkrlxmyDRn1TJdZdhu2zLdlchi5ncVJXwLqPHIbaPwx9D7NYBtP2sR3M3oyn5hemGWsi1JO6vSKZNdsSUaflv3uenTkuZ15SeYnffJpsGRH5rPCuVOBRabZ/QIpSt+LSJaeCsakDxr4xCzQYZCmwD5GyWxQRQGaBYdLjAQ0BT0taZSMlNSlxCzxvKhxkbgM5sbpdHXixIg8Jz2PCcAnyg4sQpEOCwQeqIP/RUEHQwa/EIK/iUkAhyFU300FT3ZCfGWgeDBD8Wx/Cqcqh8Z3BU8BIcJ3GyoIG1CNhDATWpnQzoR/AEYSPJ4KQxOp8O+ZEE/IVBjPhFIqiEQIVGFJ9O0ggy79KelXUPCmZGsTj6k9T94OUZjy8BgINKLALAjRVSnYQV7ShYpdDiZU6Dtow4tBAP3cUqTKdVhkwhk5E+GZVrgi18FjJFr1nVTPnpNoHhROvhCHIBuUdLxwNgdKOoIRwALHFAc2QlMAiwAbcMgAUs9PQt42tq0FZx6NZ5TND55ZFJqWIxNLStoE9dN3VT5LXULA0tO5rmXypDbWdxJBZIJMaYCoz8rLsHQ2zQau6+zzpexlmv8FCHdTob2ZCviuNrkTuYkwu5HemfskFUiPIIiu4KTV40zgmRCxNJgIMuFCBr2QCb/OBEHj0SN0oZ1CQTNkVibrBZ1V5oXELAoFKUacpHAAJpxoI2wlhBosbtQdHc/9QfDwAJ365YaChA14RBuFu9sP/aKG6dOE/RlSzjptu2GW62bdHnwG+j+bkmUbX8ODexN4po/vu9H38DwCK1zMlBSJ+xDeRRKHaHiEcAoKehB8K8kJgeno+izzcZIcH1XALw6cvkZuYeBCn4gspndu0hV8EVdmb0vcazlp0Ea2iK9ViIoQliDoAdhkhowlxQghJYgihLoaMwyjdFztR7v+lZJ4wIDrCpQX/W2mndVt3EJ+JmQuwkgLfA47zNgEhRHb0Qa+kAZ1H0TludtIkCIeNpInKtiJKPj+v4tg4vReN0F2vJlx5Kz8AF1uux9ZhCjz5n0QNnfWmZNzuBvb3qBg7ByhHo+wEjYl9wVG8joWkWFF5E0Av3khxGbD9GZ4G/EJmQTkWyoFEvlEPthmX92JUFNdTrH2+g5EuFtyHcLFHAJLq4cvyyYUX/N0P6cdGBxCuOrrnu7lEIFmDbqMEOnVaIZoO5DUeCPdw6Ew+hS6Ke+DsvHuXAFyk+72Iow9yz+BezjDnNz9gAxejQyae24OiSZxiNTIYY7f+wI8xsELVCjgRlnwkXYVEZ8Q3tcdgSaqcoxn5SB9lrR97FIya2alZFpWebD8DdIg/f9NSWhFgZPKwfd66GjV7tZxG9XQMycxVBf1EjRIUEG7VHTheRTPpmH5RZQ2ORusZ10KqD7EekywguAAYh1aSDmKs7uhdC57M7uHuzZYtvyE+RN1I9n+puthEmXiCgQBDjRb4WloSWiiDtdL0AADtKQwoeJ3ojJFFfpWxUf0VA4lddBROKAeUwOKunrTIh3HtaFA0uO+RN+hrOPfniWPfxnDHVw4GfsSfiampI3pbv4x7GEZyvJonKGwOD9IKB5OZKjI0KTnGFM4YjcUgz9ju27XvOIuWjC8Wxid0qfFO+M/Quegt3OyIAak4M+BWo7sPahGY+UUbJYggsUBUHaiaooGvShPokhCj5Ap5+O7uDtRxhHlvajoTpRxCA5diV8b9iU8JIvdOIlY1vtRCNClkLuhVBffBmHU3oMGaI6YRSyAsNzp1XOEKsDjpUgJQCdjvShPpwJgAU2FHjTuoirU70dFOhUA9WkqGH1NJlQNtGJU4vBtwhQms57bDaWB7617F5gfdHwNjQPb7PSgPtogxM4BRNaI9pIGkiapFkCJ3m0Cpi06GAPHAT+5w2DvJxMlQb0dHRL0bSB+qm3QmfcgDdIg/a9Phw6cfPKbJ4drpZppVy1z5OSJE+Xqw4/9SXkENk8W/Blpv7x83f/JSFrQts1ms1JU7vLFhZeW58/+7I3zy6tvnH/31as3l1fPrn/4q+t3ri1fF2v//N7aH65eyNFYJatZxHPh4wtvrlx4d81++6d/lBUvlxqmVet/bBn+jOCjqpU3zuOjFu4NW90nVM1y1S6qUa6UFl56NFeu2ugvRw15K7xy98bZG7+68Yu1K21+bWNpbXn10kcrv7z00dpH1+/85J3l02+FZ+czHqu6mwIX7lybX379/H92S9Zts2HVi4ou/va8uPzBwu3l6+fFpcvnfrn25plX3ns1+dc7d5L8zEs9RNVyEdH5i1T05V8sr3587uLCveXrly63X76xduaV5WtX/gUfMX/m4r0eonqhEs5dxGoL917/+OK9D6++9ypaw8Ll1+K34jOv/Pj0h1cvvXlp5Wc/7yFqVouI3n9z9acrp6/8x5XN+dOvxTde++A3b7fmT7feubb6zr++/W/zp99//3J07lKeyC6Xiohe/7j167XlpcUryz+/NX+mW6G8m07LpbJ1zIK/tXzZaqHtlcuPlBqPlJv5knatqCTwZYXqFcts1gufvXD3mv9jHK/HHn3m8a898eRwBb8JseHZVtkewe9xLChaMUFjltVslJt2tVKu15p546wWqjNhHqZkVWpWo96sla1yfprWCyuevbA6//67acVG5Y8hVZu1Uu6JlfKnVYR6VfAY/fVqhfU+k1/ASZ+nsgup+t1Cw4LbpWrhAH149ep/LV/Lqd4um7V6KdU8aJtUXzXru6ieRrVZaIEF+sbS4NAKHWPejwwnDRquN5qmDQNvWeWMoVmDbhca/G9unB/JlbILG7X423MfpeTgW2HqNOyKWclulKt9Nyr9Jar9JWqVWu8N1HbuhgXKxFvQiVo5K9OsNXsrWaVKz506/rO3Vg3/0xL4wcwoHTrw58lo1etQolKqmE+ZNfNR6OTIyDZWbQCHDVAlgf7uBz8Yf+TYsb//m29PfPu7Dz///MPPfu+5Y88f+943//LEE0/97Xe+f+JP/+L7je+On/jGd54Glq8/c/xpmNqmdejAfwNd3t+nZUUAAA==", + siid = config.siid + }; + BaseReq baseReq = new BaseReq() + { + key = config.key, + t = timestamp, + sign = SignUtils.GetMD5(baseParam.ToString() + timestamp + config.key + config.secret), + param = baseParam + }; + CloudPrint.commandPrint(baseReq); + } + + /// + /// 发货单接口 + /// + static void testCloudPrintParcelsBill() + { + + var timestamp = DateUtils.GetTimestamp(); + //OrderGoods 表格对象,可以自行自定义即可,这里仅供参考 + var baseParam = new ParcelsBillsParam() + { + tempid = "164509714515858026", + siid = config.siid + }; + BaseReq> baseReq = new BaseReq>() + { + key = config.key, + t = timestamp, + sign = SignUtils.GetMD5(baseParam.ToString() + timestamp + config.key + config.secret), + param = baseParam + }; + CloudPrint.billParcels(baseReq); + } + + /// + /// 硬件状态接口 + /// + static void testCloudDevStatus() + { + + var timestamp = DateUtils.GetTimestamp(); + var baseParam = new DevStatusParam() + { + siid = config.siid + }; + BaseReq baseReq = new BaseReq() + { + key = config.key, + t = timestamp, + sign = SignUtils.GetMD5(baseParam.ToString() + timestamp + config.key + config.secret), + param = baseParam + }; + CloudPrint.devStatus(baseReq); + } + + /// + /// 获取店铺授权超链接接口 + /// + static void testThirdPlatformStoreAuth() + { + + var baseParam = new StoreAuthParam() + { + shopType = "TAOBAO", + callBackUrl = "http://www.xxxx.com", + salt = "123" + }; + BaseReq baseReq = new BaseReq() + { + key = config.key, + sign = SignUtils.GetMD5(baseParam.ToString() + config.key + config.secret), + param = baseParam + }; + ThirdPlatformOrder.auth(baseReq); + } + + /// + /// 提交订单获取任务接口 + /// + static void testThirdPlatformCommitTask() + { + + var baseParam = new CommitTaskParam() + { + shopType = "TAOBAO", + shopId = "41****377", + orderStatus = "UNSHIP", + updateAtMin = "2022-02-17 16:00:00", + updateAtMax = "2022-02-17 16:30:00", + callbackUrl = "http://www.xxxx.com", + salt = "123" + }; + BaseReq baseReq = new BaseReq() + { + key = config.key, + sign = SignUtils.GetMD5(baseParam.ToString() + config.key + config.secret), + param = baseParam + }; + ThirdPlatformOrder.commitTask(baseReq); + } + + /// + /// 快递单号回传及订单发货接口 + /// + static void testThirdPlatformUploadNum() + { + + var baseParam = new UploadNumParam() + { + shopType = "TAOBAO", + shopId = "41****77", + orderNum = "240*****8072", + kuaidiCom = "yunda", + kuaidiNum = "1ds23456" + }; + BaseReq baseReq = new BaseReq() + { + key = config.key, + sign = SignUtils.GetMD5(baseParam.ToString() + config.key + config.secret), + param = baseParam + }; + ThirdPlatformOrder.uploadNum(baseReq); + } + + /// + /// 同城配送账号授权接口 + /// + static void testSameCityStoreAuth() + { + + var timestamp = DateUtils.GetTimestamp(); + var baseParam = new SameCityAuthParam() + { + com = "shansong", + storeId = "123456", + callbackUrl = "http://www.xxxx.com" + }; + BaseReq baseReq = new BaseReq() + { + key = config.key, + t = timestamp, + sign = SignUtils.GetMD5(baseParam.ToString() + timestamp + config.key + config.secret), + param = baseParam + }; + SameCity.auth(baseReq); + } + + /// + /// 同城配送下单 + /// + static void testSameCityOrder() + { + + var timestamp = DateUtils.GetTimestamp(); + var baseParam = new SameCityOrderParam() + { + partnerId = "199****601", + partnerKey = "806cdf87*******dfb000326375d", + com = "kfw", + storeId = "123456", + recManName = "张三", + recManMobile = "1599*****912", + recManPrintAddr = "西藏日喀则市定日县珠穆朗玛峰", + sendManName = "李四", + sendManMobile = "153******3333", + sendManPrintAddr = "西藏日喀则市定日县珠穆朗玛峰", + price = 100, + orderSourceType = "饿了么", + weight = 1, + remark = "测试单,待会取消", + serviceType = "火锅", + salt = "123", + callbackUrl = "http://www.xxxx.com", + orderSourceNo = "1233", + orderType = 0 + + }; + BaseReq baseReq = new BaseReq() + { + key = config.key, + t = timestamp, + sign = SignUtils.GetMD5(baseParam.ToString() + timestamp + config.key + config.secret), + param = baseParam + }; + SameCity.order(baseReq); + } + + /// + /// 同城配送查询订单 + /// + static void testSameCityQuery() + { + + var timestamp = DateUtils.GetTimestamp(); + var baseParam = new SameCityQueryParam() + { + taskId = "EE815B30*****2FEE0EBFEC3", + orderId = "10003****SWiZ", + }; + BaseReq baseReq = new BaseReq() + { + key = config.key, + t = timestamp, + sign = SignUtils.GetMD5(baseParam.ToString() + timestamp + config.key + config.secret), + param = baseParam + }; + SameCity.query(baseReq); + } + + + /// + /// 同城配送取消下单接口 + /// + static void testSameCityCancel() + { + + var timestamp = DateUtils.GetTimestamp(); + var baseParam = new SameCityCancelParam() + { + taskId = "EE815B30B5*****B8D522FEE0EBFEC3", + orderId = "1000****WiZ", + cancelMsg = "地址信息填错啦,重新下单" + }; + BaseReq baseReq = new BaseReq() + { + key = config.key, + t = timestamp, + sign = SignUtils.GetMD5(baseParam.ToString() + timestamp + config.key + config.secret), + param = baseParam + }; + SameCity.cancel(baseReq); + } + + /// + /// 第三方电商平台账号授权 + /// + static void testThirdPlatformAuth() + { + + var timestamp = DateUtils.GetTimestamp(); + var baseParam = new PlatformAuthParam() + { + net = "taobao", + callbackUrl = "http://www.xxx.com" + }; + BaseReq baseReq = new BaseReq() + { + key = config.key, + t = timestamp, + sign = SignUtils.GetMD5(baseParam.ToString() + timestamp + config.key + config.secret), + param = baseParam + }; + ThirdPlatformOrder.platformAuth(baseReq); + } + + /// + /// 第三方平台面单余额接口 + /// + static void testThirdPlatBranchInfo() + { + + var timestamp = DateUtils.GetTimestamp(); + var baseParam = new BranchInfoParam() + { + partnerId = "343****2875", + partnerKey = "6201d13dee73*********557aa3431402875", + net = "taobao" + }; + BaseReq baseReq = new BaseReq() + { + key = config.key, + t = timestamp, + sign = SignUtils.GetMD5(baseParam.ToString() + timestamp + config.key + config.secret), + param = baseParam + }; + ThirdPlatformOrder.branchInfo(baseReq); + + } + + /// + /// 电子面单取消接口 + /// + static void testLabelCancel() + { + + var timestamp = DateUtils.GetTimestamp(); + var baseParam = new CancelPrint() + { + partnerId = "", + partnerKey = "", + net = "", + kuaidicom = "shunfeng", + kuaidinum = "SF136*****3507", + orderId = "016455*****25zosNIq", + reason = "地址错误" + }; + BaseReq baseReq = new BaseReq() + { + key = config.key, + t = timestamp, + sign = SignUtils.GetMD5(baseParam.ToString() + timestamp + config.key + config.secret), + param = baseParam + }; + PrintCloud.cancel(baseReq); + + } + + /// + /// 快递面单OCR识别接口 + /// + static void testOcr() + { + + var baseParam = new OcrParam() + { + image = "132" + }; + BaseReq baseReq = new BaseReq() + { + key = config.key, + param = baseParam + }; + Ocr.ocr(baseReq); + + } + + /// + /// 商家寄件查询订单详情 + /// + static void testBOrderOfficialQueryDetail() + { + + var baseParam = new BOrderOfficialQueryDetailParam() + { + taskId = "9FC293CA417E431F33046E64F4C4EC20" + }; + var timestamp = DateUtils.GetTimestamp(); + BaseReq baseReq = new BaseReq() + { + key = config.key, + param = baseParam, + method = ApiInfoConstant.ORDER, + t = timestamp, + sign = SignUtils.GetMD5(baseParam.ToString() + timestamp + config.key + config.secret) + }; + BOrderOfficial.queryDetail(baseReq); + + } + + + /// + /// C端寄件下单接口 + /// 注意保存一下返回值(taskId和orderId) + /// + static void testCOrder() + { + var timestamp = DateUtils.GetTimestamp(); + var baseParam = new COrderParam() + { + kuaidicom = "shunfeng", + recManName = "张三", + recManMobile = "12345678910", + recManPrintAddr = "西藏日喀则市定日县珠穆朗玛峰", + sendManName = "李四", + sendManMobile = "12345678910", + sendManPrintAddr = "西藏日喀则市定日县珠穆朗玛峰", + cargo = "文件", + weight = "1", + remark = "测试单,待会取消", + salt = "123", + callBackUrl = "http://www.xxxx.com" + }; + BaseReq baseReq = new BaseReq() + { + key = config.key, + t = timestamp, + sign = SignUtils.GetMD5(baseParam.ToString() + timestamp + config.key + config.secret), + param = baseParam + }; + Corder.order(baseReq); + } + + /// + /// C端寄件下单取消接口 + /// 入参为下单接口返回的taskId和orderId + /// + static void testCOrderCancel() + { + var timestamp = DateUtils.GetTimestamp(); + var baseParam = new COrderCancelParam() + { + taskId = "B25F2F0C7990889559107CEEC3B3045C", + orderId = "26743813", + cancelMsg = "测试单" + }; + BaseReq baseReq = new BaseReq() + { + key = config.key, + t = timestamp, + sign = SignUtils.GetMD5(baseParam.ToString() + timestamp + config.key + config.secret), + param = baseParam + }; + Corder.cancel(baseReq); + } + + /// + /// C端寄件价格查询接口 + /// 入参为下单接口返回的taskId和orderId + /// + static void testCOrderQueryPrice() + { + var timestamp = DateUtils.GetTimestamp(); + var baseParam = new COrderQueryPriceParam() + { + kuaidicom = "shunfeng", + sendManPrintAddr = "广东深圳市南山区", + recManPrintAddr = "北京海淀区" + }; + BaseReq baseReq = new BaseReq() + { + key = config.key, + t = timestamp, + sign = SignUtils.GetMD5(baseParam.ToString() + timestamp + config.key + config.secret), + param = baseParam + }; + Corder.queryPrice(baseReq); + } + + /// + /// 快递可用性接口 + /// + static void testExpressReachable() + { + var timestamp = DateUtils.GetTimestamp(); + var baseParam = new ExpressReachableParam() + { + kuaidicom = "shunfeng", + recManName = "张三", + recManMobile = "12345678910", + recManPrintAddr = "西藏日喀则市定日县珠穆朗玛峰", + sendManName = "李四", + sendManMobile = "12345678910", + sendManPrintAddr = "西藏日喀则市定日县珠穆朗玛峰" + }; + BaseReq baseReq = new BaseReq() + { + key = config.key, + t = timestamp, + sign = SignUtils.GetMD5(baseParam.ToString() + timestamp + config.key + config.secret), + param = baseParam + }; + ExpressReachable.query(baseReq); + } + + /// + /// 同城寄件-预下单 + /// + static void testBsamecityPrice() + { + var timestamp = DateUtils.GetTimestamp(); + var mygoods = new Goods() + { + name = "外卖", + type = "食品", + count = 1 + }; + var baseParam = new BsamecityOrderParam() + { + kuaidicom = "shunfengtongcheng", + lbsType = 2, + recManName = "顺丰同城", + recManMobile = "12345678910", + recManProvince = "北京市", + recManCity = "北京市", + recManDistrict = "海淀区", + recManAddr = "学清嘉创大厦A座15层", + recManLat = "40.014838", + recManLng = "116.352569", + sendManName = "测试", + sendManMobile = "12345678910", + sendManProvince = "北京", + sendManCity = "北京市", + sendManDistrict = "海淀区", + sendManAddr = "清华大学", + sendManLat = "40.002436", + sendManLng = "116.326582", + weight = "1", + remark = "测试下单", + volume = "", + orderType = 0, + expectPickupTime = "", + expectFinishTime = "", + insurance = "", + price = "0", + goods = new List() { mygoods } + }; + BaseReq baseReq = new BaseReq() + { + key = config.key, + t = timestamp, + sign = SignUtils.GetMD5(baseParam.ToString() + timestamp + config.key + config.secret), + param = baseParam + }; + BsamecityOrder.price(baseReq); + } + + /// + /// 同城寄件-下单 + /// + static void testBsamecityOrder() + { + var timestamp = DateUtils.GetTimestamp(); + var mygoods = new Goods() + { + name = "外卖", + type = "食品", + count = 1 + }; + var baseParam = new BsamecityOrderParam() + { + kuaidicom = "shunfengtongcheng", + lbsType = 2, + recManName = "顺丰同城", + recManMobile = "12345678910", + recManProvince = "北京市", + recManCity = "北京市", + recManDistrict = "海淀区", + recManAddr = "学清嘉创大厦A座15层", + recManLat = "40.014838", + recManLng = "116.352569", + sendManName = "测试", + sendManMobile = "12345678910", + sendManProvince = "北京", + sendManCity = "北京市", + sendManDistrict = "海淀区", + sendManAddr = "清华大学", + sendManLat = "40.002436", + sendManLng = "116.326582", + weight = "1", + remark = "测试下单", + volume = "", + salt = "", + orderType = 0, + expectPickupTime = "", + expectFinishTime = "", + insurance = "", + price = "0", + goods = new List() { mygoods }, + callbackUrl = "http://www.baidu.com" + }; + BaseReq baseReq = new BaseReq() + { + key = config.key, + t = timestamp, + sign = SignUtils.GetMD5(baseParam.ToString() + timestamp + config.key + config.secret), + param = baseParam + }; + BsamecityOrder.order(baseReq); + } + + /// + /// 同城寄件-预取消 + /// + static void testBsamecityPrecancel() + { + var timestamp = DateUtils.GetTimestamp(); + var baseParam = new BsamecityCancelParam() + { + orderId = "100241", + cancelMsgType = 1, + cancelMsg = "测试寄件", + taskId = "DE49A5C45B0845328CE0AE8EF9951EC5" + }; + BaseReq baseReq = new BaseReq() + { + key = config.key, + t = timestamp, + sign = SignUtils.GetMD5(baseParam.ToString() + timestamp + config.key + config.secret), + param = baseParam + }; + BsamecityOrder.precancel(baseReq); + } + + /// + /// 同城寄件-取消 + /// + static void testBsamecityCancel() + { + var timestamp = DateUtils.GetTimestamp(); + var baseParam = new BsamecityCancelParam() + { + orderId = "100241", + cancelMsgType = 1, + cancelMsg = "测试寄件", + taskId = "DE49A5C45B0845328CE0AE8EF9951EC5" + }; + BaseReq baseReq = new BaseReq() + { + key = config.key, + t = timestamp, + sign = SignUtils.GetMD5(baseParam.ToString() + timestamp + config.key + config.secret), + param = baseParam + }; + BsamecityOrder.cancel(baseReq); + } + + /// + /// 同城寄件-加小费 + /// + static void testBsamecityAddfee() + { + var timestamp = DateUtils.GetTimestamp(); + var baseParam = new BsamecityAddfeeParam() + { + orderId = "100213", + remark = "", + taskId = "0E1536182BAE416080AC3C5DE6896F03", + tips = "10" + }; + BaseReq baseReq = new BaseReq() + { + key = config.key, + t = timestamp, + sign = SignUtils.GetMD5(baseParam.ToString() + timestamp + config.key + config.secret), + param = baseParam + }; + BsamecityOrder.addfee(baseReq); + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Utils/DateUtils.cs b/Infrastructure/Kuaidi100/Utils/DateUtils.cs new file mode 100644 index 0000000..0d57eb9 --- /dev/null +++ b/Infrastructure/Kuaidi100/Utils/DateUtils.cs @@ -0,0 +1,13 @@ +using System; + +namespace Utils +{ + public static class DateUtils + { + public static string GetTimestamp() + { + TimeSpan ts = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0); + return Convert.ToInt64(ts.TotalMilliseconds).ToString(); + } + } +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Utils/HttpUtils.cs b/Infrastructure/Kuaidi100/Utils/HttpUtils.cs new file mode 100644 index 0000000..3683d34 --- /dev/null +++ b/Infrastructure/Kuaidi100/Utils/HttpUtils.cs @@ -0,0 +1,79 @@ +using System; +using System.Net.Http; +using System.Collections; +using System.Collections.Generic; +using Newtonsoft.Json; +using Common.Request; +using System.Web; + +namespace Utils +{ + class HttpUtils + { + public static string doPostForm(string url, Dictionary param) + { + try + { + using (var client = new HttpClient()) + { + using (var multipartFormDataContent = new FormUrlEncodedContent(param)) + { + Console.WriteLine(JsonConvert.SerializeObject(param)); + var result = client.PostAsync(url, multipartFormDataContent).Result.Content.ReadAsStringAsync().Result; + Console.WriteLine(result); + return result; + } + } + } + catch (Exception e) + { + return e.ToString(); + } + } + + public static string doGet(string url) + { + try + { + using (var client = new HttpClient()) + { + Console.WriteLine(JsonConvert.SerializeObject(url)); + var result = client.GetAsync(url).Result.Content.ReadAsStringAsync().Result; + Console.WriteLine(result); + return result; + + } + } + catch (Exception e) + { + return e.ToString(); + } + } + + public static string doPostMultipartFormData(string url, String filePath,String filename) + { + try + { + using (var client = new HttpClient()) + { + using (var multipartFormDataContent = new MultipartFormDataContent()) + { + multipartFormDataContent.Add(new ByteArrayContent(System.IO.File.ReadAllBytes(filePath)), "file", filename); + var result = client.PostAsync(url, multipartFormDataContent).Result.Content.ReadAsStringAsync().Result; + Console.WriteLine(result); + return result; + } + } + } + catch (Exception e) + { + return e.ToString(); + } + } + + public static string buildUrl(string url, BaseReq baseReq){ + return string.Format(url,baseReq.method,baseReq.t,baseReq.key,baseReq.sign, HttpUtility.UrlEncode(baseReq.param.ToString())); + } + + } +} diff --git a/Infrastructure/Kuaidi100/Utils/ObjectToDictionaryUtils.cs b/Infrastructure/Kuaidi100/Utils/ObjectToDictionaryUtils.cs new file mode 100644 index 0000000..15c94fe --- /dev/null +++ b/Infrastructure/Kuaidi100/Utils/ObjectToDictionaryUtils.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Reflection; +namespace Utils +{ + public class ObjectToDictionaryUtils{ + public static Dictionary ObjectToMap(object obj) + { + Dictionary map = new Dictionary(); + + Type t = obj.GetType(); // 获取对象对应的类, 对应的类型 + + PropertyInfo[] pi = t.GetProperties(BindingFlags.Public | BindingFlags.Instance); // 获取当前type公共属性 + + foreach (PropertyInfo p in pi) + { + MethodInfo m = p.GetGetMethod(); + + if (m != null && m.IsPublic) + { + // 进行判NULL处理 + if (m.Invoke(obj, new object[] { }) != null) + { + map.Add(p.Name, m.Invoke(obj, new object[] { }) + .ToString()); // 向字典添加元素 + } + } + } + return map; + } + } + +} \ No newline at end of file diff --git a/Infrastructure/Kuaidi100/Utils/SignUtils.cs b/Infrastructure/Kuaidi100/Utils/SignUtils.cs new file mode 100644 index 0000000..04108da --- /dev/null +++ b/Infrastructure/Kuaidi100/Utils/SignUtils.cs @@ -0,0 +1,17 @@ +using System; +using System.Security.Cryptography; +using System.Text; + +namespace Utils +{ + public static class SignUtils{ + public static string GetMD5(this string data) + { + using (var md5 = MD5.Create()) + { + var hsah = md5.ComputeHash(Encoding.UTF8.GetBytes(data)); + return BitConverter.ToString(hsah).Replace("-", ""); + } + } + } +}