|
@@ -219,19 +219,18 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
|
|
|
@Override
|
|
|
public HttpResponseResult updateLiveGroup(VipGroupApplyDto vipGroup) {
|
|
|
-
|
|
|
-
|
|
|
- if (vipGroup.getVipGroupApplyBaseInfo().getId() == null) {
|
|
|
+ VipGroupApplyBaseInfoDto applyBaseInfo = vipGroup.getVipGroupApplyBaseInfo();
|
|
|
+ if (applyBaseInfo.getId() == null) {
|
|
|
throw new BizException("课程id不能为空");
|
|
|
}
|
|
|
- VipGroup vipGroup1 = vipGroupDao.get(vipGroup.getVipGroupApplyBaseInfo().getId());
|
|
|
+ VipGroup vipGroup1 = vipGroupDao.get(applyBaseInfo.getId());
|
|
|
if (vipGroup1 == null) {
|
|
|
throw new BizException("课程不存在");
|
|
|
}
|
|
|
|
|
|
TeacherDefaultVipGroupSalary groupSalary = teacherDefaultVipGroupSalaryDao
|
|
|
- .findByTeacherAndCategory(vipGroup.getVipGroupApplyBaseInfo().getUserId(), vipGroup.getVipGroupApplyBaseInfo().getVipGroupCategoryId());
|
|
|
- if (groupSalary == null && vipGroup.getVipGroupApplyBaseInfo().getGroupType().equals(GroupType.LIVE.getCode())) {
|
|
|
+ .findByTeacherAndCategory(applyBaseInfo.getUserId(), applyBaseInfo.getVipGroupCategoryId());
|
|
|
+ if (groupSalary == null && applyBaseInfo.getGroupType().equals(GroupType.LIVE.getCode())) {
|
|
|
throw new BizException("请设置教师课酬");
|
|
|
}
|
|
|
// 声部
|
|
@@ -243,28 +242,28 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
// 有人购买过直播课 不可修改判断
|
|
|
|
|
|
// 声部
|
|
|
- if (!vipGroupApplyDto.getVipGroupApplyBaseInfo().getSubjectIdList().equals(vipGroup.getVipGroupApplyBaseInfo().getSubjectIdList())) {
|
|
|
+ if (!vipGroupApplyDto.getVipGroupApplyBaseInfo().getSubjectIdList().equals(applyBaseInfo.getSubjectIdList())) {
|
|
|
throw new BizException("已有学生购买直播课,不可修改声部");
|
|
|
}
|
|
|
|
|
|
// 课时数
|
|
|
- if (!vipGroupApplyDto.getVipGroupApplyBaseInfo().getOnlineClassesNum().equals(vipGroup.getVipGroupApplyBaseInfo().getOnlineClassesNum())) {
|
|
|
+ if (!vipGroupApplyDto.getVipGroupApplyBaseInfo().getOnlineClassesNum().equals(applyBaseInfo.getOnlineClassesNum())) {
|
|
|
throw new BizException("已有学生购买直播课,不可修改课时数");
|
|
|
}
|
|
|
|
|
|
// 课程时长
|
|
|
- if (!vipGroupApplyDto.getVipGroupApplyBaseInfo().getSingleClassMinutes().equals(vipGroup.getVipGroupApplyBaseInfo().getSingleClassMinutes())) {
|
|
|
+ if (!vipGroupApplyDto.getVipGroupApplyBaseInfo().getSingleClassMinutes().equals(applyBaseInfo.getSingleClassMinutes())) {
|
|
|
throw new BizException("已有学生购买直播课,不可修改课程时长");
|
|
|
}
|
|
|
|
|
|
|
|
|
/// 现价
|
|
|
- if (vipGroupApplyDto.getVipGroupApplyBaseInfo().getOnlineClassesUnitPrice().compareTo(vipGroup.getVipGroupApplyBaseInfo().getOnlineClassesUnitPrice()) != 0) {
|
|
|
+ if (vipGroupApplyDto.getVipGroupApplyBaseInfo().getOnlineClassesUnitPrice().compareTo(applyBaseInfo.getOnlineClassesUnitPrice()) != 0) {
|
|
|
throw new BizException("已有学生购买直播课,不可修改现价");
|
|
|
}
|
|
|
|
|
|
// 原价
|
|
|
- if (vipGroupApplyDto.getVipGroupApplyBaseInfo().getOfflineClassesUnitPrice().compareTo(vipGroup.getVipGroupApplyBaseInfo().getOfflineClassesUnitPrice()) != 0) {
|
|
|
+ if (vipGroupApplyDto.getVipGroupApplyBaseInfo().getOfflineClassesUnitPrice().compareTo(applyBaseInfo.getOfflineClassesUnitPrice()) != 0) {
|
|
|
throw new BizException("已有学生购买直播课,不可修改原价");
|
|
|
}
|
|
|
}
|
|
@@ -272,16 +271,16 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
|
|
|
|
|
|
// VIP, LIVE课程公共参数校验
|
|
|
- if (Objects.isNull(vipGroup.getVipGroupApplyBaseInfo().getUserId())) {
|
|
|
+ if (Objects.isNull(applyBaseInfo.getUserId())) {
|
|
|
throw new BizException("请选择指导老师");
|
|
|
}
|
|
|
|
|
|
- if (vipGroup.getCourseSchedules().size() != (vipGroup.getVipGroupApplyBaseInfo().getOfflineClassesNum() + vipGroup.getVipGroupApplyBaseInfo().getOnlineClassesNum())) {
|
|
|
+ if (vipGroup.getCourseSchedules().size() != (applyBaseInfo.getOfflineClassesNum() + applyBaseInfo.getOnlineClassesNum())) {
|
|
|
throw new BizException("建课失败,当前课程存在未排课课程,请调整相关设置");
|
|
|
}
|
|
|
|
|
|
// 学生购买价格,老师课薪设置校验
|
|
|
- VipGroupApplyBaseInfoDto vipGroupApplyBaseInfoDto = vipGroup.getVipGroupApplyBaseInfo();
|
|
|
+ VipGroupApplyBaseInfoDto vipGroupApplyBaseInfoDto = applyBaseInfo;
|
|
|
|
|
|
if (Objects.isNull(vipGroupApplyBaseInfoDto.getOfflineClassesUnitPrice())
|
|
|
&& Objects.isNull(vipGroupApplyBaseInfoDto.getOnlineClassesUnitPrice())) {
|
|
@@ -321,14 +320,13 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
}
|
|
|
Date now = new Date();
|
|
|
// VIP课,LIVE课参数校验
|
|
|
- String groupType = vipGroup.getVipGroupApplyBaseInfo().getGroupType();
|
|
|
+ String groupType = applyBaseInfo.getGroupType();
|
|
|
|
|
|
// 购买学生列表
|
|
|
List<Integer> canBuyStudentIds = Lists.newArrayList();
|
|
|
if (StringUtils.isNotBlank(vipGroupApplyBaseInfoDto.getStudentIdList())) {
|
|
|
canBuyStudentIds = Arrays.stream(vipGroupApplyBaseInfoDto.getStudentIdList().split(",")).map(Integer::valueOf).collect(Collectors.toList());
|
|
|
}
|
|
|
- List<VipGroupStudentCoursePrice> vscps = vipGroup.getVipGroupApplyBaseInfo().getVipGroupStudentCoursePrices();
|
|
|
|
|
|
// VIP课参数校验
|
|
|
if (CourseSchedule.CourseScheduleType.VIP.getCode().equals(groupType)) {
|
|
@@ -352,11 +350,12 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
}
|
|
|
|
|
|
// 设置默认参数
|
|
|
- liveRoom.groupType(vipGroup.getVipGroupApplyBaseInfo().getGroupType())
|
|
|
- .subjectId(vipGroup.getVipGroupApplyBaseInfo().getSubjectIdList())
|
|
|
+ liveRoom.groupType(applyBaseInfo.getGroupType())
|
|
|
+ .subjectId(applyBaseInfo.getSubjectIdList())
|
|
|
.setTenantId(TenantContextHolder.getTenantId());
|
|
|
|
|
|
- vipGroup.getVipGroupApplyBaseInfo().setLiveConfigJson(JSON.toJSONString(liveRoom));
|
|
|
+ vipGroupApplyBaseInfoDto.setLiveConfigJson(JSON.toJSONString(liveRoom));
|
|
|
+ vipGroupApplyBaseInfoDto.setOrganId(teacherDao.get(applyBaseInfo.getUserId()).getTeacherOrganId());
|
|
|
}
|
|
|
|
|
|
vipGroupApplyBaseInfoDto.setName(vipGroup.getLiveBroadcastRoom().getRoomTitle());
|
|
@@ -438,7 +437,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
classGroupTeacherSalaryDao.update(classGroupTeacherSalary);
|
|
|
}
|
|
|
|
|
|
- vipGroup.getVipGroupApplyBaseInfo().setName(vipGroup.getLiveBroadcastRoom().getRoomTitle());
|
|
|
+ applyBaseInfo.setName(vipGroup.getLiveBroadcastRoom().getRoomTitle());
|
|
|
//课程信息调整
|
|
|
List<CourseSchedule> courseSchedules = vipGroup.getCourseSchedules();
|
|
|
ClassGroup finalClassGroup = classGroup;
|
|
@@ -446,7 +445,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
courseSchedule.setGroupType(GroupType.valueOf(groupType));
|
|
|
courseSchedule.setMusicGroupId(vipGroupApplyBaseInfoDto.getId().toString());
|
|
|
if (courseSchedule.getTeachMode().equals(TeachModeEnum.OFFLINE)) {
|
|
|
- courseSchedule.setSchoolId(vipGroup.getVipGroupApplyBaseInfo().getTeacherSchoolId());
|
|
|
+ courseSchedule.setSchoolId(applyBaseInfo.getTeacherSchoolId());
|
|
|
}
|
|
|
courseSchedule.setTeacherId(vipGroupApplyBaseInfoDto.getUserId());
|
|
|
courseSchedule.setActualTeacherId(vipGroupApplyBaseInfoDto.getUserId());
|
|
@@ -483,7 +482,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
}
|
|
|
// 加入群组
|
|
|
imGroupMemberService.join(classGroup.getId().toString(), vipGroup.getLiveBroadcastRoom().getSpeakerId(),EFriendRoleType.ORCHESTRA_TEACHER.getMsg(),false);
|
|
|
- imGroupMemberService.join(classGroup.getId().toString(), vipGroup.getVipGroupApplyBaseInfo().getEducationalTeacherId(),EFriendRoleType.ORCHESTRA_MANAGER.getMsg(),false);
|
|
|
+ imGroupMemberService.join(classGroup.getId().toString(), applyBaseInfo.getEducationalTeacherId(),EFriendRoleType.ORCHESTRA_MANAGER.getMsg(),false);
|
|
|
}
|
|
|
|
|
|
if (!vipGroup1.getStatus().equals(VipGroupStatusEnum.PROGRESS)) {
|