|
@@ -9,6 +9,7 @@ import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fdkankan.common.config.FileRouteConfig;
|
|
|
import com.fdkankan.common.constant.*;
|
|
@@ -645,9 +646,17 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
Object folderNameObject = redisUtil.get(fileId);
|
|
|
String folderName = folderNameObject == null ? null : (String)folderNameObject;
|
|
|
if(StringUtils.isEmpty(folderName)){
|
|
|
- SceneProPO sceneProPO = sceneProService.getSceneStatusByUnicode("/" + fileId + "/", TbStatus.VALID.code());
|
|
|
- if(sceneProPO != null){
|
|
|
- folderName = sceneProPO.getDataSource().substring(sceneProPO.getDataSource().lastIndexOf("/") + 1);
|
|
|
+ // TODO: 2022/3/19 plus版本稳定后删除----------------------------------------------------------------------start
|
|
|
+// SceneProPO sceneProPO = sceneProService.getSceneStatusByUnicode("/" + fileId + "/", TbStatus.VALID.code());
|
|
|
+// if(sceneProPO != null){
|
|
|
+// folderName = sceneProPO.getDataSource().substring(sceneProPO.getDataSource().lastIndexOf("/") + 1);
|
|
|
+// }
|
|
|
+ // TODO: 2022/3/19 plus版本稳定后删除----------------------------------------------------------------------end
|
|
|
+ ScenePlusExt scenePlusExt = scenePlusExtService.list(
|
|
|
+ new LambdaQueryWrapper<ScenePlusExt>()
|
|
|
+ .like(ScenePlusExt::getDataSource, "%/" + fileId + "/%")).get(0);
|
|
|
+ if(scenePlusExt != null){
|
|
|
+ folderName = scenePlusExt.getDataSource().substring(scenePlusExt.getDataSource().lastIndexOf("/") + 1);
|
|
|
}
|
|
|
|
|
|
if(StringUtils.isEmpty(folderName)){
|
|
@@ -895,11 +904,18 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
String unicode = jsonObject.getString("creator") + "_" + jsonObject.getString("uuidtime"); //从data.fage 取出
|
|
|
// sceneProService.updateRecStatus(unicode);
|
|
|
//查看场景中的文件目录是否有改文件id,有则重新计算改场景,无则新建场景
|
|
|
- SceneProPO sceneProPO = sceneProService.findByFileId("/" + fileId + "/");
|
|
|
+ ScenePlusExt scene = scenePlusExtService.list(
|
|
|
+ new LambdaQueryWrapper<ScenePlusExt>()
|
|
|
+ .like(ScenePlusExt::getDataSource, "%/" + fileId + "/%")).get(0);
|
|
|
+
|
|
|
+ // TODO: 2022/3/19 plus 版本稳定后删除-------------------------------start
|
|
|
+ SceneProPO scene = sceneProService.findByFileId("/" + fileId + "/");
|
|
|
+ // TODO: 2022/3/19 plus 版本稳定后删除-------------------------------end
|
|
|
+
|
|
|
int rebuild = 1;
|
|
|
- if(sceneProPO != null){
|
|
|
- sceneNum = sceneProPO.getNum();
|
|
|
- if(sceneProPO.getSceneStatus() == SceneStatus.wait.code()){
|
|
|
+ if(scene != null){
|
|
|
+ sceneNum = scene.getNum();
|
|
|
+ if(scene.getSceneStatus() == SceneStatus.wait.code()){
|
|
|
log.info(sceneNum + ":场景处于计算中,不能再计算");
|
|
|
return;
|
|
|
}
|
|
@@ -2236,7 +2252,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
// }
|
|
|
// Integer sceneSource = sceneProExt.getSceneSource();
|
|
|
// String dataSource = sceneProExt.getDataSource();
|
|
|
-// Long userId = scenePro.getUserId();
|
|
|
+// Long sceneUserId = scenePro.getUserId();
|
|
|
// String buildType = scenePro.getBuildType();
|
|
|
// Integer sceneStatus = scenePro.getSceneStatus();
|
|
|
// String webSite = scenePro.getWebSite();
|
|
@@ -2244,6 +2260,8 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
// Integer payStatus = scenePro.getPayStatus();
|
|
|
// Integer sceneScheme = scenePro.getSceneScheme();
|
|
|
// Long sceneId = scenePro.getId();
|
|
|
+// String sceneName = scenePro.getSceneName();
|
|
|
+// Date createTime = scenePro.getCreateTime();
|
|
|
|
|
|
// TODO: 2022/3/16 旧主表逻辑, 待删除 -------------------------------end
|
|
|
|
|
@@ -2256,14 +2274,16 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
String path = scenePlusExt.getDataSource();
|
|
|
Integer sceneSource = scenePlus.getSceneSource();
|
|
|
String dataSource = scenePlusExt.getDataSource();
|
|
|
- Long userId = scenePlus.getUserId();
|
|
|
+ Long sceneUserId = scenePlus.getUserId();
|
|
|
String buildType = scenePlusExt.getBuildType();
|
|
|
Integer sceneStatus = scenePlus.getSceneStatus();
|
|
|
String webSite = scenePlusExt.getWebSite();
|
|
|
String thumb = scenePlusExt.getThumb();
|
|
|
Integer payStatus = scenePlus.getPayStatus();
|
|
|
Integer sceneScheme = scenePlusExt.getSceneScheme();
|
|
|
- scenePlus
|
|
|
+ Long sceneId = scenePlus.getId();
|
|
|
+ String sceneName = scenePlus.getTitle();
|
|
|
+ Date createTime = scenePlus.getCreateTime();
|
|
|
|
|
|
//重新计算时需要删除文件夹,否知使用缓存
|
|
|
FileUtils.delAllFile(path + File.separator + "results");
|
|
@@ -2346,8 +2366,8 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
} else {
|
|
|
String cameraName = jsonObject.getJSONObject("cam").getString("uuid");
|
|
|
String userName = null;
|
|
|
- if (!ObjectUtils.isEmpty(userId)) {
|
|
|
- ResultData<SSOUser> ssoUserResult = platformUserClient.getSSOUserByUserId(userId);
|
|
|
+ if (!ObjectUtils.isEmpty(sceneUserId)) {
|
|
|
+ ResultData<SSOUser> ssoUserResult = platformUserClient.getSSOUserByUserId(sceneUserId);
|
|
|
SSOUser user = ssoUserResult.getData();
|
|
|
userName = user.getUserName();
|
|
|
}
|
|
@@ -2385,10 +2405,9 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
"zip.Zip", "0",
|
|
|
userName, jsonObject.getString("location") != null && "1".equals(jsonObject.getString("location")) ? "sfm" : "slam",
|
|
|
jsonObject.getInteger("resolution"), buildType,
|
|
|
- ConstantFilePath.BUILD_MODEL_LASER_PATH + unicode, scenePro.getId(), scenePro.getSceneName(),
|
|
|
- scenePro.getWebSite(), scenePro.getCreateTime(), scenePro.getUserId(),
|
|
|
- dataSource, scenePro.getSceneStatus(), scenePro.getPayStatus(), scenePro.getThumb());
|
|
|
- mqProducer.syncSend(topicLaserA, buildSceneMqMessage);
|
|
|
+ ConstantFilePath.BUILD_MODEL_LASER_PATH + unicode, sceneId, sceneName,
|
|
|
+ webSite, createTime, sceneUserId, dataSource, sceneStatus, payStatus, thumb);
|
|
|
+ mqProducer.syncSend(topicModelingAPre, buildSceneMqMessage);
|
|
|
}else{
|
|
|
BuildSceneMqMessage buildSceneMqMessage =this.getBuildSceneMqMessage(
|
|
|
num, cameraName, unicode, cameraType, fileId,
|
|
@@ -2397,15 +2416,21 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
"zip.Zip", "0",
|
|
|
userName, jsonObject.getString("location") != null && "1".equals(jsonObject.getString("location")) ? "sfm" : "slam",
|
|
|
jsonObject.getInteger("resolution"), buildType,
|
|
|
- ConstantFilePath.BUILD_MODEL_PATH + unicode, scenePro.getId(), scenePro.getSceneName(),
|
|
|
- scenePro.getWebSite(), scenePro.getCreateTime(), scenePro.getUserId(),
|
|
|
- dataSource, scenePro.getSceneStatus(), scenePro.getPayStatus(), scenePro.getThumb());
|
|
|
+ ConstantFilePath.BUILD_MODEL_PATH + unicode, sceneId, sceneName,
|
|
|
+ webSite, createTime, sceneUserId, dataSource, sceneStatus, payStatus, thumb);
|
|
|
|
|
|
mqProducer.syncSend(topicModelingAPre, buildSceneMqMessage);
|
|
|
}
|
|
|
+
|
|
|
sceneProService.updateStatus(num,0);
|
|
|
+ scenePlusService.update(new LambdaUpdateWrapper<ScenePlus>()
|
|
|
+ .set(ScenePlus::getSceneStatus, SceneStatus.wait.code())
|
|
|
+ .eq(ScenePlus::getNum, num));
|
|
|
+
|
|
|
+ // TODO: 2022/3/16 旧主表逻辑, 待删除 -------------------------------start
|
|
|
// 更新imageVersion
|
|
|
- sceneProEditService.updateImageVersionByProId(scenePro.getId());
|
|
|
+// sceneProEditService.updateImageVersionByProId(scenePro.getId());
|
|
|
+ // TODO: 2022/3/16 旧主表逻辑, 待删除 -------------------------------end
|
|
|
}
|
|
|
log.info("生成新的场景重新计算");
|
|
|
return ResultData.ok();
|