|
|
@@ -2,6 +2,7 @@ package com.fs.course.task;
|
|
|
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.fs.common.core.redis.RedisCache;
|
|
|
+import com.fs.common.utils.StringUtils;
|
|
|
import com.fs.course.config.CourseConfig;
|
|
|
import com.fs.course.domain.*;
|
|
|
import com.fs.course.mapper.*;
|
|
|
@@ -9,11 +10,13 @@ import com.fs.course.param.FsCourseSendRewardUParam;
|
|
|
import com.fs.course.service.IFsCourseTrafficLogService;
|
|
|
import com.fs.course.service.IFsUserCourseVideoService;
|
|
|
import com.fs.course.service.IFsUserVideoCommentService;
|
|
|
+import com.fs.his.config.AppConfig;
|
|
|
import com.fs.his.domain.FsUser;
|
|
|
import com.fs.his.domain.FsUserIntegralLogs;
|
|
|
import com.fs.his.enums.FsUserIntegralLogTypeEnum;
|
|
|
import com.fs.his.mapper.FsUserIntegralLogsMapper;
|
|
|
import com.fs.his.mapper.FsUserMapper;
|
|
|
+import com.fs.system.service.ISysConfigService;
|
|
|
import com.qcloud.cos.COSClient;
|
|
|
import com.qcloud.cos.ClientConfig;
|
|
|
import com.qcloud.cos.auth.BasicCOSCredentials;
|
|
|
@@ -70,6 +73,8 @@ public class VideoTask {
|
|
|
private FsUserIntegralLogsMapper fsUserIntegralLogsMapper;
|
|
|
@Autowired
|
|
|
private IFsUserCourseVideoService courseVideoService;
|
|
|
+ @Autowired
|
|
|
+ private ISysConfigService configService;
|
|
|
|
|
|
public void autoNotShowVideo() {
|
|
|
List<Long> list = videoMapper.selectNotAuditVideo();
|
|
|
@@ -269,32 +274,43 @@ public class VideoTask {
|
|
|
* 补发完课积分
|
|
|
*/
|
|
|
public void reissueFinishVideoIntegral() {
|
|
|
- List<FsCourseWatchLog> watchingLogs = courseWatchLogMapper.findWatchLogsIdExitAndFinish();
|
|
|
- //查询积分记录 是否存在
|
|
|
- for (FsCourseWatchLog watchingLog : watchingLogs) {
|
|
|
- FsUserIntegralLogs queryParam = new FsUserIntegralLogs();
|
|
|
- queryParam.setUserId(watchingLog.getUserId());
|
|
|
- queryParam.setBusinessId(watchingLog.getLogId().toString());
|
|
|
- queryParam.setLogType(FsUserIntegralLogTypeEnum.TYPE_17.getValue());
|
|
|
- //查询积分记录 是否存在
|
|
|
- Long num = fsUserIntegralLogsMapper.selectFsUserIntegralLogsListCOUNT(queryParam);
|
|
|
- if (num == null || num == 0){
|
|
|
- FsCourseSendRewardUParam param = new FsCourseSendRewardUParam();
|
|
|
- param.setIsAuto(1);
|
|
|
- param.setVideoId(watchingLog.getVideoId());
|
|
|
- param.setQwUserId(watchingLog.getQwUserId().toString());
|
|
|
- param.setCompanyUserId(watchingLog.getCompanyUserId());
|
|
|
- param.setCompanyId(watchingLog.getCompanyId());
|
|
|
- param.setCourseId(watchingLog.getCourseId());
|
|
|
- param.setQwExternalId(watchingLog.getQwExternalContactId());
|
|
|
- param.setSource(watchingLog.getWatchType() == 2?2:1);
|
|
|
- param.setSendType(watchingLog.getSendType());
|
|
|
- param.setPeriodId(watchingLog.getPeriodId());
|
|
|
- param.setUserId(watchingLog.getUserId());
|
|
|
- param.setAppId("");
|
|
|
- courseVideoService.sendRewardByFsUser(param);
|
|
|
- log.info("补发积分 userId:{},watchLogsId:{}",watchingLog.getUserId(),watchingLog.getLogId());
|
|
|
+ //查询发送奖励方式
|
|
|
+ String json = configService.selectConfigByKey("course.config");
|
|
|
+ if (StringUtils.isNotBlank(json)) {
|
|
|
+ CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
|
|
|
+ if (config != null) {
|
|
|
+ Integer rewardType = config.getRewardType();
|
|
|
+ if (rewardType != null && rewardType == 2) {
|
|
|
+ List<FsCourseWatchLog> watchingLogs = courseWatchLogMapper.findWatchLogsIdExitAndFinish();
|
|
|
+ //查询积分记录 是否存在
|
|
|
+ for (FsCourseWatchLog watchingLog : watchingLogs) {
|
|
|
+ FsUserIntegralLogs queryParam = new FsUserIntegralLogs();
|
|
|
+ queryParam.setUserId(watchingLog.getUserId());
|
|
|
+ queryParam.setBusinessId(watchingLog.getLogId().toString());
|
|
|
+ queryParam.setLogType(FsUserIntegralLogTypeEnum.TYPE_17.getValue());
|
|
|
+ //查询积分记录 是否存在
|
|
|
+ Long num = fsUserIntegralLogsMapper.selectFsUserIntegralLogsListCOUNT(queryParam);
|
|
|
+ if (num == null || num == 0){
|
|
|
+ FsCourseSendRewardUParam param = new FsCourseSendRewardUParam();
|
|
|
+ param.setIsAuto(1);
|
|
|
+ param.setVideoId(watchingLog.getVideoId());
|
|
|
+ param.setQwUserId(watchingLog.getQwUserId().toString());
|
|
|
+ param.setCompanyUserId(watchingLog.getCompanyUserId());
|
|
|
+ param.setCompanyId(watchingLog.getCompanyId());
|
|
|
+ param.setCourseId(watchingLog.getCourseId());
|
|
|
+ param.setQwExternalId(watchingLog.getQwExternalContactId());
|
|
|
+ param.setSource(watchingLog.getWatchType() == 2?2:1);
|
|
|
+ param.setSendType(watchingLog.getSendType());
|
|
|
+ param.setPeriodId(watchingLog.getPeriodId());
|
|
|
+ param.setUserId(watchingLog.getUserId());
|
|
|
+ param.setAppId("");
|
|
|
+ courseVideoService.sendRewardByFsUser(param);
|
|
|
+ log.info("补发积分 userId:{},watchLogsId:{}",watchingLog.getUserId(),watchingLog.getLogId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|