/// <summary> /// 第三方电商获取订单项物流 /// </summary> /// <param name="appId"></param> /// <param name="orderId"></param> /// <returns></returns> public static List <ThirdOrderItemExpress> GetOrderItemExpress(Guid appId, Guid orderId, ref bool isThirdECommerceOrder) { var type = GetAppThirdECommerceType(appId); if (type == ThirdECommerceTypeEnum.WangYiYanXuan) { isThirdECommerceOrder = true; var list = YXOrderHelper.GetYXExpressDetailInfoSkuList(orderId); return(list.Select(p => new ThirdOrderItemExpress { OrderItemId = p.OrderItemId, ExpressNo = p.ExpressNo, SubExpressNos = p.SubExpressNos }).ToList()); } else if (type == ThirdECommerceTypeEnum.ByBiaoZhunJieKou) { isThirdECommerceOrder = true; var list = ThirdECommerceOrderHelper.GetThirdECOrderPackageSkuList(orderId); return(list.Select(p => new ThirdOrderItemExpress { OrderItemId = p.OrderItemId, ExpressNo = p.ExpressNo }).ToList()); } else if (type == ThirdECommerceTypeEnum.SuNingYiGou) { isThirdECommerceOrder = true; return(SuningSV.suning_govbus_rejection_getsnpackage(orderId)); } else if (type == ThirdECommerceTypeEnum.FangZheng) { isThirdECommerceOrder = true; return(FangZhengSV.FangZheng_Logistics_Package(orderId)); } return(new List <ThirdOrderItemExpress>()); }
/// <summary> /// 是否第三方电商订单(暂时京东除外) /// </summary> /// <param name="appId">店铺Id</param> /// <param name="orderId">订单Id</param> /// <returns></returns> public static bool IsThirdECommerceOrder(Guid appId, Guid orderId) { var type = GetAppThirdECommerceType(appId); if (type == ThirdECommerceTypeEnum.WangYiYanXuan) { return(YXOrderHelper.IsYXOrder(orderId)); } if (type == ThirdECommerceTypeEnum.ByBiaoZhunJieKou) { return(ThirdECommerceOrderHelper.IsThirdECOrder(orderId)); } return(false); }
/// <summary> /// 第三方电商取消订单申请 /// </summary> /// <param name="order"></param> /// <returns></returns> public static ResultDTO CancelOrder(CommodityOrder order) { var type = GetAppThirdECommerceType(order.AppId); if (type == ThirdECommerceTypeEnum.WangYiYanXuan && YXOrderHelper.IsYXOrder(order.Id)) { return(YXOrderRefundHelper.CancelPaidOrder(order)); } else if (type == ThirdECommerceTypeEnum.ByBiaoZhunJieKou && ThirdECommerceOrderHelper.IsThirdECOrder(order.Id)) { return(ThirdECommerceOrderHelper.CancelOrder(order.Id)); } return(new ResultDTO { isSuccess = true }); }
/// <summary> /// 第三方电商获取订单项物流轨迹信息 /// </summary> /// <param name="appId"></param> /// <param name="orderItemId"></param> /// <returns></returns> public static ThirdOrderPackageExpress GetOrderItemExpressTrace(Guid appId, Guid orderItemId) { var type = GetAppThirdECommerceType(appId); if (type == ThirdECommerceTypeEnum.WangYiYanXuan) { var yxexpress = YXOrderHelper.GetExpressInfo(orderItemId); if (yxexpress == null) { return(null); } var express = new ThirdOrderPackageExpress { ExpressCompany = yxexpress.company, ExpressNo = yxexpress.number, ExpressTraceList = new List <ThirdExpressTrace>() }; if (yxexpress.content != null && yxexpress.content.Count > 0) { yxexpress.content.ForEach(p => { express.ExpressTraceList.Add(new ThirdExpressTrace { Desc = p.desc, Time = p.time }); }); } return(express); } else if (type == ThirdECommerceTypeEnum.ByBiaoZhunJieKou) { return(ThirdECommerceOrderHelper.GetExpressInfo(orderItemId)); } return(null); }