|
@@ -12,8 +12,11 @@ import com.ym.mec.biz.service.SysConfigService;
|
|
import com.ym.mec.biz.service.SysMessageService;
|
|
import com.ym.mec.biz.service.SysMessageService;
|
|
import com.ym.mec.biz.service.TeacherService;
|
|
import com.ym.mec.biz.service.TeacherService;
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
|
+import com.ym.mec.common.entity.ImGroupMember;
|
|
|
|
+import com.ym.mec.common.entity.ImGroupModel;
|
|
import com.ym.mec.common.exception.BizException;
|
|
import com.ym.mec.common.exception.BizException;
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
|
+import com.ym.mec.im.ImFeignService;
|
|
import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
|
|
import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
|
|
import com.ym.mec.util.collection.MapUtil;
|
|
import com.ym.mec.util.collection.MapUtil;
|
|
import com.ym.mec.util.date.DateUtil;
|
|
import com.ym.mec.util.date.DateUtil;
|
|
@@ -66,6 +69,8 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
private SysMessageService sysMessageService;
|
|
private SysMessageService sysMessageService;
|
|
@Autowired
|
|
@Autowired
|
|
private MusicGroupDao musicGroupDao;
|
|
private MusicGroupDao musicGroupDao;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ImFeignService imFeignService;
|
|
|
|
|
|
private static Map<Integer,Map<Integer,List<Integer>>> schoolSubjectTeachersMap;
|
|
private static Map<Integer,Map<Integer,List<Integer>>> schoolSubjectTeachersMap;
|
|
|
|
|
|
@@ -314,9 +319,11 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
Student student = studentDao.get(userId);
|
|
Student student = studentDao.get(userId);
|
|
List<Subject> subjects = subjectDao.findBySubjectByIdList(practiceSubjectIdListConfig.getParanValue());
|
|
List<Subject> subjects = subjectDao.findBySubjectByIdList(practiceSubjectIdListConfig.getParanValue());
|
|
List<Integer> subjectIds = Arrays.asList(practiceSubjectIdListConfig.getParanValue().split(",")).stream().mapToInt(idStr -> Integer.valueOf(idStr)).boxed().collect(Collectors.toList());
|
|
List<Integer> subjectIds = Arrays.asList(practiceSubjectIdListConfig.getParanValue().split(",")).stream().mapToInt(idStr -> Integer.valueOf(idStr)).boxed().collect(Collectors.toList());
|
|
- List<Integer> userDefaultSubjectIds=Objects.isNull(student) ? null : Arrays.asList(student.getSubjectIdList().split(",")).stream().mapToInt(idStr -> Integer.valueOf(idStr)).boxed().collect(Collectors.toList());
|
|
|
|
|
|
+ List<Integer> userDefaultSubjectIds=Objects.isNull(student)||Objects.isNull(student.getSubjectIdList()) ? null : Arrays.asList(student.getSubjectIdList().split(",")).stream().mapToInt(idStr -> Integer.valueOf(idStr)).boxed().collect(Collectors.toList());
|
|
if(!CollectionUtils.isEmpty(userDefaultSubjectIds)){
|
|
if(!CollectionUtils.isEmpty(userDefaultSubjectIds)){
|
|
userDefaultSubjectIds=userDefaultSubjectIds.stream().filter(userDefaultSubjectId -> subjectIds.contains(userDefaultSubjectId)).collect(Collectors.toList());
|
|
userDefaultSubjectIds=userDefaultSubjectIds.stream().filter(userDefaultSubjectId -> subjectIds.contains(userDefaultSubjectId)).collect(Collectors.toList());
|
|
|
|
+ }else{
|
|
|
|
+ userDefaultSubjectIds=new ArrayList<>();
|
|
}
|
|
}
|
|
result.put("subjects", subjects);
|
|
result.put("subjects", subjects);
|
|
result.put("practiceApplyStartTime", practiceApplyStartTimeConfig.getParanValue());
|
|
result.put("practiceApplyStartTime", practiceApplyStartTimeConfig.getParanValue());
|
|
@@ -408,9 +415,6 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- for (Map.Entry<Integer, List<CourseSchedule>> integerListEntry : teacherCoursesMap.entrySet()) {
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
result.put("teacherFreeDates",allTeacherFreeDates);
|
|
result.put("teacherFreeDates",allTeacherFreeDates);
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
@@ -522,7 +526,7 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
classGroup.setExpectStudentNum(1);
|
|
classGroup.setExpectStudentNum(1);
|
|
classGroup.setStudentNum(1);
|
|
classGroup.setStudentNum(1);
|
|
classGroup.setName(practiceGroup.getName());
|
|
classGroup.setName(practiceGroup.getName());
|
|
- classGroup.setTotalClassTimes(4);
|
|
|
|
|
|
+ classGroup.setTotalClassTimes(allCourseDates.size());
|
|
classGroup.setType(ClassGroupTypeEnum.PRACTICE);
|
|
classGroup.setType(ClassGroupTypeEnum.PRACTICE);
|
|
classGroup.setDelFlag(0);
|
|
classGroup.setDelFlag(0);
|
|
classGroup.setGroupType(GroupType.PRACTICE);
|
|
classGroup.setGroupType(GroupType.PRACTICE);
|
|
@@ -647,6 +651,13 @@ public class PracticeGroupServiceImpl extends BaseServiceImpl<Long, PracticeGrou
|
|
studentDao.update(student);
|
|
studentDao.update(student);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ List<ImGroupMember> imGroupMemberList = new ArrayList<>();
|
|
|
|
+ imGroupMemberList.add(new ImGroupMember(practiceGroup.getUserId().toString()));
|
|
|
|
+ imGroupMemberList.add(new ImGroupMember(practiceGroup.getStudentId().toString()));
|
|
|
|
+ ImGroupMember[] imGroupMembers = imGroupMemberList.toArray(new ImGroupMember[imGroupMemberList.size()]);
|
|
|
|
+ // 创建群组
|
|
|
|
+ imFeignService.groupCreate(new ImGroupModel(classGroup.getId().toString(), imGroupMembers, classGroup.getName()));
|
|
|
|
+
|
|
//推送
|
|
//推送
|
|
List<CourseSchedule> courseSchedules1=courseScheduleDao.findTeacherCoursesWithIncludeDateRange(teacherId,allCourseDates.get(2),DateUtil.addMinutes(allCourseDates.get(2),practiceCourseMinutes));
|
|
List<CourseSchedule> courseSchedules1=courseScheduleDao.findTeacherCoursesWithIncludeDateRange(teacherId,allCourseDates.get(2),DateUtil.addMinutes(allCourseDates.get(2),practiceCourseMinutes));
|
|
List<CourseSchedule> courseSchedules2=courseScheduleDao.findTeacherCoursesWithIncludeDateRange(teacherId,allCourseDates.get(3),DateUtil.addMinutes(allCourseDates.get(3),practiceCourseMinutes));
|
|
List<CourseSchedule> courseSchedules2=courseScheduleDao.findTeacherCoursesWithIncludeDateRange(teacherId,allCourseDates.get(3),DateUtil.addMinutes(allCourseDates.get(3),practiceCourseMinutes));
|