Browse Source

1、陪练课调整
2、付费陪练课

Joburgess 5 years ago
parent
commit
998097f4bc

+ 3 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PracticeGroupServiceImpl.java

@@ -3160,7 +3160,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         }
         PracticeGroup practiceGroup = practiceGroupDao.lockPracticeGroup(practiceGroupId);
         if(Objects.isNull(practiceGroup)){
-            throw new BizException("此课程组已过期,请重新购买");
+            return BaseController.failed(HttpStatus.DESTINATION_LOCKED, "此课程组已过期,请重新购买");
         }
         if(!practiceGroup.getGroupStatus().equals(GroupStatusEnum.LOCK)){
             throw new BizException("此课程组订单正在支付中");
@@ -3169,7 +3169,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
         Map<DealStatusEnum, List<StudentPaymentOrder>> statusOrderMap = userGroupOrders.stream().collect(Collectors.groupingBy(StudentPaymentOrder::getStatus));
         List<StudentPaymentOrder> successOrders=statusOrderMap.get(DealStatusEnum.SUCCESS);
         if(!CollectionUtils.isEmpty(successOrders)&&successOrders.size()>0){
-            throw new BizException("该订单已经支付成功,请勿重复购买");
+            return BaseController.failed(HttpStatus.DESTINATION_LOCKED, "该订单已经支付成功,请勿重复购买");
         }
 
         StudentPaymentOrder latestOrder=userGroupOrders.stream().max(Comparator.comparing(StudentPaymentOrder::getId)).get();
@@ -3179,7 +3179,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
 
         List<StudentPaymentOrder> ingOrders = statusOrderMap.get(DealStatusEnum.ING);
         if(CollectionUtils.isEmpty(ingOrders)||ingOrders.size()<=0){
-            throw new BizException("该订单支付失败,请重新购买");
+            return BaseController.failed(HttpStatus.DESTINATION_LOCKED, "该订单支付失败,请重新购买");
         }else{
             for (StudentPaymentOrder ingOrder : ingOrders) {
                 ingOrder.setStatus(DealStatusEnum.CLOSE);