he2802 4 lat temu
rodzic
commit
c869289b7c

+ 1 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderServiceImpl.java

@@ -353,9 +353,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
             //价格不能小于0.01
             totalPrice = zero;
         }
-        if(totalPrice==null){
-            throw new CustomException("金额错误"+totalPrice);
-        }
+
         add.setOrderPrice(totalPrice);
         if(!this.save(add)){
             throw new CustomException("订单数据错误");

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/wx/service/impl/WxPayServiceImpl.java

@@ -171,6 +171,9 @@ public class WxPayServiceImpl  implements IWxPayService {
             BigDecimal unit = new BigDecimal(100);
             price = price.multiply(unit);
             Map<String, String> data = new HashMap<String, String>();
+            if(price==null){
+                throw new CustomException("金额错误"+price);
+            }
     //        data.put("attach", "pay");
             data.put("body", body);
             data.put("out_trade_no", out_trade_no);