|
@@ -7,7 +7,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.fdkankan.common.constant.ConstantFilePath;
|
|
|
import com.fdkankan.common.constant.UploadFilePath;
|
|
|
import com.fdkankan.common.response.ResultData;
|
|
|
+import com.fdkankan.common.util.FileUtil;
|
|
|
import com.fdkankan.common.util.FileUtils;
|
|
|
+import com.fdkankan.common.util.SceneUtil;
|
|
|
import com.fdkankan.fyun.oss.UploadToOssUtil;
|
|
|
import com.fdkankan.rabbitmq.util.RabbitMqProducer;
|
|
|
import com.fdkankan.redis.constant.RedisKey;
|
|
@@ -15,7 +17,10 @@ import com.fdkankan.redis.util.RedisUtil;
|
|
|
import com.fdkankan.repair.bean.SceneRepairParamVO;
|
|
|
import com.fdkankan.repair.bean.SceneUpgradeProgressBean;
|
|
|
import com.fdkankan.repair.entity.ScenePro;
|
|
|
+import com.fdkankan.repair.entity.SceneProExt;
|
|
|
import com.fdkankan.repair.httpclient.FdkankanMiniClient;
|
|
|
+import com.fdkankan.repair.service.IScenePlusExtService;
|
|
|
+import com.fdkankan.repair.service.ISceneProExtService;
|
|
|
import com.fdkankan.repair.service.ISceneProService;
|
|
|
import com.fdkankan.repair.service.ISceneResourceService;
|
|
|
import com.fdkankan.repair.service.impl.SceneRepairService;
|
|
@@ -53,6 +58,8 @@ public class SceneRepairController {
|
|
|
@Autowired
|
|
|
ISceneProService sceneProService;
|
|
|
@Autowired
|
|
|
+ ISceneProExtService sceneProExtService;
|
|
|
+ @Autowired
|
|
|
private UploadToOssUtil uploadToOssUtil;
|
|
|
@Autowired
|
|
|
private SceneRepairService sceneRepairService;
|
|
@@ -96,6 +103,26 @@ public class SceneRepairController {
|
|
|
return ResultData.ok();
|
|
|
}
|
|
|
|
|
|
+ @PostMapping("repairPan")
|
|
|
+ public ResultData repairPan(String num){
|
|
|
+ ScenePro scenePro = sceneProService
|
|
|
+ .getOne(new LambdaQueryWrapper<ScenePro>().eq(ScenePro::getNum, num));
|
|
|
+ SceneProExt sceneProExt = sceneProExtService.getOne(
|
|
|
+ new LambdaQueryWrapper<SceneProExt>().eq(SceneProExt::getSceneProId, scenePro.getId()));
|
|
|
+ String path = sceneProExt.getDataSource();
|
|
|
+ List<String> imagesList = FileUtil.getFileList(path + "/caches/images");
|
|
|
+
|
|
|
+ String imagesCachePath = "/mnt/4Dkankan/scene/" + num;
|
|
|
+ String visionPath = path + "/results/vision.txt";
|
|
|
+ List<String> panoramaImageList = SceneUtil.getPanoramaImageList(visionPath);
|
|
|
+ imagesList.stream().forEach(srcPath -> {
|
|
|
+ if(panoramaImageList.contains(srcPath)){
|
|
|
+ cn.hutool.core.io.FileUtil.copy(srcPath, srcPath.replace(path, imagesCachePath), true);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return ResultData.ok();
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 更新进度条
|
|
|
* @param num
|