|
|
@@ -1293,15 +1293,18 @@ public class CourseTableServiceImpl extends ServiceImpl<CourseTableMapper, Cours
|
|
|
|
|
|
Map<String, List<CourseDetailVo>> classDataMap = tableVo.getCourseList().stream().filter(x -> x.getClassName() != null).collect(Collectors.groupingBy(CourseDetailVo::getClassName));
|
|
|
|
|
|
+ List<Long> teacherIds = classList.stream().map(BaseClass::getTeacherId).collect(Collectors.toList());
|
|
|
+ List<User> userList = userService.listByIds(teacherIds);
|
|
|
+ Map<Long, String> teacherMap = userList.stream().collect(Collectors.toMap(User::getId, User::getName));
|
|
|
+
|
|
|
Workbook workbook = new XSSFWorkbook();
|
|
|
String sheetName = "班级课表";
|
|
|
Sheet sheet = workbook.createSheet(sheetName);
|
|
|
String bigHead = "课程表";
|
|
|
|
|
|
int classTableRowCount = 16;//每个班的课表占用的总行数
|
|
|
- for(int i = 0; i < classList.size(); i ++){
|
|
|
- BaseClass baseClass = classList.get(i);
|
|
|
-
|
|
|
+ int i = 0;
|
|
|
+ for (BaseClass baseClass : classList) {
|
|
|
CourseTableVo classData = new CourseTableVo();
|
|
|
classData.setClassTimeList(tableVo.getClassTimeList());
|
|
|
if(!classDataMap.containsKey(baseClass.getName())){
|
|
|
@@ -1309,7 +1312,7 @@ public class CourseTableServiceImpl extends ServiceImpl<CourseTableMapper, Cours
|
|
|
}
|
|
|
classData.setCourseList(classDataMap.get(baseClass.getName()));
|
|
|
|
|
|
- String rightName = "班主任:" + tableVo.getTeacherName() + " 行政班:" + baseClass.getName();
|
|
|
+ String rightName = "班主任:" + teacherMap.get(baseClass.getTeacherId()) + " 行政班:" + baseClass.getName();
|
|
|
int bigHeadRow = (classTableRowCount + 3) * i;
|
|
|
//生成第一行title
|
|
|
ImportExcelUtil.createBigHead(workbook, sheet, bigHead, bigHeadRow, 8);
|
|
|
@@ -1321,6 +1324,7 @@ public class CourseTableServiceImpl extends ServiceImpl<CourseTableMapper, Cours
|
|
|
createSecondTitle(workbook, sheet, bigHeadRow + 3);
|
|
|
//生成内容
|
|
|
exportQueryUtil.createContent(workbook, sheet, bigHeadRow + 4, classData, dto.getCourseType());
|
|
|
+ i ++;
|
|
|
}
|
|
|
workbook.write(bot);
|
|
|
}else if("teacher".equals(dto.getCourseType())){//教师课表
|