Commit c6096c21 by 涂亚平

人社局跑数据准备中

新加了个有效时长
1 parent 4897185f
......@@ -473,16 +473,21 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
//该学生完成了多少个
int i = 0;
int playLength = 0;
int validLength = 0;
//该成员完成了几个视频
for (VodDictDO vodDictDO : vodDictDOS) {
int totalPlayLength = vodPlayHistoryMapper.memberVodTotalLength(classDetailDTO.getId(), classDetailVO.getId(), vodDictDO.getId());
if (totalPlayLength >= vodDictDO.getVodLength()) {
validLength+=vodDictDO.getVodLength();
i++;
}else {
validLength+=totalPlayLength;
}
playLength += totalPlayLength;
}
//培训时长
classDetailVO.setTrainingLength(playLength);
classDetailVO.setValidLength(MathUtil.floorSecond(validLength));
//学生测试完成情况 多套卷子各返回最高成绩
List<GetMaxScoreVO> getMaxScoreVOS = exerciseDoneResultMapper.getMaxScore(classDictDO.getId(), classDetailVO.getId());
......@@ -529,6 +534,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
return classDetailVOIPage;
}
public List<ClassDetailVO> exportClassDetail(ClassDetailDTO classDetailDTO) throws Exception {
Page pager = new Page(1, -1L);
......@@ -547,15 +553,20 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
//该学生完成了多少个
int i = 0;
int playLength = 0;
int validLength = 0;
//该成员完成了几个视频
for (VodDictDO vodDictDO : vodDictDOS) {
int totalPlayLength = vodPlayHistoryMapper.memberVodTotalLength(classDetailDTO.getId(), classDetailVO.getId(), vodDictDO.getId());
if (totalPlayLength >= vodDictDO.getVodLength()) {
i++;
validLength+=vodDictDO.getVodLength();
}else {
validLength+=totalPlayLength;
}
playLength += totalPlayLength;
}
//课程进度
classDetailVO.setValidLength(MathUtil.floorSecond(validLength));
classDetailVO.setClassProcess(i + "/" + vodDictDOS.size());
//学生测试完成情况 多套卷子各返回最高成绩
......@@ -1574,7 +1585,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
sheet.addMergedRegion(cellRangeAddress21);
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);
setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress22, sheet, workbook); //给合并过的单元格加边框
......@@ -1590,7 +1601,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
sheet.addMergedRegion(cellRangeAddress31);
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);
setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框
thirdRow.createCell(0).setCellValue(thirdHead[0]);
......@@ -1665,14 +1676,18 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
newCell = dataRow.createCell(10);
newCell.setCellStyle(cellStyle);
newCell.setCellValue(classDetailVO.getAskCounts());
newCell.setCellValue(classDetailVO.getValidLength());
newCell = dataRow.createCell(11);
newCell.setCellStyle(cellStyle);
newCell.setCellValue(classDetailVO.getScore());
newCell.setCellValue(classDetailVO.getAskCounts());
newCell = dataRow.createCell(12);
newCell.setCellStyle(cellStyle);
newCell.setCellValue(classDetailVO.getScore());
newCell = dataRow.createCell(13);
newCell.setCellStyle(cellStyle);
newCell.setCellValue(classDetailVO.getResult());
rowIndex++;
......
......@@ -6,7 +6,7 @@ import java.util.List;
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地址","最近签到设备型号");
......
......@@ -35,6 +35,11 @@ public class MathUtil {
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) {
if (i > 60) {
......
......@@ -493,7 +493,7 @@ public class ExcelUtil {
sheet.addMergedRegion(cellRangeAddress21);
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);
setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress22, sheet, workbook); //给合并过的单元格加边框
......@@ -509,7 +509,7 @@ public class ExcelUtil {
sheet.addMergedRegion(cellRangeAddress31);
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);
setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框
thirdRow.createCell(0).setCellValue(thirdHead[0]);
......@@ -584,14 +584,18 @@ public class ExcelUtil {
newCell = dataRow.createCell(10);
newCell.setCellStyle(cellStyle);
newCell.setCellValue(classDetailVO.getAskCounts());
newCell.setCellValue(classDetailVO.getValidLength());
newCell = dataRow.createCell(11);
newCell.setCellStyle(cellStyle);
newCell.setCellValue(classDetailVO.getScore());
newCell.setCellValue(classDetailVO.getAskCounts());
newCell = dataRow.createCell(12);
newCell.setCellStyle(cellStyle);
newCell.setCellValue(classDetailVO.getScore());
newCell = dataRow.createCell(13);
newCell.setCellStyle(cellStyle);
newCell.setCellValue(classDetailVO.getResult());
rowIndex++;
seq++;
......
......@@ -63,6 +63,9 @@ public class ClassDetailVO{
@ExcelColumn(col = 9,value = "培训时长(分钟)")
private String trainingLengthMinute;
@ExcelColumn(col = 10,value = "累计有效学习时长")
private String validLength;
/**
* 作对个数
*/
......@@ -76,13 +79,13 @@ public class ClassDetailVO{
/**
* 评价测试
*/
@ExcelColumn(col = 10,value = "评价测试")
@ExcelColumn(col = 11,value = "评价测试")
private String score;
/**
* 答疑个数
*/
@ExcelColumn(col = 11,value = "答题数")
@ExcelColumn(col = 12,value = "答题数")
private Integer askCounts;
......
# 环境配置
spring.profiles.active=dev
spring.profiles.active=prod
#和CPU数
spring.server.acceptorThreadCount=600
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!