Browse Source

优惠券支付

zouxuan 3 năm trước cách đây
mục cha
commit
76526adf96

+ 6 - 8
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -873,7 +873,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         String orderNo = idGeneratorService.generatorId("payment") + "";
 
         String channelType = "";
-
+        if (amount.compareTo(orderAmount) != 0) {
+            throw new BizException("商品价格不符");
+        }
         StudentPaymentOrder studentPaymentOrder = studentRegistrationService.addOrder(studentRegistration,
                 amount,
                 orderNo,
@@ -887,9 +889,6 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                 registerPayDto.getBuyCloudTeacher(),
                 registerPayDto.getBuyCloudTeacherPlus(),registerPayDto.getCouponIdList());
         amount = studentPaymentOrder.getActualAmount();
-        if (amount.compareTo(orderAmount) != 0) {
-            throw new BizException("商品价格不符");
-        }
         if (amount.compareTo(BigDecimal.ZERO) < 0) {
             throw new BizException("价格异常");
         }
@@ -1145,7 +1144,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         String orderNo = idGeneratorService.generatorId("payment") + "";
 
         String channelType = "";
-
+        if (amount.compareTo(orderAmount) != 0) {
+            throw new BizException("商品价格不符");
+        }
         StudentPaymentOrder studentPaymentOrder = studentRegistrationService.addOrder(studentRegistration,
                 amount,
                 orderNo,
@@ -1160,9 +1161,6 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                 registerPayDto.getBuyCloudTeacherPlus(),registerPayDto.getCouponIdList());
         studentPaymentOrder = studentPaymentOrderService.get(studentPaymentOrder.getId());
         amount = studentPaymentOrder.getActualAmount();
-        if (amount.compareTo(orderAmount) != 0) {
-            throw new BizException("商品价格不符");
-        }
 
         if (amount.compareTo(BigDecimal.ZERO) < 0) {
             throw new BizException("价格异常");