Selaa lähdekoodia

Merge branch 'release-floorplanai' into test

dengsixing 4 viikkoa sitten
vanhempi
commit
7dff59c1f6

+ 18 - 1
src/main/java/com/fdkankan/contro/service/impl/CommonServiceImpl.java

@@ -889,6 +889,7 @@ public class CommonServiceImpl implements ICommonService {
 
         try {
             String aiJsonKey = String.format(UploadFilePath.DATA_VIEW_PATH, num) + "floorplan/ai.json";
+            String aiEntireJsonKey = String.format(UploadFilePath.DATA_VIEW_PATH, num) + "floorplan/ai-entire.json";
             //先清空历史数据,因为数据格式改动很多个版本,已经无法按照规律进行过滤删除,所以这里先删除历史数据,而后再根据算法生成去插入数据
             sceneMarkShapeService.remove(new LambdaQueryWrapper<SceneMarkShape>().eq(SceneMarkShape::getNum, num).eq(SceneMarkShape::getType, DetectType.PLAN.getCode()));
             if(fYunFileService.fileExist(aiJsonKey)){
@@ -945,7 +946,21 @@ public class CommonServiceImpl implements ICommonService {
                     }
                 }
             }
-
+            //先上传一份带门窗的,完整的,绘图功能要用
+            fYunFileService.uploadFile(JSON.toJSONString(sceneMarkShapes).getBytes(StandardCharsets.UTF_8), aiEntireJsonKey);
+
+            //上传一份过滤掉门窗的,徐总要求过滤
+            for (SceneMarkShape sceneMarkShape : sceneMarkShapes) {
+                //徐总要求去掉门窗(因为门窗不属于家具)
+                List<JSONObject> shapes = sceneMarkShape.getShapes().stream().filter(v -> {
+                    String category = v.getString("category");
+                    if (StrUtil.isNotEmpty(category) && (category.contains("Door") || category.contains("Window"))) {
+                        return false;
+                    }
+                    return true;
+                }).collect(Collectors.toList());
+                sceneMarkShape.setShapes(shapes);
+            }
             fYunFileService.uploadFile(JSON.toJSONString(sceneMarkShapes).getBytes(StandardCharsets.UTF_8), aiJsonKey);
 
             return hasFloorplanAi;
@@ -956,4 +971,6 @@ public class CommonServiceImpl implements ICommonService {
 //            FileUtil.del(workDir);
         }
     }
+
+
 }