|
|
|
@ -11,7 +11,6 @@ import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
|
|
|
|
import com.baomidou.dynamic.datasource.annotation.Master;
|
|
|
|
|
import com.google.common.base.Optional;
|
|
|
|
|
import com.ibeetl.admin.core.service.CoreBaseService;
|
|
|
|
|
import com.ibeetl.admin.core.util.PlatformException;
|
|
|
|
|
import com.ibeetl.admin.core.util.holidays.Day;
|
|
|
|
@ -29,6 +28,7 @@ import com.ibeetl.jlw.entity.TeacherOpenCourseScheduleSessionSnap;
|
|
|
|
|
import com.ibeetl.jlw.web.query.TeacherOpenCourseScheduleSessionClassQuery;
|
|
|
|
|
import com.ibeetl.jlw.web.query.TeacherOpenCourseScheduleSessionQuery;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.assertj.core.util.Lists;
|
|
|
|
|
import org.beetl.sql.core.SqlId;
|
|
|
|
|
import org.beetl.sql.core.engine.PageQuery;
|
|
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
|
@ -36,10 +36,7 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
import static cn.hutool.core.date.DatePattern.NORM_DATE_PATTERN;
|
|
|
|
@ -259,7 +256,7 @@ public class TeacherOpenCourseScheduleSessionService extends CoreBaseService<Tea
|
|
|
|
|
|
|
|
|
|
// 根据跟教室ID分组
|
|
|
|
|
Map<Long, TeacherOpenCourseScheduleSessionClass> classIdMap =
|
|
|
|
|
Optional.fromNullable(teacherOpenCourseScheduleSessionClassDao.getValuesByQuery(classQuery)).get()
|
|
|
|
|
Optional.ofNullable(teacherOpenCourseScheduleSessionClassDao.getValuesByQuery(classQuery)).orElseGet(Lists::emptyList)
|
|
|
|
|
.stream().collect(toMap(TeacherOpenCourseScheduleSessionClass::getTeacherOpenCourseScheduleSessionClassId, sc -> sc));
|
|
|
|
|
|
|
|
|
|
// 一个教室对应一个或多个开课节次
|
|
|
|
@ -268,7 +265,9 @@ public class TeacherOpenCourseScheduleSessionService extends CoreBaseService<Tea
|
|
|
|
|
Assert.notEmpty(sessionTag, "开课节次不能为空!");
|
|
|
|
|
List<TeacherOpenCourseScheduleSessionSnap> res = BeanUtil.copyToList(sessionTag, TeacherOpenCourseScheduleSessionSnap.class);
|
|
|
|
|
res.forEach(item -> {
|
|
|
|
|
String className = Optional.fromNullable(classIdMap.get(Long.parseLong(schoolClassId))).or(sessionClass).getTeacherOpenCourseScheduleSessionClassName();
|
|
|
|
|
String className = Optional
|
|
|
|
|
.ofNullable(classIdMap.get(Long.parseLong(schoolClassId))).orElse(sessionClass)
|
|
|
|
|
.getTeacherOpenCourseScheduleSessionClassName();
|
|
|
|
|
item.setTeacherOpenCourseScheduleSessionSnapAddTime(new Date());
|
|
|
|
|
item.setTeacherOpenCourseScheduleSessionSnapStatus(1);
|
|
|
|
|
item.setTeacherOpenCourseScheduleSessionId(tocss.getTeacherOpenCourseScheduleSessionId());
|
|
|
|
|