|
|
@@ -1157,10 +1157,10 @@ 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){
|
|
|
+ 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());
|
|
|
@@ -1174,8 +1174,8 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
// redPacketLog.setWatchLogId(log.getLogId() != null ? log.getLogId() : null);
|
|
|
// redPacketLog.setPeriodId(param.getPeriodId());
|
|
|
// redPacketLogMapper.insertFsCourseRedPacketLog(redPacketLog);
|
|
|
-// return R.error("余额不足请稍等");
|
|
|
-// }
|
|
|
+ return R.error("红包领取失败,请联系对应管理员");
|
|
|
+ }
|
|
|
// 发送红包
|
|
|
R sendRedPacket = paymentService.sendRedPacket(packetParam);
|
|
|
if (sendRedPacket.get("code").equals(200)) {
|
|
|
@@ -1936,14 +1936,14 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
duration = Objects.isNull(watchLog) ? 0 : watchLog.getDuration();
|
|
|
}
|
|
|
//
|
|
|
- if (courseVideoDetails != null && courseVideoDetails.getDuration() != null){
|
|
|
- // 查询视频是否设置了红包,没有就不提示
|
|
|
- Integer fsUserCourseVideoRedPackage = fsUserCourseVideoRedPackageMapper.selectRedPacketByCompanyCount(param.getVideoId(), null, param.getPeriodId());
|
|
|
- if(fsUserCourseVideoRedPackage>0){
|
|
|
- tipsTime = courseVideoDetails.getDuration() / 3;
|
|
|
- tipsTime2 = (courseVideoDetails.getDuration() * 2) / 3;
|
|
|
- }
|
|
|
- }
|
|
|
+// if (courseVideoDetails != null && courseVideoDetails.getDuration() != null){
|
|
|
+// // 查询视频是否设置了红包,没有就不提示
|
|
|
+// Integer fsUserCourseVideoRedPackage = fsUserCourseVideoRedPackageMapper.selectRedPacketByCompanyCount(param.getVideoId(), null, param.getPeriodId());
|
|
|
+// if(fsUserCourseVideoRedPackage>0){
|
|
|
+// tipsTime = courseVideoDetails.getDuration() / 3;
|
|
|
+// tipsTime2 = (courseVideoDetails.getDuration() * 2) / 3;
|
|
|
+// }
|
|
|
+// }
|
|
|
vo.setTipsTime(tipsTime);
|
|
|
vo.setTipsTime2(tipsTime2);
|
|
|
//判断是否完课
|