|
@@ -18,6 +18,7 @@ import com.google.common.collect.Maps;
|
|
import com.ym.mec.biz.dal.dto.*;
|
|
import com.ym.mec.biz.dal.dto.*;
|
|
import com.ym.mec.biz.dal.dto.VipGroupClassGroupMapper;
|
|
import com.ym.mec.biz.dal.dto.VipGroupClassGroupMapper;
|
|
import com.ym.mec.biz.dal.entity.*;
|
|
import com.ym.mec.biz.dal.entity.*;
|
|
|
|
+import com.ym.mec.biz.dal.enums.*;
|
|
import com.ym.mec.biz.dal.mapper.LiveGroupPlusMapper;
|
|
import com.ym.mec.biz.dal.mapper.LiveGroupPlusMapper;
|
|
import com.ym.mec.biz.dal.wrapper.LiveGroupWrapper;
|
|
import com.ym.mec.biz.dal.wrapper.LiveGroupWrapper;
|
|
import com.ym.mec.biz.service.*;
|
|
import com.ym.mec.biz.service.*;
|
|
@@ -67,25 +68,6 @@ import com.ym.mec.biz.dal.dao.VipGroupDefaultClassesCycleDao;
|
|
import com.ym.mec.biz.dal.dao.VipGroupDefaultClassesUnitPriceDao;
|
|
import com.ym.mec.biz.dal.dao.VipGroupDefaultClassesUnitPriceDao;
|
|
import com.ym.mec.biz.dal.dao.VipGroupStudentCoursePriceDao;
|
|
import com.ym.mec.biz.dal.dao.VipGroupStudentCoursePriceDao;
|
|
import com.ym.mec.biz.dal.entity.StudentApplyRefunds.StudentApplyRefundsStatus;
|
|
import com.ym.mec.biz.dal.entity.StudentApplyRefunds.StudentApplyRefundsStatus;
|
|
-import com.ym.mec.biz.dal.enums.ActivityCourseType;
|
|
|
|
-import com.ym.mec.biz.dal.enums.AuditStatusEnum;
|
|
|
|
-import com.ym.mec.biz.dal.enums.ClassGroupStudentStatusEnum;
|
|
|
|
-import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
|
|
|
|
-import com.ym.mec.biz.dal.enums.CouponDetailTypeEnum;
|
|
|
|
-import com.ym.mec.biz.dal.enums.CourseStatusEnum;
|
|
|
|
-import com.ym.mec.biz.dal.enums.DealStatusEnum;
|
|
|
|
-import com.ym.mec.biz.dal.enums.GroupType;
|
|
|
|
-import com.ym.mec.biz.dal.enums.MessageTypeEnum;
|
|
|
|
-import com.ym.mec.biz.dal.enums.OrderTypeEnum;
|
|
|
|
-import com.ym.mec.biz.dal.enums.PlatformCashAccountDetailTypeEnum;
|
|
|
|
-import com.ym.mec.biz.dal.enums.ReturnFeeEnum;
|
|
|
|
-import com.ym.mec.biz.dal.enums.SalarySettlementTypeEnum;
|
|
|
|
-import com.ym.mec.biz.dal.enums.StudentAttendanceStatusEnum;
|
|
|
|
-import com.ym.mec.biz.dal.enums.SysUserRoleEnum;
|
|
|
|
-import com.ym.mec.biz.dal.enums.TeachModeEnum;
|
|
|
|
-import com.ym.mec.biz.dal.enums.TeachTypeEnum;
|
|
|
|
-import com.ym.mec.biz.dal.enums.VipGroupStatusEnum;
|
|
|
|
-import com.ym.mec.biz.dal.enums.YesOrNoEnum;
|
|
|
|
import com.ym.mec.biz.dal.page.ActivityUserQueryInfo;
|
|
import com.ym.mec.biz.dal.page.ActivityUserQueryInfo;
|
|
import com.ym.mec.biz.dal.page.StudentVipGroupQueryInfo;
|
|
import com.ym.mec.biz.dal.page.StudentVipGroupQueryInfo;
|
|
import com.ym.mec.biz.dal.page.VipGroupAttendanceQueryInfo;
|
|
import com.ym.mec.biz.dal.page.VipGroupAttendanceQueryInfo;
|
|
@@ -2205,6 +2187,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
VipGroupCategory vipGroupCategory = vipGroupCategoryService.get(vipGroup.getVipGroupCategoryId());
|
|
VipGroupCategory vipGroupCategory = vipGroupCategoryService.get(vipGroup.getVipGroupCategoryId());
|
|
vipGroupDetail.setCategoryName(vipGroupCategory.getName());
|
|
vipGroupDetail.setCategoryName(vipGroupCategory.getName());
|
|
vipGroupDetail.setNumberOfClasses(vipGroupDao.countTeacherVipGroups(vipGroupDetail.getTeacherId().longValue()));
|
|
vipGroupDetail.setNumberOfClasses(vipGroupDao.countTeacherVipGroups(vipGroupDetail.getTeacherId().longValue()));
|
|
|
|
+ vipGroupDetail.setLiveConfigJson(vipGroup.getLiveConfigJson());
|
|
return vipGroupDetail;
|
|
return vipGroupDetail;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -2758,19 +2741,19 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
//退还优惠券
|
|
//退还优惠券
|
|
sysCouponCodeService.quit(order.getCouponCodeId());
|
|
sysCouponCodeService.quit(order.getCouponCodeId());
|
|
} else {
|
|
} else {
|
|
|
|
+ //生成班级学员关联
|
|
|
|
+ ClassGroupStudentMapper classGroupStudentMapper = new ClassGroupStudentMapper();
|
|
|
|
+ classGroupStudentMapper.setMusicGroupId(classGroup.getMusicGroupId());
|
|
|
|
+ classGroupStudentMapper.setClassGroupId(classGroup.getId());
|
|
|
|
+ classGroupStudentMapper.setUserId(userId);
|
|
|
|
+ classGroupStudentMapper.setCreateTime(date);
|
|
|
|
+ classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
|
|
|
|
+ classGroupStudentMapper.setGroupType(groupType);
|
|
|
|
+ classGroupStudentMapperDao.insert(classGroupStudentMapper);
|
|
if(groupType == VIP){
|
|
if(groupType == VIP){
|
|
//活动赠送
|
|
//活动赠送
|
|
studentPaymentOrderService.activityGive(vipGroup.getVipGroupActivityId(), order,
|
|
studentPaymentOrderService.activityGive(vipGroup.getVipGroupActivityId(), order,
|
|
vipGroup.getId().toString(), null);
|
|
vipGroup.getId().toString(), null);
|
|
- //生成班级学员关联
|
|
|
|
- ClassGroupStudentMapper classGroupStudentMapper = new ClassGroupStudentMapper();
|
|
|
|
- classGroupStudentMapper.setMusicGroupId(classGroup.getMusicGroupId());
|
|
|
|
- classGroupStudentMapper.setClassGroupId(classGroup.getId());
|
|
|
|
- classGroupStudentMapper.setUserId(userId);
|
|
|
|
- classGroupStudentMapper.setCreateTime(date);
|
|
|
|
- classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
|
|
|
|
- classGroupStudentMapper.setGroupType(groupType);
|
|
|
|
- classGroupStudentMapperDao.insert(classGroupStudentMapper);
|
|
|
|
//获取班级实际人数
|
|
//获取班级实际人数
|
|
Integer studentNum = classGroupStudentMapperDao.countGroupNormalStudentNum(groupType, classGroup.getMusicGroupId());
|
|
Integer studentNum = classGroupStudentMapperDao.countGroupNormalStudentNum(groupType, classGroup.getMusicGroupId());
|
|
//课程组人数已满,变更状态
|
|
//课程组人数已满,变更状态
|
|
@@ -2779,7 +2762,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
classGroup.setDelFlag(0);
|
|
classGroup.setDelFlag(0);
|
|
VipGroupDefaultClassesUnitPrice vipGroupDefaultClassesUnitPrice = vipGroupDefaultClassesUnitPriceDao.getByVipGroupCategory(vipGroup.getVipGroupCategoryId(),
|
|
VipGroupDefaultClassesUnitPrice vipGroupDefaultClassesUnitPrice = vipGroupDefaultClassesUnitPriceDao.getByVipGroupCategory(vipGroup.getVipGroupCategoryId(),
|
|
vipGroup.getOrganId(), vipGroup.getGroupType());
|
|
vipGroup.getOrganId(), vipGroup.getGroupType());
|
|
-
|
|
|
|
//生成课表
|
|
//生成课表
|
|
List<CourseSchedule> courseSchedules = JSON.parseArray(vipGroup.getCourseSchedulesJson(), CourseSchedule.class);
|
|
List<CourseSchedule> courseSchedules = JSON.parseArray(vipGroup.getCourseSchedulesJson(), CourseSchedule.class);
|
|
classGroup.setTotalClassTimes(courseSchedules.size());
|
|
classGroup.setTotalClassTimes(courseSchedules.size());
|
|
@@ -4525,16 +4507,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
Integer tenantId = vipGroup.getTenantId();
|
|
Integer tenantId = vipGroup.getTenantId();
|
|
for (String s : vipGroup.getStudentIdList().split(",")) {
|
|
for (String s : vipGroup.getStudentIdList().split(",")) {
|
|
Integer userId = Integer.parseInt(s);
|
|
Integer userId = Integer.parseInt(s);
|
|
- //生成班级学员关联
|
|
|
|
- ClassGroupStudentMapper classGroupStudentMapper = new ClassGroupStudentMapper();
|
|
|
|
- classGroupStudentMapper.setMusicGroupId(classGroup.getMusicGroupId());
|
|
|
|
- classGroupStudentMapper.setClassGroupId(classGroup.getId());
|
|
|
|
- classGroupStudentMapper.setUserId(userId);
|
|
|
|
- classGroupStudentMapper.setCreateTime(now);
|
|
|
|
- classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
|
|
|
|
- classGroupStudentMapper.setGroupType(GroupType.LIVE);
|
|
|
|
- classGroupStudentMapperDao.insert(classGroupStudentMapper);
|
|
|
|
-
|
|
|
|
classGroup.setDelFlag(0);
|
|
classGroup.setDelFlag(0);
|
|
VipGroupDefaultClassesUnitPrice vipGroupDefaultClassesUnitPrice = vipGroupDefaultClassesUnitPriceDao.getByVipGroupCategory(vipGroup.getVipGroupCategoryId(),
|
|
VipGroupDefaultClassesUnitPrice vipGroupDefaultClassesUnitPrice = vipGroupDefaultClassesUnitPriceDao.getByVipGroupCategory(vipGroup.getVipGroupCategoryId(),
|
|
vipGroup.getOrganId(), vipGroup.getGroupType());
|
|
vipGroup.getOrganId(), vipGroup.getGroupType());
|
|
@@ -4865,14 +4837,12 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
// 手机号
|
|
// 手机号
|
|
List<SimpleUserDto> usersSimpleInfo = teacherDao.getUsersSimpleInfo(studentIds.stream().map(Long::intValue).collect(Collectors.toList()));
|
|
List<SimpleUserDto> usersSimpleInfo = teacherDao.getUsersSimpleInfo(studentIds.stream().map(Long::intValue).collect(Collectors.toList()));
|
|
|
|
|
|
- Set<Integer> subjectIds = new HashSet<>();
|
|
|
|
Set<Integer> coopIds = new HashSet<>();
|
|
Set<Integer> coopIds = new HashSet<>();
|
|
- Set<Integer> organIds = new HashSet<>();
|
|
|
|
|
|
+ Set<Integer> organIds;
|
|
studentMap.values().forEach(student -> {
|
|
studentMap.values().forEach(student -> {
|
|
- subjectIds.add(Integer.parseInt(student.getSubjectIdList()));
|
|
|
|
coopIds.add(student.getCooperationOrganId());
|
|
coopIds.add(student.getCooperationOrganId());
|
|
- organIds.add(student.getOrganId());
|
|
|
|
});
|
|
});
|
|
|
|
+ organIds = usersSimpleInfo.stream().map( o -> Integer.parseInt(o.getOrganIds())).collect(Collectors.toSet());
|
|
// 分部
|
|
// 分部
|
|
Map<Integer, Organization> organizationMap = organizationService.getMapById(new ArrayList<>(organIds));
|
|
Map<Integer, Organization> organizationMap = organizationService.getMapById(new ArrayList<>(organIds));
|
|
|
|
|
|
@@ -4975,8 +4945,51 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
// 查询30分钟内要开始的并且没有直播通知的直播课
|
|
// 查询30分钟内要开始的并且没有直播通知的直播课
|
|
List<CourseSchedule> courseSchedules = courseScheduleDao.liveCourseRemind();
|
|
List<CourseSchedule> courseSchedules = courseScheduleDao.liveCourseRemind();
|
|
|
|
|
|
|
|
+ if (CollectionUtils.isEmpty(courseSchedules)) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for (CourseSchedule courseSchedule : courseSchedules) {
|
|
|
|
+
|
|
|
|
+ // 获取班级名
|
|
|
|
+ ClassGroup classGroup = classGroupDao.get(courseSchedule.getClassGroupId());
|
|
|
|
+ if (Objects.isNull(classGroup)) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 通知老师
|
|
|
|
+ Integer actualTeacherId = courseSchedule.getActualTeacherId();
|
|
|
|
+ if (actualTeacherId != null) {
|
|
|
|
+ Map<Integer, String> userMap = new HashMap<>();
|
|
|
|
+ userMap.put(actualTeacherId, actualTeacherId.toString());
|
|
|
|
+
|
|
|
|
+ sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.JIGUANG_LIVE_COURSE_START,
|
|
|
|
+ userMap, null, 0, null, "TEACHER", classGroup.getName());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 通知学生
|
|
|
|
+ List<SimpleUserDto> courseStudents = courseScheduleStudentPaymentService.getCourseStudents(Lists.newArrayList(courseSchedule.getId()));
|
|
|
|
+ if (!CollectionUtils.isEmpty(courseStudents)) {
|
|
|
|
+ Map<Integer, String> userMap = new HashMap<>();
|
|
|
|
+ courseStudents.forEach(data -> {
|
|
|
|
+ userMap.put(data.getUserId(), data.getUserId().toString());
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.JIGUANG_LIVE_COURSE_START_STUDENT,
|
|
|
|
+ userMap, null, 0, null, "STUDENT", classGroup.getName());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // im消息 TODO
|
|
|
|
+ sysMessageService.batchSendImGroupMessage(MessageTypeEnum.IM_LIVE_COURSE_START_GROUP, courseSchedule.getActualTeacherId().toString(), "extra",
|
|
|
|
+ new String[]{classGroup.getId().toString()},null);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ // id 集合
|
|
|
|
+ List<Long> ids = courseSchedules.stream().map(CourseSchedule::getId).collect(Collectors.toList());
|
|
|
|
|
|
|
|
+ // 更新通知状态
|
|
|
|
+ courseScheduleDao.updateRemindStatus(ids);
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|