|
@@ -1171,6 +1171,11 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
|
|
|
courseScheduleService.batchDeleteMusicGroupCourseWithStudent(vipGroupId.toString(),studentId,GroupType.VIP);
|
|
|
|
|
|
+ List<Integer> studentPaymentIds = courseScheduleStudentPaymentDao.findNotStartCourseStudentPaymentIdsWithClassGroupAndStudent(classGroup.getId(), studentId);
|
|
|
+ if(!CollectionUtils.isEmpty(studentPaymentIds)){
|
|
|
+ courseScheduleStudentPaymentDao.batchDeleteWithID(studentPaymentIds);
|
|
|
+ }
|
|
|
+
|
|
|
// classGroup.setStudentNum(classGroupStudentMapperDao.countClassGroupStudentNum(classGroup.getId()));
|
|
|
// classGroupDao.update(classGroup);
|
|
|
|
|
@@ -1261,6 +1266,11 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
// classGroup.setStudentNum(classGroupStudentMapperDao.countClassGroupStudentNum(classGroup.getId()));
|
|
|
// classGroupDao.update(classGroup);
|
|
|
|
|
|
+ List<Integer> studentPaymentIds = courseScheduleStudentPaymentDao.findNotStartCourseStudentPaymentIdsWithClassGroupAndStudent(classStudentMapperByUserIdAndClassGroupId.getClassGroupId(), studentApplyRefunds.getUserId());
|
|
|
+ if(!CollectionUtils.isEmpty(studentPaymentIds)){
|
|
|
+ courseScheduleStudentPaymentDao.batchDeleteWithID(studentPaymentIds);
|
|
|
+ }
|
|
|
+
|
|
|
courseScheduleService.batchDeleteMusicGroupCourseWithStudent(studentPaymentOrder.getMusicGroupId(),studentApplyRefunds.getUserId(),GroupType.VIP);
|
|
|
|
|
|
//学员退出班级群
|
|
@@ -1563,7 +1573,12 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
}
|
|
|
ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroupId, null);
|
|
|
|
|
|
- Integer exitStudentNum = classGroupStudentMapperDao.countClassGroupExitStudentNum(classGroup.getId(), studentIds);
|
|
|
+ Integer studentNum = classGroupStudentMapperDao.countClassGroupStudentNum(classGroup.getId());
|
|
|
+ if(studentNum.compareTo(classGroup.getExpectStudentNum())>=0){
|
|
|
+ throw new BizException("该班级人数已达上限");
|
|
|
+ }
|
|
|
+
|
|
|
+ Integer exitStudentNum = classGroupStudentMapperDao.countClassGroupExitStudentNum(classGroup.getId(), studentIds);
|
|
|
if(exitStudentNum>0){
|
|
|
throw new BizException("选择的学生中存在此课程中已存在的学生");
|
|
|
}
|
|
@@ -1583,11 +1598,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
surplusCoursesPrice=surplusCoursesPrice.add(vipGroup.getOnlineClassesUnitPrice());
|
|
|
}
|
|
|
}
|
|
|
- List<CourseSchedule> vipGroupCourseSchedules=courseScheduleDao.findVipGroupCourseSchedules(vipGroupId);
|
|
|
-
|
|
|
- if(CollectionUtils.isEmpty(vipGroupCourseSchedules)){
|
|
|
- throw new BizException("此vip课不存在课程");
|
|
|
- }
|
|
|
|
|
|
List<ImGroupMember> imGroupMemberList = new ArrayList<>();
|
|
|
List<ClassGroupStudentMapper> classGroupStudentMappers=new ArrayList<>();
|
|
@@ -1600,7 +1610,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
// courseScheduleStudentPaymentService.createCourseScheduleStudentPaymentForVipGroup(vipGroupId,studentId);
|
|
|
|
|
|
List<CourseScheduleStudentPayment> courseScheduleStudentPayments=new ArrayList<>();
|
|
|
- for (CourseSchedule vipGroupCourseSchedule : vipGroupCourseSchedules) {
|
|
|
+ for (CourseSchedule vipGroupCourseSchedule : surplusCourses) {
|
|
|
CourseScheduleStudentPayment courseScheduleStudentPayment = new CourseScheduleStudentPayment();
|
|
|
courseScheduleStudentPayment.setGroupType(GroupType.VIP);
|
|
|
courseScheduleStudentPayment.setMusicGroupId(vipGroupId.toString());
|
|
@@ -1702,22 +1712,31 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
List<VipGroup> normalVipGroupList = vipGroupDao.queryNormalStatusList();
|
|
|
if (!CollectionUtils.isEmpty(normalVipGroupList)){
|
|
|
Date now = new Date();
|
|
|
+ List<VipGroup> needUpdateVipGroups = new ArrayList<>();
|
|
|
for (VipGroup vipGroup : normalVipGroupList) {
|
|
|
- if(now.before(vipGroup.getRegistrationStartTime())){
|
|
|
- vipGroup.setStatus(VipGroupStatusEnum.NOT_START);
|
|
|
- }
|
|
|
- if(vipGroup.getRegistrationStartTime().before(now)&&vipGroup.getCoursesExpireDate().after(now)){
|
|
|
- vipGroup.setStatus(VipGroupStatusEnum.APPLYING);
|
|
|
- }
|
|
|
- if(vipGroup.getCoursesExpireDate().before(now)&&vipGroup.getCourseStartDate().after(now)){
|
|
|
- vipGroup.setStatus(VipGroupStatusEnum.APPLYING_END);
|
|
|
- }
|
|
|
- if(vipGroup.getCourseStartDate().before(now)&&vipGroup.getCoursesExpireDate().after(now)){
|
|
|
- vipGroup.setStatus(VipGroupStatusEnum.PROGRESS);
|
|
|
+ try {
|
|
|
+ if(now.before(vipGroup.getRegistrationStartTime())){
|
|
|
+ vipGroup.setStatus(VipGroupStatusEnum.NOT_START);
|
|
|
+ }
|
|
|
+ if(vipGroup.getRegistrationStartTime().before(now)&&vipGroup.getCoursesExpireDate().after(now)){
|
|
|
+ vipGroup.setStatus(VipGroupStatusEnum.APPLYING);
|
|
|
+ }
|
|
|
+ if(vipGroup.getCoursesExpireDate().before(now)&&vipGroup.getCourseStartDate().after(now)){
|
|
|
+ vipGroup.setStatus(VipGroupStatusEnum.APPLYING_END);
|
|
|
+ }
|
|
|
+ if(vipGroup.getCourseStartDate().before(now)&&vipGroup.getCoursesExpireDate().after(now)){
|
|
|
+ vipGroup.setStatus(VipGroupStatusEnum.PROGRESS);
|
|
|
+ }
|
|
|
+ VipGroup vipGroup1 = new VipGroup();
|
|
|
+ vipGroup1.setId(vipGroup.getId());
|
|
|
+ vipGroup1.setStatus(vipGroup.getStatus());
|
|
|
+ vipGroup1.setUpdateTime(now);
|
|
|
+ needUpdateVipGroups.add(vipGroup1);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
|
- vipGroup.setUpdateTime(now);
|
|
|
}
|
|
|
- vipGroupDao.batchUpdate(normalVipGroupList);
|
|
|
+ vipGroupDao.batchUpdate(needUpdateVipGroups);
|
|
|
}
|
|
|
}
|
|
|
|