|
@@ -235,8 +235,9 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
IPage<DeviceInfo> iPage = page(toIPage(pageBean), lqw);
|
|
IPage<DeviceInfo> iPage = page(toIPage(pageBean), lqw);
|
|
List<DeviceInfo> records = iPage.getRecords();
|
|
List<DeviceInfo> records = iPage.getRecords();
|
|
if (CollUtil.isNotEmpty(records)) {
|
|
if (CollUtil.isNotEmpty(records)) {
|
|
- records.forEach(r -> {
|
|
|
|
- Long deviceId = r.getDeviceId();
|
|
|
|
|
|
+ ThreadPoolUtils.Execute execute = ThreadPoolUtils.excPoll(DeviceThreadPoolConfig.TY_DEVICE_STATUS, records.size());
|
|
|
|
+ records.forEach(deviceInfo -> execute.execute(() -> {
|
|
|
|
+ Long deviceId = deviceInfo.getDeviceId();
|
|
/**
|
|
/**
|
|
* 请求状态码。
|
|
* 请求状态码。
|
|
* 1000: 未知的设备CPUID
|
|
* 1000: 未知的设备CPUID
|
|
@@ -245,19 +246,20 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
* 4000: 设备登记成功
|
|
* 4000: 设备登记成功
|
|
* 5000: 设备已禁⽤
|
|
* 5000: 设备已禁⽤
|
|
*/
|
|
*/
|
|
- String tyStatus = r.getThirdStatus();
|
|
|
|
|
|
+ String tyStatus = deviceInfo.getThirdStatus();
|
|
if (!"4000".equals(tyStatus)) {
|
|
if (!"4000".equals(tyStatus)) {
|
|
//未登记成功的需要实时查询
|
|
//未登记成功的需要实时查询
|
|
//查询登记设备
|
|
//查询登记设备
|
|
DeviceQueryVO deviceQueryVO = tyApiService.deviceQuery(new DeviceQueryDTO().setCpuId(String.valueOf(deviceId)));
|
|
DeviceQueryVO deviceQueryVO = tyApiService.deviceQuery(new DeviceQueryDTO().setCpuId(String.valueOf(deviceId)));
|
|
Integer status = deviceQueryVO.getStatus();
|
|
Integer status = deviceQueryVO.getStatus();
|
|
String message = deviceQueryVO.getMessage();
|
|
String message = deviceQueryVO.getMessage();
|
|
- r.setThirdStatus(String.valueOf(status));
|
|
|
|
- r.setThirdResult(message);
|
|
|
|
- updateById(r);
|
|
|
|
|
|
+ deviceInfo.setThirdStatus(String.valueOf(status));
|
|
|
|
+ deviceInfo.setThirdResult(message);
|
|
|
|
+ updateById(deviceInfo);
|
|
}
|
|
}
|
|
|
|
+ }));
|
|
|
|
+ execute.end();
|
|
|
|
|
|
- });
|
|
|
|
}
|
|
}
|
|
PageBean<DeviceInfoDto.Vo> voPageBean = toPageBean(DeviceInfoDto.Vo.class, iPage);
|
|
PageBean<DeviceInfoDto.Vo> voPageBean = toPageBean(DeviceInfoDto.Vo.class, iPage);
|
|
|
|
|