|
@@ -81,6 +81,7 @@ import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeansException;
|
|
import org.springframework.beans.BeansException;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
+import org.springframework.data.redis.core.RedisTemplate;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
@@ -247,6 +248,8 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
@Autowired
|
|
@Autowired
|
|
private CloudHostProper cloudHostProper;
|
|
private CloudHostProper cloudHostProper;
|
|
|
|
|
|
|
|
+ private RedisTemplate<String,BigDecimal> redisTemplate;
|
|
|
|
+
|
|
|
|
|
|
/**
|
|
/**
|
|
* 查询课堂视频
|
|
* 查询课堂视频
|
|
@@ -1151,7 +1154,8 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
|
|
|
BigDecimal companyMoney = null;
|
|
BigDecimal companyMoney = null;
|
|
if(StringUtils.equals(ENABLE_RED_PACK_ACCOUNT,"1")) {
|
|
if(StringUtils.equals(ENABLE_RED_PACK_ACCOUNT,"1")) {
|
|
- companyMoney = redisCache.getCacheObject(REDPACKET_COMPANY_MONEY);
|
|
|
|
|
|
+ companyMoney = redisTemplate.opsForValue().get(REDPACKET_COMPANY_MONEY);
|
|
|
|
+
|
|
if(ObjectUtils.isNull(companyMoney)){
|
|
if(ObjectUtils.isNull(companyMoney)){
|
|
SysConfig sysConfig = sysConfigService.selectConfigByConfigKey("company.money");
|
|
SysConfig sysConfig = sysConfigService.selectConfigByConfigKey("company.money");
|
|
if(ObjectUtils.isNull(sysConfig)){
|
|
if(ObjectUtils.isNull(sysConfig)){
|
|
@@ -1207,7 +1211,7 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
logger.info("[更新账户余额] 当前余额{} 更新后余额{}",companyMoney.toPlainString(),companyMoney.subtract(amount).toPlainString());
|
|
logger.info("[更新账户余额] 当前余额{} 更新后余额{}",companyMoney.toPlainString(),companyMoney.subtract(amount).toPlainString());
|
|
|
|
|
|
companyMoney = companyMoney.subtract(amount);
|
|
companyMoney = companyMoney.subtract(amount);
|
|
- redisCache.setCacheObject(REDPACKET_COMPANY_MONEY,companyMoney);
|
|
|
|
|
|
+ redisTemplate.opsForValue().set(REDPACKET_COMPANY_MONEY,companyMoney);
|
|
}
|
|
}
|
|
return sendRedPacket;
|
|
return sendRedPacket;
|
|
} else {
|
|
} else {
|
|
@@ -1332,7 +1336,7 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
|
|
|
BigDecimal companyMoney = null;
|
|
BigDecimal companyMoney = null;
|
|
if(StringUtils.equals(ENABLE_RED_PACK_ACCOUNT,"1")) {
|
|
if(StringUtils.equals(ENABLE_RED_PACK_ACCOUNT,"1")) {
|
|
- companyMoney = redisCache.getCacheObject(REDPACKET_COMPANY_MONEY);
|
|
|
|
|
|
+ companyMoney = redisTemplate.opsForValue().get(REDPACKET_COMPANY_MONEY);
|
|
if(ObjectUtils.isNull(companyMoney)){
|
|
if(ObjectUtils.isNull(companyMoney)){
|
|
SysConfig sysConfig = sysConfigService.selectConfigByConfigKey("company.money");
|
|
SysConfig sysConfig = sysConfigService.selectConfigByConfigKey("company.money");
|
|
if(ObjectUtils.isNull(sysConfig)){
|
|
if(ObjectUtils.isNull(sysConfig)){
|
|
@@ -1386,7 +1390,7 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
logger.info("[更新账户余额] 当前余额{} 更新后余额{}",companyMoney.toPlainString(),companyMoney.subtract(amount).toPlainString());
|
|
logger.info("[更新账户余额] 当前余额{} 更新后余额{}",companyMoney.toPlainString(),companyMoney.subtract(amount).toPlainString());
|
|
|
|
|
|
companyMoney = companyMoney.subtract(amount);
|
|
companyMoney = companyMoney.subtract(amount);
|
|
- redisCache.setCacheObject(REDPACKET_COMPANY_MONEY,companyMoney);
|
|
|
|
|
|
+ redisTemplate.opsForValue().set(REDPACKET_COMPANY_MONEY,companyMoney);
|
|
}
|
|
}
|
|
|
|
|
|
return sendRedPacket;
|
|
return sendRedPacket;
|