Ver Fonte

优惠券支付

zouxuan há 3 anos atrás
pai
commit
42e92565aa

+ 10 - 11
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -873,11 +873,8 @@ 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,
+                orderAmount,
                 orderNo,
                 channelType,
                 courseFee,
@@ -888,7 +885,10 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                 registerPayDto.getBuyMaintenance(),
                 registerPayDto.getBuyCloudTeacher(),
                 registerPayDto.getBuyCloudTeacherPlus(),registerPayDto.getCouponIdList());
-        amount = studentPaymentOrder.getActualAmount();
+        orderAmount = studentPaymentOrder.getActualAmount();
+        if (amount.compareTo(orderAmount) != 0) {
+            throw new BizException("商品价格不符");
+        }
         if (amount.compareTo(BigDecimal.ZERO) < 0) {
             throw new BizException("价格异常");
         }
@@ -1144,11 +1144,8 @@ 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,
+                orderAmount,
                 orderNo,
                 channelType,
                 courseFee,
@@ -1160,8 +1157,10 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                 registerPayDto.getBuyCloudTeacher(),
                 registerPayDto.getBuyCloudTeacherPlus(),registerPayDto.getCouponIdList());
         studentPaymentOrder = studentPaymentOrderService.get(studentPaymentOrder.getId());
-        amount = studentPaymentOrder.getActualAmount();
-
+        orderAmount = studentPaymentOrder.getActualAmount();
+        if (amount.compareTo(orderAmount) != 0) {
+            throw new BizException("商品价格不符");
+        }
         if (amount.compareTo(BigDecimal.ZERO) < 0) {
             throw new BizException("价格异常");
         }

+ 2 - 2
mec-student/src/main/resources/logback-spring.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration scan="true" scanPeriod="10 seconds">
 
-	<property name="LOG_HOME" value="/mdata/logs/student-%d{yyyy-MM-dd_HH}-%i.log" />
+	<property name="LOG_HOME" value="/Users/chenxiaoyu/Documents/logs/student-%d{yyyy-MM-dd_HH}-%i.log" />
 	<property name="CONSOLE_LOG_PATTERN"
 			  value="[%X{username} %X{ip} %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36}] : %msg%n" />
 
@@ -30,7 +30,7 @@
 	<appender name="messagefile"
 			  class="ch.qos.logback.core.rolling.RollingFileAppender">
 		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-			<FileNamePattern>/mdata/logs/student-message-%d{yyyy-MM-dd_HH}-%i.log</FileNamePattern>
+			<FileNamePattern>/Users/chenxiaoyu/Documents/logs/student-message-%d{yyyy-MM-dd_HH}-%i.log</FileNamePattern>
 			<MaxHistory>90</MaxHistory>
 			<TimeBasedFileNamingAndTriggeringPolicy
 					class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">