|
@@ -1210,26 +1210,6 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
//2025.6.19 红包金额为0的时候
|
|
|
if (amount.compareTo(BigDecimal.ZERO)>0){
|
|
|
|
|
|
-// Company company = companyMapper.selectCompanyByIdForUpdate(param.getCompanyId());
|
|
|
-// BigDecimal money = company.getMoney();
|
|
|
-// BigDecimal subtract = money.subtract(amount);
|
|
|
-// if (subtract.compareTo(BigDecimal.ZERO)<0){
|
|
|
-// FsCourseRedPacketLog redPacketLog = new FsCourseRedPacketLog();
|
|
|
-// redPacketLog.setCourseId(param.getCourseId());
|
|
|
-// redPacketLog.setCompanyId(param.getCompanyId());
|
|
|
-// redPacketLog.setUserId(param.getUserId());
|
|
|
-// redPacketLog.setVideoId(param.getVideoId());
|
|
|
-// redPacketLog.setStatus(0);
|
|
|
-// redPacketLog.setQwUserId(param.getQwUserId() != null ? param.getQwUserId() : null);
|
|
|
-// redPacketLog.setCompanyUserId(param.getCompanyUserId());
|
|
|
-// redPacketLog.setCreateTime(new Date());
|
|
|
-// redPacketLog.setAmount(amount);
|
|
|
-// redPacketLog.setWatchLogId(log.getLogId() != null ? log.getLogId() : null);
|
|
|
-// redPacketLog.setPeriodId(param.getPeriodId());
|
|
|
-// redPacketLog.setAppId(param.getAppId());
|
|
|
-// redPacketLogMapper.insertFsCourseRedPacketLog(redPacketLog);
|
|
|
-// return R.error("余额不足请稍等");
|
|
|
-// }
|
|
|
// 发送红包
|
|
|
R sendRedPacket = paymentService.sendRedPacket(packetParam);
|
|
|
if (sendRedPacket.get("code").equals(200)) {
|
|
@@ -1262,19 +1242,6 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
log.setRewardType(config.getRewardType());
|
|
|
courseWatchLogMapper.updateFsCourseWatchLog(log);
|
|
|
|
|
|
-
|
|
|
-// company.setMoney(subtract);
|
|
|
-// companyMapper.updateCompany(company);
|
|
|
-//
|
|
|
-// CompanyMoneyLogs logs=new CompanyMoneyLogs();
|
|
|
-// logs.setCompanyId(company.getCompanyId());
|
|
|
-// logs.setRemark("扣除红包金额");
|
|
|
-// logs.setMoney(amount.multiply(new BigDecimal(-1)));
|
|
|
-// logs.setLogsType(15);
|
|
|
-// logs.setBalance(company.getMoney());
|
|
|
-// logs.setCreateTime(new Date());
|
|
|
-// moneyLogsMapper.insertCompanyMoneyLogs(logs);
|
|
|
-
|
|
|
return sendRedPacket;
|
|
|
} else {
|
|
|
return R.error("奖励发送失败,请联系客服");
|
|
@@ -1287,7 +1254,7 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
redPacketLog.setCompanyId(param.getCompanyId());
|
|
|
redPacketLog.setUserId(param.getUserId());
|
|
|
redPacketLog.setVideoId(param.getVideoId());
|
|
|
- redPacketLog.setStatus(0);
|
|
|
+ redPacketLog.setStatus(1);
|
|
|
redPacketLog.setQwUserId(param.getQwUserId() != null ? param.getQwUserId() : null);
|
|
|
redPacketLog.setCompanyUserId(param.getCompanyUserId());
|
|
|
redPacketLog.setCreateTime(new Date());
|
|
@@ -1297,11 +1264,9 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
redPacketLog.setAppId(param.getAppId());
|
|
|
redPacketLogMapper.insertFsCourseRedPacketLog(redPacketLog);
|
|
|
|
|
|
- // 更新观看记录的奖励类型
|
|
|
-// if (param.getLinkType() == null || param.getLinkType() == 0) {
|
|
|
+ // 更新观看记录的奖励类
|
|
|
log.setRewardType(config.getRewardType());
|
|
|
courseWatchLogMapper.updateFsCourseWatchLog(log);
|
|
|
-// }
|
|
|
return R.ok("红包发送成功");
|
|
|
}
|
|
|
|