|
@@ -719,7 +719,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
BigDecimal classTimeDuty=new BigDecimal(vipGroup.getSingleClassMinutes()).divide(teacherSalaryTimeUnit,2,BigDecimal.ROUND_DOWN);
|
|
BigDecimal classTimeDuty=new BigDecimal(vipGroup.getSingleClassMinutes()).divide(teacherSalaryTimeUnit,2,BigDecimal.ROUND_DOWN);
|
|
BigDecimal offlineClassNum=new BigDecimal(vipGroup.getOfflineClassesNum());
|
|
BigDecimal offlineClassNum=new BigDecimal(vipGroup.getOfflineClassesNum());
|
|
BigDecimal onlineClassNum=new BigDecimal(vipGroup.getOnlineClassesNum());
|
|
BigDecimal onlineClassNum=new BigDecimal(vipGroup.getOnlineClassesNum());
|
|
|
|
+ onlineClassesUnitPrice=Objects.isNull(onlineClassesUnitPrice)?new BigDecimal(0):onlineClassesUnitPrice;
|
|
BigDecimal onlineVipGroupCharge = onlineClassesUnitPrice.multiply(onlineClassNum);
|
|
BigDecimal onlineVipGroupCharge = onlineClassesUnitPrice.multiply(onlineClassNum);
|
|
|
|
+ offlineClassesUnitPrice=Objects.isNull(offlineClassesUnitPrice)?new BigDecimal(0):offlineClassesUnitPrice;
|
|
BigDecimal offlineVipGroupCharge = offlineClassesUnitPrice.multiply(offlineClassNum);
|
|
BigDecimal offlineVipGroupCharge = offlineClassesUnitPrice.multiply(offlineClassNum);
|
|
BigDecimal totalClassNum=offlineClassNum.add(onlineClassNum);
|
|
BigDecimal totalClassNum=offlineClassNum.add(onlineClassNum);
|
|
BigDecimal teacherOnlineSalary=null,teacherOfflineSalary=null;
|
|
BigDecimal teacherOnlineSalary=null,teacherOfflineSalary=null;
|
|
@@ -797,7 +799,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
totalPrice=totalPrice.multiply(discount).divide(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_HALF_UP);
|
|
totalPrice=totalPrice.multiply(discount).divide(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_HALF_UP);
|
|
break;
|
|
break;
|
|
case GIVE_CLASS:
|
|
case GIVE_CLASS:
|
|
- if(vipGroup.getGiveTeachMode()==TeachModeEnum.OFFLINE){
|
|
|
|
|
|
+ if(totalClassNum.compareTo(new BigDecimal(vipGroupActivity.getAttribute1()))<0){
|
|
|
|
+
|
|
|
|
+ }else if(vipGroup.getGiveTeachMode()==TeachModeEnum.OFFLINE){
|
|
if(totalClassNum.compareTo(new BigDecimal(vipGroupActivity.getAttribute1()))>-1){
|
|
if(totalClassNum.compareTo(new BigDecimal(vipGroupActivity.getAttribute1()))>-1){
|
|
offlineClassNum=offlineClassNum.subtract(new BigDecimal(vipGroupActivity.getAttribute2()));
|
|
offlineClassNum=offlineClassNum.subtract(new BigDecimal(vipGroupActivity.getAttribute2()));
|
|
}
|
|
}
|
|
@@ -1148,6 +1152,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
|
|
|
courseScheduleService.batchDeleteMusicGroupCourseWithStudent(vipGroupId.toString(),studentId,GroupType.VIP);
|
|
courseScheduleService.batchDeleteMusicGroupCourseWithStudent(vipGroupId.toString(),studentId,GroupType.VIP);
|
|
|
|
|
|
|
|
+ classGroup.setStudentNum(classGroupStudentMapperDao.countClassGroupStudentNum(classGroup.getId()));
|
|
|
|
+ classGroupDao.update(classGroup);
|
|
|
|
+
|
|
//学员退出班级群
|
|
//学员退出班级群
|
|
ImGroupMember[] imGroupMembers = new ImGroupMember[]{new ImGroupMember(studentId.toString())};
|
|
ImGroupMember[] imGroupMembers = new ImGroupMember[]{new ImGroupMember(studentId.toString())};
|
|
imFeignService.groupJoin(new ImGroupModel(classGroup.getId().toString(), imGroupMembers, null));
|
|
imFeignService.groupJoin(new ImGroupModel(classGroup.getId().toString(), imGroupMembers, null));
|
|
@@ -1228,6 +1235,11 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
classStudentMapperByUserIdAndClassGroupId.setStatus(ClassGroupStudentStatusEnum.QUIT);
|
|
classStudentMapperByUserIdAndClassGroupId.setStatus(ClassGroupStudentStatusEnum.QUIT);
|
|
classGroupStudentMapperDao.update(classStudentMapperByUserIdAndClassGroupId);
|
|
classGroupStudentMapperDao.update(classStudentMapperByUserIdAndClassGroupId);
|
|
|
|
|
|
|
|
+ ClassGroup classGroup=new ClassGroup();
|
|
|
|
+ classGroup.setId(classStudentMapperByUserIdAndClassGroupId.getClassGroupId());
|
|
|
|
+ classGroup.setStudentNum(classGroupStudentMapperDao.countClassGroupStudentNum(classGroup.getId()));
|
|
|
|
+ classGroupDao.update(classGroup);
|
|
|
|
+
|
|
courseScheduleService.batchDeleteMusicGroupCourseWithStudent(studentPaymentOrder.getMusicGroupId(),studentApplyRefunds.getUserId(),GroupType.VIP);
|
|
courseScheduleService.batchDeleteMusicGroupCourseWithStudent(studentPaymentOrder.getMusicGroupId(),studentApplyRefunds.getUserId(),GroupType.VIP);
|
|
|
|
|
|
//学员退出班级群
|
|
//学员退出班级群
|
|
@@ -1312,9 +1324,13 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
}else{
|
|
}else{
|
|
vipGroupSalaryBaseInfo.setTotalFeeDeduction(new BigDecimal(0));
|
|
vipGroupSalaryBaseInfo.setTotalFeeDeduction(new BigDecimal(0));
|
|
}
|
|
}
|
|
- BigDecimal studentNum=new BigDecimal(classGroup.getStudentNum());
|
|
|
|
|
|
+
|
|
|
|
+ BigDecimal totalCoursePrice= courseScheduleStudentPaymentDao.countAllCourseFee(classGroup.getId());
|
|
|
|
+ if(Objects.isNull(totalCoursePrice)){
|
|
|
|
+ totalCoursePrice=new BigDecimal(0);
|
|
|
|
+ }
|
|
//课程总价
|
|
//课程总价
|
|
- vipGroupSalaryBaseInfo.setTotalCoursePrice(vipGroup.getTotalPrice().multiply(studentNum));
|
|
|
|
|
|
+ vipGroupSalaryBaseInfo.setTotalCoursePrice(totalCoursePrice);
|
|
|
|
|
|
List<Map<String, BigDecimal>> teacherSalaryCount = courseScheduleTeacherSalaryDao.countTeacherOnlineOfflineSalaryByClass(classGroup.getId());
|
|
List<Map<String, BigDecimal>> teacherSalaryCount = courseScheduleTeacherSalaryDao.countTeacherOnlineOfflineSalaryByClass(classGroup.getId());
|
|
Map<String,BigDecimal> teacherTeachModeSalaryMap = MapUtil.convertIntegerMap(teacherSalaryCount);
|
|
Map<String,BigDecimal> teacherTeachModeSalaryMap = MapUtil.convertIntegerMap(teacherSalaryCount);
|
|
@@ -1527,6 +1543,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
throw new BizException("选择的学生中存在此课程中已存在的学生");
|
|
throw new BizException("选择的学生中存在此课程中已存在的学生");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ Date now=new Date();
|
|
|
|
+
|
|
List<CourseSchedule> surplusCourses = courseScheduleDao.findByClassGroupAndStatus(classGroup.getId(), CourseStatusEnum.NOT_START.getCode());
|
|
List<CourseSchedule> surplusCourses = courseScheduleDao.findByClassGroupAndStatus(classGroup.getId(), CourseStatusEnum.NOT_START.getCode());
|
|
if(CollectionUtils.isEmpty(surplusCourses)){
|
|
if(CollectionUtils.isEmpty(surplusCourses)){
|
|
throw new BizException("此vip课程没有剩余课程计划");
|
|
throw new BizException("此vip课程没有剩余课程计划");
|
|
@@ -1540,6 +1558,12 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
surplusCoursesPrice=surplusCoursesPrice.add(vipGroup.getOnlineClassesUnitPrice());
|
|
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<ImGroupMember> imGroupMemberList = new ArrayList<>();
|
|
List<ClassGroupStudentMapper> classGroupStudentMappers=new ArrayList<>();
|
|
List<ClassGroupStudentMapper> classGroupStudentMappers=new ArrayList<>();
|
|
//生成学生单课缴费信息
|
|
//生成学生单课缴费信息
|
|
@@ -1548,7 +1572,22 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
if(sysUserCashAccount.getCourseBalance().compareTo(surplusCoursesPrice)<0){
|
|
if(sysUserCashAccount.getCourseBalance().compareTo(surplusCoursesPrice)<0){
|
|
throw new BizException("存在课程余额不足的学生");
|
|
throw new BizException("存在课程余额不足的学生");
|
|
}
|
|
}
|
|
- courseScheduleStudentPaymentService.createCourseScheduleStudentPaymentForVipGroup(vipGroupId,studentId);
|
|
|
|
|
|
+// courseScheduleStudentPaymentService.createCourseScheduleStudentPaymentForVipGroup(vipGroupId,studentId);
|
|
|
|
+
|
|
|
|
+ List<CourseScheduleStudentPayment> courseScheduleStudentPayments=new ArrayList<>();
|
|
|
|
+ for (CourseSchedule vipGroupCourseSchedule : vipGroupCourseSchedules) {
|
|
|
|
+ CourseScheduleStudentPayment courseScheduleStudentPayment = new CourseScheduleStudentPayment();
|
|
|
|
+ courseScheduleStudentPayment.setGroupType(GroupType.VIP);
|
|
|
|
+ courseScheduleStudentPayment.setMusicGroupId(vipGroupId.toString());
|
|
|
|
+ courseScheduleStudentPayment.setClassGroupId(vipGroupCourseSchedule.getClassGroupId());
|
|
|
|
+ courseScheduleStudentPayment.setCourseScheduleId(vipGroupCourseSchedule.getId());
|
|
|
|
+ courseScheduleStudentPayment.setUserId(studentId);
|
|
|
|
+ courseScheduleStudentPayment.setExpectPrice(new BigDecimal(0));
|
|
|
|
+ courseScheduleStudentPayment.setCreateTime(now);
|
|
|
|
+ courseScheduleStudentPayment.setUpdateTime(now);
|
|
|
|
+ courseScheduleStudentPayments.add(courseScheduleStudentPayment);
|
|
|
|
+ }
|
|
|
|
+ courseScheduleStudentPaymentDao.batchInsert(courseScheduleStudentPayments);
|
|
|
|
|
|
sysUserCashAccountService.updateCourseBalance(studentId,sysUserCashAccount.getCourseBalance().subtract(surplusCoursesPrice));
|
|
sysUserCashAccountService.updateCourseBalance(studentId,sysUserCashAccount.getCourseBalance().subtract(surplusCoursesPrice));
|
|
|
|
|
|
@@ -1566,7 +1605,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
|
|
|
classGroupStudentMapperDao.classGroupStudentsInsert(classGroupStudentMappers);
|
|
classGroupStudentMapperDao.classGroupStudentsInsert(classGroupStudentMappers);
|
|
|
|
|
|
- classGroup.setStudentNum(classGroup.getStudentNum()+classGroupStudentMappers.size());
|
|
|
|
|
|
+ classGroup.setStudentNum(classGroupStudentMapperDao.countClassGroupStudentNum(classGroup.getId()));
|
|
classGroupDao.update(classGroup);
|
|
classGroupDao.update(classGroup);
|
|
|
|
|
|
try {
|
|
try {
|