fix: 设备数限制
This commit is contained in:
@@ -305,7 +305,7 @@ public class UAccountServiceImpl extends ServiceImpl<UAccountMapper, UAccount> i
|
|||||||
|
|
||||||
if (account.getClientNumEnable()) {
|
if (account.getClientNumEnable()) {
|
||||||
int onlineClientNum = uClientService.getCurrentClients(client.getUserId()).size();
|
int onlineClientNum = uClientService.getCurrentClients(client.getUserId()).size();
|
||||||
if (onlineClientNum > account.getClientNum()) {
|
if (onlineClientNum >= account.getClientNum()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,6 +82,9 @@ public class UCdrServiceImpl extends ServiceImpl<UCdrMapper, UCdr> implements IU
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IWifiApi wifiApi;
|
private IWifiApi wifiApi;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IUClientService uClientService;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UCdrUserVo getByUser() {
|
public UCdrUserVo getByUser() {
|
||||||
@@ -153,6 +156,12 @@ public class UCdrServiceImpl extends ServiceImpl<UCdrMapper, UCdr> implements IU
|
|||||||
for (UAccount account : accounts) {
|
for (UAccount account : accounts) {
|
||||||
if (Objects.equals(unAuthClient.getUserId(), account.getUserId())) {
|
if (Objects.equals(unAuthClient.getUserId(), account.getUserId())) {
|
||||||
if (AccountUtil.isValid(account, new Date())) {
|
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());
|
wifiApi.authClient(unAuthClient.getSiteId(), unAuthClient.getClientMac());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user