Преглед на файлове

Merge branch 'feature/1219_opt' into develop-new

刘俊驰 преди 1 ден
родител
ревизия
58b09202b4
променени са 1 файла, в които са добавени 4 реда и са изтрити 4 реда
  1. 4 4
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/UserOrderServiceImpl.java

+ 4 - 4
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/UserOrderServiceImpl.java

@@ -242,12 +242,12 @@ public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> i
             Map<String,BigDecimal> orderDiscount = new HashMap<>();
             orderDetilListByOrderNo.forEach(o -> {
                 if (StringUtils.isNotBlank(o.getDiscountJson())) {
-                    Map<String,String> decimalMap = JSON.parseObject(o.getDiscountJson(), Map.class);
-                   decimalMap.forEach((k,v) -> {
+                    JSONObject jsonObject = JSON.parseObject(o.getDiscountJson(), JSONObject.class);
+                    jsonObject.forEach((k,v) -> {
                        if (orderDiscount.containsKey(k)) {
-                           orderDiscount.put(k,orderDiscount.get(k).add(new BigDecimal(v)));
+                           orderDiscount.put(k,orderDiscount.get(k).add(new BigDecimal(v.toString())));
                        } else {
-                           orderDiscount.put(k,new BigDecimal(v));
+                           orderDiscount.put(k,new BigDecimal(v.toString()));
                        }
                    });
                 }