Commit eede23cb by 涂亚平

Merge branch '20211125' of D:\code\subsidy with conflicts.

1 parent d0c69bbb
......@@ -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){
......
......@@ -9,4 +9,8 @@ public class MemberStudyLogDTO {
private Long classId;
private Integer pageSize;
private Integer pageNum;
}
......@@ -63,6 +63,11 @@ public interface VodPlayHistoryMapper extends BaseMapper<VodPlayHistoryDO> {
List<ContentVodNewVO> memberRecentPlay(Long classId, Long memberId);
/**
* 查看某个成员某个课程的学习日志--分页
*/
IPage<MemberStudyLogVO> memberStudy(IPage iPage,Long classId, Long memberId);
/**
* 查看某个成员某个课程的学习日志
*/
List<MemberStudyLogVO> memberStudyLog(Long classId, Long memberId);
......
......@@ -70,6 +70,8 @@ public interface AdministerService extends IService<AdministerDO> {
void export(ClassDetailDTO classDetailDTO)throws Exception;
IPage memberStudy(MemberStudyLogDTO memberStudyLogDTO);
void memberStudyLog(MemberStudyLogDTO memberStudyLogDTO)throws Exception;
String importMember(Long companyId, MultipartFile multipartFile);
......
......@@ -1223,6 +1223,17 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
}
public IPage memberStudy(MemberStudyLogDTO memberStudyLogDTO){
Page pager = new Page(memberStudyLogDTO.getPageNum(), memberStudyLogDTO.getPageSize());
IPage iPage = vodPlayHistoryMapper.memberStudy(pager,memberStudyLogDTO.getClassId(),memberStudyLogDTO.getMemberId());
List<MemberStudyLogVO> 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 {
......
......@@ -84,11 +84,6 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig
List<ClassDictDO> classDictDOS = classMemberMappingMapper.getMemberClass(signInRecordDO.getMemberId());
for (ClassDictDO classDictDO : classDictDOS) {
Set<String> 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);
}
......
......@@ -14,6 +14,6 @@ public class ExcelFormatUtils {
public static final List<String> answersList = Arrays.asList("序号", "提问", "答疑", "提问时间", "提问成员", "答疑时间");
public static final List<String> studyLogList = Arrays.asList("开始时间","结束时间","操作对象","类型","平台","学习时长","累计有效时长");
public static final List<String> studyLogList = Arrays.asList("开始时间","结束时间","课程","类型","学习时长","累计有效时长");
}
......@@ -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<String> 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());
......
......@@ -13,8 +13,6 @@ public class MemberStudyLogVO {
private String studyType;
private String platForm;
private String playLength;
private String totalLength;
......
# 环境配置
spring.profiles.active=prod
spring.profiles.active=dev
# 端口号
spring.server.port=23459
spring.server.port=23457
#嵌入tomcat配置
#和CPU数
spring.server.acceptorThreadCount=600
......
......@@ -243,6 +243,46 @@ FROM
AND t2.class_id = #{classId}
</select>
<select id="memberStudy" resultType="com.subsidy.vo.administer.MemberStudyLogVO">
SELECT
DATE_SUB( t1.create_date, INTERVAL t1.play_length SECOND ) AS startDate,
t1.create_date AS endDate,
t1.vod_name,
'视频学习' AS studyType,
t1.play_length,
IF
( t2.total_length &lt;= t1.vod_length, t2.total_length, t1.vod_length ) AS total_length
FROM
(
SELECT
t.vod_id,
t.create_date,
t2.vod_name,
t.play_length,
t2.vod_length
FROM
vod_play_history t
LEFT JOIN vod_dict t2 ON t.vod_id = t2.id
WHERE
t.class_id = #{classId}
AND t.member_id = #{memberId}
) t1
LEFT JOIN (
SELECT
t.vod_id,
sum( t.play_length ) AS total_length
FROM
vod_play_history t
LEFT JOIN vod_dict t2 ON t.vod_id = t2.id
WHERE
t.class_id = #{classId}
AND t.member_id = #{memberId}
GROUP BY
t.vod_id
) t2 ON t1.vod_id = t2.vod_id
ORDER BY
t1.create_date DESC
</select>
<select id="memberStudyLog" resultType="com.subsidy.vo.administer.MemberStudyLogVO">
SELECT
......@@ -250,7 +290,6 @@ FROM
t1.create_date AS endDate,
t1.vod_name,
'视频学习' AS studyType,
'有课互联系统' as platForm,
t1.play_length,
IF
( t2.total_length &lt;= t1.vod_length, t2.total_length, t1.vod_length ) AS total_length
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!