|
|
@@ -1443,6 +1443,12 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
logger.info("红包金额 {},红包商户号 {}",amount,packetParam);
|
|
|
//2025.6.19 红包金额为0的时候
|
|
|
if (amount.compareTo(BigDecimal.ZERO)>0){
|
|
|
+ // 检查公司余额是否足够
|
|
|
+ Company company = companyMapper.selectCompanyById(param.getCompanyId());
|
|
|
+ BigDecimal money = company.getMoney();
|
|
|
+ if (money.compareTo(amount) < 0) {
|
|
|
+ return R.error("服务商余额不足,请联系群主服务器充值!");
|
|
|
+ }
|
|
|
// 发送红包
|
|
|
return sendRedPacketRewardToUser(param, log, config, packetParam, amount);
|
|
|
} else {
|
|
|
@@ -1620,7 +1626,8 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
|
|
|
Company company = companyMapper.selectCompanyById(param.getCompanyId());
|
|
|
BigDecimal money = company.getMoney();
|
|
|
- if (money.compareTo(BigDecimal.ZERO)<=0) {
|
|
|
+ // 检查余额是否足够支付当前红包金额
|
|
|
+ if (money.compareTo(amount) < 0) {
|
|
|
return R.error("服务商余额不足,请联系群主服务器充值!");
|
|
|
}
|
|
|
|