diff --git a/src/main/java/com/subsidy/jobs/Scheduler.java b/src/main/java/com/subsidy/jobs/Scheduler.java index ee7e619..e1f42ce 100644 --- a/src/main/java/com/subsidy/jobs/Scheduler.java +++ b/src/main/java/com/subsidy/jobs/Scheduler.java @@ -92,14 +92,15 @@ public class Scheduler { /** * 视频播放记录缩量 */ - //@Scheduled(cron = "0 35 18 * * ?") + @Scheduled(cron = "0 48 14 * * ?") @Transactional(rollbackFor = Exception.class) public void condenseVodPlayHistory() { List list = vodPlayHistoryMapper.getVodPlayHistory(); - List vodPlayHistoryList = vodPlayHistoryMapper.selectList(new QueryWrapper()); - for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryList) { - vodPlayHistoryMapper.deleteById(vodPlayHistoryDO.getId()); - } + vodPlayHistoryMapper.delete(null); + //List vodPlayHistoryList = vodPlayHistoryMapper.selectList(null); + //for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryList) { + vodPlayHistoryMapper.deleteById(null); + //} for (VodPlayHistoryDO vodPlayHistoryDO : list) { vodPlayHistoryMapper.insert(vodPlayHistoryDO); diff --git a/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java b/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java index d0b2287..43b4ea5 100644 --- a/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java @@ -12,6 +12,7 @@ import com.subsidy.mapper.ClassDictMapper; import com.subsidy.mapper.ClassHourDictMapper; import com.subsidy.mapper.ClassMemberMappingMapper; import com.subsidy.mapper.ExerciseDoneResultMapper; +import com.subsidy.mapper.MemberMapper; import com.subsidy.mapper.SignInRecordMapper; import com.subsidy.mapper.VodPlayHistoryMapper; import com.subsidy.model.AnsweringQuestionDO; @@ -19,6 +20,7 @@ import com.subsidy.model.ClassDictDO; import com.subsidy.model.ClassHourDictDO; import com.subsidy.model.ClassMemberMappingDO; import com.subsidy.model.ExerciseDoneResultDO; +import com.subsidy.model.MemberDO; import com.subsidy.model.SignInRecordDO; import com.subsidy.model.VodDictDO; import com.subsidy.model.VodPlayHistoryDO; @@ -70,6 +72,9 @@ public class SignInRecordServiceImpl extends ServiceImpl getMemberSignInfo(GetMemberSignInfoDTO getMemberSignInfoDTO) { @@ -250,6 +255,11 @@ public class SignInRecordServiceImpl extends ServiceImpl memberDOS = memberMapper.selectList(null); + //for (MemberDO memberDO : memberDOS){ + // redisUtil.set(RedisPrefixConstant.SUBSIDY_COMPANY_MEMBER_PREFIX+memberDO.getCompanyId()+"_"+memberDO.getAccountName(),memberDO); + //} + } } diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties index 351d497..a02ed62 100644 --- a/src/main/resources/application-dev.properties +++ b/src/main/resources/application-dev.properties @@ -2,7 +2,7 @@ # 数据源配置 spring.datasource.url=jdbc:mysql://47.97.19.66:3306/subsidy_test?autoReconnect=true&useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8 -#spring.datasource.url=jdbc:mysql://rm-uf67mjh19252z6yg4eo.mysql.rds.aliyuncs.com:3306/subsidy?autoReconnect=true&useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8 +#spring.datasource.url=jdbc:mysql://rm-uf606h696n5qod70cfo.mysql.rds.aliyuncs.com:3306/subsidy_test?autoReconnect=true&useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8 spring.datasource.type=com.alibaba.druid.pool.DruidDataSource spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver #spring.datasource.username=ykadmin_new diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 9685e52..05b49fc 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -64,12 +64,12 @@ spring.quartz.overwrite-existing-jobs=false #spring.quartz.jdbc.initialize-schema=always #spring.datasource.initialization-mode=embedded -spring.task.execution.pool.allow-core-thread-timeout=true -spring.task.execution.pool.core-size=8 -spring.task.execution.pool.keep-alive=60 -spring.task.execution.pool.max-size=200 -spring.task.execution.pool.queue-capacity=200 -spring.task.execution.thread-name-prefix=subsidy- +#spring.task.execution.pool.allow-core-thread-timeout=true +#spring.task.execution.pool.core-size=8 +#spring.task.execution.pool.keep-alive=60 +#spring.task.execution.pool.max-size=200 +#spring.task.execution.pool.queue-capacity=200 +#spring.task.execution.thread-name-prefix=subsidy- #spring.task.scheduling.pool.size=2 #spring.task.scheduling.thread-name-prefix=subsidy- @@ -82,6 +82,10 @@ spring.task.execution.thread-name-prefix=subsidy- #spring.redis.lettuce.pool.max-active=32 #spring.redis.lettuce.pool.min-idle=8 +#spring.redis.host=r-uf6m4cpkjrgpzywjm3pd.redis.rds.aliyuncs.com +#spring.redis.port=6379 +#spring.redis.password=r-uf6m4cpkjrgpzywjm3:Ykhl@208 + spring.redis.host=47.97.19.66 spring.redis.password=Ykhl@208 spring.redis.port=6389 diff --git a/src/main/resources/mapper/VodPlayHistoryMapper.xml b/src/main/resources/mapper/VodPlayHistoryMapper.xml index 339a43b..7d3e6a1 100644 --- a/src/main/resources/mapper/VodPlayHistoryMapper.xml +++ b/src/main/resources/mapper/VodPlayHistoryMapper.xml @@ -24,7 +24,6 @@ delete from vod_play_history - where id = #{id} SELECT IF - ( max( t.play_record ) > t2.vod_length, 1, 0 ) AS count + ( max( t.play_record ) > t2.vod_length*0.8, 1, 0 ) AS count FROM vod_play_history t LEFT JOIN vod_dict t2 ON t.vod_id = t2.id