|
@@ -233,7 +233,6 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
}
|
|
}
|
|
scenePlus.setUpdateTime(new Date());
|
|
scenePlus.setUpdateTime(new Date());
|
|
scenePlus.setSceneStatus(SceneStatus.NO_DISPLAY.code());
|
|
scenePlus.setSceneStatus(SceneStatus.NO_DISPLAY.code());
|
|
- scenePlusService.updateById(scenePlus);
|
|
|
|
|
|
|
|
|
|
|
|
Integer videoVersion = fdageData.getInteger("videoVersion");
|
|
Integer videoVersion = fdageData.getInteger("videoVersion");
|
|
@@ -283,8 +282,8 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
this.cachePanorama(path, sceneCode);
|
|
this.cachePanorama(path, sceneCode);
|
|
|
|
|
|
//生成houseTypejson并上传
|
|
//生成houseTypejson并上传
|
|
- uploadFiles.entrySet().stream().filter(entry-> FileNameUtil.getName(entry.getKey()).equals("floorplan_cad.json"))
|
|
|
|
- .forEach(entry-> uploadHouseTypeJson(sceneCode,entry.getKey()));
|
|
|
|
|
|
+ boolean existHouseType = this.uploadHouseTypeJson(sceneCode, scenePlusExt.getDataSource());
|
|
|
|
+ scenePlus.setHouseType(existHouseType ? CommonStatus.YES.code().intValue() : CommonStatus.NO.code().intValue());
|
|
|
|
|
|
//写scene.json
|
|
//写scene.json
|
|
|
|
|
|
@@ -314,7 +313,8 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
String pushToken = fdageData.getString("pushToken");
|
|
String pushToken = fdageData.getString("pushToken");
|
|
this.pushMsgToApp(pushChannel,pushToken, cameraType, scenePlus.getTitle(), scenePlusExt.getWebSite());
|
|
this.pushMsgToApp(pushChannel,pushToken, cameraType, scenePlus.getTitle(), scenePlusExt.getWebSite());
|
|
|
|
|
|
-
|
|
|
|
|
|
+ //更新场景主表
|
|
|
|
+ scenePlusService.updateById(scenePlus);
|
|
|
|
|
|
CreateObjUtil.deleteFile(path.replace(ConstantFilePath.BUILD_MODEL_PATH, "/") + "/capture");
|
|
CreateObjUtil.deleteFile(path.replace(ConstantFilePath.BUILD_MODEL_PATH, "/") + "/capture");
|
|
|
|
|
|
@@ -720,42 +720,6 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
return uploadFile.keySet().stream().map(File::new).filter(File::exists).mapToLong(File::length).sum();
|
|
return uploadFile.keySet().stream().map(File::new).filter(File::exists).mapToLong(File::length).sum();
|
|
}
|
|
}
|
|
|
|
|
|
- private void sealScene(Long scenePlusId){
|
|
|
|
- scenePlusService.update(
|
|
|
|
- new LambdaUpdateWrapper<ScenePlus>()
|
|
|
|
- .set(ScenePlus::getPayStatus, PayStatus.NO_CAPACITY.code())
|
|
|
|
- .eq(ScenePlus::getId, scenePlusId));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * <p>
|
|
|
|
- 双目场景更新数据库
|
|
|
|
- * </p>
|
|
|
|
- * @author dengsixing
|
|
|
|
- * @date 2022/3/21
|
|
|
|
- * @param num
|
|
|
|
- * @param space
|
|
|
|
- **/
|
|
|
|
- private void updateDb4Sm(String num, long space){
|
|
|
|
- List<ScenePlus> ScenePlusList = scenePlusService.list(
|
|
|
|
- new LambdaQueryWrapper<ScenePlus>().select(ScenePlus::getId).eq(ScenePlus::getNum, num));
|
|
|
|
-
|
|
|
|
- if(CollUtil.isEmpty(ScenePlusList)){
|
|
|
|
- return ;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- List<Long> sceneIds = ScenePlusList.stream().map(ScenePlus::getId).collect(Collectors.toList());
|
|
|
|
-
|
|
|
|
- //更新场景创建时间
|
|
|
|
- scenePlusService.update(new LambdaUpdateWrapper<ScenePlus>().in(ScenePlus::getId, sceneIds)
|
|
|
|
- .set(ScenePlus::getSceneStatus, SceneStatus.NO_DISPLAY.code()));
|
|
|
|
-
|
|
|
|
- //更新使用容量
|
|
|
|
- scenePlusExtService.update(new LambdaUpdateWrapper<ScenePlusExt>().in(ScenePlusExt::getPlusId, sceneIds)
|
|
|
|
- .set(ScenePlusExt::getSpace, space)
|
|
|
|
- .set(ScenePlusExt::getAlgorithmTime, Calendar.getInstance().getTime()));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
private void updateDbPlus(int sceneSource,Long space,String videosJson, Long computeTime,boolean isObj,ScenePlusExt scenePlusExt){
|
|
private void updateDbPlus(int sceneSource,Long space,String videosJson, Long computeTime,boolean isObj,ScenePlusExt scenePlusExt){
|
|
|
|
|
|
scenePlusExt.setSpace(space);
|
|
scenePlusExt.setSpace(space);
|
|
@@ -846,15 +810,21 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
|
|
return new Object[]{sceneEditInfo, sceneEditInfoExt, sceneEditControls};
|
|
return new Object[]{sceneEditInfo, sceneEditInfoExt, sceneEditControls};
|
|
}
|
|
}
|
|
|
|
|
|
- public void uploadHouseTypeJson(String num, String floorPlanCardFilePath) {
|
|
|
|
|
|
+ public boolean uploadHouseTypeJson(String num, String dataSource) {
|
|
|
|
+ String floorPlanCardFilePath = dataSource + File.separator + "floorplan_cad.json";
|
|
if (!new File(floorPlanCardFilePath).exists()) {
|
|
if (!new File(floorPlanCardFilePath).exists()) {
|
|
- log.error("floorplan_cad.json 文件不存在,文件路径:{}", floorPlanCardFilePath);
|
|
|
|
- return;
|
|
|
|
|
|
+ log.warn("floorplan_cad.json 文件不存在,文件路径:{}", floorPlanCardFilePath);
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
JSONObject json = CreateHouseJsonUtil.createHouseTypeJsonByCad(floorPlanCardFilePath);
|
|
JSONObject json = CreateHouseJsonUtil.createHouseTypeJsonByCad(floorPlanCardFilePath);
|
|
|
|
+ if(Objects.isNull(json)){
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
String hourseTypeJsonPath = String.format(UploadFilePath.DATA_VIEW_PATH, num) + "houseType.json";
|
|
String hourseTypeJsonPath = String.format(UploadFilePath.DATA_VIEW_PATH, num) + "houseType.json";
|
|
fYunFileService.uploadFile(json.toJSONString().getBytes(), hourseTypeJsonPath);
|
|
fYunFileService.uploadFile(json.toJSONString().getBytes(), hourseTypeJsonPath);
|
|
hourseTypeJsonPath = String.format(UploadFilePath.DATA_EDIT_PATH, num) + "houseType.json";
|
|
hourseTypeJsonPath = String.format(UploadFilePath.DATA_EDIT_PATH, num) + "houseType.json";
|
|
fYunFileService.uploadFile(json.toJSONString().getBytes(), hourseTypeJsonPath);
|
|
fYunFileService.uploadFile(json.toJSONString().getBytes(), hourseTypeJsonPath);
|
|
|
|
+
|
|
|
|
+ return true;
|
|
}
|
|
}
|
|
}
|
|
}
|