Browse Source

修复订单优惠券报错问题

AddValidOverTime
sanji 2 years ago
parent
commit
a574d77efc
  1. 38
      BBWY.Server.Business/Order/OrderBusiness.cs

38
BBWY.Server.Business/Order/OrderBusiness.cs

@ -1293,26 +1293,32 @@ namespace BBWY.Server.Business
var itemList = new List<OrderCouponDetailGroupItemResponse>(); var itemList = new List<OrderCouponDetailGroupItemResponse>();
var couponDetailVoJToken = jtoken["jingdong_pop_order_coupondetail_responce"]["couponDetailExternal"]["couponDetailVo"]; var couponDetailVoJToken = jtoken["jingdong_pop_order_coupondetail_responce"]["couponDetailExternal"]["couponDetailVo"];
var promotionTaskJArray = couponDetailVoJToken["promotionList"] as JArray; var promotionTaskJArray = couponDetailVoJToken["promotionList"] as JArray;
itemList.AddRange(promotionTaskJArray.Select(j => new OrderCouponDetailGroupItemResponse() if (promotionTaskJArray != null)
{ {
Initiator = string.IsNullOrEmpty(j.Value<string>("promotionName")) ? "平台" : "商家", itemList.AddRange(promotionTaskJArray.Select(j => new OrderCouponDetailGroupItemResponse()
CouponOrPromotionType = j.Value<string>("saleTypeDesc"), {
PreferentialAmount = j.Value<decimal>("salePrice"), Initiator = string.IsNullOrEmpty(j.Value<string>("promotionName")) ? "平台" : "商家",
UndertakenByMerchantAmount = j.Value<decimal>("salePrice"), CouponOrPromotionType = j.Value<string>("saleTypeDesc"),
UndertakenByPlatformAmount = 0 PreferentialAmount = j.Value<decimal>("salePrice"),
})); UndertakenByMerchantAmount = j.Value<decimal>("salePrice"),
UndertakenByPlatformAmount = 0
}));
}
var couponJArray = couponDetailVoJToken["couponList"] as JArray; var couponJArray = couponDetailVoJToken["couponList"] as JArray;
itemList.AddRange(couponJArray.Select(j => new OrderCouponDetailGroupItemResponse() if (couponJArray != null)
{ {
Initiator = string.IsNullOrEmpty(j.Value<string>("couponName")) ? "平台" : "商家", itemList.AddRange(couponJArray.Select(j => new OrderCouponDetailGroupItemResponse()
CouponOrPromotionType = j.Value<string>("couponTypeDesc"), {
PreferentialAmount = j.Value<decimal>("couponPrice"), Initiator = string.IsNullOrEmpty(j.Value<string>("couponName")) ? "平台" : "商家",
UndertakenByMerchantAmount = j.Value<bool>("priceDivide") == true ? CouponOrPromotionType = j.Value<string>("couponTypeDesc"),
j.Value<decimal>("venderDivideMoney") : PreferentialAmount = j.Value<decimal>("couponPrice"),
j.Value<decimal>("couponPrice"), UndertakenByMerchantAmount = j.Value<bool>("priceDivide") == true ?
UndertakenByPlatformAmount = j.Value<decimal>("jdDivideMoney") j.Value<decimal>("venderDivideMoney") :
})); j.Value<decimal>("couponPrice"),
UndertakenByPlatformAmount = j.Value<decimal>("jdDivideMoney")
}));
}
var groups = itemList.GroupBy(x => x.Initiator); var groups = itemList.GroupBy(x => x.Initiator);

Loading…
Cancel
Save