|
@@ -18,6 +18,7 @@ import com.google.common.collect.Maps;
|
|
|
import com.ym.mec.biz.dal.dto.*;
|
|
|
import com.ym.mec.biz.dal.dto.VipGroupClassGroupMapper;
|
|
|
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.wrapper.LiveGroupWrapper;
|
|
|
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.VipGroupStudentCoursePriceDao;
|
|
|
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.StudentVipGroupQueryInfo;
|
|
|
import com.ym.mec.biz.dal.page.VipGroupAttendanceQueryInfo;
|
|
@@ -4871,14 +4853,12 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
// 手机号
|
|
|
List<SimpleUserDto> usersSimpleInfo = teacherDao.getUsersSimpleInfo(studentIds.stream().collect(Collectors.toList()));
|
|
|
|
|
|
- Set<Integer> subjectIds = new HashSet<>();
|
|
|
Set<Integer> coopIds = new HashSet<>();
|
|
|
- Set<Integer> organIds = new HashSet<>();
|
|
|
+ Set<Integer> organIds;
|
|
|
studentMap.values().forEach(student -> {
|
|
|
- subjectIds.add(Integer.parseInt(student.getSubjectIdList()));
|
|
|
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));
|
|
|
|
|
@@ -4894,7 +4874,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
}
|
|
|
|
|
|
for (LiveGroupWrapper.LiveGroupStudentList record : records) {
|
|
|
- Student student = studentMap.get(record.getStudentId());
|
|
|
+ Student student = studentMap.get(record.getStudentId().longValue());
|
|
|
if (Objects.nonNull(student)) {
|
|
|
record.setStudentName(student.getUsername());
|
|
|
record.setOrganName(organizationMap.getOrDefault(student.getOrganId(), new Organization()).getName());
|
|
@@ -4981,8 +4961,51 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
// 查询30分钟内要开始的并且没有直播通知的直播课
|
|
|
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);
|
|
|
|
|
|
}
|
|
|
}
|