dengsixing 2 月之前
父节点
当前提交
1268a88920

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

@@ -594,6 +594,7 @@ public class CommonServiceImpl implements ICommonService {
 
 
         try {
         try {
             String aiJsonKey = String.format(UploadFilePath.DATA_VIEW_PATH, num) + "floorplan/ai.json";
             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()));
             sceneMarkShapeService.remove(new LambdaQueryWrapper<SceneMarkShape>().eq(SceneMarkShape::getNum, num).eq(SceneMarkShape::getType, DetectType.PLAN.getCode()));
             if(fYunFileService.fileExist(aiJsonKey)){
             if(fYunFileService.fileExist(aiJsonKey)){
@@ -650,7 +651,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);
             fYunFileService.uploadFile(JSON.toJSONString(sceneMarkShapes).getBytes(StandardCharsets.UTF_8), aiJsonKey);
 
 
             return hasFloorplanAi;
             return hasFloorplanAi;

+ 8 - 2
src/main/java/com/fdkankan/contro/service/impl/MjServiceImpl.java

@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.fdkankan.common.constant.CommonSuccessStatus;
 import com.fdkankan.common.constant.CommonSuccessStatus;
 import com.fdkankan.common.constant.RecStatus;
 import com.fdkankan.common.constant.RecStatus;
 import com.fdkankan.common.constant.SceneStatus;
 import com.fdkankan.common.constant.SceneStatus;
+import com.fdkankan.common.util.CmdUtils;
 import com.fdkankan.common.util.SnowflakeIdGenerator;
 import com.fdkankan.common.util.SnowflakeIdGenerator;
 import com.fdkankan.contro.entity.SceneFileBuild;
 import com.fdkankan.contro.entity.SceneFileBuild;
 import com.fdkankan.contro.entity.SceneOrigBd;
 import com.fdkankan.contro.entity.SceneOrigBd;
@@ -76,7 +77,10 @@ public class MjServiceImpl implements MjService {
                     continue;
                     continue;
                 }
                 }
 
 
-                httpClient.downloadFile(fileUrl, zipDir, zipName);
+                FileUtil.mkdir(zipDir);
+                String downloadCmd = "wget -O " + zipDir + zipName + " " + fileUrl;
+                CmdUtils.callLineSh(downloadCmd);
+//                httpClient.downloadFile(fileUrl, zipDir, zipName);
 //                String unzipCmd = "unzip -O GBK " + zipDir + zipName + " -d " + zipDir;
 //                String unzipCmd = "unzip -O GBK " + zipDir + zipName + " -d " + zipDir;
 
 
 //                CmdUtils.callLine(unzipCmd);
 //                CmdUtils.callLine(unzipCmd);
@@ -126,7 +130,9 @@ public class MjServiceImpl implements MjService {
     }
     }
 
 
     public static void main(String[] args) {
     public static void main(String[] args) {
-        ZipUtil.unzip(new File("D:\\Downloads\\916ed6689_202501101516307030\\916ed6689_202501101516307030.zip"), new File("D:\\Downloads\\aaa\\bbb"));
+//        ZipUtil.unzip(new File("D:\\Downloads\\916ed6689_202501101516307030\\916ed6689_202501101516307030.zip"), new File("D:\\Downloads\\aaa\\bbb"));
+        String substring = "/mnt/data/bd/0ef1b470-4f3a-49b4-bd66-7e0584cce660/".substring(0, "/mnt/data/bd/0ef1b470-4f3a-49b4-bd66-7e0584cce660/".lastIndexOf("/"));
+        System.out.println(substring);
     }
     }
 
 
 }
 }