|
@@ -1541,15 +1541,18 @@ public class FsUserCourseVideoServiceImpl extends ServiceImpl<FsUserCourseVideoM
|
|
|
if (param.getSource() != 3 && config.getMiniAppAuthType() == 2 && StringUtil.strIsNullOrEmpty(user.getMpOpenId())) {
|
|
if (param.getSource() != 3 && config.getMiniAppAuthType() == 2 && StringUtil.strIsNullOrEmpty(user.getMpOpenId())) {
|
|
|
return R.error(401, "授权后可继续!");
|
|
return R.error(401, "授权后可继续!");
|
|
|
}
|
|
}
|
|
|
- // 根据奖励类型发放不同奖励 //todo
|
|
|
|
|
- if ((param.getUserId() == 42 || param.getUserId() == 41 || param.getUserId() == 816473) && (param.getSource() == 3)){
|
|
|
|
|
- return withdrawal(param);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
log.info("奖励类型:{}", config.getRewardType());
|
|
log.info("奖励类型:{}", config.getRewardType());
|
|
|
switch (config.getRewardType()) {
|
|
switch (config.getRewardType()) {
|
|
|
// 红包奖励
|
|
// 红包奖励
|
|
|
case 1:
|
|
case 1:
|
|
|
- return sendRedPacketReward(param, user, watchLog, video, config);
|
|
|
|
|
|
|
+ if (param.getSource() == 3){
|
|
|
|
|
+ param.setWatchLogId(watchLog.getLogId());
|
|
|
|
|
+ return withdrawal(param);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return sendRedPacketReward(param, user, watchLog, video, config);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 积分奖励
|
|
// 积分奖励
|
|
|
case 2:
|
|
case 2:
|
|
|
return sendIntegralReward(param, user, watchLog, config);
|
|
return sendIntegralReward(param, user, watchLog, config);
|
|
@@ -1667,7 +1670,7 @@ public class FsUserCourseVideoServiceImpl extends ServiceImpl<FsUserCourseVideoM
|
|
|
if (log.getRewardType() == 1) {
|
|
if (log.getRewardType() == 1) {
|
|
|
FsCourseRedPacketLog fsCourseRedPacketLog = redPacketLogMapper.selectUserFsCourseRedPacketLog(param.getVideoId(), param.getUserId(), param.getPeriodId());
|
|
FsCourseRedPacketLog fsCourseRedPacketLog = redPacketLogMapper.selectUserFsCourseRedPacketLog(param.getVideoId(), param.getUserId(), param.getPeriodId());
|
|
|
if (fsCourseRedPacketLog != null && fsCourseRedPacketLog.getStatus() == 1) {
|
|
if (fsCourseRedPacketLog != null && fsCourseRedPacketLog.getStatus() == 1) {
|
|
|
- return R.error("已领取该课程奖励,不可重复领取!");
|
|
|
|
|
|
|
+ return R.error("已领取该课程奖励,不可重复领取!").put("data",fsCourseRedPacketLog.getResult());
|
|
|
}
|
|
}
|
|
|
if (fsCourseRedPacketLog != null && fsCourseRedPacketLog.getStatus() == 0) {
|
|
if (fsCourseRedPacketLog != null && fsCourseRedPacketLog.getStatus() == 0) {
|
|
|
if (StringUtils.isNotEmpty(fsCourseRedPacketLog.getResult())) {
|
|
if (StringUtils.isNotEmpty(fsCourseRedPacketLog.getResult())) {
|
|
@@ -1691,7 +1694,7 @@ public class FsUserCourseVideoServiceImpl extends ServiceImpl<FsUserCourseVideoM
|
|
|
|
|
|
|
|
// 判断来源是否是app,如是app,则发放积分奖励
|
|
// 判断来源是否是app,如是app,则发放积分奖励
|
|
|
int sourceApp = 3;
|
|
int sourceApp = 3;
|
|
|
- if (sourceApp == param.getSource() && !CloudHostUtils.hasCloudHostName("中康")) {
|
|
|
|
|
|
|
+ if (sourceApp == param.getSource() && !CloudHostUtils.hasCloudHostName("中康","金牛明医")) {
|
|
|
return sendIntegralReward(param, user, log, config);
|
|
return sendIntegralReward(param, user, log, config);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1699,7 +1702,18 @@ public class FsUserCourseVideoServiceImpl extends ServiceImpl<FsUserCourseVideoM
|
|
|
switch (config.getRewardType()) {
|
|
switch (config.getRewardType()) {
|
|
|
// 红包奖励
|
|
// 红包奖励
|
|
|
case 1:
|
|
case 1:
|
|
|
- return sendRedPacketRewardFsUser(param, user, log, video, config);
|
|
|
|
|
|
|
+ if (sourceApp == param.getSource()){
|
|
|
|
|
+ WxSendRedPacketParam packetParam = new WxSendRedPacketParam();
|
|
|
|
|
+ String openId = getOpenId(param, user);
|
|
|
|
|
+ if (StringUtils.isBlank(openId)) {
|
|
|
|
|
+ return R.error("请重新使用微信登录");
|
|
|
|
|
+ }
|
|
|
|
|
+ packetParam.setOpenId(openId);
|
|
|
|
|
+ BeanUtils.copyProperties(param, packetParam);
|
|
|
|
|
+ return sendAppRedPacket(packetParam, log,video, config);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return sendRedPacketRewardFsUser(param, user, log, video, config);
|
|
|
|
|
+ }
|
|
|
// 积分奖励
|
|
// 积分奖励
|
|
|
case 2:
|
|
case 2:
|
|
|
return sendIntegralReward(param, user, log, config);
|
|
return sendIntegralReward(param, user, log, config);
|
|
@@ -5166,8 +5180,13 @@ public class FsUserCourseVideoServiceImpl extends ServiceImpl<FsUserCourseVideoM
|
|
|
if (user == null) {
|
|
if (user == null) {
|
|
|
return R.error("未识别到用户信息");
|
|
return R.error("未识别到用户信息");
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- FsCourseWatchLog log = courseWatchLogMapper.getWatchCourseVideoByFsUser(param.getUserId(), param.getVideoId(), param.getCompanyUserId());
|
|
|
|
|
|
|
+ FsCourseWatchLog log = null;
|
|
|
|
|
+ if (param.getWatchLogId() != null){
|
|
|
|
|
+ //企微自动发课
|
|
|
|
|
+ log = courseWatchLogMapper.selectFsCourseWatchLogByLogId(param.getWatchLogId());
|
|
|
|
|
+ } else {
|
|
|
|
|
+ log = courseWatchLogMapper.getWatchCourseVideoByFsUser(param.getUserId(), param.getVideoId(), param.getCompanyUserId());
|
|
|
|
|
+ }
|
|
|
if (log == null) {
|
|
if (log == null) {
|
|
|
return R.error("无记录");
|
|
return R.error("无记录");
|
|
|
}
|
|
}
|
|
@@ -5177,7 +5196,7 @@ public class FsUserCourseVideoServiceImpl extends ServiceImpl<FsUserCourseVideoM
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
FsCourseAnswerLogs rightLog = courseAnswerLogsMapper.selectRightLogByCourseVideo(param.getVideoId(), param.getUserId(), param.getQwUserId());
|
|
FsCourseAnswerLogs rightLog = courseAnswerLogsMapper.selectRightLogByCourseVideo(param.getVideoId(), param.getUserId(), param.getQwUserId());
|
|
|
- if (rightLog == null) {
|
|
|
|
|
|
|
+ if (rightLog == null && !CloudHostUtils.hasCloudHostName("金牛明医")) {
|
|
|
logger.error("未答题:{}", param.getUserId());
|
|
logger.error("未答题:{}", param.getUserId());
|
|
|
return R.error("未答题");
|
|
return R.error("未答题");
|
|
|
}
|
|
}
|