|
@@ -987,7 +987,11 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
normalStudentNum = classGroupStudentMapperDao.countGroupNormalStudentNum(GroupType.VIP, vipGroup.getId().toString());
|
|
|
}
|
|
|
|
|
|
- if(Objects.nonNull(vipGroupActivity)){
|
|
|
+ if(!vipGroupCategory.getMusicTheory()&&Objects.isNull(vipGroupActivity)){
|
|
|
+ throw new BizException("活动设置错误");
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!vipGroupCategory.getMusicTheory()){
|
|
|
VipGroupSalarySettlementDto vipGroupSalarySettlementDto = JSON.parseObject(vipGroupActivity.getSalarySettlementJson(), VipGroupSalarySettlementDto.class);
|
|
|
|
|
|
if(Objects.isNull(vipGroupSalarySettlementDto)){
|
|
@@ -1044,17 +1048,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
}
|
|
|
|
|
|
results.put("totalPrice",totalPrice.setScale(0,BigDecimal.ROUND_CEILING));
|
|
|
-
|
|
|
- if(vipGroup instanceof VipGroupApplyBaseInfoDto && !CollectionUtils.isEmpty(((VipGroupApplyBaseInfoDto)vipGroup).getVipGroupStudentCoursePrices())){
|
|
|
- for (VipGroupStudentCoursePrice vscp : ((VipGroupApplyBaseInfoDto)vipGroup).getVipGroupStudentCoursePrices()) {
|
|
|
- if(Objects.isNull(vscp.getOnlineClassesUnitPrice())||Objects.isNull(vscp.getOfflineClassesUnitPrice())){
|
|
|
- throw new BizException("请设置课程单价");
|
|
|
- }
|
|
|
- vscp.setPaymentPrice(vscp.getOfflineClassesUnitPrice().multiply(new BigDecimal(vipGroup.getOfflineClassesNum())).add(vscp.getOnlineClassesUnitPrice().multiply(new BigDecimal(vipGroup.getOnlineClassesNum()))));
|
|
|
- vipGroup.setTotalPrice(vipGroup.getTotalPrice().add(vscp.getPaymentPrice()));
|
|
|
- results.put(vscp.getStudentId().toString(), vscp.getPaymentPrice());
|
|
|
- }
|
|
|
- }
|
|
|
+ vipGroup.setTotalPrice(totalPrice.setScale(0,BigDecimal.ROUND_CEILING));
|
|
|
|
|
|
//教师课酬线上单课酬计算
|
|
|
if(Objects.nonNull(vipGroupSalarySettlementDto.getOnlineSalarySettlement())){
|
|
@@ -1124,11 +1118,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
|
|
|
results.put("onlineTeacherSalary", ots);
|
|
|
results.put("offlineTeacherSalary", ofts);
|
|
|
- }else{
|
|
|
-
|
|
|
}
|
|
|
|
|
|
- if(Objects.isNull(vipGroupActivity)||vipGroupCategory.getMusicTheory()){
|
|
|
+ if(vipGroupCategory.getMusicTheory()){
|
|
|
BigDecimal ots = teacherDefaultVipGroupSalary.getOfflineClassesSalary();
|
|
|
BigDecimal ofts = teacherDefaultVipGroupSalary.getOfflineClassesSalary();
|
|
|
if(Objects.nonNull(vipGroup.getStatus())&&vipGroupCategory.getMusicTheory()){
|
|
@@ -1141,8 +1133,14 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
}
|
|
|
|
|
|
if(vipGroup instanceof VipGroupApplyBaseInfoDto&&!CollectionUtils.isEmpty(((VipGroupApplyBaseInfoDto)vipGroup).getVipGroupStudentCoursePrices())){
|
|
|
- vipGroup.setTotalPrice(new BigDecimal(0));
|
|
|
+ if(vipGroupCategory.getMusicTheory()){
|
|
|
+ vipGroup.setTotalPrice(new BigDecimal(0));
|
|
|
+ }
|
|
|
for (VipGroupStudentCoursePrice vscp : ((VipGroupApplyBaseInfoDto)vipGroup).getVipGroupStudentCoursePrices()) {
|
|
|
+ if(!vipGroupCategory.getMusicTheory()){
|
|
|
+ results.put(vscp.getStudentId().toString(), vipGroup.getTotalPrice());
|
|
|
+ continue;
|
|
|
+ }
|
|
|
if(Objects.isNull(vscp.getOnlineClassesUnitPrice())||Objects.isNull(vscp.getOfflineClassesUnitPrice())){
|
|
|
throw new BizException("请设置课程单价");
|
|
|
}
|
|
@@ -1821,7 +1819,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
throw new BizException("不能对已停止的课程进行此操作");
|
|
|
}
|
|
|
|
|
|
- List<StudentApplyRefunds> studentApplyRefunds = studentApplyRefundsDao.findByGroupAndUser(vipGroupId.toString(), GroupType.VIP.getCode(), studentId);
|
|
|
+ VipGroupCategory vipGroupCategory = vipGroupCategoryDao.get(vipGroup.getVipGroupCategoryId());
|
|
|
+
|
|
|
+ List<StudentApplyRefunds> studentApplyRefunds = studentApplyRefundsDao.findByGroupAndUser(vipGroupId.toString(), GroupType.VIP.getCode(), studentId);
|
|
|
if(!CollectionUtils.isEmpty(studentApplyRefunds)){
|
|
|
throw new BizException("此学生存在退课申请,请到系统日志中查看");
|
|
|
}
|
|
@@ -1879,7 +1879,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
courseScheduleStudentPaymentDao.batchDeleteWithID(studentPaymentIds);
|
|
|
}
|
|
|
|
|
|
- if(!vipGroup.getStatus().equals(VipGroupStatusEnum.APPLYING)){
|
|
|
+ if(!vipGroup.getStatus().equals(VipGroupStatusEnum.APPLYING)||(Objects.nonNull(vipGroupCategory)&&vipGroupCategory.getMusicTheory())){
|
|
|
courseScheduleTeacherSalaryService.updateVipGroupCourseTeacherSalary(vipGroupId.intValue(), vipGroup.getUserId());
|
|
|
}
|
|
|
|