fix: 设备数限制
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user