|
@@ -41,6 +41,7 @@ public class UserCoinServiceImpl extends ServiceImpl<UserCoinMapper, UserCoin> i
|
|
boolean rtn = update(new LambdaUpdateWrapper<UserCoin>().set(UserCoin::getCoin, userCoin.getCoin() + logCoin)
|
|
boolean rtn = update(new LambdaUpdateWrapper<UserCoin>().set(UserCoin::getCoin, userCoin.getCoin() + logCoin)
|
|
.eq(UserCoin::getUserId, userId).eq(UserCoin::getCoin, userCoin.getCoin()));
|
|
.eq(UserCoin::getUserId, userId).eq(UserCoin::getCoin, userCoin.getCoin()));
|
|
Assert.isTrue(rtn, "更新盲豆余额失败。userId:" + userId);
|
|
Assert.isTrue(rtn, "更新盲豆余额失败。userId:" + userId);
|
|
|
|
+ userCoin.setCoin(userCoin.getCoin() + logCoin);
|
|
}
|
|
}
|
|
|
|
|
|
UserCoinLog userCoinLog = new UserCoinLog();
|
|
UserCoinLog userCoinLog = new UserCoinLog();
|
|
@@ -67,7 +68,7 @@ public class UserCoinServiceImpl extends ServiceImpl<UserCoinMapper, UserCoin> i
|
|
UserCoinLog userCoinLog = new UserCoinLog();
|
|
UserCoinLog userCoinLog = new UserCoinLog();
|
|
userCoinLog.setUserId(userId);
|
|
userCoinLog.setUserId(userId);
|
|
userCoinLog.setType(CoinLogTypeEnum.EXCHANGE);
|
|
userCoinLog.setType(CoinLogTypeEnum.EXCHANGE);
|
|
- userCoinLog.setMoney(userCoin.getCoin());
|
|
|
|
|
|
+ userCoinLog.setMoney(userCoin.getCoin() - logCoin);
|
|
userCoinLog.setLogMoney(0 - logCoin);
|
|
userCoinLog.setLogMoney(0 - logCoin);
|
|
userCoinLog.setIncomeExpense(CoinLogTypeEnum.EXPENSES);
|
|
userCoinLog.setIncomeExpense(CoinLogTypeEnum.EXPENSES);
|
|
userCoinLog.setLogText("兑换商品");
|
|
userCoinLog.setLogText("兑换商品");
|