fix: 修复账单
This commit is contained in:
@@ -108,21 +108,26 @@ public class UAccountServiceImpl extends ServiceImpl<UAccountMapper, UAccount> i
|
||||
account.setBalance(BigDecimal.ZERO);
|
||||
}
|
||||
if (account.getBalance().compareTo(account.getBalanceUsed()) <= 0) {
|
||||
if (account.getBalanceUsed().compareTo(BigDecimal.ZERO) > 0) {
|
||||
UBill bill = new UBill();
|
||||
bill.setUserId(account.getUserId());
|
||||
bill.setType(2);
|
||||
bill.setStatus(1);
|
||||
bill.setAmount(account.getBalanceUsed());
|
||||
billMapper.insert(bill);
|
||||
}
|
||||
account.setBalanceUsed(BigDecimal.ZERO);
|
||||
account.setBalance(BigDecimal.ZERO);
|
||||
cancelUserIds.add(account.getUserId());
|
||||
|
||||
UBill bill = new UBill();
|
||||
bill.setUserId(account.getUserId());
|
||||
bill.setType(2);
|
||||
bill.setStatus(1);
|
||||
bill.setAmount(account.getBalanceUsed());
|
||||
billMapper.insert(bill);
|
||||
}
|
||||
this.updateById(account);
|
||||
}
|
||||
|
||||
for (UCdrLatestHistoryVo historyVo : latestHistoryList) {
|
||||
List<UBill> uBills = billMapper.selectList(Wrappers.<UBill>lambdaQuery().eq(UBill::getCdrHistoryId, historyVo.getId()));
|
||||
if (CollUtil.isNotEmpty(uBills)) {
|
||||
continue;
|
||||
}
|
||||
UBill bill = new UBill();
|
||||
bill.setUserId(historyVo.getUserId());
|
||||
bill.setCdrHistoryId(historyVo.getId());
|
||||
@@ -226,7 +231,6 @@ public class UAccountServiceImpl extends ServiceImpl<UAccountMapper, UAccount> i
|
||||
Date current = new Date();
|
||||
if (AccountUtil.isValid(account, current)) {
|
||||
wifiApi.authClient(client.getSiteId(), client.getClientMac());
|
||||
wifiApi.reconnectClient(client.getSiteId(), client.getClientMac());
|
||||
|
||||
// 带宽限速
|
||||
ClientRateLimitSettingDto clientRateLimitSetting = OmadaConvert.INSTANCE.toClientRateLimitSettingDto(account);
|
||||
|
||||
@@ -16,5 +16,6 @@
|
||||
LEFT JOIN u_cdr_history h ON h.id = b.cdr_history_id
|
||||
AND h.del_flag = 0
|
||||
AND b.user_id = #{userId}
|
||||
order by b.create_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user