From f66a6e317224cee7431ba2f51fb68d87fc857921 Mon Sep 17 00:00:00 2001 From: shanj <18996038927@163.com> Date: Sun, 16 Jul 2023 13:49:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A5=E5=BA=93=E5=8D=95=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PlatformSDK/JDBusiness.cs | 22 ++++++++++++ .../PlatformSDK/PlatformSDKBusiness.cs | 11 ++++++ BBWY.Server.Business/QiKu/QiKuBusiness.cs | 2 -- .../GetJDInStorePurchaseOrderDetailRequest.cs | 10 +++++- .../Dto/Response/JD/JDInStoreOrderDetail.cs | 34 +++++++++++++++++++ JD.API/Controllers/PlatformSDKController.cs | 11 ++++++ 6 files changed, 87 insertions(+), 3 deletions(-) create mode 100644 BBWY.Server.Model/Dto/Response/JD/JDInStoreOrderDetail.cs diff --git a/BBWY.Server.Business/PlatformSDK/JDBusiness.cs b/BBWY.Server.Business/PlatformSDK/JDBusiness.cs index a62dff98..a81e8463 100644 --- a/BBWY.Server.Business/PlatformSDK/JDBusiness.cs +++ b/BBWY.Server.Business/PlatformSDK/JDBusiness.cs @@ -1460,5 +1460,27 @@ namespace BBWY.Server.Business res.Json = JObject.Parse(res.Body); return res.Json; } + + public override IList GetJDInStorePurchaseOrderList(GetJDInStorePurchaseOrderListRequest request) + { + var jdClient = GetJdClient(request.AppKey, request.AppSecret); + var req = new EclpPoQueryPoOrderRequest(); + req.poOrderNo = request.PoOrderNos; + var res = jdClient.Execute(req, request.AppToken, DateTime.Now.ToLocalTime()); + if (res.Json == null) + res.Json = JObject.Parse(res.Body); + if (!string.IsNullOrEmpty(res.ErrorMsg) || !string.IsNullOrEmpty(res.ErrMsg)) + throw new BusinessException(!string.IsNullOrEmpty(res.ErrMsg) ? res.ErrMsg : res.ErrorMsg); + return res.Json["jingdong_eclp_po_queryPoOrder_responce"]["queryPoModelList"].Children().Select(x => new JDInStoreOrderDetail() + { + deptNo = x.Value("deptNo"), + isvPoOrderNo = x.Value("isvPoOrderNo"), + poOrderNo = x.Value("poOrderNo"), + poOrderStatus = x.Value("poOrderStatus"), + storageStatus = x.Value("storageStatus"), + supplierNo = x.Value("supplierNo"), + whNo = x.Value("whNo") + }).ToList(); + } } } diff --git a/BBWY.Server.Business/PlatformSDK/PlatformSDKBusiness.cs b/BBWY.Server.Business/PlatformSDK/PlatformSDKBusiness.cs index 5a39bfd8..e97af5bf 100644 --- a/BBWY.Server.Business/PlatformSDK/PlatformSDKBusiness.cs +++ b/BBWY.Server.Business/PlatformSDK/PlatformSDKBusiness.cs @@ -238,5 +238,16 @@ namespace BBWY.Server.Business { throw new NotImplementedException(); } + + /// + /// 获取入库采购单列表 + /// + /// + /// + /// + public virtual IList GetJDInStorePurchaseOrderList(GetJDInStorePurchaseOrderListRequest request) + { + throw new NotImplementedException(); + } } } diff --git a/BBWY.Server.Business/QiKu/QiKuBusiness.cs b/BBWY.Server.Business/QiKu/QiKuBusiness.cs index b6b23f19..a2f493f1 100644 --- a/BBWY.Server.Business/QiKu/QiKuBusiness.cs +++ b/BBWY.Server.Business/QiKu/QiKuBusiness.cs @@ -5,9 +5,7 @@ using BBWY.Server.Model.Dto; using Microsoft.Extensions.Options; using Newtonsoft.Json; using Newtonsoft.Json.Linq; -using Org.BouncyCastle.Ocsp; using System.Linq; -using Yitter.IdGenerator; namespace BBWY.Server.Business.QiKu { diff --git a/BBWY.Server.Model/Dto/Request/JD/GetJDInStorePurchaseOrderDetailRequest.cs b/BBWY.Server.Model/Dto/Request/JD/GetJDInStorePurchaseOrderDetailRequest.cs index e14c92b0..5d156883 100644 --- a/BBWY.Server.Model/Dto/Request/JD/GetJDInStorePurchaseOrderDetailRequest.cs +++ b/BBWY.Server.Model/Dto/Request/JD/GetJDInStorePurchaseOrderDetailRequest.cs @@ -4,11 +4,19 @@ using System.Text; namespace BBWY.Server.Model.Dto { - public class GetJDInStorePurchaseOrderDetailRequest:PlatformRequest + public class GetJDInStorePurchaseOrderDetailRequest : PlatformRequest { /// /// 入库采购单号 /// public string PoOrderNo { get; set; } } + + public class GetJDInStorePurchaseOrderListRequest : PlatformRequest + { + /// + /// 入库采购单号,逗号间隔,最多100个 + /// + public string PoOrderNos { get; set; } + } } diff --git a/BBWY.Server.Model/Dto/Response/JD/JDInStoreOrderDetail.cs b/BBWY.Server.Model/Dto/Response/JD/JDInStoreOrderDetail.cs new file mode 100644 index 00000000..c65aec40 --- /dev/null +++ b/BBWY.Server.Model/Dto/Response/JD/JDInStoreOrderDetail.cs @@ -0,0 +1,34 @@ +namespace BBWY.Server.Model.Dto +{ + public class JDInStoreOrderDetail + { + public string poOrderNo { get; set; } + + public string isvPoOrderNo { get; set; } + + /// + /// 开放平台事业部编号 + /// + public string deptNo { get; set; } + + /// + /// 开放平台库房编号 + /// + public string whNo { get; set; } + + /// + /// 开放平台供应商编号 + /// + public string supplierNo { get; set; } + + /// + /// 采购入库单状态:4等待箱明细、5等待序列号清单、6待集单、10新建、15追加中、16已集单、20初始、30预约、31单据申报、32入园放行、33理货申报、34入库放行、40叫号、50验收、51 TC验收、60上架、70完成、80异常、81未完成、82申报失败、90取消中、91取消成功、92取消失败、93待取消、94等待取消中、95库房修改;最大长度4字符 + /// + public string poOrderStatus { get; set; } + + /// + /// 采购入库单入库状态;1:有差异待确认,2:无差异已确认,3:待确认,4:有差异已确认 + /// + public string storageStatus { get; set; } + } +} diff --git a/JD.API/Controllers/PlatformSDKController.cs b/JD.API/Controllers/PlatformSDKController.cs index e0b24dad..61f6255e 100644 --- a/JD.API/Controllers/PlatformSDKController.cs +++ b/JD.API/Controllers/PlatformSDKController.cs @@ -389,6 +389,17 @@ namespace JD.API.API.Controllers return platformSDKBusinessList.FirstOrDefault(p => p.Platform == request.Platform).GetJDInStorePurchaseOrderDetail(request); } + /// + /// 获取京东入库单列表 + /// + /// + /// + [HttpPost] + public IList GetJDInStorePurchaseOrderList([FromBody] GetJDInStorePurchaseOrderListRequest request) + { + return platformSDKBusinessList.FirstOrDefault(p => p.Platform == request.Platform).GetJDInStorePurchaseOrderList(request); + } + /// /// 获取京东供应商详情 ///