Jelajahi Sumber

Merge branch 'usky-zyj' into server-165

james 2 minggu lalu
induk
melakukan
3c82913d83

+ 9 - 0
service-iot/service-iot-biz/src/main/java/com/usky/iot/controller/web/DmpDeviceInfoController.java

@@ -85,6 +85,15 @@ public class DmpDeviceInfoController {
         return ApiResult.success(dmpDeviceInfoService.pageWhite(dmpDeviceInfoRequest));
     }
 
+    /**
+     * 网关设备信息下拉接口
+     * @return
+     */
+    @GetMapping("gatewayDeviceList")
+    public ApiResult<List<DmpDeviceInfo>> gatewayDeviceList() {
+        return ApiResult.success(dmpDeviceInfoService.gatewayDeviceList());
+    }
+
     /**
      * 删除记录
      */

+ 2 - 0
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/DmpDeviceInfoService.java

@@ -41,6 +41,8 @@ public interface DmpDeviceInfoService extends CrudService<DmpDeviceInfo> {
 
     CommonPage<DmpDeviceInfo> pageWhite(DmpDeviceInfoRequest dmpDeviceInfoRequest);
 
+    List<DmpDeviceInfo> gatewayDeviceList();
+
     boolean remove(Integer id);
 
     /**

+ 240 - 66
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/impl/DmpDeviceInfoServiceImpl.java

@@ -172,6 +172,8 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
         Integer productId = requestVO.getProductId();
         Integer pageNum = requestVO.getPageNum();
         Integer pageSize = requestVO.getPageSize();
+        Integer categoryType = requestVO.getCategoryType();
+
 
         pageNum = (pageNum != null) ? pageNum : 1;
         pageSize = (pageSize != null) ? pageSize : 10;
@@ -188,37 +190,98 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
                 throw new BusinessException("设备uuid“deviceUuid“不能为空!");
             }
 
-            DmpTopicResponseVO add = new DmpTopicResponseVO();
-            add.setTopic("/usky/devices/" + deviceUuid + "/" + TopicInfo.ADD_REMARKS.getLetter());
-            add.setPublisher(TopicInfo.GATEWAY_DEVICE.getValue());
-            add.setSubscriber(TopicInfo.IOT_PLATFORM.getValue());
-            add.setRemarks(TopicInfo.ADD_REMARKS.getValue());
-            responseVOList.add(add);
-
-            DmpTopicResponseVO info = new DmpTopicResponseVO();
-            info.setTopic("/usky/devices/" + deviceUuid + "/" + TopicInfo.INFO_REMARKS.getLetter());
-            info.setPublisher(TopicInfo.GATEWAY_DEVICE.getValue());
-            info.setSubscriber(TopicInfo.IOT_PLATFORM.getValue());
-            info.setRemarks(TopicInfo.INFO_REMARKS.getValue());
-            responseVOList.add(info);
-
-            DmpTopicResponseVO control = new DmpTopicResponseVO();
-            control.setTopic("/usky/devices/" + deviceUuid + "/" + TopicInfo.CONTROL_REMARKS.getLetter());
-            control.setSubscriber(TopicInfo.GATEWAY_DEVICE.getValue());
-            control.setPublisher(TopicInfo.IOT_PLATFORM.getValue());
-            control.setRemarks(TopicInfo.CONTROL_REMARKS.getValue());
-            responseVOList.add(control);
-
-            DmpTopicResponseVO controlResponse = new DmpTopicResponseVO();
-            controlResponse.setTopic("/usky/devices/" + deviceUuid + "/" + TopicInfo.CONTROL_RESPONSE_REMARKS.getLetter());
-            controlResponse.setPublisher(TopicInfo.GATEWAY_DEVICE.getValue());
-            controlResponse.setSubscriber(TopicInfo.IOT_PLATFORM.getValue());
-            controlResponse.setRemarks(TopicInfo.CONTROL_RESPONSE_REMARKS.getValue());
-            responseVOList.add(controlResponse);
+            if(categoryType == 1){
+                DmpTopicResponseVO add = new DmpTopicResponseVO();
+                add.setTopic("/usky/devices/" + deviceUuid + "/add");
+                add.setPublisher("普通设备");
+                add.setSubscriber("物联网平台");
+                add.setRemarks("添加普通设备");
+                responseVOList.add(add);
+
+                DmpTopicResponseVO info = new DmpTopicResponseVO();
+                info.setTopic("/usky/devices/" + deviceUuid + "/info");
+                info.setPublisher("普通设备");
+                info.setSubscriber("物联网平台");
+                info.setRemarks("普通设备上报数据");
+                responseVOList.add(info);
+
+                DmpTopicResponseVO control = new DmpTopicResponseVO();
+                control.setTopic("/usky/devices/" + deviceUuid + "/control");
+                control.setPublisher("物联网平台");
+                control.setSubscriber("普通设备");
+                control.setRemarks("物联网平台给普通设备下发命令");
+                responseVOList.add(control);
+
+                DmpTopicResponseVO controlResponse = new DmpTopicResponseVO();
+                controlResponse.setTopic("/usky/devices/" + deviceUuid + "/controlResponse");
+                controlResponse.setPublisher("普通设备");
+                controlResponse.setSubscriber("物联网平台");
+                controlResponse.setRemarks("普通设备返回给物联网平台的命令响应");
+                responseVOList.add(controlResponse);
+            }else{
+                String gatewayUuid = requestVO.getGatewayUuid();
+
+                DmpTopicResponseVO add = new DmpTopicResponseVO();
+                add.setTopic("/usky/devices/" + gatewayUuid + "/add");
+                add.setPublisher("网关设备");
+                add.setSubscriber("物联网平台");
+                add.setRemarks("网关设备添加子设备");
+                responseVOList.add(add);
+
+                DmpTopicResponseVO info = new DmpTopicResponseVO();
+                info.setTopic("/usky/devices/" + gatewayUuid + "/info");
+                info.setPublisher("网关设备");
+                info.setSubscriber("物联网平台");
+                info.setRemarks("网关设备上报数据");
+                responseVOList.add(info);
+
+                DmpTopicResponseVO control = new DmpTopicResponseVO();
+                control.setTopic("/usky/devices/" + gatewayUuid + "/control");
+                control.setPublisher("物联网平台");
+                control.setSubscriber("网关设备");
+                control.setRemarks("物联网平台给网关设备下发命令");
+                responseVOList.add(control);
+
+                DmpTopicResponseVO controlResponse = new DmpTopicResponseVO();
+                controlResponse.setTopic("/usky/devices/" + gatewayUuid + "/controlResponse");
+                controlResponse.setPublisher("网关设备");
+                controlResponse.setSubscriber("物联网平台");
+                controlResponse.setRemarks("网关设备返回给物联网平台的命令响应");
+                responseVOList.add(controlResponse);
+            }
+
+//            DmpTopicResponseVO add = new DmpTopicResponseVO();
+//            add.setTopic("/usky/devices/" + deviceUuid + "/" + TopicInfo.ADD_REMARKS.getLetter());
+//            add.setPublisher(TopicInfo.GATEWAY_DEVICE.getValue());
+//            add.setSubscriber(TopicInfo.IOT_PLATFORM.getValue());
+//            add.setRemarks(TopicInfo.ADD_REMARKS.getValue());
+//            responseVOList.add(add);
+//
+//            DmpTopicResponseVO info = new DmpTopicResponseVO();
+//            info.setTopic("/usky/devices/" + deviceUuid + "/" + TopicInfo.INFO_REMARKS.getLetter());
+//            info.setPublisher(TopicInfo.GATEWAY_DEVICE.getValue());
+//            info.setSubscriber(TopicInfo.IOT_PLATFORM.getValue());
+//            info.setRemarks(TopicInfo.INFO_REMARKS.getValue());
+//            responseVOList.add(info);
+//
+//            DmpTopicResponseVO control = new DmpTopicResponseVO();
+//            control.setTopic("/usky/devices/" + deviceUuid + "/" + TopicInfo.CONTROL_REMARKS.getLetter());
+//            control.setSubscriber(TopicInfo.GATEWAY_DEVICE.getValue());
+//            control.setPublisher(TopicInfo.IOT_PLATFORM.getValue());
+//            control.setRemarks(TopicInfo.CONTROL_REMARKS.getValue());
+//            responseVOList.add(control);
+//
+//            DmpTopicResponseVO controlResponse = new DmpTopicResponseVO();
+//            controlResponse.setTopic("/usky/devices/" + deviceUuid + "/" + TopicInfo.CONTROL_RESPONSE_REMARKS.getLetter());
+//            controlResponse.setPublisher(TopicInfo.GATEWAY_DEVICE.getValue());
+//            controlResponse.setSubscriber(TopicInfo.IOT_PLATFORM.getValue());
+//            controlResponse.setRemarks(TopicInfo.CONTROL_RESPONSE_REMARKS.getValue());
+//            responseVOList.add(controlResponse);
 
         } else {
-            switch (topicType) {
-                case "add":
+            if(categoryType == 1){
+                switch (topicType) {
+                    case "add":
                     /*if (StringUtils.isBlank(productCode)) {
                         throw new BusinessException("产品编码“productCode”不能为空!");
                     } else if (StringUtils.isBlank(deviceId)) {
@@ -247,44 +310,138 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
                     String topicPayload = topicPayloadJson.toString();
                     add.setTopicPayload(topicPayload);
                     responseVOList.add(add);*/
-                    break;
-                case "info":
-                    if (StringUtils.isBlank(productCode)) {
+                        break;
+                    case "info":
+                        if (StringUtils.isBlank(productCode)) {
+                            throw new BusinessException("产品编码“productCode”不能为空!");
+                        } else if (productId == null) {
+                            throw new BusinessException("产品ID“productId“不能为空!");
+                        } else if (StringUtils.isBlank(deviceId)) {
+                            throw new BusinessException("设备编号“deviceId”不能为空!");
+                        }
+
+                        DmpTopicResponseVO info = new DmpTopicResponseVO();
+                        info.setTopic("/usky/devices/" + deviceUuid + "/info");
+                        info.setPublisher("普通设备");
+                        info.setSubscriber("物联网平台");
+                        info.setRemarks("普通设备上报数据");
+
+                        // 组装topicPayload
+                        JSONObject infoPayloadJson = new JSONObject();
+                        infoPayloadJson.put("productCode", productCode);
+                        infoPayloadJson.put("deviceUuid", deviceUuid);
+                        Long timestamp = System.currentTimeMillis();
+                        infoPayloadJson.put("timestamp", timestamp);
+
+                        JSONObject metricsJson = new JSONObject();
+                        List<DmpProductAttribute> productAttributeList = getProductAttributeList(productId);
+                        for (DmpProductAttribute productAttribute : productAttributeList) {
+                            metricsJson.put(productAttribute.getAttributeCode(), productAttribute.getMaximum());
+                        }
+                        infoPayloadJson.put("metrics", metricsJson);
+
+                        JSONObject tagsJson = new JSONObject();
+                        tagsJson.put("device_id", deviceId);
+                        infoPayloadJson.put("tags", tagsJson);
+                        String infoPayload = infoPayloadJson.toString();
+                        info.setTopicPayload(infoPayload);
+                        info.setProductAttributeList(productAttributeList);
+                        responseVOList.add(info);
+                        break;
+                    case "control":
+                    /*if (StringUtils.isBlank(deviceUuid)) {
+                        throw new BusinessException("设备uuid“deviceUuid“不能为空!");
+                    }else if (StringUtils.isBlank(productCode)){
+                        throw new BusinessException("产品编码“productCode”不能为空!");
+                    }
+
+                    DmpTopicResponseVO control = new DmpTopicResponseVO();
+                    control.setTopic("/" + deviceUuid + "/" + TopicInfo.CONTROL_REMARKS.getLetter());
+                    control.setPublisher(TopicInfo.IOT_PLATFORM.getValue());
+                    control.setSubscriber(TopicInfo.GATEWAY_DEVICE.getValue());
+                    control.setRemarks(TopicInfo.CONTROL_REMARKS.getValue());
+
+                    // 组装topicPayload
+                    JSONObject controlPayloadJson = new JSONObject();
+
+                    responseVOList.add(control);*/
+                        break;
+                    case "controlResponse":
+                        break;
+                    default:
+                        throw new BusinessException("topicType参数错误!");
+                }
+            }else{
+                String gatewayUuid = requestVO.getGatewayUuid();
+                switch (topicType) {
+                    case "add":
+                    /*if (StringUtils.isBlank(productCode)) {
                         throw new BusinessException("产品编码“productCode”不能为空!");
-                    } else if (productId == null) {
-                        throw new BusinessException("产品ID“productId“不能为空!");
                     } else if (StringUtils.isBlank(deviceId)) {
                         throw new BusinessException("设备编号“deviceId”不能为空!");
+                    } else if (StringUtils.isBlank(deviceName)) {
+                        throw new BusinessException("设备名“deviceName“不能为空!");
                     }
 
-                    DmpTopicResponseVO info = new DmpTopicResponseVO();
-                    info.setTopic("/" + productCode + "/" + deviceId + "/" + TopicInfo.INFO_REMARKS.getLetter());
-                    info.setPublisher(TopicInfo.GATEWAY_DEVICE.getValue());
-                    info.setSubscriber(TopicInfo.IOT_PLATFORM.getValue());
-                    info.setRemarks(TopicInfo.INFO_REMARKS.getValue());
+                    DmpTopicResponseVO add = new DmpTopicResponseVO();
+                    add.setTopic("/" + productCode + "/" + deviceId + "/" + TopicInfo.ADD_REMARKS.getLetter());
+                    add.setPublisher(TopicInfo.GATEWAY_DEVICE.getValue());
+                    add.setSubscriber(TopicInfo.IOT_PLATFORM.getValue());
+                    add.setRemarks(TopicInfo.ADD_REMARKS.getValue());
 
                     // 组装topicPayload
-                    JSONObject infoPayloadJson = new JSONObject();
-                    infoPayloadJson.put("productCode", productCode);
-                    Long timestamp = System.currentTimeMillis();
-                    infoPayloadJson.put("timestamp", timestamp);
-
-                    JSONObject metricsJson = new JSONObject();
-                    List<DmpProductAttribute> productAttributeList = getProductAttributeList(productId);
-                    for (DmpProductAttribute productAttribute : productAttributeList) {
-                        metricsJson.put(productAttribute.getAttributeCode(), productAttribute.getMaximum());
+                    JSONObject topicPayloadJson = new JSONObject();
+                    topicPayloadJson.put("productCode", productCode);
+                    topicPayloadJson.put("deviceId", deviceId);
+                    topicPayloadJson.put("deviceName", deviceName);
+                    if (!StringUtils.isBlank(simCode)) {
+                        topicPayloadJson.put("simCode", simCode);
                     }
-                    infoPayloadJson.put("metrics", metricsJson);
-
-                    JSONObject tagsJson = new JSONObject();
-                    tagsJson.put("device_id", deviceId);
-                    infoPayloadJson.put("tags", tagsJson);
-                    String infoPayload = infoPayloadJson.toString();
-                    info.setTopicPayload(infoPayload);
-                    info.setProductAttributeList(productAttributeList);
-                    responseVOList.add(info);
-                    break;
-                case "control":
+                    if (!StringUtils.isBlank(installAddress)) {
+                        topicPayloadJson.put("installAddress", installAddress);
+                    }
+                    String topicPayload = topicPayloadJson.toString();
+                    add.setTopicPayload(topicPayload);
+                    responseVOList.add(add);*/
+                        break;
+                    case "info":
+                        if (StringUtils.isBlank(productCode)) {
+                            throw new BusinessException("产品编码“productCode”不能为空!");
+                        } else if (productId == null) {
+                            throw new BusinessException("产品ID“productId“不能为空!");
+                        } else if (StringUtils.isBlank(deviceId)) {
+                            throw new BusinessException("设备编号“deviceId”不能为空!");
+                        }
+
+                        DmpTopicResponseVO info = new DmpTopicResponseVO();
+                        info.setTopic("/usky/devices/" + gatewayUuid + "/info");
+                        info.setPublisher("网关设备");
+                        info.setSubscriber("物联网平台");
+                        info.setRemarks("网关设备上报数据");
+
+                        // 组装topicPayload
+                        JSONObject infoPayloadJson = new JSONObject();
+                        infoPayloadJson.put("productCode", productCode);
+                        infoPayloadJson.put("deviceUuid", deviceUuid);
+                        Long timestamp = System.currentTimeMillis();
+                        infoPayloadJson.put("timestamp", timestamp);
+
+                        JSONObject metricsJson = new JSONObject();
+                        List<DmpProductAttribute> productAttributeList = getProductAttributeList(productId);
+                        for (DmpProductAttribute productAttribute : productAttributeList) {
+                            metricsJson.put(productAttribute.getAttributeCode(), productAttribute.getMaximum());
+                        }
+                        infoPayloadJson.put("metrics", metricsJson);
+
+                        JSONObject tagsJson = new JSONObject();
+                        tagsJson.put("device_id", deviceId);
+                        infoPayloadJson.put("tags", tagsJson);
+                        String infoPayload = infoPayloadJson.toString();
+                        info.setTopicPayload(infoPayload);
+                        info.setProductAttributeList(productAttributeList);
+                        responseVOList.add(info);
+                        break;
+                    case "control":
                     /*if (StringUtils.isBlank(deviceUuid)) {
                         throw new BusinessException("设备uuid“deviceUuid“不能为空!");
                     }else if (StringUtils.isBlank(productCode)){
@@ -301,11 +458,12 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
                     JSONObject controlPayloadJson = new JSONObject();
 
                     responseVOList.add(control);*/
-                    break;
-                case "controlResponse":
-                    break;
-                default:
-                    throw new BusinessException("topicType参数错误!");
+                        break;
+                    case "controlResponse":
+                        break;
+                    default:
+                        throw new BusinessException("topicType参数错误!");
+                }
             }
         }
 
