|
@@ -77,104 +77,104 @@ public class V4toV3Handler {
|
|
|
numList = Arrays.asList(nums.split(","));
|
|
|
}
|
|
|
|
|
|
-// LambdaQueryWrapper<ScenePlus> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
-// if(CollUtil.isNotEmpty(numList)){
|
|
|
-// queryWrapper.in(ScenePlus::getNum, numList);
|
|
|
-// }
|
|
|
-// List<ScenePlus> list = scenePlusService.list(queryWrapper);
|
|
|
-
|
|
|
+ LambdaQueryWrapper<ScenePlus> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
if(CollUtil.isNotEmpty(numList)){
|
|
|
- numList.parallelStream().forEach(num->{
|
|
|
-// String num = plus.getNum();
|
|
|
+ queryWrapper.in(ScenePlus::getNum, numList);
|
|
|
+ }
|
|
|
+ List<ScenePlus> list = scenePlusService.list(queryWrapper);
|
|
|
+
|
|
|
+ if(CollUtil.isNotEmpty(list)){
|
|
|
+ list.parallelStream().forEach(plus->{
|
|
|
+ String num = plus.getNum();
|
|
|
try {
|
|
|
-// ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(plus.getId());
|
|
|
-// SceneEditInfo sceneEditInfo = sceneEditInfoService.getOne(new LambdaQueryWrapper<SceneEditInfo>().eq(SceneEditInfo::getScenePlusId, plus.getId()));
|
|
|
-
|
|
|
-// ScenePro scenePro = new ScenePro();
|
|
|
-// scenePro.setNum(plus.getNum());
|
|
|
-// scenePro.setWebSite(mainUrl + "/" + sceneProV3Url + plus.getNum());
|
|
|
-// scenePro.setThumb("https://4dkk.4dage.com/loading/thumb.jpg");
|
|
|
-// scenePro.setCreateTime(plus.getCreateTime());
|
|
|
-// scenePro.setStatus(-2);
|
|
|
-// scenePro.setDataSource(scenePlusExt.getDataSource());
|
|
|
-// scenePro.setUserId(plus.getUserId());
|
|
|
-// scenePro.setPayStatus(PayStatus.PAY.code());
|
|
|
-// scenePro.setCameraId(plus.getCameraId());
|
|
|
-// scenePro.setPhoneId(plus.getPhoneId());
|
|
|
-// scenePro.setSceneName(plus.getTitle());
|
|
|
-// scenePro.setSceneDec(plus.getDescription());
|
|
|
-// scenePro.setSceneType(plus.getSceneType());
|
|
|
-// scenePro.setViewCount(scenePlusExt.getViewCount());
|
|
|
-// scenePro.setShootCount(scenePlusExt.getShootCount());
|
|
|
-// if(StrUtil.isNotEmpty(scenePlusExt.getVideos())){
|
|
|
-// scenePro.setVideos(scenePlusExt.getVideos().replaceAll("scene_view_data/" + plus.getNum() + "/data", "data/data" + plus.getNum()));
|
|
|
-// }
|
|
|
-// scenePro.setGps(scenePlusExt.getGps());
|
|
|
-// scenePro.setSceneScheme(scenePlusExt.getSceneScheme());
|
|
|
-// scenePro.setAlgorithm(scenePlusExt.getAlgorithm());
|
|
|
-// scenePro.setEcs(scenePlusExt.getEcs());
|
|
|
-// scenePro.setSpace(scenePlusExt.getSpace());
|
|
|
-// scenePro.setFirmwareVersion(scenePlusExt.getFirmwareVersion());
|
|
|
-// scenePro.setBuildType(scenePlusExt.getBuildType());
|
|
|
-// scenePro.setComputeTime(scenePlusExt.getComputeTime());
|
|
|
-// scenePro.setSceneSource(plus.getSceneSource());
|
|
|
-// sceneProService.save(scenePro);
|
|
|
-//
|
|
|
-// SceneProEdit sceneProEdit = new SceneProEdit();
|
|
|
-// sceneProEdit.setProId(scenePro.getId());
|
|
|
-// sceneProEdit.setCreateTime(plus.getCreateTime());
|
|
|
-// sceneProEdit.setVersion(sceneEditInfo.getVersion());
|
|
|
-// sceneProEdit.setImagesVersion(sceneEditInfo.getImgVersion());
|
|
|
-// sceneProEditService.save(sceneProEdit);
|
|
|
-//
|
|
|
-// //复制oss
|
|
|
+
|
|
|
+ plus.setNum(num + "-back");
|
|
|
+ scenePlusService.updateById(plus);
|
|
|
+
|
|
|
+ ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(plus.getId());
|
|
|
+ SceneEditInfo sceneEditInfo = sceneEditInfoService.getOne(new LambdaQueryWrapper<SceneEditInfo>().eq(SceneEditInfo::getScenePlusId, plus.getId()));
|
|
|
+
|
|
|
+ ScenePro scenePro = new ScenePro();
|
|
|
+ scenePro.setNum(num);
|
|
|
+ scenePro.setWebSite(mainUrl + "/" + sceneProV3Url + num);
|
|
|
+ scenePro.setThumb("https://4dkk.4dage.com/loading/thumb.jpg");
|
|
|
+ scenePro.setCreateTime(plus.getCreateTime());
|
|
|
+ scenePro.setStatus(-2);
|
|
|
+ scenePro.setDataSource(scenePlusExt.getDataSource());
|
|
|
+ scenePro.setUserId(plus.getUserId());
|
|
|
+ scenePro.setPayStatus(PayStatus.PAY.code());
|
|
|
+ scenePro.setCameraId(plus.getCameraId());
|
|
|
+ scenePro.setPhoneId(plus.getPhoneId());
|
|
|
+ scenePro.setSceneName(plus.getTitle());
|
|
|
+ scenePro.setSceneDec(plus.getDescription());
|
|
|
+ scenePro.setSceneType(plus.getSceneType());
|
|
|
+ scenePro.setViewCount(scenePlusExt.getViewCount());
|
|
|
+ scenePro.setShootCount(scenePlusExt.getShootCount());
|
|
|
+ if(StrUtil.isNotEmpty(scenePlusExt.getVideos())){
|
|
|
+ scenePro.setVideos(scenePlusExt.getVideos().replaceAll("scene_view_data/" + num + "/data", "data/data" + num));
|
|
|
+ }
|
|
|
+ scenePro.setGps(scenePlusExt.getGps());
|
|
|
+ scenePro.setSceneScheme(scenePlusExt.getSceneScheme());
|
|
|
+ scenePro.setAlgorithm(scenePlusExt.getAlgorithm());
|
|
|
+ scenePro.setEcs(scenePlusExt.getEcs());
|
|
|
+ scenePro.setSpace(scenePlusExt.getSpace());
|
|
|
+ scenePro.setFirmwareVersion(scenePlusExt.getFirmwareVersion());
|
|
|
+ scenePro.setBuildType(scenePlusExt.getBuildType());
|
|
|
+ scenePro.setComputeTime(scenePlusExt.getComputeTime());
|
|
|
+ scenePro.setSceneSource(plus.getSceneSource());
|
|
|
+ sceneProService.save(scenePro);
|
|
|
+
|
|
|
+ SceneProEdit sceneProEdit = new SceneProEdit();
|
|
|
+ sceneProEdit.setProId(scenePro.getId());
|
|
|
+ sceneProEdit.setCreateTime(plus.getCreateTime());
|
|
|
+ sceneProEdit.setVersion(sceneEditInfo.getVersion());
|
|
|
+ sceneProEdit.setImagesVersion(sceneEditInfo.getImgVersion());
|
|
|
+ sceneProEditService.save(sceneProEdit);
|
|
|
+
|
|
|
+ //复制oss
|
|
|
String dataPath = String.format("data/data%s/", num);
|
|
|
-// String imagePath = String.format("images/images%s/", num);
|
|
|
-// String videoPath = String.format("video/video%s/", num);
|
|
|
-// String voicePath = String.format("voice/voice%s/", num);
|
|
|
+ String imagePath = String.format("images/images%s/", num);
|
|
|
+ String videoPath = String.format("video/video%s/", num);
|
|
|
+ String voicePath = String.format("voice/voice%s/", num);
|
|
|
String dataViewPath = String.format(UploadFilePath.DATA_VIEW_PATH, num);
|
|
|
-// String imageViewPath = String.format(UploadFilePath.IMG_VIEW_PATH, num);
|
|
|
-// String videoViewPath = String.format(UploadFilePath.VIDEOS_VIEW_PATH, num);
|
|
|
-// String voiceViewPath = String.format(UploadFilePath.VOICE_VIEW_PATH, num);
|
|
|
-//
|
|
|
-// fYunFileService.copyFileInBucket(dataViewPath, dataPath);
|
|
|
-// fYunFileService.copyFileInBucket(imageViewPath, imagePath);
|
|
|
-// fYunFileService.copyFileInBucket(videoViewPath, videoPath);
|
|
|
-// fYunFileService.copyFileInBucket(voiceViewPath, voicePath);
|
|
|
-//
|
|
|
-// //写入本地文件
|
|
|
-// JSONObject sceneJson = JSONObject.parseObject(JSONObject.toJSONString(scenePro));
|
|
|
-// if(StrUtil.isNotEmpty(scenePro.getVideos())){
|
|
|
-// sceneJson.put("videos",JSON.parseObject(scenePro.getVideos()).toJSONString());
|
|
|
-// }
|
|
|
-// sceneJson.put("version",sceneProEdit.getVersion());
|
|
|
-// sceneJson.put("imagesVersion",sceneProEdit.getImagesVersion());
|
|
|
-// sceneJson.put("floorEditVer",sceneProEdit.getFloorEditVer());
|
|
|
-// sceneJson.put("floorPublishVer",sceneProEdit.getFloorPublishVer());
|
|
|
-// String sceneJsonStr = JSON.toJSONString(sceneJson);
|
|
|
-//
|
|
|
-// FileUtils.writeFile(ConstantFilePath.SCENE_PATH + "data/data" + num + File.separator + "scene.json", sceneJsonStr);
|
|
|
-// //上传sceneJson文件
|
|
|
-// fYunFileService.uploadFile(sceneJsonStr.getBytes(), dataViewPath + "scene.json");
|
|
|
-
|
|
|
-// fYunFileService.downloadFile(dataViewPath + "floorplan_cad.json", ConstantFilePath.SCENE_PATH + "data" + File.separator + "data" + num + File.separator + "floor.json");
|
|
|
+ String imageViewPath = String.format(UploadFilePath.IMG_VIEW_PATH, num);
|
|
|
+ String videoViewPath = String.format(UploadFilePath.VIDEOS_VIEW_PATH, num);
|
|
|
+ String voiceViewPath = String.format(UploadFilePath.VOICE_VIEW_PATH, num);
|
|
|
+
|
|
|
+ fYunFileService.copyFileInBucket(dataViewPath, dataPath);
|
|
|
+ fYunFileService.copyFileInBucket(imageViewPath, imagePath);
|
|
|
+ fYunFileService.copyFileInBucket(videoViewPath, videoPath);
|
|
|
+ fYunFileService.copyFileInBucket(voiceViewPath, voicePath);
|
|
|
+
|
|
|
+ //写入本地文件
|
|
|
+ JSONObject sceneJson = JSONObject.parseObject(JSONObject.toJSONString(scenePro));
|
|
|
+ if(StrUtil.isNotEmpty(scenePro.getVideos())){
|
|
|
+ sceneJson.put("videos",JSON.parseObject(scenePro.getVideos()).toJSONString());
|
|
|
+ }
|
|
|
+ sceneJson.put("version",sceneProEdit.getVersion());
|
|
|
+ sceneJson.put("imagesVersion",sceneProEdit.getImagesVersion());
|
|
|
+ sceneJson.put("floorEditVer",sceneProEdit.getFloorEditVer());
|
|
|
+ sceneJson.put("floorPublishVer",sceneProEdit.getFloorPublishVer());
|
|
|
+ String sceneJsonStr = JSON.toJSONString(sceneJson);
|
|
|
+
|
|
|
+ FileUtils.writeFile(ConstantFilePath.SCENE_PATH + "data/data" + num + File.separator + "scene.json", sceneJsonStr);
|
|
|
+ //上传sceneJson文件
|
|
|
+ fYunFileService.uploadFile(sceneJsonStr.getBytes(), dataViewPath + "scene.json");
|
|
|
+
|
|
|
+ fYunFileService.downloadFile(dataViewPath + "floorplan_cad.json", ConstantFilePath.SCENE_PATH + "data" + File.separator + "data" + num + File.separator + "floor.json");
|
|
|
fYunFileService.uploadFile(ConstantFilePath.SCENE_PATH + "data" + File.separator + "data" + num + File.separator + "floor.json", dataPath + "floor.json");
|
|
|
|
|
|
- //
|
|
|
-// if(!FileUtil.exist(scenePlusExt.getDataSource())){
|
|
|
-// String ossResultPath = String.format(UploadFilePath.scene_result_data_path, num);
|
|
|
-// List<String> resultList = fYunFileService.listRemoteFiles(ossResultPath);
|
|
|
-// if(CollUtil.isNotEmpty(resultList)){
|
|
|
-// resultList.stream().forEach(key->{
|
|
|
-// fYunFileService.downloadFile(key, key.replace(ossResultPath, scenePlusExt.getDataSource() + "/"));
|
|
|
-// });
|
|
|
-// }
|
|
|
-// }
|
|
|
-
|
|
|
-// plus.setNum(num + "-yjj");
|
|
|
-// scenePlusService.updateById(plus);
|
|
|
-//
|
|
|
-// scenePlusService.removeById(plus.getId());
|
|
|
+ if(!FileUtil.exist(scenePlusExt.getDataSource())){
|
|
|
+ String ossResultPath = String.format(UploadFilePath.scene_result_data_path, num);
|
|
|
+ List<String> resultList = fYunFileService.listRemoteFiles(ossResultPath);
|
|
|
+ if(CollUtil.isNotEmpty(resultList)){
|
|
|
+ resultList.stream().forEach(key->{
|
|
|
+ fYunFileService.downloadFile(key, key.replace(ossResultPath, scenePlusExt.getDataSource() + "/"));
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ scenePlusService.removeById(plus.getId());
|
|
|
|
|
|
}catch (Exception e){
|
|
|
faildNumList.add(num);
|