From 716cd459585fe2bc9a9529d1b83a9cf6bf12318a Mon Sep 17 00:00:00 2001 From: tuyp Date: Thu, 13 Oct 2022 16:02:16 +0800 Subject: [PATCH] websocket上线了~~~ --- src/main/java/com/subsidy/controller/AdministerController.java | 2 +- src/main/java/com/subsidy/controller/ExerciseDictController.java | 2 +- src/main/java/com/subsidy/dto/exercise/SubmitDTO.java | 4 ++++ src/main/java/com/subsidy/model/ExerciseDoneResultDO.java | 6 ++++++ src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java | 2 ++ src/main/java/com/subsidy/service/impl/ExerciseDictServiceImpl.java | 1 + src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java | 6 +++--- src/main/java/com/subsidy/util/ExcelFormatUtils.java | 2 +- src/main/java/com/subsidy/util/excel/ExcelUtil.java | 18 ++++++++++++++++-- src/main/java/com/subsidy/vo/administer/ExerciseTestVO.java | 5 +++++ src/main/java/com/subsidy/vo/administer/GetMemberPapersVO.java | 2 ++ src/main/java/com/subsidy/vo/done/TestScoreInfoVO.java | 3 +++ src/main/resources/application.properties | 2 +- src/main/resources/mapper/ExerciseDoneResultMapper.xml | 11 ++++++++--- 14 files changed, 54 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/subsidy/controller/AdministerController.java b/src/main/java/com/subsidy/controller/AdministerController.java index d476d70..624856c 100644 --- a/src/main/java/com/subsidy/controller/AdministerController.java +++ b/src/main/java/com/subsidy/controller/AdministerController.java @@ -240,7 +240,7 @@ public class AdministerController { @PostMapping("exportZip") @ApiOperation("下载压缩包 id 班级id") @CrossOrigin - @LoginRequired +// @LoginRequired public void exportZip(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{ administerService.export(classDetailDTO); } diff --git a/src/main/java/com/subsidy/controller/ExerciseDictController.java b/src/main/java/com/subsidy/controller/ExerciseDictController.java index 2c29814..4222a2b 100644 --- a/src/main/java/com/subsidy/controller/ExerciseDictController.java +++ b/src/main/java/com/subsidy/controller/ExerciseDictController.java @@ -59,7 +59,7 @@ public class ExerciseDictController { } @PostMapping("submit") - @ApiOperation("提交答案 {paperId 卷子id memberId 成员id classId课程 courseId 课程id memberExerciseVOS [ id selectAnswer ] length:做题时长} ") + @ApiOperation("提交答案 {paperId 卷子id memberId 成员id classId课程 courseId 课程id memberExerciseVOS [ id selectAnswer ] startDate:做题时长} ") @LoginRequired @TimeRequired @CachePut(value = "ResultData" ,key = "'classId_'+#submitDTO.getClassId()") diff --git a/src/main/java/com/subsidy/dto/exercise/SubmitDTO.java b/src/main/java/com/subsidy/dto/exercise/SubmitDTO.java index ac701c0..1a83d03 100644 --- a/src/main/java/com/subsidy/dto/exercise/SubmitDTO.java +++ b/src/main/java/com/subsidy/dto/exercise/SubmitDTO.java @@ -3,6 +3,8 @@ package com.subsidy.dto.exercise; import com.subsidy.vo.exercise.MemberExerciseVO; import lombok.Data; +import java.time.LocalDateTime; +import java.util.Date; import java.util.List; @Data @@ -19,4 +21,6 @@ public class SubmitDTO { private Long paperId; private Integer length; + + private String startDate; } diff --git a/src/main/java/com/subsidy/model/ExerciseDoneResultDO.java b/src/main/java/com/subsidy/model/ExerciseDoneResultDO.java index 243db90..8472f2e 100644 --- a/src/main/java/com/subsidy/model/ExerciseDoneResultDO.java +++ b/src/main/java/com/subsidy/model/ExerciseDoneResultDO.java @@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.annotation.TableId; import lombok.Data; import lombok.EqualsAndHashCode; +import java.time.LocalDateTime; + /** *

* 学生课程习题完成情况 @@ -71,4 +73,8 @@ public class ExerciseDoneResultDO extends BaseModel { */ private Integer length; + /** + * 做题开始时间 + */ + private String startDate; } diff --git a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java index 6bd0dcd..937c735 100644 --- a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java @@ -746,6 +746,8 @@ public class AdministerServiceImpl extends ServiceImpl=60?"合格":"不合格"); diff --git a/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java b/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java index 0c930c8..4c51743 100644 --- a/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java @@ -84,10 +84,10 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl signList = Arrays.asList("序号", "成员名称", "身份证号", "联系方式", "签到次数", "签到时间","最近签到ip地址","最近签到设备型号"); - public static final List scoreList = Arrays.asList("序号", "成员名称", "身份证号码", "联系方式", "测试成绩", "测试次数", "总评价"); + public static final List scoreList = Arrays.asList("序号", "成员名称", "身份证号码", "联系方式", "测试成绩", "测试次数","开始时间","结束时间", "总评价"); public static final List answersList = Arrays.asList("序号", "提问", "答疑", "提问时间", "提问成员", "答疑时间"); diff --git a/src/main/java/com/subsidy/util/excel/ExcelUtil.java b/src/main/java/com/subsidy/util/excel/ExcelUtil.java index a085eb2..68bbed0 100644 --- a/src/main/java/com/subsidy/util/excel/ExcelUtil.java +++ b/src/main/java/com/subsidy/util/excel/ExcelUtil.java @@ -948,11 +948,11 @@ public class ExcelUtil { //第三行 2 SXSSFRow thirdRow = sheet.createRow(2); //第二行 rowIndex =1 - CellRangeAddress cellRangeAddress31 = new CellRangeAddress(2, 2, 0, 3); + CellRangeAddress cellRangeAddress31 = new CellRangeAddress(2, 2, 0, 4); sheet.addMergedRegion(cellRangeAddress31); setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress31, sheet, workbook); //给合并过的单元格加边框 - CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 4, 6); + CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 5, 8); sheet.addMergedRegion(cellRangeAddress32); setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框 thirdRow.createCell(0).setCellValue(thirdHead[0]); @@ -1015,8 +1015,22 @@ public class ExcelUtil { newCell.setCellValue(0); } + //次数 newCell = dataRow.createCell(6); newCell.setCellStyle(cellStyle); + if (exerciseTestVO.getScore() != 0) { + newCell.setCellValue(exerciseTestVO.getStartDate()); + } + + //次数 + newCell = dataRow.createCell(7); + newCell.setCellStyle(cellStyle); + if (exerciseTestVO.getScore() != 0) { + newCell.setCellValue(exerciseTestVO.getEndDate()); + } + + newCell = dataRow.createCell(8); + newCell.setCellStyle(cellStyle); if (exerciseTestVO.getScore() >= 60) { newCell.setCellValue("合格"); } else { diff --git a/src/main/java/com/subsidy/vo/administer/ExerciseTestVO.java b/src/main/java/com/subsidy/vo/administer/ExerciseTestVO.java index 0a0e649..c15214b 100644 --- a/src/main/java/com/subsidy/vo/administer/ExerciseTestVO.java +++ b/src/main/java/com/subsidy/vo/administer/ExerciseTestVO.java @@ -27,4 +27,9 @@ public class ExerciseTestVO { private Integer count; private Long paperId; + + private String startDate; + + private String endDate; + } diff --git a/src/main/java/com/subsidy/vo/administer/GetMemberPapersVO.java b/src/main/java/com/subsidy/vo/administer/GetMemberPapersVO.java index 20d7767..c91b4cb 100644 --- a/src/main/java/com/subsidy/vo/administer/GetMemberPapersVO.java +++ b/src/main/java/com/subsidy/vo/administer/GetMemberPapersVO.java @@ -19,6 +19,8 @@ public class GetMemberPapersVO { private String result; + private String startDate; + private String createDate; } diff --git a/src/main/java/com/subsidy/vo/done/TestScoreInfoVO.java b/src/main/java/com/subsidy/vo/done/TestScoreInfoVO.java index 855d040..b85bc23 100644 --- a/src/main/java/com/subsidy/vo/done/TestScoreInfoVO.java +++ b/src/main/java/com/subsidy/vo/done/TestScoreInfoVO.java @@ -13,4 +13,7 @@ public class TestScoreInfoVO { private String result; + private String startDate; + + private String endDate; } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 50ca700..559f4ed 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,5 +1,5 @@ # 环境配置 -spring.profiles.active=prod +spring.profiles.active=dev #和CPU数 spring.server.acceptorThreadCount=600 spring.server.minSpareThreads=100 diff --git a/src/main/resources/mapper/ExerciseDoneResultMapper.xml b/src/main/resources/mapper/ExerciseDoneResultMapper.xml index 081c5a0..64cf6a2 100644 --- a/src/main/resources/mapper/ExerciseDoneResultMapper.xml +++ b/src/main/resources/mapper/ExerciseDoneResultMapper.xml @@ -30,7 +30,8 @@ total_counts, score, result, - create_date + create_date, + start_date FROM exercise_done_result t WHERE @@ -122,7 +123,9 @@ t1.paper_id, t1.score, t1.result, - t2.cnt + t2.cnt, + t1.startDate, + t1.endDate FROM ( SELECT @@ -131,7 +134,9 @@ t.member_id, t.score, IF - ( ( t.score )>= 60, '合格', '不合格' ) AS result + ( ( t.score )>= 60, '合格', '不合格' ) AS result, + t.start_date startDate, + t.create_date as endDate FROM exercise_done_result t LEFT JOIN paper_dict t2 ON t.paper_id = t2.id -- libgit2 0.25.0