Bläddra i källkod

Merge remote-tracking branch 'origin/sys_coupon' into sys_coupon

zouxuan 3 år sedan
förälder
incheckning
fe5e93a95f

+ 6 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/EduPracticeGroupServiceImpl.java

@@ -112,6 +112,8 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
     private TeacherCourseRewardService teacherCourseRewardService;
     @Autowired
     private StudentPaymentRouteOrderService studentPaymentRouteOrderService;
+    @Autowired
+    private SysCouponCodeService sysCouponCodeService;
 
     private static final Logger LOGGER = LoggerFactory
             .getLogger(EduPracticeGroupService.class);
@@ -447,7 +449,10 @@ public class EduPracticeGroupServiceImpl implements EduPracticeGroupService{
             return BaseController.failed(HttpStatus.FOUND, errMessage);
         }
 
-        StudentPaymentOrder studentPaymentOrder=new StudentPaymentOrder();
+        //使用优惠券
+        StudentPaymentOrder studentPaymentOrder = sysCouponCodeService.use(practiceGroupBuyParams.getCouponIdList(),amount,true);
+        amount = studentPaymentOrder.getActualAmount();
+
         studentPaymentOrder.setUserId(practiceGroupBuyParams.getStudentId());
         studentPaymentOrder.setGroupType(GroupType.PRACTICE);
         String orderNo=idGeneratorService.generatorId("payment") + "";