parent
d3271ef065
commit
1dd48cd195
|
@ -4,6 +4,7 @@ import com.dispose.common.DisposeCapacityType;
|
|||
import com.dispose.common.ObjectStatus;
|
||||
import com.dispose.pojo.entity.DisposeCapacity;
|
||||
import com.dispose.pojo.entity.DisposeDevice;
|
||||
import com.dispose.pojo.po.AbilityInfo;
|
||||
import com.dispose.service.AreaCodeManagerService;
|
||||
import com.dispose.service.DisposeAbilityRouterService;
|
||||
import com.dispose.service.DisposeDeviceManagerService;
|
||||
|
@ -11,6 +12,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
@ -76,13 +78,20 @@ public class AreaCodeManagerServiceImpl implements AreaCodeManagerService {
|
|||
*/
|
||||
@Override
|
||||
public int getAreaCodeOnlineDeviceNum(Integer areaCode) {
|
||||
List<AbilityInfo> devs = new ArrayList<>();
|
||||
List<DisposeDevice> disposeDevices = disposeDeviceManagerService.getAllDisposeDevice();
|
||||
return (int) disposeDevices.stream()
|
||||
|
||||
List<DisposeDevice> disDevs = disposeDevices.stream()
|
||||
.filter(v -> v.getAreaCode().equals(areaCode) && v.getStatus() == ObjectStatus.NORMAL)
|
||||
.filter(k -> disposeAbilityRouterService.getAbilityDevice(k.getId())
|
||||
.getDb()
|
||||
.getDeviceLinkStatus())
|
||||
.count();
|
||||
.collect(Collectors.toList());
|
||||
|
||||
disDevs.forEach(v -> {
|
||||
if (disposeAbilityRouterService.getAbilityDevice(v.getId()) != null) {
|
||||
devs.add(disposeAbilityRouterService.getAbilityDevice(v.getId()));
|
||||
}
|
||||
});
|
||||
|
||||
return (int) devs.stream().filter(v -> v.getDb().getDeviceLinkStatus()).count();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -107,7 +107,7 @@ public class JsonTestCaseRun extends CommonRestfulJson implements TestCaseRun {
|
|||
.filter(k -> k.getCaseJsonValue() != null && k.getCaseJsonValue().length() > 0)
|
||||
.filter(k -> usedId.size() == 0 || usedId.stream().anyMatch(v -> Objects.equals(v, k.getId())))
|
||||
.filter(k -> Arrays.stream(CommonEnvironment.commonPriorityFilter).anyMatch(v -> k.getPriority() == v))
|
||||
//.filter(k -> k.getId() >= 1300)
|
||||
//.filter(k -> k.getId() == 700)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
@ -130,8 +130,7 @@ public class JsonTestCaseRun extends CommonRestfulJson implements TestCaseRun {
|
|||
rspObject.getUrlPath(),
|
||||
rspObject.getRspClass(),
|
||||
rspObject.getRspCode(),
|
||||
rspObject.getAutoLogin() ? getLoginToken() :
|
||||
"",
|
||||
rspObject.getAutoLogin() ? getLoginToken() : "",
|
||||
true,
|
||||
rspObject.getMethod());
|
||||
|
||||
|
|
Loading…
Reference in New Issue