|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package com.ibeetl.jlw.service;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
|
import cn.hutool.core.date.DateField;
|
|
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
@ -48,6 +49,7 @@ import static cn.hutool.core.collection.CollUtil.join;
|
|
|
|
|
import static cn.hutool.core.date.DatePattern.NORM_DATE_PATTERN;
|
|
|
|
|
import static cn.hutool.core.date.DateUtil.offsetDay;
|
|
|
|
|
import static cn.hutool.core.date.DateUtil.parseDate;
|
|
|
|
|
import static com.ibeetl.admin.core.util.BeanUtil.copyToListSupportExtMap;
|
|
|
|
|
import static com.ibeetl.admin.core.util.DateUtil.weekNumberInList;
|
|
|
|
|
import static java.util.stream.Collectors.groupingBy;
|
|
|
|
|
import static java.util.stream.Collectors.toMap;
|
|
|
|
@ -310,6 +312,59 @@ public class TeacherOpenCourseScheduleSessionService extends CoreBaseService<Tea
|
|
|
|
|
return teacherOpenCourseScheduleSessionDao.getSessionNameList(teacherOpenCourseId, teacherId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 导入课程,下拉列表
|
|
|
|
|
* @param teacherOpenCourseId
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public List<? extends Map> getSessionNameList2(Long teacherOpenCourseId, Long teacherId) {
|
|
|
|
|
TeacherOpenCourseScheduleSessionQuery query = new TeacherOpenCourseScheduleSessionQuery();
|
|
|
|
|
query.setTeacherOpenCourseScheduleSessionStatus(1);
|
|
|
|
|
query.setTeacherOpenCourseId(teacherOpenCourseId);
|
|
|
|
|
if (null != teacherId) {
|
|
|
|
|
query.setTeacherId(teacherId);
|
|
|
|
|
}
|
|
|
|
|
List<TeacherOpenCourseScheduleSession> list = teacherOpenCourseScheduleSessionService.getValuesByQuery(query);
|
|
|
|
|
dictParser(list);
|
|
|
|
|
|
|
|
|
|
List<TeacherOpenCourseScheduleSession> result = CollectionUtil.emptyIfNull(list).stream().map(item -> {
|
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
|
TeacherOpenCourseScheduleSession scheduleSession = new TeacherOpenCourseScheduleSession();
|
|
|
|
|
Long scheduleSessionId = item.getTeacherOpenCourseScheduleSessionId();
|
|
|
|
|
scheduleSession.setTeacherOpenCourseScheduleSessionId(scheduleSessionId);
|
|
|
|
|
Map<String, List<Map<String, String>>> sessionClassListMap = ((Map) item.get("teacherOpenCourseScheduleSessionClassListJSONEntity"));
|
|
|
|
|
|
|
|
|
|
sb.append("上课班级:");
|
|
|
|
|
sb.append(item.getSchoolClassIdsText());
|
|
|
|
|
sb.append("</br>");
|
|
|
|
|
sb.append("上课周次:");
|
|
|
|
|
sb.append(item.getTeacherOpenCourseScheduleSessionStatusWeekDetailText());
|
|
|
|
|
sb.append("</br>");
|
|
|
|
|
if (ObjectUtil.isNotEmpty(sessionClassListMap)) {
|
|
|
|
|
|
|
|
|
|
// 上课教室查询
|
|
|
|
|
String sessionClassIds = sessionClassListMap.keySet().stream().collect(Collectors.joining(","));
|
|
|
|
|
List<String> sessionClassNameList = teacherOpenCourseScheduleSessionSnapDao.getSessionClassNameListBySessionIds(sessionClassIds);
|
|
|
|
|
if(ObjectUtil.isNotEmpty(sessionClassNameList)) {
|
|
|
|
|
sb.append("上课教室:");
|
|
|
|
|
sb.append(join(sessionClassNameList, ", "));
|
|
|
|
|
sb.append("</br>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String sessionTagStr = sessionClassListMap.values().stream()
|
|
|
|
|
.flatMap(it -> it.stream()).map(it -> it.getOrDefault("teacherOpenCourseScheduleSessionTagName", "") + it.getOrDefault("teacherOpenCourseScheduleSessionTagStartTime", ""))
|
|
|
|
|
.collect(Collectors.joining(","));
|
|
|
|
|
sb.append("课次及上课时间:");
|
|
|
|
|
sb.append(sessionTagStr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
scheduleSession.set("teacherOpenCourseTitle", sb.toString());
|
|
|
|
|
return scheduleSession;
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
return copyToListSupportExtMap(result, false, true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 插入返回的实体。
|
|
|
|
|