|
@@ -1201,7 +1201,12 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
if(vipGroup.getStatus().equals(VipGroupStatusEnum.APPLYING)){
|
|
|
StudentPaymentOrder studentPaymentOrder = studentPaymentOrderDao.findByStudentVipGroup(vipGroupId, studentId, DealStatusEnum.SUCCESS.getCode());
|
|
|
if(Objects.isNull(studentPaymentOrder)){
|
|
|
- result.put("suplusCourseFee",new BigDecimal(0));
|
|
|
+ BigDecimal surplusCourseFee = studentPaymentOrderDao.sumSurplusCourseFee(vipGroupId.toString(), studentId);
|
|
|
+ if(Objects.isNull(surplusCourseFee)){
|
|
|
+ result.put("suplusCourseFee",new BigDecimal(0));
|
|
|
+ }else{
|
|
|
+ result.put("suplusCourseFee",surplusCourseFee);
|
|
|
+ }
|
|
|
}else{
|
|
|
result.put("suplusCourseFee",studentPaymentOrder.getActualAmount());
|
|
|
}
|
|
@@ -1209,7 +1214,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
}
|
|
|
ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroupId, null);
|
|
|
if(Objects.isNull(classGroup)){
|
|
|
- throw new BizException("为找到对应班级");
|
|
|
+ throw new BizException("未找到对应班级");
|
|
|
}
|
|
|
BigDecimal bigDecimal = courseScheduleStudentPaymentDao.countSurplusCourseFee(classGroup.getId(), studentId);
|
|
|
result.put("suplusCourseFee",Objects.isNull(bigDecimal)?new BigDecimal(0):bigDecimal);
|
|
@@ -1618,6 +1623,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
courseScheduleStudentPayment.setClassGroupId(vipGroupCourseSchedule.getClassGroupId());
|
|
|
courseScheduleStudentPayment.setCourseScheduleId(vipGroupCourseSchedule.getId());
|
|
|
courseScheduleStudentPayment.setUserId(studentId);
|
|
|
+ //通过课程余额兑换的课程不会产生实际费用
|
|
|
courseScheduleStudentPayment.setExpectPrice(new BigDecimal(0));
|
|
|
courseScheduleStudentPayment.setCreateTime(now);
|
|
|
courseScheduleStudentPayment.setUpdateTime(now);
|
|
@@ -1720,7 +1726,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
vipGroup.setStatus(VipGroupStatusEnum.NOT_START);
|
|
|
}
|
|
|
if(vipGroup.getRegistrationStartTime().before(now)&&vipGroup.getCoursesExpireDate().after(now)){
|
|
|
- vipGroup.setStatus(VipGroupStatusEnum.APPLYING);
|
|
|
+ if(vipGroup.getStatus().equals(VipGroupStatusEnum.APPLYING)){
|
|
|
+ vipGroup.setStatus(VipGroupStatusEnum.APPLYING);
|
|
|
+ }
|
|
|
}
|
|
|
if(vipGroup.getCoursesExpireDate().before(now)&&vipGroup.getCourseStartDate().after(now)){
|
|
|
vipGroup.setStatus(VipGroupStatusEnum.APPLYING_END);
|