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