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