|
@@ -125,16 +125,16 @@ public class GroupClassServiceImpl implements GroupClassService {
|
|
|
throw new BizException("指定的课程组不存在");
|
|
|
}
|
|
|
List<StudentPaymentOrder> orders = studentPaymentOrderDao.findOrderByGroup(practiceGroup.getId().toString(), GroupType.PRACTICE, DealStatusEnum.SUCCESS);
|
|
|
- if(CollectionUtils.isEmpty(orders)){
|
|
|
+ if(CollectionUtils.isEmpty(orders)&&Objects.nonNull(refundAmount)){
|
|
|
throw new BizException("未获取到订单");
|
|
|
}
|
|
|
- if(refundAmount.compareTo(orders.get(0).getExpectAmount())>0){
|
|
|
- throw new BizException("退款不可大于购买金额");
|
|
|
- }
|
|
|
if(!practiceGroup.getGroupStatus().equals(GroupStatusEnum.NORMAL)||practiceGroup.getCoursesExpireDate().before(now)){
|
|
|
throw new BizException("当前课程组不可关闭");
|
|
|
}
|
|
|
if(Objects.nonNull(refundAmount)&&refundAmount.compareTo(BigDecimal.ZERO)>0){
|
|
|
+ if(refundAmount.compareTo(orders.get(0).getExpectAmount())>0){
|
|
|
+ throw new BizException("退款不可大于购买金额");
|
|
|
+ }
|
|
|
sysUserCashAccountService.updateBalance(practiceGroup.getStudentId(), refundAmount, PlatformCashAccountDetailTypeEnum.REFUNDS, "后团关闭网管课");
|
|
|
}
|
|
|
cleanGroupInfo(groupId.toString(), GroupType.PRACTICE);
|