|
@@ -248,10 +248,10 @@ public class IotDeviceController {
|
|
|
@PreAuthorize("@ss.hasPermission('rq:iot-device:query')")
|
|
|
public CommonResult<PageResult<IotDeviceRespVO>> getIotDeviceTdPage(@Valid IotDevicePageReqVO pageReqVO) {
|
|
|
List<String> codes = new ArrayList<>();
|
|
|
- List<YfDeviceDO> allDevice = yfDeviceService.getAllDevice();
|
|
|
- allDevice.forEach(d -> {
|
|
|
- codes.add(d.getSerialNumber());
|
|
|
- });
|
|
|
+// List<YfDeviceDO> allDevice = yfDeviceService.getAllDevice();
|
|
|
+// allDevice.forEach(d -> {
|
|
|
+// codes.add(d.getSerialNumber());
|
|
|
+// });
|
|
|
PageResult<IotDeviceDO> pageResult = iotDeviceService.getIotDeviceTdPage(pageReqVO, codes);
|
|
|
if (CollUtil.isEmpty(pageResult.getList())) {
|
|
|
return success(new PageResult<>(pageResult.getTotal()));
|
|
@@ -263,25 +263,33 @@ public class IotDeviceController {
|
|
|
for (IotDeviceRespVO iotDeviceRespVO : result.getList()) {
|
|
|
IotProductClassifyDO iotProductClassify = iotProductClassifyService.getIotProductClassify(iotDeviceRespVO.getAssetClass());
|
|
|
iotDeviceRespVO.setAssetClassName(iotProductClassify.getName());
|
|
|
- String deviceCode = iotDeviceRespVO.getDeviceCode();
|
|
|
- allDevice.stream().filter(e -> e.getSerialNumber().equals(deviceCode)).findFirst().ifPresent(e -> {
|
|
|
- iotDeviceRespVO.setIfInline(e.getStatus());
|
|
|
- Integer i = deviceMapper.tableIfExist(e.getSerialNumber().toLowerCase());
|
|
|
- if (i==1) {
|
|
|
- List<DeviceVO> deviceVOS = deviceMapper.selectLastTime(e.getSerialNumber());
|
|
|
- if (CollUtil.isNotEmpty(deviceVOS)) {
|
|
|
- Timestamp ts = deviceVOS.get(0).getTs();
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
- String format = sdf.format(ts);
|
|
|
- iotDeviceRespVO.setLastInlineTime(format);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
}
|
|
|
+// for (IotDeviceRespVO iotDeviceRespVO : result.getList()) {
|
|
|
+// IotProductClassifyDO iotProductClassify = iotProductClassifyService.getIotProductClassify(iotDeviceRespVO.getAssetClass());
|
|
|
+// iotDeviceRespVO.setAssetClassName(iotProductClassify.getName());
|
|
|
+// String deviceCode = iotDeviceRespVO.getDeviceCode();
|
|
|
+// allDevice.stream().filter(e -> e.getSerialNumber().equals(deviceCode)).findFirst().ifPresent(e -> {
|
|
|
+// iotDeviceRespVO.setIfInline(e.getStatus());
|
|
|
+// Integer i = deviceMapper.tableIfExist(e.getSerialNumber().toLowerCase());
|
|
|
+// if (i==1) {
|
|
|
+// List<DeviceVO> deviceVOS = deviceMapper.selectLastTime(e.getSerialNumber());
|
|
|
+// if (CollUtil.isNotEmpty(deviceVOS)) {
|
|
|
+// Timestamp ts = deviceVOS.get(0).getTs();
|
|
|
+// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+// String format = sdf.format(ts);
|
|
|
+// iotDeviceRespVO.setLastInlineTime(format);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// });
|
|
|
+//
|
|
|
+// }
|
|
|
+
|
|
|
return success(result);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
@GetMapping("/td/test")
|
|
|
@Operation(summary = "获得设备台账包含数采信息")
|
|
|
@PermitAll
|