@@ -479,7 +637,7 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
         IPage<DmpDeviceInfo> page = new Page<>(pageCurrent, pageSize);
 
         if (diRequest.getDeviceStatus() != null) {
-            if (StringUtils.isNotBlank(diRequest.getDeviceId()) || StringUtils.isNotBlank(diRequest.getDeviceUuid()) || StringUtils.isNotBlank(diRequest.getDeviceName()) || diRequest.getProductId() != null || StringUtils.isNotBlank(diRequest.getProductCode()) || diRequest.getServiceStatus() != null) {
+            if (StringUtils.isNotBlank(diRequest.getDeviceId()) || StringUtils.isNotBlank(diRequest.getDeviceUuid()) || StringUtils.isNotBlank(diRequest.getDeviceName()) || diRequest.getProductId() != null || StringUtils.isNotBlank(diRequest.getProductCode()) || diRequest.getServiceStatus() != null || diRequest.getCategoryType() != null) {
                 LambdaQueryWrapper<DmpDeviceInfo> queryWrapper = Wrappers.lambdaQuery();
                 queryWrapper.eq(StringUtils.isNotBlank(diRequest.getDeviceId()), DmpDeviceInfo::getDeviceId, diRequest.getDeviceId())
                         .eq(StringUtils.isNotBlank(diRequest.getDeviceUuid()), DmpDeviceInfo::getDeviceUuid, diRequest.getDeviceUuid())
@@ -487,6 +645,7 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
                         .eq(diRequest.getProductId() != null, DmpDeviceInfo::getProductId, diRequest.getProductId())
                         .like(StringUtils.isNotBlank(diRequest.getProductCode()), DmpDeviceInfo::getProductCode, diRequest.getProductCode())
                         .eq(diRequest.getServiceStatus() != null, DmpDeviceInfo::getServiceStatus, diRequest.getServiceStatus())
+                        .eq(diRequest.getCategoryType() != null, DmpDeviceInfo::getCategoryType, diRequest.getCategoryType())
                         .eq(DmpDeviceInfo::getDeleteFlag, 0)
                         .eq(DmpDeviceInfo::getTenantId, SecurityUtils.getTenantId())
                         .orderByDesc(DmpDeviceInfo::getId);
@@ -597,6 +756,7 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
                     .eq(diRequest.getProductId() != null, DmpDeviceInfo::getProductId, diRequest.getProductId())
                     .like(StringUtils.isNotBlank(diRequest.getProductCode()), DmpDeviceInfo::getProductCode, diRequest.getProductCode())
                     .eq(diRequest.getServiceStatus() != null, DmpDeviceInfo::getServiceStatus, diRequest.getServiceStatus())
+                    .eq(diRequest.getCategoryType() != null, DmpDeviceInfo::getCategoryType, diRequest.getCategoryType())
                     .eq(DmpDeviceInfo::getDeleteFlag, 0)
                     .eq(DmpDeviceInfo::getTenantId, SecurityUtils.getTenantId());
 
@@ -674,13 +834,14 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
         }
 
         if (diRequest.getDeviceStatus() != null) {
-            if (StringUtils.isNotBlank(diRequest.getDeviceId()) || StringUtils.isNotBlank(diRequest.getDeviceName()) || diRequest.getProductId() != null || StringUtils.isNotBlank(diRequest.getProductCode()) || diRequest.getServiceStatus() != null) {
+            if (StringUtils.isNotBlank(diRequest.getDeviceId()) || StringUtils.isNotBlank(diRequest.getDeviceName()) || diRequest.getProductId() != null || StringUtils.isNotBlank(diRequest.getProductCode()) || diRequest.getServiceStatus() != null || diRequest.getCategoryType() != null) {
                 LambdaQueryWrapper<DmpDeviceInfo> queryWrapper = Wrappers.lambdaQuery();
                 queryWrapper.eq(StringUtils.isNotBlank(diRequest.getDeviceId()), DmpDeviceInfo::getDeviceId, diRequest.getDeviceId())
                         .like(StringUtils.isNotBlank(diRequest.getDeviceName()), DmpDeviceInfo::getDeviceName, diRequest.getDeviceName())
                         .eq(diRequest.getProductId() != null, DmpDeviceInfo::getProductId, diRequest.getProductId())
                         .like(StringUtils.isNotBlank(diRequest.getProductCode()), DmpDeviceInfo::getProductCode, diRequest.getProductCode())
                         .eq(diRequest.getServiceStatus() != null, DmpDeviceInfo::getServiceStatus, diRequest.getServiceStatus())
+                        .eq(diRequest.getCategoryType() != null, DmpDeviceInfo::getCategoryType, diRequest.getCategoryType())
                         .eq(DmpDeviceInfo::getDeleteFlag, 0)
                         .eq(DmpDeviceInfo::getTenantId, tenantId)
                         .orderByDesc(DmpDeviceInfo::getId);
@@ -790,6 +951,7 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
                     .eq(diRequest.getProductId() != null, DmpDeviceInfo::getProductId, diRequest.getProductId())
                     .like(StringUtils.isNotBlank(diRequest.getProductCode()), DmpDeviceInfo::getProductCode, diRequest.getProductCode())
                     .eq(diRequest.getServiceStatus() != null, DmpDeviceInfo::getServiceStatus, diRequest.getServiceStatus())
+                    .eq(diRequest.getCategoryType() != null, DmpDeviceInfo::getCategoryType, diRequest.getCategoryType())
                     .eq(DmpDeviceInfo::getDeleteFlag, 0)
                     .eq(DmpDeviceInfo::getTenantId, tenantId)
                     .orderByDesc(DmpDeviceInfo::getId);
@@ -831,6 +993,18 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
         return new CommonPage<>(page.getRecords(), page.getTotal(), pageSize, pageCurrent);
     }
 
+    @Override
+    public List<DmpDeviceInfo> gatewayDeviceList(){
+        LambdaQueryWrapper<DmpDeviceInfo> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.eq(DmpDeviceInfo::getCategoryType,2)
+                .eq(DmpDeviceInfo::getDeleteFlag, 0)
+                .eq(DmpDeviceInfo::getTenantId, SecurityUtils.getTenantId())
+                .orderByDesc(DmpDeviceInfo::getId);
+        List<DmpDeviceInfo> list1 = this.list(queryWrapper);
+
+        return list1;
+    }
+
     @Override
     public boolean remove(Integer id) {
         DmpDeviceInfo dmpDeviceInfo = this.getById(id);

+ 5 - 0
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/vo/DmpDeviceInfoRequest.java

@@ -56,4 +56,9 @@ public class DmpDeviceInfoRequest {
      */
     private String deviceUuid;
 
+    /**
+     * 设备所属类型(1、普通设备  2、网关设备  3、网关子设备)
+     */
+    private Integer categoryType;
+
 }

+ 10 - 0
service-iot/service-iot-biz/src/main/java/com/usky/iot/service/vo/DmpTopicRequestVO.java

@@ -76,4 +76,14 @@ public class DmpTopicRequestVO {
      **/
     private Integer pageSize;
 
+    /**
+     * 设备所属类型(1、普通设备  2、网关设备  3、网关子设备)
+     */
+    private Integer categoryType;
+
+    /**
+     * 所属网关
+     */
+    private String gatewayUuid;
+
 }