|
@@ -1612,7 +1612,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
|
|
|
List<VipGroup> dataList = null;
|
|
|
int count = vipGroupDao.countVipGroupByOrgan(params);
|
|
|
- if (queryInfo.getIsExport() && count > 50000) {
|
|
|
+ if (queryInfo.isExport() && count > 50000) {
|
|
|
throw new BizException("数据集太大,不能导出.最大数据集不能超过50000");
|
|
|
}
|
|
|
if (count > 0) {
|
|
@@ -1621,7 +1621,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
dataList = vipGroupDao.findAllByOrgan(params);
|
|
|
if (dataList != null && dataList.size() > 0) {
|
|
|
List<String> vipGroupIds = dataList.stream().map(vipGroup -> String.valueOf(vipGroup.getId())).distinct().collect(Collectors.toList());
|
|
|
- List<Map<Long, Integer>> vipGroupOverCourses = courseScheduleDao.countGroupOverCourse(vipGroupIds, "VIP");
|
|
|
+ List<Map<Long, Integer>> vipGroupOverCourses = courseScheduleDao.countGroupOverCourse(vipGroupIds, queryInfo.getGroupType());
|
|
|
Map<String, Integer> vipGroupOverCourseMaps = JSONObject.parseObject(JSONObject.toJSONString(MapUtil.convertIntegerMap(vipGroupOverCourses)), HashMap.class);
|
|
|
List<Integer> educationalTeacherIds = dataList.stream().filter(data -> Objects.nonNull(data.getEducationalTeacherId())).map(VipGroup::getEducationalTeacherId).collect(Collectors.toList());
|
|
|
|
|
@@ -1631,12 +1631,12 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
|
|
|
Map<String, ClassGroup> vipGroupClassGroupMap = classGroupsByVipGroups.stream().collect(Collectors.toMap(ClassGroup::getMusicGroupId, classGroup -> classGroup));
|
|
|
|
|
|
- Map<String, Long> totalClassTimeMap = MapUtil.convertIntegerMap(courseScheduleDao.countTotalCourseScheduleNum(vipGroupIds, "VIP"));
|
|
|
- Map<String, Long> currentClassTimeMap = MapUtil.convertIntegerMap(courseScheduleDao.countCourseScheduleNum(vipGroupIds, "VIP"));
|
|
|
+ Map<String, Long> totalClassTimeMap = MapUtil.convertIntegerMap(courseScheduleDao.countTotalCourseScheduleNum(vipGroupIds, queryInfo.getGroupType()));
|
|
|
+ Map<String, Long> currentClassTimeMap = MapUtil.convertIntegerMap(courseScheduleDao.countCourseScheduleNum(vipGroupIds, queryInfo.getGroupType()));
|
|
|
Map<String, String> lastOverTimeMap = MapUtil.convertIntegerMap(courseScheduleDao.findLastOverTime(vipGroupIds));
|
|
|
|
|
|
- List<Map<String, BigDecimal>> groupCoursesUnitPriceMaps = courseScheduleStudentPaymentDao.findGroupCoursesUnitPrice(GroupType.VIP, vipGroupIds);
|
|
|
- Map<String, BigDecimal> groupCoursesUnitPrice = new HashMap<>();
|
|
|
+ List<Map<String, BigDecimal>> groupCoursesUnitPriceMaps = courseScheduleStudentPaymentDao.findGroupCoursesUnitPrice(queryInfo.getGroupType(), vipGroupIds);
|
|
|
+ Map<String, BigDecimal> groupCoursesUnitPrice = new HashMap<>(groupCoursesUnitPriceMaps.size());
|
|
|
if (!CollectionUtils.isEmpty(groupCoursesUnitPriceMaps)) {
|
|
|
groupCoursesUnitPrice = MapUtil.convertIntegerMap(groupCoursesUnitPriceMaps);
|
|
|
}
|
|
@@ -1655,8 +1655,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
}
|
|
|
|
|
|
Map<String, List<GroupUserDto>> groupStudentsMap = new HashMap<>();
|
|
|
- if (queryInfo.getIsExport()) {
|
|
|
- List<GroupUserDto> groupsStudents = groupDao.findGroupsStudents(vipGroupIds, GroupType.VIP);
|
|
|
+ if (queryInfo.isExport()) {
|
|
|
+ List<GroupUserDto> groupsStudents = groupDao.findGroupsStudents(vipGroupIds, queryInfo.getGroupType());
|
|
|
groupStudentsMap = groupsStudents.stream().collect(Collectors.groupingBy(GroupUserDto::getGroupId));
|
|
|
}
|
|
|
|
|
@@ -1683,7 +1683,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
|
|
|
vipGroup.setCourseUnitPrice(groupCoursesUnitPrice.get(String.valueOf(vipGroup.getId())));
|
|
|
|
|
|
- if (queryInfo.getIsExport()) {
|
|
|
+ if (queryInfo.isExport()) {
|
|
|
List<GroupUserDto> groupStudents = groupStudentsMap.get(vipGroup.getId().toString());
|
|
|
if (!CollectionUtils.isEmpty(groupStudents)) {
|
|
|
List<String> userInfos = groupStudents.stream().map(u -> u.getUserName() + "(" + u.getUserId() + ")").collect(Collectors.toList());
|
|
@@ -1718,7 +1718,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
public Map<String, Object> findVipGroupTeachingRecord(VipGroupTeachingRecordQueryInfo queryInfo) {
|
|
|
Long vipGroupId = queryInfo.getVipGroupId();
|
|
|
if (Objects.isNull(vipGroupId)) {
|
|
|
- throw new BizException("请指定vip课程!");
|
|
|
+ throw new BizException("请指定课程组");
|
|
|
}
|
|
|
PageInfo pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
@@ -1777,7 +1777,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
pageInfo.setTotal(count);
|
|
|
params.put("offset", pageInfo.getOffset());
|
|
|
dataList = vipGroupDao.findVipGroupStudents(params);
|
|
|
- List<StudentApplyRefunds> applyRefunds = studentApplyRefundsDao.findByGroupAndType(queryInfo.getVipGroupId().toString(), GroupType.VIP.getCode());
|
|
|
+ List<StudentApplyRefunds> applyRefunds = studentApplyRefundsDao.findByGroupAndType(queryInfo.getVipGroupId().toString(), queryInfo.getGroupType());
|
|
|
Map<Integer, List<StudentApplyRefunds>> studentApplyRefundsMap = applyRefunds.stream()
|
|
|
.collect(Collectors.groupingBy(StudentApplyRefunds::getUserId));
|
|
|
dataList.forEach(data -> {
|
|
@@ -1856,7 +1856,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
@Override
|
|
|
public VipGroupManageDetailDto getVipGroupDetail(Long vipGroupId) {
|
|
|
if (Objects.isNull(vipGroupId)) {
|
|
|
- throw new BizException("请指定vip课程");
|
|
|
+ throw new BizException("请指定课程组编号");
|
|
|
}
|
|
|
VipGroupManageDetailDto vipGroupBaseInfo = vipGroupDao.getVipGroupBaseInfo(vipGroupId);
|
|
|
if (Objects.nonNull(vipGroupBaseInfo.getEducationalTeacherId())) {
|
|
@@ -2235,7 +2235,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
throw new BizException("您无法购买此课程");
|
|
|
}
|
|
|
}
|
|
|
- ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroupId.longValue(), null);
|
|
|
+ ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroupId.longValue(), vipGroup.getGroupType());
|
|
|
//是否已经购买
|
|
|
Boolean exist = classGroupStudentMapperDao.existByClassGroupIds(classGroup.getId().toString(), userId);
|
|
|
if (exist) {
|
|
@@ -2773,7 +2773,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
throw new BizException("此学生存在退课申请,请到系统日志中查看");
|
|
|
}
|
|
|
|
|
|
- ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroupId, null);
|
|
|
+ ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroupId, vipGroup.getGroupType());
|
|
|
|
|
|
ClassGroupStudentMapper classStudentMapperByUserIdAndClassGroupId = classGroupStudentMapperDao.query(classGroup.getId(),
|
|
|
studentId);
|
|
@@ -2876,7 +2876,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
throw new BizException("学生 {} {} 存在退课申请", studentId, user.getUsername());
|
|
|
}
|
|
|
|
|
|
- ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroupId, null);
|
|
|
+ ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroupId, vipGroup.getGroupType());
|
|
|
|
|
|
ClassGroupStudentMapper classStudentMapperByUserIdAndClassGroupId = classGroupStudentMapperDao.query(classGroup.getId(),
|
|
|
studentId);
|
|
@@ -2927,7 +2927,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroupId, null);
|
|
|
+ ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroupId, vipGroup.getGroupType());
|
|
|
|
|
|
ClassGroupStudentMapper classStudentMapperByUserIdAndClassGroupId = classGroupStudentMapperDao.query(classGroup.getId(),
|
|
|
studentId);
|
|
@@ -3015,7 +3015,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
throw new BizException("此学生存在退课申请,请到系统日志中查看");
|
|
|
}
|
|
|
|
|
|
- ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroupId, null);
|
|
|
+ ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroupId, vipGroup.getGroupType());
|
|
|
|
|
|
ClassGroupStudentMapper classStudentMapperByUserIdAndClassGroupId = classGroupStudentMapperDao.query(classGroup.getId(),
|
|
|
studentId);
|
|
@@ -3122,7 +3122,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
throw new BizException("课程单价设置错误");
|
|
|
}
|
|
|
|
|
|
- ClassGroup classGroup = classGroupDao.findByVipGroup(studentRecoverInfo.getVipGroupId().longValue(), null);
|
|
|
+ ClassGroup classGroup = classGroupDao.findByVipGroup(studentRecoverInfo.getVipGroupId().longValue(), vipGroup.getGroupType());
|
|
|
|
|
|
Integer oldTeacherId = vipGroup.getUserId();
|
|
|
if (Objects.nonNull(studentRecoverInfo.getTeacherId()) && !studentRecoverInfo.getTeacherId().equals(vipGroup.getUserId())) {
|
|
@@ -3315,7 +3315,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
throw new BizException("不能对已停止的课程进行此操作");
|
|
|
}
|
|
|
|
|
|
- ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroupId, null);
|
|
|
+ ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroupId, vipGroup.getGroupType());
|
|
|
|
|
|
ClassGroupStudentMapper classStudentMapperByUserIdAndClassGroupId = classGroupStudentMapperDao.query(classGroup.getId(), studentId);
|
|
|
|
|
@@ -3391,7 +3391,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
} else {
|
|
|
result.put("suplusCourseOriginalFee", bigDecimal);
|
|
|
}
|
|
|
- ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroupId, null);
|
|
|
+ ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroupId, vipGroup.getGroupType());
|
|
|
if (Objects.isNull(classGroup)) {
|
|
|
throw new BizException("未找到对应班级");
|
|
|
}
|
|
@@ -3499,17 +3499,13 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
|
|
|
@Override
|
|
|
public Map<String, Object> findVipGroupSalarys(VipGroupSalaryQueryInfo queryInfo) {
|
|
|
-
|
|
|
if (Objects.isNull(queryInfo.getVipGroupId())) {
|
|
|
- throw new BizException("请指定vip课程!");
|
|
|
+ throw new BizException("请指定课程组");
|
|
|
}
|
|
|
-
|
|
|
VipGroup vipGroup = vipGroupDao.get(queryInfo.getVipGroupId());
|
|
|
-
|
|
|
if (Objects.isNull(vipGroup)) {
|
|
|
- throw new BizException("未找到指定vip课");
|
|
|
+ throw new BizException("未找到指定课程组");
|
|
|
}
|
|
|
-
|
|
|
PageInfo pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
|
Map<String, Object> params = new HashMap<String, Object>();
|
|
|
MapUtil.populateMap(params, queryInfo);
|
|
@@ -3561,7 +3557,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
vipGroupSalaryBaseInfo.setTotalSalary(new BigDecimal(0));
|
|
|
}
|
|
|
|
|
|
- ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroup.getId(), null);
|
|
|
+ ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroup.getId(), vipGroup.getGroupType());
|
|
|
|
|
|
//扣费笔数
|
|
|
vipGroupSalaryBaseInfo.setFeeDeductionNum(vipGroupDao.countStudentPaymentNum(classGroup.getId()));
|
|
@@ -3572,7 +3568,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
vipGroupSalaryBaseInfo.setTotalFeeDeduction(new BigDecimal(0));
|
|
|
}
|
|
|
|
|
|
- BigDecimal totalCoursePrice = studentPaymentOrderDao.sumGroupIncomeFee(vipGroup.getId());
|
|
|
+ BigDecimal totalCoursePrice = studentPaymentOrderDao.sumGroupIncomeFee(vipGroup.getId(),vipGroup.getGroupType());
|
|
|
if (Objects.isNull(totalCoursePrice)) {
|
|
|
totalCoursePrice = new BigDecimal(0);
|
|
|
}
|
|
@@ -3725,11 +3721,11 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void updateVipGroupBaseInfo(VipGroupApplyBaseInfoDto vipGroupApplyBaseInfo) {
|
|
|
if (Objects.isNull(vipGroupApplyBaseInfo.getId())) {
|
|
|
- throw new BizException("请指定vip课");
|
|
|
+ throw new BizException("请指定课程");
|
|
|
}
|
|
|
VipGroup oldVipGroupInfo = vipGroupDao.get(vipGroupApplyBaseInfo.getId());
|
|
|
if (Objects.isNull(oldVipGroupInfo)) {
|
|
|
- throw new BizException("指定的vip课不存在");
|
|
|
+ throw new BizException("指定的课程不存在");
|
|
|
}
|
|
|
if (Objects.isNull(vipGroupApplyBaseInfo.getId())) {
|
|
|
return;
|
|
@@ -3748,11 +3744,11 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
}
|
|
|
if (Objects.nonNull(vipGroupApplyBaseInfo.getTeacherSchoolId())) {
|
|
|
oldVipGroupInfo.setTeacherSchoolId(vipGroupApplyBaseInfo.getTeacherSchoolId());
|
|
|
- courseScheduleDao.updateCourseSchoolByGroup(oldVipGroupInfo.getId().toString(), GroupType.VIP.getCode(), oldVipGroupInfo.getTeacherSchoolId());
|
|
|
+ courseScheduleDao.updateCourseSchoolByGroup(oldVipGroupInfo.getId().toString(), oldVipGroupInfo.getGroupType(), oldVipGroupInfo.getTeacherSchoolId());
|
|
|
isChange = true;
|
|
|
}
|
|
|
if (Objects.nonNull(vipGroupApplyBaseInfo.getEducationalTeacherId()) && !vipGroupApplyBaseInfo.getEducationalTeacherId().equals(oldVipGroupInfo.getEducationalTeacherId())) {
|
|
|
- ClassGroup classGroup = classGroupDao.findByMusicGroupAndType(oldVipGroupInfo.getId().toString(), GroupType.VIP.getCode());
|
|
|
+ ClassGroup classGroup = classGroupDao.findByMusicGroupAndType(oldVipGroupInfo.getId().toString(), oldVipGroupInfo.getGroupType());
|
|
|
if (Objects.nonNull(oldVipGroupInfo.getEducationalTeacherId())) {
|
|
|
|
|
|
imGroupMemberService.quit(classGroup.getId().toString(), oldVipGroupInfo.getEducationalTeacherId());
|
|
@@ -3772,7 +3768,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
oldVipGroupInfo.setUpdateTime(now);
|
|
|
vipGroupDao.update(oldVipGroupInfo);
|
|
|
}
|
|
|
- imUserFriendService.refreshGroupImUserFriend(oldVipGroupInfo.getId().toString(), GroupType.VIP);
|
|
|
+ imUserFriendService.refreshGroupImUserFriend(oldVipGroupInfo.getId().toString(),
|
|
|
+ "VIP".equals(vipGroupApplyBaseInfo.getGroupType())?GroupType.VIP:GroupType.LIVE);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -3785,7 +3782,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
if (Objects.isNull(vipGroup)) {
|
|
|
throw new BizException("指定的vip课不存在");
|
|
|
}
|
|
|
- ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroup.getId(), null);
|
|
|
+ ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroup.getId(), vipGroup.getGroupType());
|
|
|
if (Objects.isNull(classGroup)) {
|
|
|
throw new BizException("班级不存在");
|
|
|
}
|
|
@@ -3909,7 +3906,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
throw new BizException("未找到指定的vip课程");
|
|
|
}
|
|
|
|
|
|
- ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroupId, null);
|
|
|
+ ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroupId, vipGroup.getGroupType());
|
|
|
|
|
|
if (classGroup.getStudentNum() > 0 && (VipGroupStatusEnum.APPLYING.equals(vipGroup.getStatus()))) {
|
|
|
int num = studentPaymentOrderDao.countGroupOrderWithoutFailed(vipGroupId.toString(), GroupType.VIP);
|
|
@@ -4383,13 +4380,13 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
@Override
|
|
|
public List<TeacherBasicDto> findTeacherWithVipGroupOrganAndSubject(Long vipGroupId) {
|
|
|
if (Objects.isNull(vipGroupId)) {
|
|
|
- throw new BizException("请指定小课");
|
|
|
+ throw new BizException("请指定课程");
|
|
|
}
|
|
|
VipGroup vipGroup = vipGroupDao.get(vipGroupId.longValue());
|
|
|
if (Objects.isNull(vipGroup)) {
|
|
|
throw new BizException("未找到指定课程");
|
|
|
}
|
|
|
- ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroupId.longValue(), null);
|
|
|
+ ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroupId.longValue(), vipGroup.getGroupType());
|
|
|
List<TeacherBasicDto> teacherByOrganAndSubject = teacherDao.findTeacherByOrganAndSubject(vipGroup.getOrganId().toString(), classGroup.getSubjectIdList());
|
|
|
if (CollectionUtils.isEmpty(teacherByOrganAndSubject)) {
|
|
|
teacherByOrganAndSubject = new ArrayList<>();
|