Commit c6096c21 by 涂亚平

人社局跑数据准备中

新加了个有效时长
1 parent 4897185f
...@@ -473,16 +473,21 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -473,16 +473,21 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
//该学生完成了多少个 //该学生完成了多少个
int i = 0; int i = 0;
int playLength = 0; int playLength = 0;
int validLength = 0;
//该成员完成了几个视频 //该成员完成了几个视频
for (VodDictDO vodDictDO : vodDictDOS) { for (VodDictDO vodDictDO : vodDictDOS) {
int totalPlayLength = vodPlayHistoryMapper.memberVodTotalLength(classDetailDTO.getId(), classDetailVO.getId(), vodDictDO.getId()); int totalPlayLength = vodPlayHistoryMapper.memberVodTotalLength(classDetailDTO.getId(), classDetailVO.getId(), vodDictDO.getId());
if (totalPlayLength >= vodDictDO.getVodLength()) { if (totalPlayLength >= vodDictDO.getVodLength()) {
validLength+=vodDictDO.getVodLength();
i++; i++;
}else {
validLength+=totalPlayLength;
} }
playLength += totalPlayLength; playLength += totalPlayLength;
} }
//培训时长 //培训时长
classDetailVO.setTrainingLength(playLength); classDetailVO.setTrainingLength(playLength);
classDetailVO.setValidLength(MathUtil.floorSecond(validLength));
//学生测试完成情况 多套卷子各返回最高成绩 //学生测试完成情况 多套卷子各返回最高成绩
List<GetMaxScoreVO> getMaxScoreVOS = exerciseDoneResultMapper.getMaxScore(classDictDO.getId(), classDetailVO.getId()); List<GetMaxScoreVO> getMaxScoreVOS = exerciseDoneResultMapper.getMaxScore(classDictDO.getId(), classDetailVO.getId());
...@@ -529,6 +534,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -529,6 +534,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
return classDetailVOIPage; return classDetailVOIPage;
} }
public List<ClassDetailVO> exportClassDetail(ClassDetailDTO classDetailDTO) throws Exception { public List<ClassDetailVO> exportClassDetail(ClassDetailDTO classDetailDTO) throws Exception {
Page pager = new Page(1, -1L); Page pager = new Page(1, -1L);
...@@ -547,15 +553,20 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -547,15 +553,20 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
//该学生完成了多少个 //该学生完成了多少个
int i = 0; int i = 0;
int playLength = 0; int playLength = 0;
int validLength = 0;
//该成员完成了几个视频 //该成员完成了几个视频
for (VodDictDO vodDictDO : vodDictDOS) { for (VodDictDO vodDictDO : vodDictDOS) {
int totalPlayLength = vodPlayHistoryMapper.memberVodTotalLength(classDetailDTO.getId(), classDetailVO.getId(), vodDictDO.getId()); int totalPlayLength = vodPlayHistoryMapper.memberVodTotalLength(classDetailDTO.getId(), classDetailVO.getId(), vodDictDO.getId());
if (totalPlayLength >= vodDictDO.getVodLength()) { if (totalPlayLength >= vodDictDO.getVodLength()) {
i++; i++;
validLength+=vodDictDO.getVodLength();
}else {
validLength+=totalPlayLength;
} }
playLength += totalPlayLength; playLength += totalPlayLength;
} }
//课程进度 //课程进度
classDetailVO.setValidLength(MathUtil.floorSecond(validLength));
classDetailVO.setClassProcess(i + "/" + vodDictDOS.size()); classDetailVO.setClassProcess(i + "/" + vodDictDOS.size());
//学生测试完成情况 多套卷子各返回最高成绩 //学生测试完成情况 多套卷子各返回最高成绩
...@@ -1574,7 +1585,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -1574,7 +1585,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
sheet.addMergedRegion(cellRangeAddress21); sheet.addMergedRegion(cellRangeAddress21);
setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress21, sheet, workbook); //给合并过的单元格加边框 setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress21, sheet, workbook); //给合并过的单元格加边框
CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 5, 12); CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 5, 13);
sheet.addMergedRegion(cellRangeAddress22); sheet.addMergedRegion(cellRangeAddress22);
setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress22, sheet, workbook); //给合并过的单元格加边框 setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress22, sheet, workbook); //给合并过的单元格加边框
...@@ -1590,7 +1601,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -1590,7 +1601,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
sheet.addMergedRegion(cellRangeAddress31); sheet.addMergedRegion(cellRangeAddress31);
setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress31, sheet, workbook); //给合并过的单元格加边框 setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress31, sheet, workbook); //给合并过的单元格加边框
CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 5, 12); CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 5, 13);
sheet.addMergedRegion(cellRangeAddress32); sheet.addMergedRegion(cellRangeAddress32);
setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框 setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框
thirdRow.createCell(0).setCellValue(thirdHead[0]); thirdRow.createCell(0).setCellValue(thirdHead[0]);
...@@ -1665,14 +1676,18 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -1665,14 +1676,18 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
newCell = dataRow.createCell(10); newCell = dataRow.createCell(10);
newCell.setCellStyle(cellStyle); newCell.setCellStyle(cellStyle);
newCell.setCellValue(classDetailVO.getAskCounts()); newCell.setCellValue(classDetailVO.getValidLength());
newCell = dataRow.createCell(11); newCell = dataRow.createCell(11);
newCell.setCellStyle(cellStyle); newCell.setCellStyle(cellStyle);
newCell.setCellValue(classDetailVO.getScore()); newCell.setCellValue(classDetailVO.getAskCounts());
newCell = dataRow.createCell(12); newCell = dataRow.createCell(12);
newCell.setCellStyle(cellStyle); newCell.setCellStyle(cellStyle);
newCell.setCellValue(classDetailVO.getScore());
newCell = dataRow.createCell(13);
newCell.setCellStyle(cellStyle);
newCell.setCellValue(classDetailVO.getResult()); newCell.setCellValue(classDetailVO.getResult());
rowIndex++; rowIndex++;
......
...@@ -6,7 +6,7 @@ import java.util.List; ...@@ -6,7 +6,7 @@ import java.util.List;
public class ExcelFormatUtils { public class ExcelFormatUtils {
public static final List<String> memberList = Arrays.asList("序号", "成员名称","身份证号码", "性别", "账号", "联系方式", "签到次数", "课程进度", "学习时长(小时)","学习时长(分钟)", "答疑数", "测试成绩", "总评价"); public static final List<String> memberList = Arrays.asList("序号", "成员名称","身份证号码", "性别", "账号", "联系方式", "签到次数", "课程进度", "学习时长(小时)","学习时长(分钟)","累计有效学习时长", "答疑数", "测试成绩", "总评价");
public static final List<String> signList = Arrays.asList("序号", "成员名称", "身份证号", "联系方式", "签到次数", "签到时间","最近签到ip地址","最近签到设备型号"); public static final List<String> signList = Arrays.asList("序号", "成员名称", "身份证号", "联系方式", "签到次数", "签到时间","最近签到ip地址","最近签到设备型号");
......
...@@ -35,6 +35,11 @@ public class MathUtil { ...@@ -35,6 +35,11 @@ public class MathUtil {
return String.valueOf((int) Math.ceil((double) length / 60)); return String.valueOf((int) Math.ceil((double) length / 60));
} }
//习题/视频 ==> 秒钟向下取整
public static String floorSecond(int length) {
return String.valueOf((int) Math.ceil((double) length / 60));
}
//视频秒数处理 //视频秒数处理
public static String vodLength(int i) { public static String vodLength(int i) {
if (i > 60) { if (i > 60) {
......
...@@ -493,7 +493,7 @@ public class ExcelUtil { ...@@ -493,7 +493,7 @@ public class ExcelUtil {
sheet.addMergedRegion(cellRangeAddress21); sheet.addMergedRegion(cellRangeAddress21);
setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress21, sheet, workbook); //给合并过的单元格加边框 setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress21, sheet, workbook); //给合并过的单元格加边框
CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 5, 12); CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 5, 13);
sheet.addMergedRegion(cellRangeAddress22); sheet.addMergedRegion(cellRangeAddress22);
setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress22, sheet, workbook); //给合并过的单元格加边框 setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress22, sheet, workbook); //给合并过的单元格加边框
...@@ -509,7 +509,7 @@ public class ExcelUtil { ...@@ -509,7 +509,7 @@ public class ExcelUtil {
sheet.addMergedRegion(cellRangeAddress31); sheet.addMergedRegion(cellRangeAddress31);
setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress31, sheet, workbook); //给合并过的单元格加边框 setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress31, sheet, workbook); //给合并过的单元格加边框
CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 5, 12); CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 5, 13);
sheet.addMergedRegion(cellRangeAddress32); sheet.addMergedRegion(cellRangeAddress32);
setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框 setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框
thirdRow.createCell(0).setCellValue(thirdHead[0]); thirdRow.createCell(0).setCellValue(thirdHead[0]);
...@@ -584,14 +584,18 @@ public class ExcelUtil { ...@@ -584,14 +584,18 @@ public class ExcelUtil {
newCell = dataRow.createCell(10); newCell = dataRow.createCell(10);
newCell.setCellStyle(cellStyle); newCell.setCellStyle(cellStyle);
newCell.setCellValue(classDetailVO.getAskCounts()); newCell.setCellValue(classDetailVO.getValidLength());
newCell = dataRow.createCell(11); newCell = dataRow.createCell(11);
newCell.setCellStyle(cellStyle); newCell.setCellStyle(cellStyle);
newCell.setCellValue(classDetailVO.getScore()); newCell.setCellValue(classDetailVO.getAskCounts());
newCell = dataRow.createCell(12); newCell = dataRow.createCell(12);
newCell.setCellStyle(cellStyle); newCell.setCellStyle(cellStyle);
newCell.setCellValue(classDetailVO.getScore());
newCell = dataRow.createCell(13);
newCell.setCellStyle(cellStyle);
newCell.setCellValue(classDetailVO.getResult()); newCell.setCellValue(classDetailVO.getResult());
rowIndex++; rowIndex++;
seq++; seq++;
......
...@@ -63,6 +63,9 @@ public class ClassDetailVO{ ...@@ -63,6 +63,9 @@ public class ClassDetailVO{
@ExcelColumn(col = 9,value = "培训时长(分钟)") @ExcelColumn(col = 9,value = "培训时长(分钟)")
private String trainingLengthMinute; private String trainingLengthMinute;
@ExcelColumn(col = 10,value = "累计有效学习时长")
private String validLength;
/** /**
* 作对个数 * 作对个数
*/ */
...@@ -76,13 +79,13 @@ public class ClassDetailVO{ ...@@ -76,13 +79,13 @@ public class ClassDetailVO{
/** /**
* 评价测试 * 评价测试
*/ */
@ExcelColumn(col = 10,value = "评价测试") @ExcelColumn(col = 11,value = "评价测试")
private String score; private String score;
/** /**
* 答疑个数 * 答疑个数
*/ */
@ExcelColumn(col = 11,value = "答题数") @ExcelColumn(col = 12,value = "答题数")
private Integer askCounts; private Integer askCounts;
......
# 环境配置 # 环境配置
spring.profiles.active=dev spring.profiles.active=prod
#和CPU数 #和CPU数
spring.server.acceptorThreadCount=600 spring.server.acceptorThreadCount=600
spring.server.minSpareThreads=100 spring.server.minSpareThreads=100
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!