|
@@ -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);
|
|
@@ -1591,6 +1596,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
throw new BizException("此vip课程没有剩余课程计划");
|
|
|
}
|
|
|
|
|
|
+ BigDecimal surplusCourseNum = new BigDecimal(surplusCourses.size());
|
|
|
BigDecimal surplusCoursesPrice=new BigDecimal(0);
|
|
|
for (CourseSchedule courseSchedule : surplusCourses) {
|
|
|
if(courseSchedule.getTeachMode().equals(TeachModeEnum.OFFLINE)){
|
|
@@ -1600,6 +1606,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ BigDecimal singleCourseFee = surplusCoursesPrice.divide(surplusCourseNum, CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP);
|
|
|
+
|
|
|
List<ImGroupMember> imGroupMemberList = new ArrayList<>();
|
|
|
List<ClassGroupStudentMapper> classGroupStudentMappers=new ArrayList<>();
|
|
|
//生成学生单课缴费信息
|
|
@@ -1618,7 +1626,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.setExpectPrice(singleCourseFee);
|
|
|
courseScheduleStudentPayment.setCreateTime(now);
|
|
|
courseScheduleStudentPayment.setUpdateTime(now);
|
|
|
courseScheduleStudentPayments.add(courseScheduleStudentPayment);
|
|
@@ -1720,7 +1728,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);
|