|
|
@@ -124,8 +124,17 @@ public class IotDeviceGroupController {
|
|
|
@Operation(summary = "获得某设备的成套信息")
|
|
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
|
@PreAuthorize("@ss.hasPermission('rq:iot-device-group:query')")
|
|
|
- public CommonResult<PageResult<IotDeviceGroupDetailDO>> getDeviceGroup(@Valid IotDeviceGroupDetailPageReqVO reqVO) {
|
|
|
+ public CommonResult<PageResult<IotDeviceGroupDetailRespVO>> getDeviceGroup(@Valid IotDeviceGroupDetailPageReqVO reqVO) {
|
|
|
PageResult<IotDeviceGroupDetailDO> deviceGroupList = iotDeviceGroupService.getDeviceGroupList(reqVO);
|
|
|
- return success(deviceGroupList);
|
|
|
+ List<IotDeviceGroupDetailRespVO> collect = deviceGroupList.getList().stream().map(e -> {
|
|
|
+ IotDeviceGroupDetailRespVO bean = BeanUtil.toBean(e, IotDeviceGroupDetailRespVO.class);
|
|
|
+ IotDeviceGroupDO iotDeviceGroup = iotDeviceGroupService.getIotDeviceGroup(e.getGroupId());
|
|
|
+ if (iotDeviceGroup != null) {
|
|
|
+ bean.setGroupName(iotDeviceGroup.getName());
|
|
|
+ }
|
|
|
+ return bean;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ return success(new PageResult<>(collect, deviceGroupList.getTotal()));
|
|
|
+// return success(deviceGroupList);
|
|
|
}
|
|
|
}
|