This commit is contained in:
张良(004796)
2024-05-13 14:16:53 +08:00
parent 5503eb04b4
commit bd32eeaad1

View File

@@ -356,7 +356,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
}else {
if(roomData.getPayIncome() > (diff - roomData.getPayCoin())){ // 消费金额不够退,但是收益金额扣扣费
incsCoin = roomData.getPayCoin();
incsIncomeCoin = roomData.getPayIncome() - (diff - roomData.getPayCoin());
incsIncomeCoin = diff - roomData.getPayCoin();
} else { // 消费金额不够退 余额也不够退 能退多少是多少
incsCoin = roomData.getPayCoin();
incsIncomeCoin = roomData.getPayIncome();
@@ -420,10 +420,10 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
public static void main(String[] args) {
long incsCoin = 0L; // 需要退的金额
long incsIncomeCoin = 0L; // 需要退的收益金额
int diff = 40;
int diff = 0;
RoomData roomData = new RoomData();
roomData.setPayCoin(100);
roomData.setPayIncome(0);
roomData.setPayIncome(100);
Long payCoin = Long.valueOf(roomData.getPayCoin()); // 已经支付的余额
Long payIncome = Long.valueOf(roomData.getPayIncome()); // 已经支付的收益
if(roomData.getPayCoin() > diff){ // 消费的金额大于待退款金额
@@ -431,7 +431,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
}else {
if(roomData.getPayIncome() > (diff - roomData.getPayCoin())){ // 消费金额不够退,但是收益金额扣扣费
incsCoin = roomData.getPayCoin();
incsIncomeCoin = roomData.getPayIncome() - (diff - roomData.getPayCoin());
incsIncomeCoin = diff - roomData.getPayCoin();
} else { // 消费金额不够退 余额也不够退 能退多少是多少
incsCoin = roomData.getPayCoin();
incsIncomeCoin = roomData.getPayIncome();