From 858a7caf32515aab5f7390e41e3c9052b4dc94b0 Mon Sep 17 00:00:00 2001 From: tuyp Date: Thu, 7 Jul 2022 18:32:25 +0800 Subject: [PATCH] 20220707 备个份 --- src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java | 35 ++++++++++++++++++++++------------- src/main/resources/application.properties | 2 +- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java b/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java index 69b657a..19e71f0 100644 --- a/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java @@ -65,8 +65,8 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl= classHourDictDO.getClassHour() * 3600) { + if (total + vodPlayHistoryDO.getPlayLength() > classHourDictDO.getClassHour() * 3600) { int playLength = classHourDictDO.getClassHour() * 3600 - total; vodPlayHistoryDO.setPlayLength(playLength); - this.baseMapper.insert(vodPlayHistoryDO); + vodPlayHistoryDO.setPlayCount(1); + if (playLength>3){ + this.baseMapper.insert(vodPlayHistoryDO); + } throw new HttpException(13001); } } @@ -98,11 +105,6 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl 3) { - //对比redis上的token - String token = redisUtil.get("mobile_" + insertHistoryNewDTO.getMemberId()).toString(); - if (!insertHistoryNewDTO.getToken().equals(token)) { - throw new HttpException(1010); - } VodPlayHistoryDO vodPlayHistoryDO = new VodPlayHistoryDO(); BeanUtils.copyProperties(insertHistoryNewDTO, vodPlayHistoryDO); @@ -117,11 +119,18 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl= classHourDictDO.getClassHour() * 3600) { + if (total + vodPlayHistoryDO.getPlayLength() > classHourDictDO.getClassHour() * 3600) { int playLength = classHourDictDO.getClassHour() * 3600 - total; vodPlayHistoryDO.setPlayLength(playLength); - this.baseMapper.insert(vodPlayHistoryDO); + vodPlayHistoryDO.setPlayCount(1); + if (playLength >3){ + this.baseMapper.insert(vodPlayHistoryDO); + } throw new HttpException(13001); } } @@ -624,7 +633,7 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl testPlays(VodPlayHistoryDO vodPlayHistoryDO) { - String classIds = "254"; + String classIds = "261"; // String classIds = "122,150"; List classIdArr = Arrays.asList(classIds.split(",")); @@ -652,7 +661,7 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl