|
@@ -418,6 +418,9 @@ public class IotDeviceController {
|
|
|
@PreAuthorize("@ss.hasPermission('rq:iot-device:query')")
|
|
@PreAuthorize("@ss.hasPermission('rq:iot-device:query')")
|
|
|
public CommonResult<PageResult<IotDeviceRespVO>> getIotDeviceTdPage(@Valid IotDevicePageReqVO pageReqVO) {
|
|
public CommonResult<PageResult<IotDeviceRespVO>> getIotDeviceTdPage(@Valid IotDevicePageReqVO pageReqVO) {
|
|
|
List<String> codes = new ArrayList<>();
|
|
List<String> codes = new ArrayList<>();
|
|
|
|
|
+ if (Objects.nonNull(pageReqVO.getIfInline())&&pageReqVO.getIfInline()==0) {
|
|
|
|
|
+ pageReqVO.setIfInline(null);
|
|
|
|
|
+ }
|
|
|
PageResult<IotDeviceDO> pageResult = iotDeviceService.getIotDeviceTdPage(pageReqVO, codes);
|
|
PageResult<IotDeviceDO> pageResult = iotDeviceService.getIotDeviceTdPage(pageReqVO, codes);
|
|
|
if (CollUtil.isEmpty(pageResult.getList())) {
|
|
if (CollUtil.isEmpty(pageResult.getList())) {
|
|
|
return success(new PageResult<>(pageResult.getTotal()));
|
|
return success(new PageResult<>(pageResult.getTotal()));
|
|
@@ -462,7 +465,10 @@ public class IotDeviceController {
|
|
|
@PreAuthorize("@ss.hasPermission('rq:iot-device:query')")
|
|
@PreAuthorize("@ss.hasPermission('rq:iot-device:query')")
|
|
|
public CommonResult<PageResult<IotDeviceRespVO>> getIotDeviceTdPageLy(@Valid IotDevicePageReqVO pageReqVO) {
|
|
public CommonResult<PageResult<IotDeviceRespVO>> getIotDeviceTdPageLy(@Valid IotDevicePageReqVO pageReqVO) {
|
|
|
DevicePageReqVO devicePageReqVO = new DevicePageReqVO();
|
|
DevicePageReqVO devicePageReqVO = new DevicePageReqVO();
|
|
|
- devicePageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
|
|
|
|
+// devicePageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
|
|
+ if (Objects.nonNull(pageReqVO.getIfInline())&&pageReqVO.getIfInline()==0) {
|
|
|
|
|
+ pageReqVO.setIfInline(null);
|
|
|
|
|
+ }
|
|
|
//连油设备
|
|
//连油设备
|
|
|
devicePageReqVO.setProductId(649L);
|
|
devicePageReqVO.setProductId(649L);
|
|
|
List<String> codes = yfDeviceService.getDevicePage(devicePageReqVO).getList().stream().map(YfDeviceDO::getSerialNumber).collect(Collectors.toList());
|
|
List<String> codes = yfDeviceService.getDevicePage(devicePageReqVO).getList().stream().map(YfDeviceDO::getSerialNumber).collect(Collectors.toList());
|
|
@@ -484,6 +490,40 @@ public class IotDeviceController {
|
|
|
return success(result);
|
|
return success(result);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @GetMapping("/td/ly/screen")
|
|
|
|
|
+ @Operation(summary = "连油看板的设备信息")
|
|
|
|
|
+ @PreAuthorize("@ss.hasPermission('rq:iot-device:query')")
|
|
|
|
|
+ public CommonResult<PageResult<IotDeviceRespVO>> getIotDeviceTdLyScreen(@Valid IotDevicePageReqVO pageReqVO) {
|
|
|
|
|
+ DevicePageReqVO devicePageReqVO = new DevicePageReqVO();
|
|
|
|
|
+ devicePageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
|
|
+ if (Objects.nonNull(pageReqVO.getIfInline())&&pageReqVO.getIfInline()==0) {
|
|
|
|
|
+ pageReqVO.setIfInline(null);
|
|
|
|
|
+ }
|
|
|
|
|
+ //连油设备
|
|
|
|
|
+ devicePageReqVO.setProductId(649L);
|
|
|
|
|
+ List<YfDeviceDO> list = yfDeviceService.getDevicePage(devicePageReqVO).getList();
|
|
|
|
|
+ List<String> codes = list.stream().map(YfDeviceDO::getSerialNumber).collect(Collectors.toList());
|
|
|
|
|
+ PageResult<IotDeviceDO> pageResult = iotDeviceService.getIotDeviceTdPage(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());
|
|
|
|
|
+ DeptRespDTO dept = deptApi.getDept(iotDeviceRespVO.getDeptId());
|
|
|
|
|
+ iotDeviceRespVO.setDeviceName(Objects.nonNull(dept)?dept.getName()+" "+iotDeviceRespVO.getDeviceName():iotDeviceRespVO.getDeviceName());
|
|
|
|
|
+ list.stream().filter(e -> e.getSerialNumber().equals(iotDeviceRespVO.getDeviceCode())).findFirst().ifPresent(e ->{
|
|
|
|
|
+ iotDeviceRespVO.setMqttUrl("/"+e.getProductId()+"/"+iotDeviceRespVO.getDeviceCode()+"/property/post");
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return success(result);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
@GetMapping("/td/page/app")
|
|
@GetMapping("/td/page/app")
|
|
|
@Operation(summary = "获得设备台账包含数采信息")
|
|
@Operation(summary = "获得设备台账包含数采信息")
|