|
@@ -269,10 +269,6 @@ 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());
|
|
|
-// });
|
|
|
PageResult<IotDeviceDO> pageResult = iotDeviceService.getIotDeviceTdPage(pageReqVO, codes);
|
|
|
if (CollUtil.isEmpty(pageResult.getList())) {
|
|
|
return success(new PageResult<>(pageResult.getTotal()));
|
|
@@ -285,30 +281,30 @@ public class IotDeviceController {
|
|
|
IotProductClassifyDO iotProductClassify = iotProductClassifyService.getIotProductClassify(iotDeviceRespVO.getAssetClass());
|
|
|
iotDeviceRespVO.setAssetClassName(iotProductClassify.getName());
|
|
|
}
|
|
|
-// 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/page/app")
|
|
|
+ @Operation(summary = "获得设备台账包含数采信息")
|
|
|
+ @PreAuthorize("@ss.hasPermission('rq:iot-device:query')")
|
|
|
+ public CommonResult<PageResult<IotDeviceRespVO>> getIotDeviceTdPageApp(@Valid IotDevicePageReqVO pageReqVO) {
|
|
|
+ List<String> codes = new ArrayList<>();
|
|
|
+ PageResult<IotDeviceDO> pageResult = iotDeviceService.getIotDeviceTdPageApp(pageReqVO, codes);
|
|
|
+ if (CollUtil.isEmpty(pageResult.getList())) {
|
|
|
+ return success(new PageResult<>(pageResult.getTotal()));
|
|
|
+ }
|
|
|
+ Map<Long, DeptDO> deptMap = deptService.getDeptMap(
|
|
|
+ convertList(pageResult.getList(), IotDeviceDO::getDeptId));
|
|
|
+ PageResult<IotDeviceRespVO> result = new PageResult<>(IotDeviceConvert.INSTANCE.convertList(pageResult.getList(), deptMap),
|
|
|
+ pageResult.getTotal());
|
|
|
+ for (IotDeviceRespVO iotDeviceRespVO : result.getList()) {
|
|
|
+ IotProductClassifyDO iotProductClassify = iotProductClassifyService.getIotProductClassify(iotDeviceRespVO.getAssetClass());
|
|
|
+ iotDeviceRespVO.setAssetClassName(iotProductClassify.getName());
|
|
|
+ }
|
|
|
|
|
|
+ return success(result);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
@GetMapping("/td/test")
|