|
|
@@ -156,7 +156,7 @@ public class ClassTimeStatisticsServiceImpl extends MPJBaseServiceImpl<ClassTime
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Boolean refreshRecord(ClassTimeStatistics statistics) {
|
|
|
try {
|
|
|
- // 1、查询教师
|
|
|
+// 1、查询教师
|
|
|
List<TeacherListVo> teacherList = this.baseMapper.getTeacherList();
|
|
|
// 2、查询补课课时
|
|
|
List<WfTeacherCourseTime> courseTimeList = this.baseMapper.getWfTeacherCourseTimeList(statistics);
|
|
|
@@ -258,11 +258,11 @@ public class ClassTimeStatisticsServiceImpl extends MPJBaseServiceImpl<ClassTime
|
|
|
continue;
|
|
|
}
|
|
|
if("早自习".equals(courseListVo.getShortName())){
|
|
|
- classTime7 += weightSetMap.get(courseListVo.getShortName());
|
|
|
+ classTime7 += weightSetMap.get(courseListVo.getShortName()) == null ? 0d : weightSetMap.get(courseListVo.getShortName());
|
|
|
}else if(zkList.contains(courseListVo.getShortName())){
|
|
|
- classTime8 += weightSetMap.get(courseListVo.getShortName());
|
|
|
+ classTime8 += weightSetMap.get(courseListVo.getShortName()) == null ? 0d : weightSetMap.get(courseListVo.getShortName());
|
|
|
}else if(wzxList.contains(courseListVo.getShortName())){
|
|
|
- classTime9 += weightSetMap.get(courseListVo.getShortName());
|
|
|
+ classTime9 += weightSetMap.get(courseListVo.getShortName()) == null ? 0d : weightSetMap.get(courseListVo.getShortName());
|
|
|
}
|
|
|
|
|
|
if(courseListVo.getAdjustType() != null && !courseListVo.getAdjustType().isEmpty()){
|
|
|
@@ -302,11 +302,11 @@ public class ClassTimeStatisticsServiceImpl extends MPJBaseServiceImpl<ClassTime
|
|
|
}
|
|
|
|
|
|
if("早自习".equals(courseListVo.getShortName())){
|
|
|
- zkTimes += weightSetMap.get(courseListVo.getShortName());
|
|
|
+ zkTimes += weightSetMap.get(courseListVo.getShortName()) == null ? 0d : weightSetMap.get(courseListVo.getShortName());
|
|
|
}else if(zkList.contains(courseListVo.getShortName())){
|
|
|
- zkTimes += weightSetMap.get(courseListVo.getShortName());
|
|
|
+ zkTimes += weightSetMap.get(courseListVo.getShortName()) == null ? 0d : weightSetMap.get(courseListVo.getShortName());
|
|
|
}else if(wzxList.contains(courseListVo.getShortName())){
|
|
|
- wzxTimes += weightSetMap.get(courseListVo.getShortName());
|
|
|
+ wzxTimes += weightSetMap.get(courseListVo.getShortName()) == null ? 0d : weightSetMap.get(courseListVo.getShortName());
|
|
|
}
|
|
|
|
|
|
if(courseListVo.getAdjustType() != null && !courseListVo.getAdjustType().isEmpty()){
|
|
|
@@ -487,6 +487,7 @@ public class ClassTimeStatisticsServiceImpl extends MPJBaseServiceImpl<ClassTime
|
|
|
*/
|
|
|
@Override
|
|
|
public byte[] recordExport(Long id) throws IOException {
|
|
|
+ try {
|
|
|
//1、查询数据
|
|
|
List<ClassTimeStatisticsRecordVo> recordList = this.baseMapper.getRecordList(id);
|
|
|
//计算出一共有多少周
|
|
|
@@ -584,7 +585,12 @@ public class ClassTimeStatisticsServiceImpl extends MPJBaseServiceImpl<ClassTime
|
|
|
createFourthTitle(workbook, sheet, weekTimeRangeVos, 13);
|
|
|
int dataRowNumber = 4;
|
|
|
//设置样式
|
|
|
- font.setFontHeightInPoints((short)24);
|
|
|
+ font = workbook.createFont();
|
|
|
+ font.setBold(false);// 设置为粗体
|
|
|
+ font.setFontName("宋体");
|
|
|
+ //font.setColor(IndexedColors.RED.getIndex()); // 设置字体颜色为红色
|
|
|
+ font.setFontHeightInPoints((short)12);
|
|
|
+
|
|
|
|
|
|
// 创建一个单元格样式对象
|
|
|
cellStyle = workbook.createCellStyle();
|
|
|
@@ -605,6 +611,10 @@ public class ClassTimeStatisticsServiceImpl extends MPJBaseServiceImpl<ClassTime
|
|
|
ByteArrayOutputStream bot = new ByteArrayOutputStream();
|
|
|
workbook.write(bot);
|
|
|
return bot.toByteArray();
|
|
|
+ }catch (Exception e){
|
|
|
+ log.error(e.getMessage());
|
|
|
+ throw new MyException("导出出错,请联系管理员");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|