Browse Source

fix 字典类型查询 项目信息点按照需求过滤所需字段

lvxianyun 3 years ago
parent
commit
5e1c448858

+ 1 - 1
adm-business/adm-middleware/src/main/java/com/persagy/proxy/calculation/model/AdmRelationAddRequest.java

@@ -34,7 +34,7 @@ public class AdmRelationAddRequest implements Serializable {
     @JSONField(name = "graphicType",alternateNames = {"parentCode","graphic_type"})
     private String graphicType;
 
-    /** 交付范围 0项目交付,1现场交付**/
+    /** 是否仅查看项目交付范围内数据:0/null-否 1-是 **/
     private Integer deliveryType;
 
 }

+ 15 - 0
adm-business/adm-middleware/src/main/java/com/persagy/proxy/dictionary/service/impl/AdmDictServiceImpl.java

@@ -404,6 +404,11 @@ public class AdmDictServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> imp
         //查询类型下的所有信息点信息
         AdmResponse admResponse = doQueryObjectInfo(context, request, AdmDictConstant.CLASS_CODE, clazz);
         List<AdmObjectInfo> admObjectInfos = (List<AdmObjectInfo>) admResponse.getContent();
+        //项目信息点 进行定制过滤
+        if(request.getType().equals(AdmProject.OBJ_TYPE)){
+            admObjectInfos = filterInfosForProject(admObjectInfos);
+            admResponse.setTotal(admObjectInfos.size()*1L);
+        }
         admObjectInfos = sortFuncidForEdit(admObjectInfos);
         //查询平台级信息点采集信息
         List<ObjectInfoCollect> commonObjectInfoCollect = queryObjectInfoCollect(context, "common", request.getType(), clazz);
@@ -625,6 +630,16 @@ public class AdmDictServiceImpl<T> extends AbstractAdmDictBaseServiceImpl<T> imp
         return resultOrders;
     }
 
+    /** 项目需要展示的信息点**/
+    private List<AdmObjectInfo> filterInfosForProject(List<AdmObjectInfo> list){
+        if(CollUtil.isEmpty(list)){
+            return Collections.emptyList();
+        }
+        List<String> projectCodes = Arrays.asList("businessOpeningTime","owner","property","designer","constructor","longitude",
+                "altitude","sFI","address","projUnderfloorNum","fireResistanceLev","projNeighborLocationMap","projLogo","projIntro",
+                "projHeight","projFuncType","projCoverArea","projCityLocationMap","projArea","assetManager");
+        return list.stream().filter(info -> projectCodes.contains(info.getCode())).collect(Collectors.toList());
+    }
     /**
      * 统计类型下的非静态信息点
      * @param context