Quellcode durchsuchen

平面图类型名称不展示问题bug修复

linhuili vor 3 Jahren
Ursprung
Commit
2ef9fa02b2

+ 20 - 3
src/main/java/com/persagy/proxy/dictionary/service/impl/AdmPlanarServiceImpl.java

@@ -25,6 +25,7 @@ import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 import java.util.stream.Collectors;
 /**
@@ -57,14 +58,30 @@ public class AdmPlanarServiceImpl extends AbstractAdmBaseServiceImpl<T> implemen
      */
     @Override
     public AdmResponse queryPlanarEquip(InstanceUrlParam context, AdmPlanarEquipRequests requests, Class<AdmEquipment> clazz) throws Exception {
-
+       AdmResponse admResponse = new AdmResponse();
        if(CollUtil.isEmpty(requests.getZoneTypes()) && CollUtil.isEmpty(requests.getSpaceIds()) && CollUtil.isEmpty(requests.getFuncTypes())){
            //查询建筑楼层下的所有设备(或指定类型下的设备)
-             return queryAdmEquip(context,requests,clazz);
+          admResponse = queryAdmEquip(context, requests, clazz);
        }else{
            //查询空间下的设备
-           return queryAdmEquipInSpace(context,requests,clazz);
+          admResponse = queryAdmEquipInSpace(context,requests,clazz);
+       }
+       //结果集处理,设置设备类型名称字段
+        List<AdmEquipment> content = (List<AdmEquipment>)admResponse.getContent();
+       if(CollUtil.isEmpty(content)){
+           return admResponse;
        }
+        for (AdmEquipment admEquipment : content) {
+            Map<String, String> equipCategory = admEquipment.getEquipCategory();
+            if(CollUtil.isEmpty(equipCategory)){
+                continue;
+            }
+            for (Map.Entry<String, String> entry : equipCategory.entrySet()) {
+                admEquipment.setCodeName(entry.getValue());
+            }
+        }
+        admResponse.setContent(content);
+        return admResponse;
     }
 
     /**