|
@@ -15,6 +15,8 @@ import com.game.business.domain.FinTranRecord;
|
|
import com.game.business.service.IFinTranRecordService;
|
|
import com.game.business.service.IFinTranRecordService;
|
|
import com.game.business.vo.ApiUserInfoVo;
|
|
import com.game.business.vo.ApiUserInfoVo;
|
|
import com.game.common.annotation.DataSource;
|
|
import com.game.common.annotation.DataSource;
|
|
|
|
+import com.game.common.constant.finance.FinTranType1;
|
|
|
|
+import com.game.common.constant.finance.FinTranType2;
|
|
import com.game.common.constant.finance.FinTranType3;
|
|
import com.game.common.constant.finance.FinTranType3;
|
|
import com.game.common.core.redis.RedisCache;
|
|
import com.game.common.core.redis.RedisCache;
|
|
import com.game.common.enums.DataSourceType;
|
|
import com.game.common.enums.DataSourceType;
|
|
@@ -175,7 +177,7 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> impl
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@DataSource(DataSourceType.SLAVE)
|
|
@DataSource(DataSourceType.SLAVE)
|
|
- public int updateUserAmount(FinTranRecord finTranRecord){
|
|
|
|
|
|
+ public int updateUserAmount(FinTranRecord finTranRecord,boolean withdrawAble){
|
|
int res = 0;
|
|
int res = 0;
|
|
int finRes = 0;
|
|
int finRes = 0;
|
|
RLock rLock = redisson.getLock("app_user_amount_".concat(String.valueOf(finTranRecord.getUid())));
|
|
RLock rLock = redisson.getLock("app_user_amount_".concat(String.valueOf(finTranRecord.getUid())));
|
|
@@ -196,6 +198,9 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> impl
|
|
updateAppUser.setDiamondCoin(finTranRecord.getDiamondCoinChange());
|
|
updateAppUser.setDiamondCoin(finTranRecord.getDiamondCoinChange());
|
|
updateAppUser.setDiamondCoinTotal(finTranRecord.getDiamondCoinChange());
|
|
updateAppUser.setDiamondCoinTotal(finTranRecord.getDiamondCoinChange());
|
|
updateAppUser.setDiamondCoinCash(MoneyUtils.consumeCash(appUser.getDiamondCoin(),appUser.getDiamondCoinCash(),finTranRecord.getDiamondCoinChange()));
|
|
updateAppUser.setDiamondCoinCash(MoneyUtils.consumeCash(appUser.getDiamondCoin(),appUser.getDiamondCoinCash(),finTranRecord.getDiamondCoinChange()));
|
|
|
|
+ if(withdrawAble){
|
|
|
|
+ updateAppUser.setWithdrawAble(finTranRecord.getDiamondCoinChange());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if(finTranRecord.getTranType3().intValue() == FinTranType3.CASH_DIAMOND_INCOME_BACK.getType()){
|
|
if(finTranRecord.getTranType3().intValue() == FinTranType3.CASH_DIAMOND_INCOME_BACK.getType()){
|
|
//回退已提现金额
|
|
//回退已提现金额
|
|
@@ -233,6 +238,12 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> impl
|
|
return res;
|
|
return res;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ @DataSource(DataSourceType.SLAVE)
|
|
|
|
+ public int updateUserAmount(FinTranRecord finTranRecord){
|
|
|
|
+ return updateUserAmount(finTranRecord,false);
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
@DataSource(DataSourceType.SLAVE)
|
|
@DataSource(DataSourceType.SLAVE)
|
|
public Map<String, BigDecimal> getUserCount(Long userId) {
|
|
public Map<String, BigDecimal> getUserCount(Long userId) {
|