Browse Source

平面图根据设备查询专业bug修复

linhuili 3 years ago
parent
commit
bc5c61de45

+ 10 - 1
src/main/java/com/persagy/proxy/dictionary/controller/AdmLabslController.java

@@ -1,5 +1,6 @@
 package com.persagy.proxy.dictionary.controller;
 
+import cn.hutool.core.collection.CollUtil;
 import com.persagy.proxy.object.model.AdmObjectInfo;
 import com.persagy.proxy.dictionary.model.AdmObjectType;
 import com.persagy.proxy.adm.request.AdmResponse;
@@ -16,6 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
 
 import javax.ws.rs.QueryParam;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * @ClassName AdmLabslController
@@ -92,7 +94,14 @@ public class AdmLabslController {
     public AdmResponse queryMajorCategory(@QueryParam("projectId") String projectId,
                                           @RequestBody List<String> ids) throws Exception {
         InstanceUrlParam context = AdmContextUtil.toDmpContext();
-        return service.queryMajorCategory(context, ids , AdmObjectType.class);
+        if(CollUtil.isEmpty(ids)){
+            return AdmResponse.failure("项目下没有设备类型");
+        }
+        List<String> newIds = ids.stream().filter(id->"fisnull".equals(id)).collect(Collectors.toList());
+        if(CollUtil.isEmpty(newIds)){
+            return AdmResponse.failure("项目下没有设备类型");
+        }
+        return service.queryMajorCategory(context, newIds , AdmObjectType.class);
     }
 
 }