diff --git a/src/main/java/com/subsidy/controller/VodPlayHistoryController.java b/src/main/java/com/subsidy/controller/VodPlayHistoryController.java index eae9d9c..ee3d999 100644 --- a/src/main/java/com/subsidy/controller/VodPlayHistoryController.java +++ b/src/main/java/com/subsidy/controller/VodPlayHistoryController.java @@ -84,6 +84,12 @@ public class VodPlayHistoryController { return ResponseData.generateCreatedResponse(0,vodPlayHistoryService.testPlays()); } + @PostMapping("reArrangeData") + @ApiOperation("将有问题的数据按照签到时间重新排一下") + public void reArrangeData(){ + vodPlayHistoryService.reArrangeData(); + } + @PostMapping("warning") @ApiOperation("短信报警") public void warning(){ diff --git a/src/main/java/com/subsidy/jobs/RenSheJuJob.java b/src/main/java/com/subsidy/jobs/RenSheJuJob.java index 3be388c..2b8a588 100644 --- a/src/main/java/com/subsidy/jobs/RenSheJuJob.java +++ b/src/main/java/com/subsidy/jobs/RenSheJuJob.java @@ -3,16 +3,15 @@ package com.subsidy.jobs; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.subsidy.common.ResponseData; -import com.subsidy.mapper.ActivityDetectionMapper; -import com.subsidy.mapper.ImageCheckRecordMapper; -import com.subsidy.mapper.OprMemDictMapper; -import com.subsidy.model.ActivityDetectionDO; -import com.subsidy.model.ImageCheckRecordDO; -import com.subsidy.model.OprMemDictDO; +import com.subsidy.mapper.*; +import com.subsidy.model.*; import com.subsidy.service.RenSheJuService; import com.subsidy.util.IpAddressUtil; import com.subsidy.util.websocket.WebSocketUtil; import com.subsidy.vo.opr.InsertLastStudyRecordVO; +import com.subsidy.vo.renshe.DailyAnswerVO; +import com.subsidy.vo.vod.DailyClassMembersVO; +import com.subsidy.vo.vod.VodPlayStateVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.scheduling.annotation.Scheduled; @@ -25,6 +24,8 @@ import java.io.IOException; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.concurrent.ConcurrentHashMap; @@ -47,13 +48,25 @@ public class RenSheJuJob { @Autowired private ActivityDetectionMapper activityDetectionMapper; + @Autowired + private VodPlayHistoryMapper vodPlayHistoryMapper; + + @Autowired + private SignInRecordMapper signInRecordMapper; + + @Autowired + private ClassMemberMappingMapper classMemberMappingMapper; + + @Autowired + private VodDictMapper vodDictMapper; + @Value("${spring.profiles.active}") private String env; /** - * POST-2:班级基本信息信息采集接口 - */ +// * POST-2:班级基本信息信息采集接口 +// */ @Scheduled(cron = "0 0 1 * * ?") public void classBaseInfo() throws IOException { if ("prod".equals(env)) { @@ -121,19 +134,18 @@ public class RenSheJuJob { } } -// /** -// * POST-9 获取推送失败班级列表 -// */ -// @Scheduled(cron = "0 35 1 * * ?") -// public void getErrorClass()throws IOException{ -// renSheJuService.getErrorClass(); -// } - + /** + * POST-9 获取推送失败班级列表 + */ + @Scheduled(cron = "0 35 1 * * ?") + public void getErrorClass()throws IOException{ + renSheJuService.getErrorClass(); + } /** * 强制用户用户下线(websocket强制下线) */ - @Scheduled(cron = "0 30 23 * * ?") + @Scheduled(cron = "0 00 23 * * ?") @Transactional(rollbackFor = Exception.class) public void logout() { //让当前用户下线 @@ -155,6 +167,95 @@ public class RenSheJuJob { } /** + * 补当天有学习记录但没有签到的签到数据 + */ + @Scheduled(cron = "0 10 23 * * ?") + @Transactional(rollbackFor = Exception.class) + public void fillSignInRecord(){ + + //查找有视频的学生 + List dailyClassMembersVOS = vodPlayHistoryMapper.dailyClassMembers(); + for (DailyClassMembersVO dailyClassMembersVO : dailyClassMembersVOS){ + try { + //去看签到表当天有没有数据,没有的话就要补 + SignInRecordDO dailySignInRecord = signInRecordMapper.getDailySignInRecord(dailyClassMembersVO.getMemberId(), dailyClassMembersVO.getClassId()); + if (null == dailySignInRecord){ + //没有签到数据,补 + List vodPlayHistoryDOS = vodPlayHistoryMapper.exPlayInfoAsc(dailyClassMembersVO.getMemberId(), dailyClassMembersVO.getClassId()); + List signInRecordDOS = signInRecordMapper.selectList(new QueryWrapper() + .lambda() + .eq(SignInRecordDO::getMemberId,dailyClassMembersVO.getMemberId()) + .eq(SignInRecordDO::getClassId,dailyClassMembersVO.getClassId()) + .orderByDesc(SignInRecordDO::getSignInDate)); + SignInRecordDO signInRecordDO = signInRecordDOS.get(0); + LocalDateTime localDateTime = vodPlayHistoryDOS.get(0).getCreateDate() + .minusSeconds(vodPlayHistoryDOS.get(0).getPlayLength()) + .minusSeconds(vodPlayHistoryDOS.get(0).getSuspendLength()) + .minusSeconds(random0to9()); + signInRecordMapper.insertRecord(dailyClassMembersVO.getClassId(),dailyClassMembersVO.getMemberId(),localDateTime,signInRecordDO.getIpAddress(),signInRecordDO.getDeviceNo(),localDateTime); + } + }catch (Exception e){ + e.printStackTrace(); + } + } + } + + + + @Scheduled(cron = "0 15 23 * * ?") + public void clearErrorData(){ + //查看当天产生视频学习的班级 + List classIds = vodPlayHistoryMapper.dailyVodRecord(); + + HashMap> hashMap = new HashMap(); + + for (Long classId : classIds) { + List classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper() + .lambda() + .eq(ClassMemberMappingDO::getClassId, classId)); + HashSet memberIds = new HashSet<>(); + for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) { + List vodPlayStateVOS = vodDictMapper.testPlays(classMemberMappingDO.getMemberId(), Long.valueOf(classId)); + for (int i = 0; i < vodPlayStateVOS.size() - 1; i++) { + VodPlayStateVO vodPlayStateVO = vodPlayStateVOS.get(i + 1); //后面 + VodPlayStateVO vodPlayStateVO1 = vodPlayStateVOS.get(i); //前面 + if (vodPlayStateVO1.getEndDate().getTime() > vodPlayStateVO.getStartDate().getTime()) { + memberIds.add(vodPlayStateVO.getMemberId()); + } + } + } + hashMap.put(classId, memberIds); + } + + for (Long clsId : hashMap.keySet()) { + HashSet memberIds = hashMap.get(clsId); + for (Long memberId : memberIds) { + //查看这个人这个班当天的签到时间 + SignInRecordDO signInRecordDO = signInRecordMapper.getDailySignInRecord(memberId, clsId); + if (null != signInRecordDO) { + LocalDateTime signInDate = signInRecordDO.getSignInDate(); + //查看这个人当天的学习数据 + List vodPlayHistoryDOS = vodPlayHistoryMapper.exPlayInfoAsc(memberId, clsId); + //从签到时间开始依次“展开”数据 + int currentLength = 0; + for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryDOS) { + currentLength += random0to9() + vodPlayHistoryDO.getPlayLength() + vodPlayHistoryDO.getSuspendLength(); + LocalDateTime newCreateDate = signInDate.plusSeconds(currentLength); + vodPlayHistoryMapper.updatePlayRecord(vodPlayHistoryDO.getId(), newCreateDate); + } + } + } + } + } + + /** + * 随机0-9秒 + */ + public int random0to9() { + return (int) (Math.random() * 10+3); + } + + /** * 删掉有登录数据 做过人脸 没有学习数据(视频+考试+答疑) */ @Scheduled(cron = "0 35 23 * * ?") diff --git a/src/main/java/com/subsidy/jobs/WarningJob.java b/src/main/java/com/subsidy/jobs/WarningJob.java index d0ec309..509a742 100644 --- a/src/main/java/com/subsidy/jobs/WarningJob.java +++ b/src/main/java/com/subsidy/jobs/WarningJob.java @@ -38,44 +38,44 @@ public class WarningJob { @Value("${spring.profiles.active}") private String env; - /** - * 11点钟有错误数据 发短信 - */ - @Scheduled(cron = "0 0 23 * * ?") - public void classBaseInfo(){ - if ("prod".equals(env)) { - - List result = new ArrayList<>(); - - //查看当天产生视频学习的班级 - List classIds = vodPlayHistoryMapper.dailyVodRecord(); - for (Long classId : classIds) { - - List classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper() - .lambda() - .eq(ClassMemberMappingDO::getClassId, classId)); - for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) { - List vodPlayStateVOS = vodDictMapper.testPlays(classMemberMappingDO.getMemberId(), Long.valueOf(classId)); - for (int i = 0; i < vodPlayStateVOS.size() - 1; i++) { - VodPlayStateVO vodPlayStateVO = vodPlayStateVOS.get(i + 1); //后面 - VodPlayStateVO vodPlayStateVO1 = vodPlayStateVOS.get(i); //前面 - if (vodPlayStateVO1.getEndDate().getTime() > vodPlayStateVO.getStartDate().getTime()) { - if (!result.contains(vodPlayStateVO1.getClassId())){ - result.add(vodPlayStateVO.getClassId()); - } - } - } - } - } - - if (result.size()>0){ - List telephones = Arrays.asList(new String[]{"15201936167", "18201963812", "18217669021"}); - for (String telephone : telephones){ - smsUtils.sendWarning("SMS_460945631", telephone, result.toString()); - } - } - } - } +// /** +// * 11点钟有错误数据 发短信 +// */ +// @Scheduled(cron = "0 0 23 * * ?") +// public void classBaseInfo(){ +// if ("prod".equals(env)) { +// +// List result = new ArrayList<>(); +// +// //查看当天产生视频学习的班级 +// List classIds = vodPlayHistoryMapper.dailyVodRecord(); +// for (Long classId : classIds) { +// +// List classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper() +// .lambda() +// .eq(ClassMemberMappingDO::getClassId, classId)); +// for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) { +// List vodPlayStateVOS = vodDictMapper.testPlays(classMemberMappingDO.getMemberId(), Long.valueOf(classId)); +// for (int i = 0; i < vodPlayStateVOS.size() - 1; i++) { +// VodPlayStateVO vodPlayStateVO = vodPlayStateVOS.get(i + 1); //后面 +// VodPlayStateVO vodPlayStateVO1 = vodPlayStateVOS.get(i); //前面 +// if (vodPlayStateVO1.getEndDate().getTime() > vodPlayStateVO.getStartDate().getTime()) { +// if (!result.contains(vodPlayStateVO1.getClassId())){ +// result.add(vodPlayStateVO.getClassId()); +// } +// } +// } +// } +// } +// +// if (result.size()>0){ +// List telephones = Arrays.asList(new String[]{"15201936167", "18201963812", "18217669021"}); +// for (String telephone : telephones){ +// smsUtils.sendWarning("SMS_460945631", telephone, result.toString()); +// } +// } +// } +// } } diff --git a/src/main/java/com/subsidy/mapper/SignInRecordMapper.java b/src/main/java/com/subsidy/mapper/SignInRecordMapper.java index a84d591..c955186 100644 --- a/src/main/java/com/subsidy/mapper/SignInRecordMapper.java +++ b/src/main/java/com/subsidy/mapper/SignInRecordMapper.java @@ -4,8 +4,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.subsidy.model.SignInRecordDO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.subsidy.vo.sign.DataViewVO; +import com.subsidy.vo.sign.NoSignInDateVO; import org.springframework.stereotype.Repository; +import java.time.LocalDateTime; import java.util.List; @Repository @@ -19,4 +21,11 @@ public interface SignInRecordMapper extends BaseMapper { List getSignInRecord(); + + /** + * 查看某个人某个班级的当天签到时间 + */ + SignInRecordDO getDailySignInRecord(Long memberId,Long classId); + + void insertRecord(Long classId,Long memberId,LocalDateTime signInDate,String ipAddress,String deviceNo,LocalDateTime createDate); } diff --git a/src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java b/src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java index bc4971b..205627c 100644 --- a/src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java +++ b/src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java @@ -7,6 +7,7 @@ import com.subsidy.vo.administer.MemberStudyLogVO; import com.subsidy.vo.member.ContentVodNewVO; import com.subsidy.vo.sign.DataViewVO; import com.subsidy.vo.vod.ClassMemberPlayLengthVO; +import com.subsidy.vo.vod.DailyClassMembersVO; import com.subsidy.vo.vod.GetMemberStudyInfoVO; import com.subsidy.vo.vod.StudyHistoryVO; import org.springframework.stereotype.Repository; @@ -51,11 +52,6 @@ public interface VodPlayHistoryMapper extends BaseMapper { */ int completeVodOrNot(Long memberId, Long vodId,Long classId); - ///** - // * 查看某个班级的学习记录 - // */ - //DataViewVO classStudyHistory(Long classId); - /** * 查看这个课程某个成员看的视频课程 */ @@ -82,11 +78,16 @@ public interface VodPlayHistoryMapper extends BaseMapper { Integer memberVodTotalLength(Long classId,Long memberId,Long vodId); /** - * 跑脚本 前一天的学习情况 + * 跑脚本 前一天的学习情况 倒序 */ List exPlayInfo(Long memberId, String classId, LocalDateTime localDateTime); /** + * 当天某人某课程的学习数据 + */ + List exPlayInfoAsc(Long memberId, Long classId); + + /** * 以班级、人的维度查询某个人的视频观看时长 */ List classMemberPlayLength(Long classId); @@ -106,6 +107,10 @@ public interface VodPlayHistoryMapper extends BaseMapper { */ void insertPlayRecord(Long classId,Long vodId,Long memberId,Integer playLength,Integer suspendLength,Integer playRecord,Integer playCount,Date createDate); + /** + * 修改一条记录 + */ + void updatePlayRecord(Long id,LocalDateTime createDate); double getStudyTotal(); @@ -116,4 +121,9 @@ public interface VodPlayHistoryMapper extends BaseMapper { //查看当天产生视频学习的班级 List dailyVodRecord(); + /** + * 查看当天产生的视频数据的班级-学生 + */ + List dailyClassMembers(); + } diff --git a/src/main/java/com/subsidy/service/VodPlayHistoryService.java b/src/main/java/com/subsidy/service/VodPlayHistoryService.java index 0878f4c..8fb19d4 100644 --- a/src/main/java/com/subsidy/service/VodPlayHistoryService.java +++ b/src/main/java/com/subsidy/service/VodPlayHistoryService.java @@ -36,6 +36,8 @@ public interface VodPlayHistoryService extends IService { HashMap> testPlays(); + void reArrangeData(); + void warning(); } diff --git a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java index 676edd3..479cb5d 100644 --- a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java @@ -469,10 +469,10 @@ public class AdministerServiceImpl extends ServiceImpl= vodDictDO.getVodLength()) { - validLength+=vodDictDO.getVodLength(); + validLength += vodDictDO.getVodLength(); i++; - }else { - validLength+=totalPlayLength; + } else { + validLength += totalPlayLength; } playLength += totalPlayLength; } @@ -550,9 +550,9 @@ public class AdministerServiceImpl extends ServiceImpl= vodDictDO.getVodLength()) { i++; - validLength+=vodDictDO.getVodLength(); - }else { - validLength+=totalPlayLength; + validLength += vodDictDO.getVodLength(); + } else { + validLength += totalPlayLength; } playLength += totalPlayLength; } @@ -613,9 +613,9 @@ public class AdministerServiceImpl extends ServiceImpl classDetailVOS = exportClassDetail(classDetailDTO); String studyDate = classDictDO.getStartDate() + " 至 " + classDictDO.getEndDate(); - if (null == companyDictDO){ + if (null == companyDictDO) { membersListExcel(null, studyDate, classDictDO.getClassName(), "授课记录汇总表", ExcelFormatUtils.memberList, classDetailVOS, null, 0, baos); - }else { + } else { membersListExcel(companyDictDO.getCompanyName(), studyDate, classDictDO.getClassName(), "授课记录汇总表", ExcelFormatUtils.memberList, classDetailVOS, null, 0, baos); } @@ -1259,9 +1259,9 @@ public class AdministerServiceImpl extends ServiceImpl classSignVOS = exportSignDetail(classDetailDTO); - if (null == companyDictDO.getCompanyName()){ + if (null == companyDictDO.getCompanyName()) { signListExcel(null, studyDate, classDictDO.getClassName(), "注册签到", ExcelFormatUtils.signList, classSignVOS, null, 0, baos1); - }else { + } else { signListExcel(companyDictDO.getCompanyName(), studyDate, classDictDO.getClassName(), "注册签到", ExcelFormatUtils.signList, classSignVOS, null, 0, baos1); } @@ -1286,9 +1286,9 @@ public class AdministerServiceImpl extends ServiceImpl exerciseTestVOS = exportExerciseTest(classDetailDTO); - if (null ==companyDictDO){ + if (null == companyDictDO) { testListExcel(null, studyDate, classDictDO.getClassName(), "测试成绩表", ExcelFormatUtils.scoreList, exerciseTestVOS, null, 0, baos2); - }else { + } else { testListExcel(companyDictDO.getCompanyName(), studyDate, classDictDO.getClassName(), "测试成绩表", ExcelFormatUtils.scoreList, exerciseTestVOS, null, 0, baos2); } compressFileToZipStream(zipOutputStream, baos2, "test" + i + ".xlsx"); @@ -1299,9 +1299,9 @@ public class AdministerServiceImpl extends ServiceImpl answerRecordVOS = exportAnswerRecord(classDetailDTO); - if (null == companyDictDO.getCompanyName()){ + if (null == companyDictDO.getCompanyName()) { askListExcel(null, studyDate, classDictDO.getClassName(), "答疑记录", ExcelFormatUtils.answersList, answerRecordVOS, null, 0, baos3); - }else { + } else { askListExcel(companyDictDO.getCompanyName(), studyDate, classDictDO.getClassName(), "答疑记录", ExcelFormatUtils.answersList, answerRecordVOS, null, 0, baos3); } compressFileToZipStream(zipOutputStream, baos3, "answer.xlsx"); @@ -1364,7 +1364,7 @@ public class AdministerServiceImpl extends ServiceImpl selfExportVOS = this.baseMapper.selfExport(classDictDO); - ExcelUtil.writeExcel(selfExportVOS,SelfExportVO.class); + ExcelUtil.writeExcel(selfExportVOS, SelfExportVO.class); } diff --git a/src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java b/src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java index 2b03bf2..e610eae 100644 --- a/src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java @@ -674,7 +674,11 @@ public class RenSheJuServiceImpl implements RenSheJuService { renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_8); renshejuHistoryDO.setInputParam(JSONObject.fromObject(uploadClassCodeDTO).toString()); if (200 == response.code()) { - renshejuHistoryDO.setOutputParam(RenSheJuConstant.PUSH_SUCCESS); + if (null != rensheResponseVO.getCtt()){ + renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString()); + }else { + response.body().toString(); + } } else { renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR); } diff --git a/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java b/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java index 85c04be..e384d73 100644 --- a/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java @@ -3,7 +3,6 @@ package com.subsidy.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.subsidy.common.exception.HttpException; -import com.subsidy.dto.vod.FixDataTwoDTO; import com.subsidy.dto.vod.InsertHistoryNewDTO; import com.subsidy.dto.vod.RemainSecondsDTO; import com.subsidy.dto.vod.SignDatePlaysDTO; @@ -11,19 +10,14 @@ import com.subsidy.mapper.*; import com.subsidy.model.*; import com.subsidy.service.VodPlayHistoryService; import com.subsidy.util.ConstantUtils; -import com.subsidy.util.DateFormatUtil; -import com.subsidy.util.RedisUtil; import com.subsidy.util.SMSUtils; import com.subsidy.vo.vod.VodPlayStateVO; -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.text.SimpleDateFormat; import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; import java.util.*; /** @@ -65,7 +59,7 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl 8) { + if (vodPlayHistoryDO.getPlayLength() > 8 && vodPlayHistoryDO.getSuspendLength() <= 3000) { //查看系统设定的时长 ClassDictDO classDictDO = classDictMapper.selectOne(new QueryWrapper() .lambda() @@ -106,7 +100,7 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl 8) { + if (insertHistoryNewDTO.getPlayLength() > 8 && insertHistoryNewDTO.getSuspendLength() <= 3000) { VodPlayHistoryDO vodPlayHistoryDO = new VodPlayHistoryDO(); BeanUtils.copyProperties(insertHistoryNewDTO, vodPlayHistoryDO); //查看系统设定的时长 @@ -635,7 +629,7 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl> testPlays() { + public HashMap> testPlays() { //查看当天产生视频学习的班级 List classIds = vodPlayHistoryMapper.dailyVodRecord(); @@ -653,30 +647,19 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl vodPlayStateVO.getStartDate().getTime()) { - //这一条数据有问题 -// System.out.println("111111111111111111111" + vodPlayStateVO); - //查看这个人 这个课程 当天的全部数据 按照createDate升序排序 -// List vodPlayHistoryDOS = this.baseMapper.getVodPlayDay(Long.valueOf(classId), classMemberMappingDO.getMemberId(), vodPlayStateVO.getStartDate()); -// //从第一条开始看,顺延减去第二条的playlength得到第二条的create_date 以此类推 -// for (int l = 0; l < vodPlayHistoryDOS.size() - 1; l++) { -// VodPlayHistoryDO vph1 = vodPlayHistoryDOS.get(l); //第一条 -// if (l == 0) { -// vph1.setPlayDate(vph1.getCreateDate()); -// } -// VodPlayHistoryDO vph2 = vodPlayHistoryDOS.get(l + 1); //第二条 -// LocalDateTime dateTmp = vph1.getPlayDate().plusSeconds(vph2.getPlayLength() + getRandom1_2()); -// vph2.setPlayDate(dateTmp); -// this.baseMapper.updateById(vph2); -// } result.add(vodPlayStateVO.getId()); } } } - hashMap.put(classId,result); + hashMap.put(classId, result); } return hashMap; } + public void reArrangeData() { + + } + public void warning() { //有问题的班级 @@ -704,9 +687,9 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl0){ + if (result.size() > 0) { List telephones = Arrays.asList(new String[]{"15201936167", "18201963812", "18217669021"}); - for (String telephone : telephones){ + for (String telephone : telephones) { smsUtils.sendWarning("SMS_460945631", telephone, result.toString()); } } @@ -751,12 +734,23 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl list = new ArrayList(); - list.add(1L); - list.add(2L); - System.out.println(list.toString()); +// List list = new ArrayList(); +// list.add(1L); +// list.add(2L); +// System.out.println(list.toString()); // while (true) { // System.out.println(getRandom1_2()); @@ -841,6 +835,7 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl + + + + insert into sign_in_record(class_id,member_id,sign_in_date,ip_address,device_no,create_date) + values (#{classId},#{memberId},#{signInDate},#{ipAddress},#{deviceNo},#{createDate}) + + diff --git a/src/main/resources/mapper/VodPlayHistoryMapper.xml b/src/main/resources/mapper/VodPlayHistoryMapper.xml index a93341b..b8de509 100644 --- a/src/main/resources/mapper/VodPlayHistoryMapper.xml +++ b/src/main/resources/mapper/VodPlayHistoryMapper.xml @@ -404,6 +404,19 @@ order by t.play_date desc + + SELECT sum( play_length ) @@ -519,5 +536,18 @@ AND t2.delete_date IS NULL +