|
@@ -7,15 +7,23 @@ import com.fdkankan.fusion.common.util.Openai;
|
|
|
import com.fdkankan.fusion.common.util.UploadToOssUtil;
|
|
|
import com.fdkankan.fusion.config.FusionConfig;
|
|
|
import com.fdkankan.fusion.entity.CaseInquestInfo;
|
|
|
+import com.fdkankan.fusion.entity.CaseNumEntity;
|
|
|
import com.fdkankan.fusion.exception.BusinessException;
|
|
|
import com.fdkankan.fusion.request.AiParam;
|
|
|
+import com.fdkankan.fusion.response.FloorPathVo;
|
|
|
import com.fdkankan.fusion.service.ICaseInquestInfoService;
|
|
|
+import com.fdkankan.fusion.service.ICaseNumService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.apache.ibatis.annotations.Param;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
+import scala.Int;
|
|
|
|
|
|
+import java.io.File;
|
|
|
import java.io.IOException;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -45,5 +53,37 @@ public class AiController {
|
|
|
throw new BusinessException(ResultCode.AI_ERROR);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ ICaseNumService caseNumService;
|
|
|
+ @GetMapping("/getFloor/{caseId}")
|
|
|
+ public ResultData getFloor(@PathVariable Integer caseId){
|
|
|
+ String foorPath = "/oss/4dkankan/scene_view_data/%s/user";
|
|
|
+ String fileName = "floor-cad";
|
|
|
+ String extName = "png";
|
|
|
+ List<CaseNumEntity> byCaseId = caseNumService.getByCaseId(caseId);
|
|
|
+ List<FloorPathVo> pathVos = new ArrayList<>();
|
|
|
+ for (CaseNumEntity caseNumEntity : byCaseId) {
|
|
|
+ if(caseNumEntity.getNumType() == 3){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ FloorPathVo pathVo = new FloorPathVo();
|
|
|
+ pathVo.setNum(caseNumEntity.getNum());
|
|
|
+ String path = String.format(foorPath, caseNumEntity.getNum());
|
|
|
+ File file = new File(path);
|
|
|
+ File[] files = file.listFiles();
|
|
|
+ if(files == null || files.length <=0){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ for (File file1 : files) {
|
|
|
+ if(file1.getName().contains(fileName) && file1.getName().contains(extName)){
|
|
|
+ pathVo.getUrls().add(file1.getPath().replace("4dkankan/",""));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ pathVos.add(pathVo);
|
|
|
+ }
|
|
|
+
|
|
|
+ return ResultData.ok(pathVos);
|
|
|
+ }
|
|
|
}
|
|
|
|