From eede23cb23637d5a756db61271688efa35c42427 Mon Sep 17 00:00:00 2001 From: Administrator Date: Tue, 8 Feb 2022 17:18:59 +0800 Subject: [PATCH] Merge branch '20211125' of D:\code\subsidy with conflicts. --- src/main/java/com/subsidy/controller/AdministerController.java | 7 ++++++- src/main/java/com/subsidy/dto/administer/MemberStudyLogDTO.java | 4 ++++ src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java | 5 +++++ src/main/java/com/subsidy/service/AdministerService.java | 2 ++ src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java | 11 +++++++++++ src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java | 5 ----- src/main/java/com/subsidy/util/ExcelFormatUtils.java | 2 +- src/main/java/com/subsidy/util/excel/ExcelUtil.java | 12 ++++-------- src/main/java/com/subsidy/vo/administer/MemberStudyLogVO.java | 2 -- src/main/resources/application.properties | 4 ++-- src/main/resources/mapper/VodPlayHistoryMapper.xml | 41 ++++++++++++++++++++++++++++++++++++++++- 11 files changed, 75 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/subsidy/controller/AdministerController.java b/src/main/java/com/subsidy/controller/AdministerController.java index d810b2f..a9d191a 100644 --- a/src/main/java/com/subsidy/controller/AdministerController.java +++ b/src/main/java/com/subsidy/controller/AdministerController.java @@ -202,13 +202,18 @@ public class AdministerController { administerService.export(classDetailDTO); } + @PostMapping("memberStudy") + @ApiOperation("学员学习日志 pageSize pageNum classId memberId") + public ResponseVO memberStudy(@RequestBody MemberStudyLogDTO memberStudyLogDTO){ + return ResponseData.generateCreatedResponse(0,administerService.memberStudy(memberStudyLogDTO)); + } + @PostMapping("memberStudyLog") @ApiOperation("学员学习日志 classId memberId") public void memberStudyLog(@RequestBody MemberStudyLogDTO memberStudyLogDTO) throws Exception{ administerService.memberStudyLog(memberStudyLogDTO); } - @PostMapping("importMember") @ApiOperation("导入学生 {companyId 公司id file}") public ResponseVO importMember(Long companyId,@RequestParam("file") MultipartFile file){ diff --git a/src/main/java/com/subsidy/dto/administer/MemberStudyLogDTO.java b/src/main/java/com/subsidy/dto/administer/MemberStudyLogDTO.java index 9f169d6..4920263 100644 --- a/src/main/java/com/subsidy/dto/administer/MemberStudyLogDTO.java +++ b/src/main/java/com/subsidy/dto/administer/MemberStudyLogDTO.java @@ -9,4 +9,8 @@ public class MemberStudyLogDTO { private Long classId; + private Integer pageSize; + + private Integer pageNum; + } diff --git a/src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java b/src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java index c891a88..2628870 100644 --- a/src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java +++ b/src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java @@ -63,6 +63,11 @@ public interface VodPlayHistoryMapper extends BaseMapper { List memberRecentPlay(Long classId, Long memberId); /** + * 查看某个成员某个课程的学习日志--分页 + */ + IPage memberStudy(IPage iPage,Long classId, Long memberId); + + /** * 查看某个成员某个课程的学习日志 */ List memberStudyLog(Long classId, Long memberId); diff --git a/src/main/java/com/subsidy/service/AdministerService.java b/src/main/java/com/subsidy/service/AdministerService.java index f6f9b99..8197926 100644 --- a/src/main/java/com/subsidy/service/AdministerService.java +++ b/src/main/java/com/subsidy/service/AdministerService.java @@ -70,6 +70,8 @@ public interface AdministerService extends IService { void export(ClassDetailDTO classDetailDTO)throws Exception; + IPage memberStudy(MemberStudyLogDTO memberStudyLogDTO); + void memberStudyLog(MemberStudyLogDTO memberStudyLogDTO)throws Exception; String importMember(Long companyId, MultipartFile multipartFile); diff --git a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java index e5eff58..8a76b3d 100644 --- a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java @@ -1223,6 +1223,17 @@ public class AdministerServiceImpl extends ServiceImpl memberStudyLogVOS = iPage.getRecords(); + for (MemberStudyLogVO memberStudyLogVO : memberStudyLogVOS) { + memberStudyLogVO.setPlayLength(MathUtil.secToTime(Integer.valueOf(memberStudyLogVO.getPlayLength()))); + memberStudyLogVO.setTotalLength(MathUtil.secToTime(Integer.valueOf(memberStudyLogVO.getTotalLength()))); + } + return iPage; + } public void memberStudyLog(MemberStudyLogDTO memberStudyLogDTO) throws Exception { diff --git a/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java b/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java index 6849279..8026b68 100644 --- a/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java @@ -84,11 +84,6 @@ public class SignInRecordServiceImpl extends ServiceImpl classDictDOS = classMemberMappingMapper.getMemberClass(signInRecordDO.getMemberId()); for (ClassDictDO classDictDO : classDictDOS) { - Set set = redisUtil.scan(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + signInRecordDO.getMemberId() + ":classId:" + classDictDO.getId() + ":" + DateFormatUtil.format(new Date(), "yyyy-MM-dd")+":*"); - if(set.size() > 0) { - redisUtil.del(set); - } - redisUtil.set(RedisPrefixConstant.SUBSIDY_SIGN_INFO_PREFIX + signInRecordDO.getMemberId() + ":classId:" + classDictDO.getId() + ":" + DateFormatUtil.format(new Date(), "yyyy-MM-dd") + ":" + System.currentTimeMillis(), null); } diff --git a/src/main/java/com/subsidy/util/ExcelFormatUtils.java b/src/main/java/com/subsidy/util/ExcelFormatUtils.java index aac6018..3d4938f 100644 --- a/src/main/java/com/subsidy/util/ExcelFormatUtils.java +++ b/src/main/java/com/subsidy/util/ExcelFormatUtils.java @@ -14,6 +14,6 @@ public class ExcelFormatUtils { public static final List answersList = Arrays.asList("序号", "提问", "答疑", "提问时间", "提问成员", "答疑时间"); - public static final List studyLogList = Arrays.asList("开始时间","结束时间","操作对象","类型","平台","学习时长","累计有效时长"); + public static final List studyLogList = 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 bf61a07..356d51d 100644 --- a/src/main/java/com/subsidy/util/excel/ExcelUtil.java +++ b/src/main/java/com/subsidy/util/excel/ExcelUtil.java @@ -1159,13 +1159,13 @@ public class ExcelUtil { } //第二行 - int[] secondWidth = new int[7]; + int[] secondWidth = new int[6]; // 产生表格标题行,以及设置列宽 - String[] secondHead = new String[7]; + String[] secondHead = new String[6]; List secondList = Arrays.asList("学员姓名", memberDO.getUserName(), "性别:" + memberDO.getGender(), "身份证号", memberDO.getIdCard(), "手机号", memberDO.getTelephone()); ii = 0; - for (int i = 0; i < 7; i++) { + for (int i = 0; i < 6; i++) { secondHead[ii] = secondList.get(i); int bytes = secondList.get(i).getBytes().length; secondWidth[ii] = bytes < minBytes ? minBytes : bytes; @@ -1238,13 +1238,9 @@ public class ExcelUtil { newCell = dataRow.createCell(4); newCell.setCellStyle(cellStyle); - newCell.setCellValue(memberStudyLogVO.getPlatForm()); - - newCell = dataRow.createCell(5); - newCell.setCellStyle(cellStyle); newCell.setCellValue(memberStudyLogVO.getPlayLength()); - newCell = dataRow.createCell(6); + newCell = dataRow.createCell(5); newCell.setCellStyle(cellStyle); newCell.setCellValue(memberStudyLogVO.getTotalLength()); diff --git a/src/main/java/com/subsidy/vo/administer/MemberStudyLogVO.java b/src/main/java/com/subsidy/vo/administer/MemberStudyLogVO.java index ae8a621..188cd1f 100644 --- a/src/main/java/com/subsidy/vo/administer/MemberStudyLogVO.java +++ b/src/main/java/com/subsidy/vo/administer/MemberStudyLogVO.java @@ -13,8 +13,6 @@ public class MemberStudyLogVO { private String studyType; - private String platForm; - private String playLength; private String totalLength; diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index dbc0753..cf4411d 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,7 +1,7 @@ # 环境配置 -spring.profiles.active=prod +spring.profiles.active=dev # 端口号 -spring.server.port=23459 +spring.server.port=23457 #嵌入tomcat配置 #和CPU数 spring.server.acceptorThreadCount=600 diff --git a/src/main/resources/mapper/VodPlayHistoryMapper.xml b/src/main/resources/mapper/VodPlayHistoryMapper.xml index 995026b..444de10 100644 --- a/src/main/resources/mapper/VodPlayHistoryMapper.xml +++ b/src/main/resources/mapper/VodPlayHistoryMapper.xml @@ -243,6 +243,46 @@ FROM AND t2.class_id = #{classId} +