|
@@ -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;
|
|
@@ -2032,6 +2014,14 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
List<StudentApplyRefunds> applyRefunds = studentApplyRefundsDao.findByGroupAndType(queryInfo.getVipGroupId().toString(), queryInfo.getGroupType());
|
|
|
Map<Integer, List<StudentApplyRefunds>> studentApplyRefundsMap = applyRefunds.stream()
|
|
|
.collect(Collectors.groupingBy(StudentApplyRefunds::getUserId));
|
|
|
+ //获取学员基本信息
|
|
|
+ List<Integer> userIds = dataList.stream().map(e -> e.getId()).collect(Collectors.toList());
|
|
|
+ List<Integer> subjectIds = dataList.stream().map(e -> e.getSubjectId()).collect(Collectors.toList());
|
|
|
+ List<SimpleUserDto> usersSimpleInfo = teacherDao.getUsersSimpleInfo(userIds);
|
|
|
+ Map<Integer, SimpleUserDto> studentInfoMap = usersSimpleInfo.stream().collect(Collectors.toMap(SimpleUserDto::getUserId, s -> s, (s1, s2) -> s1));
|
|
|
+ List<Integer> organIds = usersSimpleInfo.stream().map(e -> Integer.parseInt(e.getOrganIds())).collect(Collectors.toList());
|
|
|
+ Map<Integer, String> organMap = getMap("organization", "id_", "name_", organIds,queryInfo.getTenantId(), Integer.class, String.class);
|
|
|
+ Map<Integer, String> subjectMap = getMap("subject", "id_", "name_", subjectIds,queryInfo.getTenantId(), Integer.class, String.class);
|
|
|
dataList.forEach(data -> {
|
|
|
List<StudentApplyRefunds> studentApplyRefunds = studentApplyRefundsMap.get(data.getId());
|
|
|
if (!CollectionUtils.isEmpty(studentApplyRefunds)) {
|
|
@@ -2042,6 +2032,14 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
} else if (data.getStudentStatus() == 0) {
|
|
|
data.setRefundDate(null);
|
|
|
}
|
|
|
+ SimpleUserDto userDto = studentInfoMap.get(data.getId());
|
|
|
+ if(Objects.nonNull(userDto)){
|
|
|
+ data.setUserName(userDto.getNickName());
|
|
|
+ data.setPhone(userDto.getPhone());
|
|
|
+ data.setOrganId(Integer.parseInt(userDto.getOrganIds()));
|
|
|
+ data.setOrganName(organMap.get(data.getOrganId()));
|
|
|
+ }
|
|
|
+ data.setSubjectName(subjectMap.get(data.getSubjectId()));
|
|
|
});
|
|
|
}
|
|
|
if (count == 0) {
|
|
@@ -4845,7 +4843,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
return livedStudentList;
|
|
|
}
|
|
|
// 学生ID集合
|
|
|
- List<Integer> studentIds = records.stream().map(LiveGroupWrapper.LiveGroupStudentList::getStudentId).map(o -> o.intValue()).collect(Collectors.toList());
|
|
|
+ List<Integer> studentIds = records.stream().map(e->e.getStudentId()).collect(Collectors.toList());
|
|
|
|
|
|
// 学生信息
|
|
|
Map<Integer, Student> studentMap = studentService.getMapByIds(studentIds);
|
|
@@ -4853,16 +4851,14 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
return livedStudentList;
|
|
|
}
|
|
|
// 手机号
|
|
|
- List<SimpleUserDto> usersSimpleInfo = teacherDao.getUsersSimpleInfo(studentIds);
|
|
|
+ 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));
|
|
|
|
|
@@ -4870,7 +4866,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
|
|
|
Map<Integer, CooperationOrgan> cooperationOrganMap = cooperationOrganService.getMapByIds(new ArrayList<>(coopIds));
|
|
|
|
|
|
// 声部
|
|
|
- Map<Integer, StudentSubjectDto> studentSubjectDtoMap = subjectService.getSubjectByStudentId(studentIds.stream().map(Integer::longValue).collect(Collectors.toSet()));
|
|
|
+ Map<Integer, StudentSubjectDto> studentSubjectDtoMap = subjectService.getSubjectByStudentId(new HashSet<>(studentIds));
|
|
|
|
|
|
Map<Integer,SimpleUserDto> userMap = new HashMap<>();
|
|
|
if (!CollectionUtils.isEmpty(usersSimpleInfo)) {
|
|
@@ -4878,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());
|
|
@@ -4965,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);
|
|
|
|
|
|
}
|
|
|
}
|