|
|
@@ -1,6 +1,7 @@
|
|
|
package com.fdkankan.fusion.controller;
|
|
|
|
|
|
|
|
|
+import cn.hutool.core.io.FileUtil;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
@@ -79,11 +80,11 @@ public class AiController {
|
|
|
String foorPath = "/oss/4dkankan/scene_view_data/%s/user";
|
|
|
String fileName = "floorplan-ai";
|
|
|
String extName = "json";
|
|
|
+ String freespacePath = "/oss/4dkankan/scene_view_data/%s/images/cover/final_freespace.png";
|
|
|
List<CaseNumEntity> byCaseId = caseNumService.getByCaseId(caseId);
|
|
|
List<String> numList = byCaseId.stream().filter(e -> e.getNumType() != 3 && e.getNumType() != 2 && e.getNumType()!=5).map(CaseNumEntity::getNum).collect(Collectors.toList());
|
|
|
List<ScenePlus> scenePluses = scenePlusService.getByNumListAndAi(numList);
|
|
|
|
|
|
- AiContent aiContent = aiContentService.getById(1);
|
|
|
|
|
|
List<FloorPathVo> pathVos = new ArrayList<>();
|
|
|
for (ScenePlus caseNumEntity : scenePluses) {
|
|
|
@@ -94,29 +95,32 @@ public class AiController {
|
|
|
if(files == null || files.length <=0){
|
|
|
continue;
|
|
|
}
|
|
|
+ String freespaceUrl = null;
|
|
|
+ if(new File(freespacePath).exists()){
|
|
|
+ freespaceUrl = freespacePath.replace("4dkankan/","");
|
|
|
+ }
|
|
|
+
|
|
|
for (File file1 : files) {
|
|
|
if(file1.getName().contains(fileName) && file1.getName().contains(extName)){
|
|
|
try {
|
|
|
+ String s = FileUtil.readUtf8String(file1);
|
|
|
FloorUser floorPlanResults = aiService.coverFloorPlanJson(file1.getPath());
|
|
|
for (Floors floor : floorPlanResults.getFloors()) {
|
|
|
if(floor == null ){
|
|
|
continue;
|
|
|
}
|
|
|
- JSONObject jsonObject = BBoxHierarchyBuilder.buildHierarchyStart(floor);
|
|
|
- if(jsonObject == null ){
|
|
|
- continue;
|
|
|
- }
|
|
|
+// JSONObject jsonObject = BBoxHierarchyBuilder.buildHierarchyStart(floor);
|
|
|
+// if(jsonObject == null ){
|
|
|
+// continue;
|
|
|
+// }
|
|
|
FloorPathVo pathVo = new FloorPathVo();
|
|
|
pathVo.setNum(caseNumEntity.getNum());
|
|
|
pathVo.setTitle(caseNumEntity.getTitle());
|
|
|
if(floorPlanResults.getFloors().size() >1){
|
|
|
pathVo.setTitle(caseNumEntity.getTitle()+"_"+ floor.getFloorsName());
|
|
|
}
|
|
|
- pathVo.setParams("## 数据\n"+jsonObject.toJSONString());
|
|
|
pathVo.setUrl(path.replace("4dkankan/","")+"/cad-style-3-"+floor.getSubgroup()+".jpg");
|
|
|
- if(aiContent!= null && StringUtils.isNotBlank(aiContent.getContent())){
|
|
|
- pathVo.setParamContent(aiContent.getContent());
|
|
|
- }
|
|
|
+ pathVo.setFreeSpaceUrl(freespaceUrl);
|
|
|
pathVos.add(pathVo);
|
|
|
}
|
|
|
}catch (Exception e){
|