|
@@ -310,14 +310,14 @@ public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> i
|
|
|
}
|
|
|
userOrderDetailVos.forEach(o -> {
|
|
|
if (StringUtils.isNotBlank(o.getDiscountJson())) {
|
|
|
- Map<String,String> decimalMap = JSON.parseObject(o.getDiscountJson(), Map.class);
|
|
|
- String bigDecimal = decimalMap.get(EDiscountType.DISCOUNT.name());
|
|
|
- if (StringUtils.isBlank(bigDecimal)) {
|
|
|
- userOrderVo.setCardDiscountPrice(userOrderVo.getCardDiscountPrice().add(new BigDecimal(bigDecimal)));
|
|
|
+ JSONObject decimalMap = JSON.parseObject(o.getDiscountJson(), JSONObject.class);
|
|
|
+ Object bigDecimal = decimalMap.get(EDiscountType.DISCOUNT.name());
|
|
|
+ if (bigDecimal !=null) {
|
|
|
+ userOrderVo.setCardDiscountPrice(userOrderVo.getCardDiscountPrice().add(new BigDecimal(bigDecimal.toString())));
|
|
|
}
|
|
|
- String couponDecimal = decimalMap.get(EDiscountType.COUPON.name());
|
|
|
- if (StringUtils.isBlank(couponDecimal)) {
|
|
|
- userOrderVo.setDiscountPrice(userOrderVo.getDiscountPrice().add(new BigDecimal(couponDecimal)));
|
|
|
+ Object couponDecimal = decimalMap.get(EDiscountType.COUPON.name());
|
|
|
+ if (couponDecimal!=null) {
|
|
|
+ userOrderVo.setDiscountPrice(userOrderVo.getDiscountPrice().add(new BigDecimal(couponDecimal.toString())));
|
|
|
}
|
|
|
}
|
|
|
});
|