浏览代码

解决java错误

yucheng 3 年之前
父节点
当前提交
2c3be2b661

+ 77 - 81
revit-algorithm/src/main/kotlin/cn/sagacloud/server/algorithm/common/utils/FloorLevelCheckUtil.kt

@@ -1,12 +1,11 @@
-package cn.sagacloud.server.algorithm.common.utils;
+package cn.sagacloud.server.algorithm.common.utils
 
-import cn.sagacloud.server.algorithm.models.dataCheck.LevelCheckResult;
-import cn.sagacloud.server.algorithm.models.modelFile.FloorModelView;
-import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.BeanUtils;
-
-import java.util.*;
+import cn.sagacloud.server.algorithm.models.dataCheck.LevelCheckResult
+import cn.sagacloud.server.algorithm.models.modelFile.FloorModelView
+import org.apache.commons.collections4.CollectionUtils
+import org.apache.commons.lang3.StringUtils
+import org.springframework.beans.BeanUtils
+import java.util.*
 
 /**
  * 楼层号检查
@@ -14,128 +13,125 @@ import java.util.*;
  * @author Administrator
  * @date 2021-10-21
  */
-public class FloorLevelCheckUtil {
-
+object FloorLevelCheckUtil {
     /**
      * 检查
      * @param views
      * @return
      */
-    public static List<LevelCheckResult> checkLevel(List<FloorModelView> views) {
-        if(CollectionUtils.isEmpty(views)) {
-            return null;
+    fun checkLevel(views: List<FloorModelView?>): List<LevelCheckResult>? {
+        if (CollectionUtils.isEmpty(views)) {
+            return null
         }
         // 排序
-        FloorModelView[] viewArr = views.toArray(new FloorModelView[0]);
-        Arrays.sort(viewArr, new FloorModelCompare());
-        Set<String> errorIds = new HashSet<>();
-        FloorModelView lastView = null;
+        val viewArr: Array<FloorModelView?> = views.toTypedArray()
+        Arrays.sort(viewArr, FloorModelCompare())
+        val errorIds: MutableSet<String?> = HashSet()
+        var lastView: FloorModelView? = null
         // 检查有楼层号异常的楼层
-        for(FloorModelView view:viewArr) {
-            Double level = view.getBaseLevel();
-            if(level != null && (lastView == null || level > lastView.getBaseLevel())) {
-                lastView = view;
-                continue;
+        for (view in viewArr) {
+            val level = view!!.baseLevel
+            if (level != null && (lastView == null || level > lastView.baseLevel!!)) {
+                lastView = view
+                continue
             }
             // 将前后的模型ID放入异常队列
-            errorIds.add(lastView.getCurrentModelId());
-            errorIds.add(view.getCurrentModelId());
-            lastView = null;
+            errorIds.add(lastView!!.currentModelId)
+            errorIds.add(view.currentModelId)
+            lastView = null
         }
         // 回写结果,按原顺序
-        List<LevelCheckResult> result = new ArrayList<>();
-        for(FloorModelView view:views) {
-            LevelCheckResult rs = new LevelCheckResult();
-            BeanUtils.copyProperties(view, rs);
-            rs.setHasError(errorIds.contains(view.getCurrentModelId()));
-            rs.setErrorMsg(rs.getHasError()?"标高冲突":null);
-            result.add(rs);
+        val result: MutableList<LevelCheckResult> = ArrayList()
+        for (view in views) {
+            val rs = LevelCheckResult()
+            BeanUtils.copyProperties(view, rs)
+            rs.hasError = errorIds.contains(view!!.currentModelId)
+            rs.errorMsg = if (rs.hasError!!) "标高冲突" else null
+            result.add(rs)
         }
-        return result;
+        return result
     }
 
     /**
      * 楼层比较器
      */
-    protected static class FloorModelCompare implements Comparator<FloorModelView> {
-
-        @Override
-        public int compare(FloorModelView v1, FloorModelView v2) {
-            if(v1 == null || v2 == null) {
-                return v1 == null ? 1 : -1;
+    class FloorModelCompare : Comparator<FloorModelView?> {
+        override fun compare(v1: FloorModelView?, v2: FloorModelView?): Int {
+            if (v1 == null || v2 == null) {
+                return if (v1 == null) 1 else -1
             }
-            FloorLevel o1 = convertToFloorLevel(v1.getFloorName());
-            FloorLevel o2 = convertToFloorLevel(v2.getFloorName());
+            val o1 = convertToFloorLevel(v1.floorName)
+            val o2 = convertToFloorLevel(v2.floorName)
             // 如果楼层类型不一样
-            if(o1.type != o2.type) {
-                return o1.type - o2.type;
+            if (o1.type != o2.type) {
+                return o1.type - o2.type
             }
             // 楼层类型一样,则看层数
-            if(o1.level != o2.level) {
+            if (o1.level != o2.level) {
                 // 层号越大的越高,但地下则刚好相反
-                int result = o1.level - o2.level;
-                return o1.type == 0 ? -result:result;
+                val result = o1.level - o2.level
+                return if (o1.type == 0) -result else result
             }
             // 都一样则看夹层号,夹层号越大越高
-            if(o1.middle != o2.middle) {
-                return o1.middle - o2.middle;
-            }
-            return 0;
+            return if (o1.middle != o2.middle) {
+                o1.middle - o2.middle
+            } else 0
         }
 
-
         /**
          * 根据楼层名称转换楼层信息
          * @param floorName
          * @return
          */
-        protected FloorLevel convertToFloorLevel(String floorName) {
-            FloorLevel floor = new FloorLevel();
-            if(StringUtils.isBlank(floorName)) {
-                return floor;
+        protected fun convertToFloorLevel(floorName: String?): FloorLevel {
+            val floor = FloorLevel()
+            if (StringUtils.isBlank(floorName)) {
+                return floor
             }
             // 顶层夹层
-            if(floorName.startsWith("RFM")) {
-                floor.type = 2;
-                if(floorName.length() > 3) {
-                    floor.middle = Integer.valueOf(floorName.substring(3));
+            if (floorName!!.startsWith("RFM")) {
+                floor.type = 2
+                if (floorName.length > 3) {
+                    floor.middle = Integer.valueOf(floorName.substring(3))
                 }
-                return floor;
+                return floor
             }
             // 顶层
-            if(floorName.startsWith("RF")) {
-                floor.type = 2;
-                return floor;
+            if (floorName.startsWith("RF")) {
+                floor.type = 2
+                return floor
             }
             // 正常楼层/地下
-            if(floorName.startsWith("F") || floorName.startsWith("B")) {
-                floor.type = floorName.startsWith("F")?1:0;
+            if (floorName.startsWith("F") || floorName.startsWith("B")) {
+                floor.type = if (floorName.startsWith("F")) 1 else 0
                 // 是否有夹层
-                int mIndex = floorName.indexOf("M");
-                if(mIndex < 0) {
-                    floor.level = Integer.valueOf(floorName.substring(1));
+                val mIndex = floorName.indexOf("M")
+                if (mIndex < 0) {
+                    floor.level = Integer.valueOf(floorName.substring(1))
                 } else if (floorName.endsWith("M")) {
                     // 没夹层数也算没夹层
-                    floor.level = Integer.valueOf(floorName.substring(1, mIndex));
+                    floor.level = Integer.valueOf(floorName.substring(1, mIndex))
                 } else {
-                    floor.level = Integer.valueOf(floorName.substring(1, mIndex));
-                    floor.middle = Integer.valueOf(floorName.substring(mIndex+1));
+                    floor.level = Integer.valueOf(floorName.substring(1, mIndex))
+                    floor.middle = Integer.valueOf(floorName.substring(mIndex + 1))
                 }
-                return floor;
+                return floor
             }
-            return floor;
+            return floor
         }
     }
 
     /**
      * 楼层信息
      */
-    public static class FloorLevel {
-        /** 楼层类型:0-地下,1-正常,2-顶层 */
-        public int type = 1;
-        /** 楼层号 */
-        public int level = 1;
-        /** 夹层号 */
-        public int middle = 0;
+    class FloorLevel {
+        /** 楼层类型:0-地下,1-正常,2-顶层  */
+        var type = 1
+
+        /** 楼层号  */
+        var level = 1
+
+        /** 夹层号  */
+        var middle = 0
     }
-}
+}

+ 121 - 120
revit-algorithm/src/main/kotlin/cn/sagacloud/server/algorithm/common/utils/GridGroupUtil.kt

@@ -1,20 +1,16 @@
-package cn.sagacloud.server.algorithm.common.utils;
+package cn.sagacloud.server.algorithm.common.utils
 
-import cn.sagacloud.server.algorithm.models.dataCheck.GridCheckResult;
-import cn.sagacloud.server.algorithm.models.entities.Grid;
-import cn.sagacloud.server.algorithm.models.jsonAnalyzer.Location;
-import cn.sagacloud.server.algorithm.models.jsonAnalyzer.Point;
-import cn.sagacloud.server.algorithm.models.modelFile.FloorModelView;
-import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.collections4.MapUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.BeanUtils;
-
-import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import cn.sagacloud.server.algorithm.models.dataCheck.GridCheckResult
+import cn.sagacloud.server.algorithm.models.entities.Grid
+import cn.sagacloud.server.algorithm.models.jsonAnalyzer.Location
+import cn.sagacloud.server.algorithm.models.jsonAnalyzer.Point
+import cn.sagacloud.server.algorithm.models.modelFile.FloorModelView
+import org.apache.commons.collections4.CollectionUtils
+import org.apache.commons.collections4.MapUtils
+import org.apache.commons.lang3.StringUtils
+import org.springframework.beans.BeanUtils
+import java.math.BigDecimal
+import java.util.*
 
 /**
  * Grid分组工具
@@ -22,31 +18,30 @@ import java.util.Map;
  * @author Administrator
  * @date 2021-10-21
  */
-public class GridGroupUtil {
-
+object GridGroupUtil {
     /**
      * 获取分组信息
      * @param views
      * @param gridMap
      * @return
      */
-    public static List<GridCheckResult> checkGridUpright(List<FloorModelView> views, Map<String, List<Grid>> gridMap) {
-        if(CollectionUtils.isEmpty(views)) {
-            return null;
+    fun checkGridUpright(views: List<FloorModelView?>, gridMap: Map<String?, List<Grid>?>): List<GridCheckResult>? {
+        if (CollectionUtils.isEmpty(views)) {
+            return null
         }
         // 组装名称位置信息
-        Map<String, Map<String, Location>> gridNameMap = convertGridMap(gridMap);
+        val gridNameMap = convertGridMap(gridMap)
         // 获取分组
-        Map<String, Integer> groupMap = groupGrids(gridNameMap);
+        val groupMap = groupGrids(gridNameMap)
         // 转换结果
-        List<GridCheckResult> rsList = new ArrayList<>();
-        for(FloorModelView view:views) {
-            GridCheckResult rs = new GridCheckResult();
-            BeanUtils.copyProperties(view, rs);
-            rs.setGroupId(MapUtils.getInteger(groupMap, view.getCurrentModelId()));
-            rsList.add(rs);
+        val rsList: MutableList<GridCheckResult> = ArrayList()
+        for (view in views) {
+            val rs = GridCheckResult()
+            BeanUtils.copyProperties(view, rs)
+            rs.groupId = MapUtils.getInteger(groupMap, view!!.currentModelId)
+            rsList.add(rs)
         }
-        return rsList;
+        return rsList
     }
 
     /**
@@ -54,30 +49,30 @@ public class GridGroupUtil {
      * @param gridMap
      * @return
      */
-    private static Map<String, Map<String, Location>> convertGridMap(Map<String, List<Grid>> gridMap) {
-        if(MapUtils.isEmpty(gridMap)) {
-            return null;
+    private fun convertGridMap(gridMap: Map<String?, List<Grid>?>): Map<String?, Map<String?, Location>?>? {
+        if (MapUtils.isEmpty(gridMap)) {
+            return null
         }
         // 组装名称位置信息
-        Map<String, Map<String, Location>> gridNameMap = new HashMap<>(16);
-        for(String modelId:gridMap.keySet()) {
-            List<Grid> gridList = gridMap.get(modelId);
-            if(CollectionUtils.isEmpty(gridList)) {
-                continue;
+        val gridNameMap: MutableMap<String?, Map<String?, Location>?> = HashMap(16)
+        for (modelId in gridMap.keys) {
+            val gridList: List<Grid?>? = gridMap[modelId]
+            if (CollectionUtils.isEmpty(gridList)) {
+                continue
             }
-            Map<String, Location> nameMap = new HashMap<>(16);
-            gridNameMap.put(modelId, nameMap);
+            val nameMap: MutableMap<String?, Location> = HashMap(16)
+            gridNameMap[modelId] = nameMap
             // 获取Name, Location存入Map
-            for(Grid grid:gridList) {
-                String name = grid.getName();
-                Location location = grid.getLocation();
-                if(StringUtils.isBlank(name) || location == null) {
-                    continue;
+            for (grid in gridList!!) {
+                val name = grid!!.name
+                val location = grid.location
+                if (StringUtils.isBlank(name) || location == null) {
+                    continue
                 }
-                nameMap.put(name, location);
+                nameMap[name] = location
             }
         }
-        return gridNameMap;
+        return gridNameMap
     }
 
     /**
@@ -86,19 +81,22 @@ public class GridGroupUtil {
      * @param gridMap
      * @return
      */
-    private static Map<String, Integer> groupGrids(Map<String, Map<String, Location>> gridMap){
-        if(MapUtils.isEmpty(gridMap)) {
-            return null;
+    private fun groupGrids(gridMap: Map<String?, Map<String?, Location>?>?): Map<String?, Int?>? {
+        if (MapUtils.isEmpty(gridMap)) {
+            return null
         }
-        List<List<String>> modelIdList = groupGridToList(gridMap);
-        Map<String, Integer> modelIdMap = new HashMap<>(16);
-        for(int i = 0,j = modelIdList.size();i < j;i++) {
-            List<String> idList = modelIdList.get(i);
-            for(String modelId:idList) {
-                modelIdMap.put(modelId, i+1);
+        val modelIdList = groupGridToList(gridMap)
+        val modelIdMap: MutableMap<String?, Int?> = HashMap(16)
+        var i = 0
+        val j = modelIdList.size
+        while (i < j) {
+            val idList: List<String?> = modelIdList[i]
+            for (modelId in idList) {
+                modelIdMap[modelId] = i + 1
             }
+            i++
         }
-        return modelIdMap;
+        return modelIdMap
     }
 
     /**
@@ -107,41 +105,44 @@ public class GridGroupUtil {
      * @param gridMap
      * @return List<[id1,id2,id5],[id3,id4]>
      */
-    private static List<List<String>> groupGridToList(Map<String, Map<String, Location>> gridMap){
-        List<List<String>> modelIdList = new ArrayList<>();
+    private fun groupGridToList(gridMap: Map<String?, Map<String?, Location>?>?): List<MutableList<String?>> {
+        val modelIdList: MutableList<MutableList<String?>> = ArrayList()
         // 按ModelId循环
-        for(String modelId : gridMap.keySet()) {
+        for (modelId in gridMap!!.keys) {
             // 是否所有分组都有冲突
-            boolean isAllConflict = true;
+            var isAllConflict = true
             // 按分组循环
-            for(int i = 0,j = modelIdList.size();i < j;i++) {
-                List<String> idList = modelIdList.get(i);
+            var i = 0
+            val j = modelIdList.size
+            while (i < j) {
+                val idList = modelIdList[i]
                 // 当前分组内是否有冲突
-                boolean isConflict = false;
-                for(String toId:idList) {
-                    Map<String, Location> fromMap = gridMap.get(modelId);
-                    Map<String, Location> toMap = gridMap.get(modelIdList.get(i));
+                var isConflict = false
+                for (toId in idList) {
+                    val fromMap: Map<String?, Location?>? = gridMap[modelId]
+                    val toMap: Map<String?, Location?>? = gridMap[toId]
                     // 如果有冲突,则不再比较
                     if (isConflict(fromMap, toMap)) {
-                        isConflict = true;
-                        break;
+                        isConflict = true
+                        break
                     }
                 }
                 // 如果没有冲突,则放入此队列中
-                if(!isConflict) {
-                    idList.add(modelId);
-                    isAllConflict = false;
-                    break;
+                if (!isConflict) {
+                    idList.add(modelId)
+                    isAllConflict = false
+                    break
                 }
+                i++
             }
             // 如果所有分组内都有冲突,则新增分组
-            if(isAllConflict) {
-                List<String> idList = new ArrayList<>();
-                idList.add(modelId);
-                modelIdList.add(idList);
+            if (isAllConflict) {
+                val idList: MutableList<String?> = ArrayList()
+                idList.add(modelId)
+                modelIdList.add(idList)
             }
         }
-        return modelIdList;
+        return modelIdList
     }
 
     /**
@@ -150,27 +151,27 @@ public class GridGroupUtil {
      * @param toMap
      * @return
      */
-    private static boolean isConflict(Map<String, Location> fromMap, Map<String, Location> toMap) {
-        if(MapUtils.isEmpty(fromMap) || MapUtils.isEmpty(toMap)) {
-            return false;
+    private fun isConflict(fromMap: Map<String?, Location?>?, toMap: Map<String?, Location?>?): Boolean {
+        if (MapUtils.isEmpty(fromMap) || MapUtils.isEmpty(toMap)) {
+            return false
         }
         // 按名称循环处理
-        for(String name:fromMap.keySet()) {
-            if(!toMap.containsKey(name)) {
-                continue;
+        for (name in fromMap!!.keys) {
+            if (!toMap!!.containsKey(name)) {
+                continue
             }
             // 只处理名称相同的比较
-            Location from = fromMap.get(name);
-            Location to = toMap.get(name);
-            if(from == null || to == null) {
-                continue;
+            val from = fromMap[name]
+            val to = toMap[name]
+            if (from == null || to == null) {
+                continue
             }
             // 位置有冲突
-            if(isConflict(from, to)) {
-                return true;
+            if (isConflict(from, to)) {
+                return true
             }
         }
-        return false;
+        return false
     }
 
     /**
@@ -179,32 +180,32 @@ public class GridGroupUtil {
      * @param to
      * @return
      */
-    public static boolean isConflict(Location from, Location to) {
+    fun isConflict(from: Location, to: Location): Boolean {
         // 只有都是线的类型才判断冲突
-        if(!(StringUtils.contains(from.getType(), "Line")
-                && StringUtils.contains(to.getType(), from.getType()))) {
-            return false;
+        if (!(StringUtils.contains(from.type, "Line")
+                        && StringUtils.contains(to.type, from.type))) {
+            return false
         }
         // 点位应在2个以上
-        if(CollectionUtils.size(from.getPoints()) < 2 || CollectionUtils.size(to.getPoints()) < 2) {
-            return false;
+        if (CollectionUtils.size(from.points) < 2 || CollectionUtils.size(to.points) < 2) {
+            return false
         }
         // 取开始结束点位
-        Point fromBegin = from.getPoints().get(0);
-        Point fromEnd = from.getPoints().get(1);
-        Point toBegin = to.getPoints().get(0);
-        Point toEnd = to.getPoints().get(1);
+        val fromBegin = from.points!![0]
+        val fromEnd = from.points!![1]
+        val toBegin = to.points!![0]
+        val toEnd = to.points!![1]
         // 计算相对角度和偏移量
-        try {
-            BigDecimal fromAngle = calAngle(fromBegin, fromEnd);
-            BigDecimal fromOffset = calOffset(fromBegin, fromAngle);
-            BigDecimal toAngle = calAngle(toBegin, toEnd);
-            BigDecimal toOffset = calOffset(toBegin, toAngle);
+        return try {
+            val fromAngle = calAngle(fromBegin, fromEnd)
+            val fromOffset = calOffset(fromBegin, fromAngle)
+            val toAngle = calAngle(toBegin, toEnd)
+            val toOffset = calOffset(toBegin, toAngle)
             // 都相同则冲突
-            return fromAngle.equals(toAngle) && fromOffset.equals(toOffset);
-        } catch (Exception e) {
+            fromAngle == toAngle && fromOffset == toOffset
+        } catch (e: Exception) {
             // 计算异常则直接判断点位X坐标
-            return fromEnd.getX() == toBegin.getX() && fromEnd.getX() == toEnd.getX();
+            fromEnd.x == toBegin.x && fromEnd.x == toEnd.x
         }
     }
 
@@ -214,12 +215,12 @@ public class GridGroupUtil {
      * @param end
      * @return
      */
-    private static BigDecimal calAngle(Point begin, Point end) {
-        BigDecimal beginX = BigDecimal.valueOf(begin.getX());
-        BigDecimal beginY = BigDecimal.valueOf(begin.getY());
-        BigDecimal endX = BigDecimal.valueOf(end.getX());
-        BigDecimal endY = BigDecimal.valueOf(end.getY());
-        return beginY.subtract(endY).divide(beginX.subtract(endX));
+    private fun calAngle(begin: Point, end: Point): BigDecimal {
+        val beginX = BigDecimal.valueOf(begin.x)
+        val beginY = BigDecimal.valueOf(begin.y)
+        val endX = BigDecimal.valueOf(end.x)
+        val endY = BigDecimal.valueOf(end.y)
+        return beginY.subtract(endY).divide(beginX.subtract(endX))
     }
 
     /**
@@ -228,9 +229,9 @@ public class GridGroupUtil {
      * @param angle
      * @return
      */
-    private static BigDecimal calOffset(Point begin, BigDecimal angle) {
-        BigDecimal beginX = BigDecimal.valueOf(begin.getX());
-        BigDecimal beginY = BigDecimal.valueOf(begin.getY());
-        return beginY.subtract(angle.multiply(beginX));
+    private fun calOffset(begin: Point, angle: BigDecimal): BigDecimal {
+        val beginX = BigDecimal.valueOf(begin.x)
+        val beginY = BigDecimal.valueOf(begin.y)
+        return beginY.subtract(angle.multiply(beginX))
     }
-}
+}

+ 4 - 4
revit-algorithm/src/main/kotlin/cn/sagacloud/server/algorithm/common/utils/SpaceAffectUtil.kt

@@ -176,7 +176,7 @@ class SpaceAffectUtil {
     private fun querySpaceByFloorModel(projectId: String, modelId: String): List<DCISpace?>? {
         val request = SQueryRequest()
         request.pageSize = 500
-        request.filters = " model_id = '$modelId' "
+        request.filters = " modelId = '$modelId' "
         val cascade = SCascadeQuery()
         cascade.name = "spaceList"
         val cascades = ArrayList<SCascadeQuery>()
@@ -207,7 +207,7 @@ class SpaceAffectUtil {
     private fun queryModelFile(projectId: String, modelId: String): List<String>? {
         val modelFileService: SObjectService<ModelFile> = modelFileService
         val request = SQueryRequest()
-        request.filters = "model_floor_id = '$modelId' and removed = false and status = 4 and version is not null"
+        request.filters = "floorModelId = '$modelId' and removed = false and status = 4 and version is not null"
         request.orders = "version desc"
         val projection = ArrayList<String>()
         projection.add("id")
@@ -230,7 +230,7 @@ class SpaceAffectUtil {
         val spaceService: SObjectService<Space> = spaceService
         // 查询新模型的元空间
         var request = SQueryRequest()
-        request.filters = "model_id = '" + modelIds!![0] + "' "
+        request.filters = "modelId = '" + modelIds!![0] + "' "
         val projection = ArrayList<String>()
         projection.add("sourceId")
         projection.add("outline")
@@ -241,7 +241,7 @@ class SpaceAffectUtil {
         }
         // 查询旧模型的元空间
         request = SQueryRequest()
-        request.filters = "model_id = '" + modelIds[1] + "' "
+        request.filters = "modelId = '" + modelIds[1] + "' "
         response = spaceService.pageQuery(request, null)
         if (CollectionUtils.isNotEmpty(response.content)) {
             spaceMap[modelIds[1]] = response.content

+ 7 - 4
revit-algorithm/src/main/kotlin/cn/sagacloud/server/algorithm/services/modelCheck/ModelCheckService.kt

@@ -46,17 +46,20 @@ class ModelCheckService {
 //        queryBuilder.tableName = "revit_calc.check_grid_valid('${projectId}', '${folderId}', '${modelId}')"
         // 查询楼层模型
         var request = SQueryRequest()
-        request.filters = " folder_id = '"+ folderId!! +"' and ( status = 4 or fid = '" + modelId!! + "') ";
+        request.filters = " folderId = '"+ folderId!! +"' and ( status = 4 or currentModelId = '" + modelId!! + "') ";
         val select = FloorModelService.pageQuery(request)
         var list = select.content
         if(list == null || list.isEmpty()){
             return ArrayList()
         }
         // 收集modelId
-        val idSet = list.stream().map { FloorModelView::currentModelId }.collect(Collectors.toSet());
+        val idSet = HashSet<String>();
+        for(model in list) {
+            idSet.add(model.currentModelId!!)
+        }
         // 查询Grid
         var gridService = SObjectService(SMybatisDao(Grid::class.java))
-        val gridRs = gridService.pageQuery(SQueryRequest(), arrayListOf(SFilter.inList("model_id", arrayListOf(idSet))))
+        val gridRs = gridService.pageQuery(SQueryRequest(), arrayListOf(SFilter.inList("modelId", arrayListOf(idSet))))
         val grids = gridRs.content;
         val gridMap = grids!!.groupBy { it.id }
         // 获取分组
@@ -73,7 +76,7 @@ class ModelCheckService {
 //        return queryBuilder.exec()
         // 查询楼层模型
         var request = SQueryRequest()
-        request.filters = " folder_id = '"+ folderId!! +"' and ( status = 4 or fid = '" + modelId!! + "') ";
+        request.filters = " folderId = '"+ folderId!! +"' and ( status = 4 or currentModelId = '" + modelId!! + "') ";
         val select = FloorModelService.pageQuery(request)
         var list = select.content
         if(list == null || list.isEmpty()){