diff --git a/BBWY.Client/APIServices/OrderService.cs b/BBWY.Client/APIServices/OrderService.cs index fadd1f85..1021ba78 100644 --- a/BBWY.Client/APIServices/OrderService.cs +++ b/BBWY.Client/APIServices/OrderService.cs @@ -310,5 +310,24 @@ namespace BBWY.Client.APIServices endTime = endDate }, null, HttpMethod.Post); } + + /// + /// 获取订单优惠详情 + /// + /// + /// + /// + public ApiResponse GetOrderCouponDetail(string orderId, Shop shop) + { + return SendRequest(globalContext.BBYWApiHost, "api/order/GetOrderCouponDetail", new + { + orderId, + shop.ShopId, + shop.Platform, + shop.AppKey, + shop.AppSecret, + shop.AppToken + }, null, HttpMethod.Post); + } } } diff --git a/BBWY.Client/App.xaml.cs b/BBWY.Client/App.xaml.cs index 7e47ace0..57856af3 100644 --- a/BBWY.Client/App.xaml.cs +++ b/BBWY.Client/App.xaml.cs @@ -126,6 +126,7 @@ namespace BBWY.Client serviceCollection.AddTransient(); serviceCollection.AddTransient(); serviceCollection.AddTransient(); + serviceCollection.AddTransient(); #region 注册拳探SDK相关类 serviceCollection.AddSingleton(); #endregion diff --git a/BBWY.Client/GlobalContext.cs b/BBWY.Client/GlobalContext.cs index 2f3b9059..9f2db2d1 100644 --- a/BBWY.Client/GlobalContext.cs +++ b/BBWY.Client/GlobalContext.cs @@ -13,7 +13,7 @@ namespace BBWY.Client { ShopServiceGroupList = new List(); ShopServiceGroupLowerList = new List(); - ClientVersion = "10188"; + ClientVersion = "10190"; } private User user; diff --git a/BBWY.Client/Models/APIModel/Response/Order/OrderCouponDetailResponse.cs b/BBWY.Client/Models/APIModel/Response/Order/OrderCouponDetailResponse.cs new file mode 100644 index 00000000..9b5a3165 --- /dev/null +++ b/BBWY.Client/Models/APIModel/Response/Order/OrderCouponDetailResponse.cs @@ -0,0 +1,204 @@ +using System.Collections.Generic; + +namespace BBWY.Client.Models +{ + public class OrderCouponDetailGroupItemResponse + { + /// + /// 发起方 + /// + public string Initiator { get; set; } + + /// + /// 优惠券或活动类型 + /// + public string CouponOrPromotionType { get; set; } + + /// + /// 优惠金额 + /// + public decimal? PreferentialAmount { get; set; } + + /// + /// 商家承担金额 + /// + public decimal? UndertakenByMerchantAmount { get; set; } + + /// + /// 平台承担金额 + /// + public decimal? UndertakenByPlatformAmount { get; set; } + } + + public class OrderCouponDetailGroupResponse + { + /// + /// 发起方 + /// + public string Initiator { get; set; } + + /// + /// 优惠明细集合 + /// + public IList ItemList { get; set; } + } + + public class OrderCouponDetailResponse + { /// + /// 合计优惠金额 + /// + public decimal TotalPreferentialAmount { get; set; } + + /// + /// 合计商家承担金额 + /// + public decimal? TotalUndertakenByMerchantAmount { get; set; } + + /// + /// 合计平台承担金额 + /// + public decimal? TotalUndertakenByPlatformAmount { get; set; } + + public IList GroupList { get; set; } + + /// + /// 合计单品金额 + /// + public decimal? TotalItemPrice { get; set; } + + /// + /// 合计基础优惠 + /// + public decimal? TotalBaseDiscount { get; set; } + + /// + /// 合计满减 + /// + public decimal? TotalManJian { get; set; } + + /// + /// 合计商家运费 + /// + public decimal? TotalVenderFee { get; set; } + + /// + /// 合计基础运费 + /// + public decimal? TotalBaseFee { get; set; } + + /// + /// 合计偏远运费 + /// + public decimal? TotalRemoteFee { get; set; } + + /// + /// 合计优惠券 + /// + public decimal? TotalCoupon { get; set; } + + /// + /// 合计京豆 + /// + public decimal? TotalJingDou { get; set; } + + /// + /// 合计余额 + /// + public decimal? TotalBalance { get; set; } + + /// + /// 合计超级红包 + /// + public decimal? TotalSuperRedEnvelope { get; set; } + + /// + /// 合计plus会员95折优惠 + /// + public decimal? TotalPlus95 { get; set; } + + /// + /// 合计退换货无忧 + /// + public decimal? TotalTuiHuanHuoWuYou { get; set; } + + /// + /// 合计全球购税费 + /// + public decimal? TotalTaxFee { get; set; } + + /// + /// 合计落地配服务 + /// + public decimal? TotalLuoDiPeiService { get; set; } + + /// + /// 合计应付金额 + /// + public decimal? TotalShouldPay { get; set; } + + /// + /// 合计京券 + /// + public decimal? TotalJingQuan { get; set; } + + /// + /// 合计东券 + /// + public decimal? TotalDongQuan { get; set; } + + /// + /// 合计限品类京券 + /// + public decimal? TotalXianPinLeiJingQuan { get; set; } + + /// + /// 合计限品类东券 + /// + public decimal? TotalXianPinLeiDongQuan { get; set; } + + /// + /// 合计按比例平台承担优惠券 + /// + public decimal? TotalPingTaiChengDanYouHuiQuan { get; set; } + + /// + /// 合计礼金优惠 + /// + public decimal? TotalLiJinYouHui { get; set; } + + /// + /// 合计支付营销优惠 + /// + public decimal? TotalZhiFuYingXiaoYouHui { get; set; } + + /// + /// 合计京东支付优惠 + /// + public decimal? TotalJdZhiFuYouHui { get; set; } + + /// + /// 合计全球购一般税 + /// + public decimal? TotalGlobalGeneralTax { get; set; } + + /// + /// 合计全球购一般包税 + /// + public decimal? TotalGlobalGeneralIncludeTax { get; set; } + + /// + /// 合计京享礼金 + /// + public decimal? TotalJingXiangLiJin { get; set; } + + /// + /// 合计跨店满减促销 + /// + public decimal? TotalPromotionDiscount { get; set; } + + /// + /// 合计满期赠促销 + /// + public decimal? TotalExpiryGiftDiscount { get; set; } + } +} diff --git a/BBWY.Client/ViewModels/Order/OrderCouponDetailViewModel.cs b/BBWY.Client/ViewModels/Order/OrderCouponDetailViewModel.cs new file mode 100644 index 00000000..bc09c76d --- /dev/null +++ b/BBWY.Client/ViewModels/Order/OrderCouponDetailViewModel.cs @@ -0,0 +1,42 @@ +using BBWY.Client.APIServices; +using BBWY.Client.Models; +using System.Threading.Tasks; +using System.Windows; + +namespace BBWY.Client.ViewModels +{ + public class OrderCouponDetailViewModel : BaseVM + { + private string orderId; + private OrderService orderService; + private Shop shop; + + public OrderCouponDetailViewModel(OrderService orderService) + { + this.orderService = orderService; + } + + public string OrderId { get => orderId; set { Set(ref orderId, value); } } + + public OrderCouponDetailResponse Coupon { get => coupon; set { Set(ref coupon, value); } } + + private OrderCouponDetailResponse coupon; + + public void SetData(string orderId, Shop shop) + { + this.OrderId = orderId; + this.shop = shop; + Task.Factory.StartNew(() => orderService.GetOrderCouponDetail(orderId, shop)) + .ContinueWith(t => + { + var r = t.Result; + if (!r.Success) + { + MessageBox.Show(r.Msg, "优惠券明细"); + return; + } + this.Coupon = r.Data; + }); + } + } +} diff --git a/BBWY.Client/ViewModels/Order/OrderListViewModel.cs b/BBWY.Client/ViewModels/Order/OrderListViewModel.cs index 3372a4c3..dcf743a0 100644 --- a/BBWY.Client/ViewModels/Order/OrderListViewModel.cs +++ b/BBWY.Client/ViewModels/Order/OrderListViewModel.cs @@ -135,6 +135,8 @@ namespace BBWY.Client.ViewModels public ICommand OpenSkuDetailCommand { get; set; } + public ICommand OpenOrderCouponDetailCommand { get; set; } + /// /// 当前条件利润汇总 /// @@ -214,6 +216,7 @@ namespace BBWY.Client.ViewModels //EditAfterSaleOrderRefundPurchaseAmountCommand = new RelayCommand(EditAfterSaleOrderRefundPurchaseAmount); //FindAfterSaleOrderCommand = new RelayCommand(FindAfterSaleOrder); OpenSkuDetailCommand = new RelayCommand(OpenSkuDetail); + OpenOrderCouponDetailCommand = new RelayCommand(OpenOrderCouponDetail); SearchOrderCommand.Execute(null); } /// @@ -1106,5 +1109,11 @@ namespace BBWY.Client.ViewModels } } + + private void OpenOrderCouponDetail(string orderId) + { + var w = new OrderCouponDetailWindow(orderId, globalContext.User.Shop); + w.ShowDialog(); + } } } diff --git a/BBWY.Client/ViewModels/ViewModelLocator.cs b/BBWY.Client/ViewModels/ViewModelLocator.cs index 0aa86d5c..5eb090c3 100644 --- a/BBWY.Client/ViewModels/ViewModelLocator.cs +++ b/BBWY.Client/ViewModels/ViewModelLocator.cs @@ -20,7 +20,7 @@ namespace BBWY.Client.ViewModels public bool IsCreateOrderList { get; private set; } public bool IsCreateBatchPurchaseOrderList { get; private set; } - + @@ -385,6 +385,14 @@ namespace BBWY.Client.ViewModels } } + public OrderCouponDetailViewModel OrderCouponDetailVM + { + get + { + using var s = sp.CreateScope(); + return s.ServiceProvider.GetRequiredService(); + } + } //public ShopSealBoxListViewModel ShopSealBoxListVM //{ diff --git a/BBWY.Client/Views/Order/OrderCouponDetailWindow.xaml b/BBWY.Client/Views/Order/OrderCouponDetailWindow.xaml new file mode 100644 index 00000000..3085a42e --- /dev/null +++ b/BBWY.Client/Views/Order/OrderCouponDetailWindow.xaml @@ -0,0 +1,449 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BBWY.Client/Views/Order/OrderCouponDetailWindow.xaml.cs b/BBWY.Client/Views/Order/OrderCouponDetailWindow.xaml.cs new file mode 100644 index 00000000..d7f89bd8 --- /dev/null +++ b/BBWY.Client/Views/Order/OrderCouponDetailWindow.xaml.cs @@ -0,0 +1,18 @@ +using BBWY.Client.Models; +using BBWY.Client.ViewModels; +using BBWY.Controls; + +namespace BBWY.Client.Views.Order +{ + /// + /// OrderCouponDetailWindow.xaml 的交互逻辑 + /// + public partial class OrderCouponDetailWindow : BWindow + { + public OrderCouponDetailWindow(string orderId, Shop shop) + { + InitializeComponent(); + (this.DataContext as OrderCouponDetailViewModel).SetData(orderId, shop); + } + } +} diff --git a/BBWY.Client/Views/Order/OrderListControl.xaml b/BBWY.Client/Views/Order/OrderListControl.xaml index 3903100b..a7c5864f 100644 --- a/BBWY.Client/Views/Order/OrderListControl.xaml +++ b/BBWY.Client/Views/Order/OrderListControl.xaml @@ -365,8 +365,10 @@ + - + diff --git a/BBWY.Server.API/Controllers/OrderController.cs b/BBWY.Server.API/Controllers/OrderController.cs index 5d9bdb61..63efd0a8 100644 --- a/BBWY.Server.API/Controllers/OrderController.cs +++ b/BBWY.Server.API/Controllers/OrderController.cs @@ -166,5 +166,16 @@ namespace BBWY.Server.API.Controllers { return orderBusiness.ExportOrderSkuList(request); } + + /// + /// 查询订单优惠明细 + /// + /// + /// + [HttpPost] + public OrderCouponDetailResponse GetOrderCouponDetail([FromBody] QueryOrderCouponDetailRequest request) + { + return orderBusiness.GetOrderCouponDetail(request); + } } } diff --git a/BBWY.Server.Business/EvaluationAssistant/EvaluationAssistantBusiness.cs b/BBWY.Server.Business/EvaluationAssistant/EvaluationAssistantBusiness.cs index ee48e9b9..ef0bafa0 100644 --- a/BBWY.Server.Business/EvaluationAssistant/EvaluationAssistantBusiness.cs +++ b/BBWY.Server.Business/EvaluationAssistant/EvaluationAssistantBusiness.cs @@ -610,7 +610,7 @@ namespace BBWY.Server.Business MainProductSkuInStore = mainProductSkuInStore, OuterId = dbPromotionTask.OuterId - }, GetYunDingRequestHeader(), HttpMethod.Post); + }, GetYunDingRequestHeader(), HttpMethod.Post, timeOutSeconds: 600); if (httpApiResult.StatusCode != System.Net.HttpStatusCode.OK) throw new BusinessException(httpApiResult.Content); diff --git a/BBWY.Server.Business/Order/OrderBusiness.cs b/BBWY.Server.Business/Order/OrderBusiness.cs index 862ca2cc..b015187e 100644 --- a/BBWY.Server.Business/Order/OrderBusiness.cs +++ b/BBWY.Server.Business/Order/OrderBusiness.cs @@ -1236,5 +1236,85 @@ namespace BBWY.Server.Business } return list; } + + public OrderCouponDetailResponse GetOrderCouponDetail(QueryOrderCouponDetailRequest request) + { + var relayAPIHost = GetPlatformRelayAPIHost(request.Platform); + var sendResult = restApiService.SendRequest(relayAPIHost, "api/PlatformSDK/GetOrderCouponDetail", request, GetYunDingRequestHeader(), HttpMethod.Post); + if (sendResult.StatusCode != System.Net.HttpStatusCode.OK) + throw new BusinessException(sendResult.Content) { Code = (int)sendResult.StatusCode }; + var response = JsonConvert.DeserializeObject>(sendResult.Content); + if (!response.Success) + throw new BusinessException(response.Msg) { Code = response.Code }; + + var jtoken = response.Data; + + var itemList = new List(); + var couponDetailVoJToken = jtoken["jingdong_pop_order_coupondetail_responce"]["couponDetailExternal"]["couponDetailVo"]; + var promotionTaskJArray = couponDetailVoJToken["promotionList"] as JArray; + itemList.AddRange(promotionTaskJArray.Select(j => new OrderCouponDetailGroupItemResponse() + { + Initiator = string.IsNullOrEmpty(j.Value("promotionName")) ? "平台" : "商家", + CouponOrPromotionType = j.Value("saleTypeDesc"), + PreferentialAmount = j.Value("salePrice"), + UndertakenByMerchantAmount = j.Value("salePrice"), + UndertakenByPlatformAmount = 0 + })); + + var couponJArray = couponDetailVoJToken["couponList"] as JArray; + itemList.AddRange(couponJArray.Select(j => new OrderCouponDetailGroupItemResponse() + { + Initiator = string.IsNullOrEmpty(j.Value("couponName")) ? "平台" : "商家", + CouponOrPromotionType = j.Value("couponTypeDesc"), + PreferentialAmount = j.Value("couponPrice"), + UndertakenByMerchantAmount = j.Value("priceDivide") == true ? + j.Value("venderDivideMoney") : + j.Value("couponPrice"), + UndertakenByPlatformAmount = j.Value("jdDivideMoney") + })); + + var groups = itemList.GroupBy(x => x.Initiator); + + + return new OrderCouponDetailResponse() + { + GroupList = groups.Select(g => new OrderCouponDetailGroupResponse() + { + Initiator = g.Key, + ItemList = g.ToList() + }).ToList(), + TotalPreferentialAmount = itemList.Sum(x => x.PreferentialAmount ?? 0), + TotalUndertakenByMerchantAmount = itemList.Sum(x => x.UndertakenByMerchantAmount ?? 0), + TotalUndertakenByPlatformAmount = itemList.Sum(x => x.UndertakenByPlatformAmount ?? 0), + TotalBalance = couponDetailVoJToken.Value("totalBalance"), + TotalBaseDiscount = couponDetailVoJToken.Value("totalBaseDiscount"), + TotalBaseFee = couponDetailVoJToken.Value("totalBaseFee"), + TotalCoupon = couponDetailVoJToken.Value("totalCoupon"), + TotalDongQuan = couponDetailVoJToken.Value("totalDongQuan"), + TotalExpiryGiftDiscount = couponDetailVoJToken.Value("totalExpiryGiftDiscount"), + TotalGlobalGeneralIncludeTax = couponDetailVoJToken.Value("totalGlobalGeneralIncludeTax"), + TotalGlobalGeneralTax = couponDetailVoJToken.Value("totalGlobalGeneralTax"), + TotalItemPrice = couponDetailVoJToken.Value("totalItemPrice"), + TotalJdZhiFuYouHui = couponDetailVoJToken.Value("totalJdZhiFuYouHui"), + TotalJingDou = couponDetailVoJToken.Value("totalJingDou"), + TotalJingQuan = couponDetailVoJToken.Value("totalJingQuan"), + TotalJingXiangLiJin = couponDetailVoJToken.Value("totalJingXiangLiJin"), + TotalLiJinYouHui = couponDetailVoJToken.Value("totalLiJinYouHui"), + TotalLuoDiPeiService = couponDetailVoJToken.Value("totalLuoDiPeiService"), + TotalManJian = couponDetailVoJToken.Value("totalManJian"), + TotalPingTaiChengDanYouHuiQuan = couponDetailVoJToken.Value("totalPingTaiChengDanYouHuiQuan"), + TotalPlus95 = couponDetailVoJToken.Value("totalPlus95"), + TotalPromotionDiscount = couponDetailVoJToken.Value("totalPromotionDiscount"), + TotalRemoteFee = couponDetailVoJToken.Value("totalRemoteFee"), + TotalShouldPay = couponDetailVoJToken.Value("totalShouldPay"), + TotalSuperRedEnvelope = couponDetailVoJToken.Value("totalSuperRedEnvelope"), + TotalTaxFee = couponDetailVoJToken.Value("totalTaxFee"), + TotalTuiHuanHuoWuYou = couponDetailVoJToken.Value("totalTuiHuanHuoWuYou"), + TotalVenderFee = couponDetailVoJToken.Value("totalVenderFee"), + TotalXianPinLeiDongQuan = couponDetailVoJToken.Value("totalXianPinLeiDongQuan"), + TotalXianPinLeiJingQuan = couponDetailVoJToken.Value("totalXianPinLeiJingQuan"), + TotalZhiFuYingXiaoYouHui = couponDetailVoJToken.Value("totalZhiFuYingXiaoYouHui") + }; + } } } diff --git a/BBWY.Server.Business/PlatformSDK/JDBusiness.cs b/BBWY.Server.Business/PlatformSDK/JDBusiness.cs index 0601bb99..d89185c5 100644 --- a/BBWY.Server.Business/PlatformSDK/JDBusiness.cs +++ b/BBWY.Server.Business/PlatformSDK/JDBusiness.cs @@ -1174,22 +1174,6 @@ namespace BBWY.Server.Business } #endregion - //#region sku改名 - //{ - // stepText = "sku改名"; - // var req = new WareWriteUpdateWareSaleAttrvalueAliasRequest() - // { - // wareId = wareId, - // props = updateSkuTitleParamList - // }; - // var res = jdClient.Execute(req, request.AppToken, DateTime.Now.ToLocalTime()); - // if (res.Json == null) - // res.Json = JObject.Parse(res.Body); - // if (res.IsError) - // throw new BusinessException($"sku改名失败-{(string.IsNullOrEmpty(res.ErrorMsg) ? res.ErrMsg : res.ErrorMsg)}"); - //} - //#endregion - #region sku修改细节图 stepText = "sku修改细节图"; foreach (var imageWriteUpdateRequest in imageWriteUpdateRequestList) @@ -1203,6 +1187,7 @@ namespace BBWY.Server.Business if (request.MainProductSkuInStore) { stepText = "设置sku全国仓库存"; + Thread.Sleep(60 * 1000); try { foreach (var giftSkuId in giftSkuIdList) @@ -1229,6 +1214,7 @@ namespace BBWY.Server.Business #region 查询上架的赠品 stepText = "查询上架的赠品SKU"; + Thread.Sleep(60 * 1000); searchProductSkuRequest.Sku = string.Join(",", giftSkuIdList); searchProductSkuRequest.CheckStep = "上架的赠品"; try @@ -1256,6 +1242,7 @@ namespace BBWY.Server.Business { stepText = "创建活动"; + Thread.Sleep(60 * 1000); var req = new SellerPromotionAddRequest(); req.name = request.ActivityName; req.type = 4; //赠品促销 @@ -1661,5 +1648,19 @@ namespace BBWY.Server.Business whNo = x.Value("whNo") }).ToList(); } + + public override JToken GetOrderCouponDetail(QueryOrderCouponDetailRequest request) + { + var jdClient = GetJdClient(request.AppKey, request.AppSecret); + var req = new PopOrderCoupondetailRequest(); + + req.orderId = Convert.ToInt64(request.OrderId); + + + var res = jdClient.Execute(req, request.AppToken, DateTime.Now.ToLocalTime()); + if (res.Json == null) + res.Json = JObject.Parse(res.Body); + return res.Json; + } } } diff --git a/BBWY.Server.Business/PlatformSDK/PlatformSDKBusiness.cs b/BBWY.Server.Business/PlatformSDK/PlatformSDKBusiness.cs index 3cf2d1f6..8728dfcb 100644 --- a/BBWY.Server.Business/PlatformSDK/PlatformSDKBusiness.cs +++ b/BBWY.Server.Business/PlatformSDK/PlatformSDKBusiness.cs @@ -255,5 +255,16 @@ namespace BBWY.Server.Business { throw new NotImplementedException(); } + + /// + /// 获取订单优惠明细 + /// + /// + /// + /// + public virtual JToken GetOrderCouponDetail(QueryOrderCouponDetailRequest request) + { + throw new NotImplementedException(); + } } } diff --git a/BBWY.Server.Business/Sync/OrderSyncBusiness.cs b/BBWY.Server.Business/Sync/OrderSyncBusiness.cs index 87876c91..5a71bf40 100644 --- a/BBWY.Server.Business/Sync/OrderSyncBusiness.cs +++ b/BBWY.Server.Business/Sync/OrderSyncBusiness.cs @@ -380,7 +380,7 @@ namespace BBWY.Server.Business } else { - preferentialAmount = dbOrder.PreferentialAmount; + //preferentialAmount = dbOrder.PreferentialAmount; if (storageType != null && dbOrder.StorageType != storageType) dbOrder.StorageType = storageType; @@ -421,18 +421,19 @@ namespace BBWY.Server.Business #endregion #region 订单优惠 - if (!dbOrderCouponList.Any(oc => oc.OrderId == orderId)) + + var orderCouponJArray = (JArray)orderJToken["couponDetailList"]; + if (orderCouponJArray.HasValues) { - var orderCouponJArray = (JArray)orderJToken["couponDetailList"]; - if (orderCouponJArray.HasValues) + foreach (var orderCouponJToken in orderCouponJArray) { - foreach (var orderCouponJToken in orderCouponJArray) + var couponType = orderCouponJToken.Value("couponType"); + if (string.IsNullOrEmpty(couponType)) + continue; + //dbOrder.PreferentialAmount += orderCouponJToken.Value("couponPrice"); + preferentialAmount += orderCouponJToken.Value("couponPrice"); + if (!dbOrderCouponList.Any(oc => oc.OrderId == orderId)) { - var couponType = orderCouponJToken.Value("couponType"); - if (string.IsNullOrEmpty(couponType)) - continue; - //dbOrder.PreferentialAmount += orderCouponJToken.Value("couponPrice"); - preferentialAmount += orderCouponJToken.Value("couponPrice"); insertOrderCouponList.Add(new OrderCoupon() { Id = idGenerator.NewLong(), @@ -620,7 +621,7 @@ namespace BBWY.Server.Business (orderSellerPrice > 0M && dbOrder.IsGift) || orderTotalPrice != dbOrder.OrderTotalPrice || storeOrder != dbOrder.StoreOrder || - //preferentialAmount != dbOrder.PreferentialAmount || + preferentialAmount != dbOrder.PreferentialAmount || storeId != dbOrder.StoreId) { var updateSql = fsql.Update(orderId).SetIf(orderState != null && orderState != dbOrder.OrderState, o => o.OrderState, orderState) @@ -637,7 +638,7 @@ namespace BBWY.Server.Business .SetIf(orderSellerPrice > 0M && dbOrder.IsGift == true, o => o.IsGift, false) .SetIf(storeOrder != dbOrder.StoreOrder, o => o.StoreOrder, storeOrder) .SetIf(storeOrder != dbOrder.StoreOrder, o => o.StorageType, storageType) - //.SetIf(preferentialAmount != dbOrder.PreferentialAmount, o => o.PreferentialAmount, preferentialAmount) + .SetIf(preferentialAmount != dbOrder.PreferentialAmount, o => o.PreferentialAmount, preferentialAmount) .SetIf(storeId != dbOrder.StoreId, o => o.StoreId, storeId); updateOrderList.Add(updateSql); } diff --git a/BBWY.Server.Model/Dto/Request/JD/QueryOrderCouponDetailRequest.cs b/BBWY.Server.Model/Dto/Request/JD/QueryOrderCouponDetailRequest.cs new file mode 100644 index 00000000..acf8e328 --- /dev/null +++ b/BBWY.Server.Model/Dto/Request/JD/QueryOrderCouponDetailRequest.cs @@ -0,0 +1,7 @@ +namespace BBWY.Server.Model.Dto +{ + public class QueryOrderCouponDetailRequest : PlatformRequest + { + public string OrderId { get; set; } + } +} diff --git a/BBWY.Server.Model/Dto/Response/Order/OrderCouponDetailResponse.cs b/BBWY.Server.Model/Dto/Response/Order/OrderCouponDetailResponse.cs new file mode 100644 index 00000000..708b38fc --- /dev/null +++ b/BBWY.Server.Model/Dto/Response/Order/OrderCouponDetailResponse.cs @@ -0,0 +1,206 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BBWY.Server.Model.Dto +{ + public class OrderCouponDetailGroupItemResponse + { + /// + /// 发起方 + /// + public string Initiator { get; set; } + + /// + /// 优惠券或活动类型 + /// + public string CouponOrPromotionType { get; set; } + + /// + /// 优惠金额 + /// + public decimal? PreferentialAmount { get; set; } + + /// + /// 商家承担金额 + /// + public decimal? UndertakenByMerchantAmount { get; set; } + + /// + /// 平台承担金额 + /// + public decimal? UndertakenByPlatformAmount { get; set; } + } + + public class OrderCouponDetailGroupResponse + { + /// + /// 发起方 + /// + public string Initiator { get; set; } + + /// + /// 优惠明细集合 + /// + public IList ItemList { get; set; } + } + + public class OrderCouponDetailResponse + { /// + /// 合计优惠金额 + /// + public decimal TotalPreferentialAmount { get; set; } + + /// + /// 合计商家承担金额 + /// + public decimal? TotalUndertakenByMerchantAmount { get; set; } + + /// + /// 合计平台承担金额 + /// + public decimal? TotalUndertakenByPlatformAmount { get; set; } + + public IList GroupList { get; set; } + + /// + /// 合计单品金额 + /// + public decimal? TotalItemPrice { get; set; } + + /// + /// 合计基础优惠 + /// + public decimal? TotalBaseDiscount { get; set; } + + /// + /// 合计满减 + /// + public decimal? TotalManJian { get; set; } + + /// + /// 合计商家运费 + /// + public decimal? TotalVenderFee { get; set; } + + /// + /// 合计基础运费 + /// + public decimal? TotalBaseFee { get; set; } + + /// + /// 合计偏远运费 + /// + public decimal? TotalRemoteFee { get; set; } + + /// + /// 合计优惠券 + /// + public decimal? TotalCoupon { get; set; } + + /// + /// 合计京豆 + /// + public decimal? TotalJingDou { get; set; } + + /// + /// 合计余额 + /// + public decimal? TotalBalance { get; set; } + + /// + /// 合计超级红包 + /// + public decimal? TotalSuperRedEnvelope { get; set; } + + /// + /// 合计plus会员95折优惠 + /// + public decimal? TotalPlus95 { get; set; } + + /// + /// 合计退换货无忧 + /// + public decimal? TotalTuiHuanHuoWuYou { get; set; } + + /// + /// 合计全球购税费 + /// + public decimal? TotalTaxFee { get; set; } + + /// + /// 合计落地配服务 + /// + public decimal? TotalLuoDiPeiService { get; set; } + + /// + /// 合计应付金额 + /// + public decimal? TotalShouldPay { get; set; } + + /// + /// 合计京券 + /// + public decimal? TotalJingQuan { get; set; } + + /// + /// 合计东券 + /// + public decimal? TotalDongQuan { get; set; } + + /// + /// 合计限品类京券 + /// + public decimal? TotalXianPinLeiJingQuan { get; set; } + + /// + /// 合计限品类东券 + /// + public decimal? TotalXianPinLeiDongQuan { get; set; } + + /// + /// 合计按比例平台承担优惠券 + /// + public decimal? TotalPingTaiChengDanYouHuiQuan { get; set; } + + /// + /// 合计礼金优惠 + /// + public decimal? TotalLiJinYouHui { get; set; } + + /// + /// 合计支付营销优惠 + /// + public decimal? TotalZhiFuYingXiaoYouHui { get; set; } + + /// + /// 合计京东支付优惠 + /// + public decimal? TotalJdZhiFuYouHui { get; set; } + + /// + /// 合计全球购一般税 + /// + public decimal? TotalGlobalGeneralTax { get; set; } + + /// + /// 合计全球购一般包税 + /// + public decimal? TotalGlobalGeneralIncludeTax { get; set; } + + /// + /// 合计京享礼金 + /// + public decimal? TotalJingXiangLiJin { get; set; } + + /// + /// 合计跨店满减促销 + /// + public decimal? TotalPromotionDiscount { get; set; } + + /// + /// 合计满期赠促销 + /// + public decimal? TotalExpiryGiftDiscount { get; set; } + } +} diff --git a/JD.API/Controllers/PlatformSDKController.cs b/JD.API/Controllers/PlatformSDKController.cs index 797b044f..a635a9ac 100644 --- a/JD.API/Controllers/PlatformSDKController.cs +++ b/JD.API/Controllers/PlatformSDKController.cs @@ -422,5 +422,16 @@ namespace JD.API.API.Controllers { return platformSDKBusinessList.FirstOrDefault(p => p.Platform == request.Platform).GetJDSupplierDetail(request); } + + /// + /// 获取优惠数据明细 + /// + /// + /// + [HttpPost] + public virtual JToken GetOrderCouponDetail([FromBody] QueryOrderCouponDetailRequest request) + { + return platformSDKBusinessList.FirstOrDefault(p => p.Platform == request.Platform).GetOrderCouponDetail(request); + } } }