2
0

fix: 设备数限制

This commit is contained in:
caiyuchao
2025-02-24 12:08:17 +08:00
parent 5f8bdab765
commit 026bded12d
2 changed files with 10 additions and 1 deletions

View File

@@ -305,7 +305,7 @@ public class UAccountServiceImpl extends ServiceImpl<UAccountMapper, UAccount> i
if (account.getClientNumEnable()) {
int onlineClientNum = uClientService.getCurrentClients(client.getUserId()).size();
if (onlineClientNum > account.getClientNum()) {
if (onlineClientNum >= account.getClientNum()) {
return;
}
}

View File

@@ -82,6 +82,9 @@ public class UCdrServiceImpl extends ServiceImpl<UCdrMapper, UCdr> implements IU
@Autowired
private IWifiApi wifiApi;
@Autowired
private IUClientService uClientService;
@Override
public UCdrUserVo getByUser() {
@@ -153,6 +156,12 @@ public class UCdrServiceImpl extends ServiceImpl<UCdrMapper, UCdr> implements IU
for (UAccount account : accounts) {
if (Objects.equals(unAuthClient.getUserId(), account.getUserId())) {
if (AccountUtil.isValid(account, new Date())) {
if (account.getClientNumEnable()) {
int onlineClientNum = uClientService.getCurrentClients(account.getUserId()).size();
if (onlineClientNum >= account.getClientNum()) {
continue;
}
}
wifiApi.authClient(unAuthClient.getSiteId(), unAuthClient.getClientMac());
}
}