|
@@ -26,6 +26,7 @@ import com.fdkankan.platform.api.vo.Camera;
|
|
|
import com.fdkankan.platform.api.vo.CameraDetail;
|
|
|
import com.fdkankan.platform.api.vo.Company;
|
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
|
+import com.fdkankan.scene.bean.SceneJsonBean;
|
|
|
import com.fdkankan.scene.entity.*;
|
|
|
import com.fdkankan.scene.mapper.ISceneFileBuildMapper;
|
|
|
import com.fdkankan.scene.service.*;
|
|
@@ -150,6 +151,10 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
IFdkkLaserService fdkkLaserService;
|
|
|
@Autowired
|
|
|
ISceneEditInfoService sceneEditInfoService;
|
|
|
+ @Autowired
|
|
|
+ ISceneEditControlsService sceneEditControlsService;
|
|
|
+ @Autowired
|
|
|
+ ISceneEditInfoExtService sceneEditInfoExtService;
|
|
|
|
|
|
@Override
|
|
|
public SceneFileBuild findByFileId(String fileId) {
|
|
@@ -840,6 +845,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
cameraType = 6L;
|
|
|
}
|
|
|
|
|
|
+ // TODO: 2022/3/21 plus版本稳定后删除 ---------------------------------------------------------------------------------start
|
|
|
SceneProPO scene = this.createScenePro(sceneNum, camera.getId(), camera.getChildName(), jsonObject.getString("creator"),
|
|
|
jsonObject.getString("pwd"), unicode,
|
|
|
cameraType, "", prefix, zipName, icon, "0", cameraDetail.getUserId(), userName,
|
|
@@ -847,6 +853,20 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
jsonObject.getJSONArray("points").size(), jsonObject.getString("name"), jsonObject.getString("info"),
|
|
|
jsonObject.getInteger("scenetype"), jsonObject.getString("gps"), rebuild,
|
|
|
4, firmwareVersion.toString(), sceneUrl, buildType, type, ecsType, cameraDetail.getCooperationUser());
|
|
|
+ // TODO: 2022/3/21 plus版本稳定后删除 ---------------------------------------------------------------------------------end
|
|
|
+
|
|
|
+ Object[] objects = this.createScenePlus2(sceneNum, camera.getId(), camera.getChildName(),
|
|
|
+ jsonObject.getString("creator"),
|
|
|
+ jsonObject.getString("pwd"), unicode,
|
|
|
+ cameraType, "", prefix, zipName, icon, "0", cameraDetail.getUserId(), userName,
|
|
|
+ jsonObject.getString("location") != null && "1".equals(jsonObject.getString("location"))
|
|
|
+ ? "sfm" : "slam",
|
|
|
+ jsonObject.getJSONArray("points").size(), jsonObject.getString("name"),
|
|
|
+ jsonObject.getString("info"),
|
|
|
+ jsonObject.getInteger("scenetype"), jsonObject.getString("gps"), rebuild,
|
|
|
+ 4, firmwareVersion.toString(), sceneUrl, buildType, ecsType,
|
|
|
+ cameraDetail.getCooperationUser());
|
|
|
+ BuildSceneMqMessage mqMessage = (BuildSceneMqMessage)objects[1];
|
|
|
|
|
|
if(scene == null){
|
|
|
log.info("双目相机入库失败");
|
|
@@ -866,7 +886,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
//删除oss的houst_floor.json
|
|
|
uploadToOssUtil.delete("data/data"+sceneNum+File.separator+"houst_floor.json");
|
|
|
|
|
|
- mqProducer.sendInOrder(topicModelingA, scene.getId()+"", scene.getMqMsg());
|
|
|
+ mqProducer.syncSend(topicModelingAPre, mqMessage);
|
|
|
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
map.put("sceneNum", sceneNum);
|
|
@@ -899,23 +919,25 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
}
|
|
|
|
|
|
String sceneNum = "";
|
|
|
-
|
|
|
String snCode = jsonObject.getJSONObject("cam").getString("uuid");
|
|
|
String unicode = jsonObject.getString("creator") + "_" + jsonObject.getString("uuidtime"); //从data.fage 取出
|
|
|
-// sceneProService.updateRecStatus(unicode);
|
|
|
//查看场景中的文件目录是否有改文件id,有则重新计算改场景,无则新建场景
|
|
|
- ScenePlusExt scene = scenePlusExtService.list(
|
|
|
+ ScenePlusExt scenePlusExt = scenePlusExtService.list(
|
|
|
new LambdaQueryWrapper<ScenePlusExt>()
|
|
|
.like(ScenePlusExt::getDataSource, "%/" + fileId + "/%")).get(0);
|
|
|
+ ScenePlus scene1 = null;
|
|
|
+ if(Objects.nonNull(scenePlusExt)){
|
|
|
+ scene1 = scenePlusService.getById(scenePlusExt.getPlusId());
|
|
|
+ }
|
|
|
|
|
|
// TODO: 2022/3/19 plus 版本稳定后删除-------------------------------start
|
|
|
- SceneProPO scene = sceneProService.findByFileId("/" + fileId + "/");
|
|
|
+// SceneProPO scene = sceneProService.findByFileId("/" + fileId + "/");
|
|
|
// TODO: 2022/3/19 plus 版本稳定后删除-------------------------------end
|
|
|
|
|
|
int rebuild = 1;
|
|
|
- if(scene != null){
|
|
|
- sceneNum = scene.getNum();
|
|
|
- if(scene.getSceneStatus() == SceneStatus.wait.code()){
|
|
|
+ if(scene1 != null){
|
|
|
+ sceneNum = scene1.getNum();
|
|
|
+ if(scene1.getSceneStatus() == SceneStatus.wait.code()){
|
|
|
log.info(sceneNum + ":场景处于计算中,不能再计算");
|
|
|
return;
|
|
|
}
|
|
@@ -962,7 +984,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- String icon = null;//新系统
|
|
|
+ String icon = null;
|
|
|
if(jsonObject.containsKey("icon") && StrUtil.isNotEmpty(jsonObject.getString("icon"))){
|
|
|
CreateObjUtil.ossUtilCp(ConstantFilePath.OSS_PREFIX + prefix + jsonObject.getString("icon"), filePath);
|
|
|
icon = prefixAli + imageViewPath + jsonObject.getString("icon");
|
|
@@ -1000,7 +1022,10 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
|
|
|
//重算的场景,先移除该场景对应的容量
|
|
|
if(rebuild == 1){
|
|
|
+ scenePlusService.resetSpace(sceneNum);
|
|
|
+ // TODO: 2022/3/19 plus版本稳定后需要删除---------------start
|
|
|
sceneProService.rebuildReduceSpaceBySceneNum(sceneNum);
|
|
|
+ // TODO: 2022/3/19 plus版本稳定后需要删除---------------end
|
|
|
}else {
|
|
|
//上传log-main.png
|
|
|
uploadToOssUtil.upload(ConstantFilePath.LOGO_PATH + "logo-main.png", imageViewPath + "logo-main.png");
|
|
@@ -1013,13 +1038,24 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
|
|
|
}
|
|
|
SceneProPO scene = null;
|
|
|
+ // TODO: 2022/3/21 plus版本稳定后删除 ---------------------------------------------------------------------------------start
|
|
|
scene = this.createScenePro(sceneNum, camera.getId(), camera.getChildName(), jsonObject.getString("creator"),
|
|
|
jsonObject.getString("pwd"), unicode,
|
|
|
cameraType, String.valueOf(fileId), prefix, "", icon, "0", cameraDetail.getUserId(), userName,
|
|
|
jsonObject.getString("location") != null && "1".equals(jsonObject.getString("location")) ? "sfm" : "slam",
|
|
|
jsonObject.getJSONArray("points").size(), jsonObject.getString("name"), jsonObject.getString("info"),
|
|
|
jsonObject.getInteger("scenetype"), jsonObject.getString("gps"), rebuild,
|
|
|
- jsonObject.getInteger("resolution"), firmwareVersion.toString(), sceneUrl, buildType, type, ecsType,cameraDetail.getCooperationUser());
|
|
|
+ jsonObject.getInteger("resolution"), firmwareVersion.toString(), sceneUrl, buildType, type, ecsType, cameraDetail.getCooperationUser());
|
|
|
+ // TODO: 2022/3/21 plus版本稳定后删除 ---------------------------------------------------------------------------------end
|
|
|
+
|
|
|
+ Object[] objects = this.createScenePlus2(sceneNum, camera.getId(), camera.getChildName(), jsonObject.getString("creator"),
|
|
|
+ jsonObject.getString("pwd"), unicode,
|
|
|
+ cameraType, String.valueOf(fileId), prefix, "", icon, "0", cameraDetail.getUserId(), userName,
|
|
|
+ jsonObject.getString("location") != null && "1".equals(jsonObject.getString("location")) ? "sfm" : "slam",
|
|
|
+ jsonObject.getJSONArray("points").size(), jsonObject.getString("name"), jsonObject.getString("info"),
|
|
|
+ jsonObject.getInteger("scenetype"), jsonObject.getString("gps"), rebuild,
|
|
|
+ jsonObject.getInteger("resolution"), firmwareVersion.toString(), sceneUrl, buildType, ecsType, cameraDetail.getCooperationUser());
|
|
|
+ BuildSceneMqMessage mqMessage = (BuildSceneMqMessage)objects[1];
|
|
|
|
|
|
if(scene != null){
|
|
|
JSONObject statusJson = new JSONObject();
|
|
@@ -1144,11 +1180,12 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
//激光转台 八目相机占用 10 和 11
|
|
|
log.info("发送mq,camType:{}", jsonObject.getJSONObject("cam").getIntValue("type"));
|
|
|
if(jsonObject.getJSONObject("cam").getIntValue("type") == 10){
|
|
|
- mqProducer.sendOneWay(topicLaserA, scene.getMqMsg());
|
|
|
+// mqProducer.sendOneWay(topicLaserA, mqMessage);
|
|
|
+ // TODO: 2022/3/19 这里应该是发送激光的 ,目前还不清楚,先统一发送同一个mq
|
|
|
+ mqProducer.syncSend(topicModelingAPre, mqMessage);
|
|
|
}else if(scene != null){
|
|
|
// mqProducer.sendInOrder(topicModelingA, scene.getId()+"", scene.getMqMsg());
|
|
|
- mqProducer.syncSend(topicModelingAPre, scene.getMqMsg());
|
|
|
-
|
|
|
+ mqProducer.syncSend(topicModelingAPre, mqMessage);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1338,7 +1375,10 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
uploadToOssUtil.upload(ConstantFilePath.LOGO_PATH + "logo-main-en.png", "images/images" + sceneNum + "/logo-main-en.png");
|
|
|
}
|
|
|
SceneProPO sceneProPO = null;
|
|
|
+ Object[] objects = null;
|
|
|
+ BuildSceneMqMessage mqMessage = null;
|
|
|
if(fromOss){
|
|
|
+ // TODO: 2022/3/21 plus版本稳定后删除 ---------------------------------------------------------------------------------start
|
|
|
sceneProPO = this.createScenePro(sceneNum, camera.getId(), camera.getChildName(), jsonObject.getString("creator"),
|
|
|
jsonObject.getString("pwd"), unicode,
|
|
|
cameraType, String.valueOf(fileId), prefix, "", icon, "0", cameraDetail.getUserId(), userName,
|
|
@@ -1346,7 +1386,18 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
jsonObject.getJSONArray("points").size(), jsonObject.getString("name"), jsonObject.getString("info"),
|
|
|
jsonObject.getInteger("scenetype"), jsonObject.getString("gps"), rebuild,
|
|
|
jsonObject.getInteger("resolution"), firmwareVersion.toString(), sceneUrl, buildType, type, ecsType,cameraDetail.getCooperationUser());
|
|
|
+ // TODO: 2022/3/21 plus版本稳定后删除 ---------------------------------------------------------------------------------end
|
|
|
+
|
|
|
+ objects = this.createScenePlus2(sceneNum, camera.getId(), camera.getChildName(), jsonObject.getString("creator"),
|
|
|
+ jsonObject.getString("pwd"), unicode,
|
|
|
+ cameraType, String.valueOf(fileId), prefix, "", icon, "0", cameraDetail.getUserId(), userName,
|
|
|
+ jsonObject.getString("location") != null && "1".equals(jsonObject.getString("location")) ? "sfm" : "slam",
|
|
|
+ jsonObject.getJSONArray("points").size(), jsonObject.getString("name"), jsonObject.getString("info"),
|
|
|
+ jsonObject.getInteger("scenetype"), jsonObject.getString("gps"), rebuild,
|
|
|
+ jsonObject.getInteger("resolution"), firmwareVersion.toString(), sceneUrl, buildType, ecsType,cameraDetail.getCooperationUser());
|
|
|
+
|
|
|
}else {
|
|
|
+ // TODO: 2022/3/21 plus版本稳定后删除 ---------------------------------------------------------------------------------start
|
|
|
sceneProPO = this.createScenePro(sceneNum, camera.getId(), camera.getChildName(), jsonObject.getString("creator"),
|
|
|
jsonObject.getString("pwd"), unicode,
|
|
|
cameraDetail.getGoodsId(), String.valueOf(fileId), "", "", icon, "0", cameraDetail.getUserId(), userName,
|
|
@@ -1354,7 +1405,17 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
jsonObject.getJSONArray("points").size(), jsonObject.getString("name"), jsonObject.getString("info"),
|
|
|
jsonObject.getInteger("scenetype"), jsonObject.getString("gps"), rebuild,
|
|
|
jsonObject.getInteger("resolution"), firmwareVersion.toString(), sceneUrl, buildType, type, ecsType, cameraDetail.getCooperationUser());
|
|
|
+ // TODO: 2022/3/21 plus版本稳定后删除 ---------------------------------------------------------------------------------end
|
|
|
+
|
|
|
+ objects = this.createScenePlus2(sceneNum, camera.getId(), camera.getChildName(), jsonObject.getString("creator"),
|
|
|
+ jsonObject.getString("pwd"), unicode,
|
|
|
+ cameraDetail.getGoodsId(), String.valueOf(fileId), "", "", icon, "0", cameraDetail.getUserId(), userName,
|
|
|
+ jsonObject.getString("location") != null && "1".equals(jsonObject.getString("location")) ? "sfm" : "slam",
|
|
|
+ jsonObject.getJSONArray("points").size(), jsonObject.getString("name"), jsonObject.getString("info"),
|
|
|
+ jsonObject.getInteger("scenetype"), jsonObject.getString("gps"), rebuild,
|
|
|
+ jsonObject.getInteger("resolution"), firmwareVersion.toString(), sceneUrl, buildType, ecsType, cameraDetail.getCooperationUser());
|
|
|
}
|
|
|
+ mqMessage = (BuildSceneMqMessage)objects[1];
|
|
|
|
|
|
if(sceneProPO != null){
|
|
|
JSONObject statusJson = new JSONObject();
|
|
@@ -1477,7 +1538,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
return;
|
|
|
}
|
|
|
if(sceneProPO != null){
|
|
|
- mqProducer.sendInOrder(topicModelingA, sceneProPO.getId()+"", sceneProPO.getMqMsg());
|
|
|
+ mqProducer.syncSend(topicModelingAPre, mqMessage);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -1631,6 +1692,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
MatrixToImageWriterUtil.createQRCode(url + projectNum + "&lang=en", ConstantFilePath.BASE_PATH + File.separator + "sceneQRcode/"+projectNum+"_en.png", null);
|
|
|
log.info("二维码生成完成");
|
|
|
|
|
|
+
|
|
|
BeanUtil.copyProperties(sceneExt, scenePo);
|
|
|
BeanUtil.copyProperties(scene, scenePo);
|
|
|
|
|
@@ -1646,13 +1708,10 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
ScenePlusVO scenePlusVO = new ScenePlusVO();
|
|
|
ScenePlus scenePlus = new ScenePlus();
|
|
|
ScenePlusExt scenePlusExt = new ScenePlusExt();
|
|
|
-// ScenePO scenePo = new ScenePO();
|
|
|
-// Scene scene = new Scene();
|
|
|
-// SceneExt sceneExt = new SceneExt();
|
|
|
scenePlusExt.setWebSite(url+projectNum);
|
|
|
scenePlus.setCameraId(cameraId);
|
|
|
scenePlus.setPhoneId(phoneId);
|
|
|
- scenePlus.setNum(String.valueOf(projectNum));
|
|
|
+ scenePlus.setNum(projectNum);
|
|
|
if(scenepsd == null)
|
|
|
{
|
|
|
scenepsd = "";
|
|
@@ -1664,10 +1723,6 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
// }
|
|
|
// TODO: 2022/3/16 这里暂时不确定要不要 ---end
|
|
|
|
|
|
- if(!org.springframework.util.StringUtils.isEmpty(ecsType)){
|
|
|
- scenePlusExt.setEcs(ecsType);
|
|
|
- }
|
|
|
-
|
|
|
String path = ConstantFilePath.BUILD_MODEL_PATH + unicode;
|
|
|
|
|
|
if(cameraType.longValue() >= 4){
|
|
@@ -1687,6 +1742,10 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
|
|
|
}
|
|
|
|
|
|
+ if(!org.springframework.util.StringUtils.isEmpty(ecsType)){
|
|
|
+ scenePlusExt.setEcs(ecsType);
|
|
|
+ }
|
|
|
+
|
|
|
if(pic!=null&&pic.length()>5) {
|
|
|
scenePlusExt.setThumb(pic);
|
|
|
}else{
|
|
@@ -1906,8 +1965,8 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
//type=0为新生成场景,其余为重新计算场景
|
|
|
|
|
|
// TODO: 2022/2/23 SceneProEdit 重构版本SceneProEdit 这个表可能不用,这里先暂时注释掉
|
|
|
-// SceneProEdit sceneProEdit = new SceneProEdit();
|
|
|
-// SceneProEditExt sceneProEditExt = new SceneProEditExt();
|
|
|
+ SceneProEdit sceneProEdit = new SceneProEdit();
|
|
|
+ SceneProEditExt sceneProEditExt = new SceneProEditExt();
|
|
|
if(type == 0){
|
|
|
scenePro.setSceneStatus(SceneStatus.wait.code());
|
|
|
sceneProService.save(scenePro);
|
|
@@ -1918,35 +1977,35 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
sceneEditInfo.setSceneProId(scenePro.getId());
|
|
|
sceneEditInfoService.save(sceneEditInfo);
|
|
|
|
|
|
-// sceneProEdit.setNeedKey(0);
|
|
|
-// if(sceneKey == null) {
|
|
|
-// sceneKey = "";
|
|
|
-// }
|
|
|
-// sceneProEdit.setSceneKey(sceneKey);
|
|
|
-// if(!sceneKey.equals("")) {
|
|
|
-// sceneProEdit.setNeedKey(1);
|
|
|
-// }else {
|
|
|
-// sceneProEdit.setNeedKey(0);
|
|
|
-// }
|
|
|
-//
|
|
|
-// sceneProEdit.setProId(scenePro.getId());
|
|
|
-// sceneProEdit.setFloorLogoSize(100);
|
|
|
-// sceneProEdit.setCreateTime(Calendar.getInstance().getTime());
|
|
|
-// sceneProEditService.save(sceneProEdit);
|
|
|
-//
|
|
|
-// sceneProEditExt.setProEditId(sceneProEdit.getId());
|
|
|
-// sceneProEditExt.setProId(scenePro.getId());
|
|
|
-// sceneProEditExt.setMapVisi(1);
|
|
|
-// sceneProEditExt.setTourVisi(1);
|
|
|
-// sceneProEditExt.setVrVisi(1);
|
|
|
-// sceneProEditExt.setRulerVisi(1);
|
|
|
-// sceneProEditExt.setCadImgVisi(1);
|
|
|
-// sceneProEditExt.setPanoVisi(1);
|
|
|
-// sceneProEditExt.setM2dVisi(1);
|
|
|
-// sceneProEditExt.setM3dVisi(1);
|
|
|
-// sceneProEditExt.setMeasureVisi(0);
|
|
|
-// sceneProEditExt.setCreateTime(Calendar.getInstance().getTime());
|
|
|
-// sceneProEditExtService.save(sceneProEditExt);
|
|
|
+ sceneProEdit.setNeedKey(0);
|
|
|
+ if(sceneKey == null) {
|
|
|
+ sceneKey = "";
|
|
|
+ }
|
|
|
+ sceneProEdit.setSceneKey(sceneKey);
|
|
|
+ if(!sceneKey.equals("")) {
|
|
|
+ sceneProEdit.setNeedKey(1);
|
|
|
+ }else {
|
|
|
+ sceneProEdit.setNeedKey(0);
|
|
|
+ }
|
|
|
+
|
|
|
+ sceneProEdit.setProId(scenePro.getId());
|
|
|
+ sceneProEdit.setFloorLogoSize(100);
|
|
|
+ sceneProEdit.setCreateTime(Calendar.getInstance().getTime());
|
|
|
+ sceneProEditService.save(sceneProEdit);
|
|
|
+
|
|
|
+ sceneProEditExt.setProEditId(sceneProEdit.getId());
|
|
|
+ sceneProEditExt.setProId(scenePro.getId());
|
|
|
+ sceneProEditExt.setMapVisi(1);
|
|
|
+ sceneProEditExt.setTourVisi(1);
|
|
|
+ sceneProEditExt.setVrVisi(1);
|
|
|
+ sceneProEditExt.setRulerVisi(1);
|
|
|
+ sceneProEditExt.setCadImgVisi(1);
|
|
|
+ sceneProEditExt.setPanoVisi(1);
|
|
|
+ sceneProEditExt.setM2dVisi(1);
|
|
|
+ sceneProEditExt.setM3dVisi(1);
|
|
|
+ sceneProEditExt.setMeasureVisi(0);
|
|
|
+ sceneProEditExt.setCreateTime(Calendar.getInstance().getTime());
|
|
|
+ sceneProEditExtService.save(sceneProEditExt);
|
|
|
|
|
|
|
|
|
//新增场景时,同时新增场景协作信息
|
|
@@ -1998,56 +2057,54 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
}
|
|
|
sceneEditInfoService.updateById(sceneEditInfo);
|
|
|
|
|
|
+ SceneProEdit oldSceneProEdit = sceneProEditService.findByProId(scenePro.getId());
|
|
|
+ SceneProEditExt oldSceneProEditeExt = sceneProEditExtService.getByProEditId(oldSceneProEdit.getId());
|
|
|
+ sceneProEdit.setNeedKey(0);
|
|
|
|
|
|
-// SceneProEdit oldSceneProEdit = sceneProEditService.findByProId(scenePro.getId());
|
|
|
-// SceneProEditExt oldSceneProEditeExt = sceneProEditExtService.getByProEditId(oldSceneProEdit.getId());
|
|
|
-// sceneProEdit.setNeedKey(0);
|
|
|
-//
|
|
|
-// if(sceneKey == null) {
|
|
|
-// sceneKey = "";
|
|
|
-// }
|
|
|
-// sceneProEdit.setSceneKey(sceneKey);
|
|
|
-// if(!sceneKey.equals("")) {
|
|
|
-// sceneProEdit.setNeedKey(1);
|
|
|
-// }else {
|
|
|
-// sceneProEdit.setNeedKey(0);
|
|
|
-// }
|
|
|
-//
|
|
|
-// sceneProEdit.setId(oldSceneProEdit.getId());
|
|
|
-// sceneProEdit.setProId(scenePro.getId());
|
|
|
-// sceneProEdit.setFloorLogoSize(100);
|
|
|
-// sceneProEdit.setTbStatus(TbStatus.VALID.code());
|
|
|
-// sceneProEdit.setFloorPublishVer(oldSceneProEdit.getFloorEditVer() + 1);
|
|
|
-// sceneProEdit.setFloorEditVer(oldSceneProEdit.getFloorEditVer() + 1);
|
|
|
-// sceneProEdit.setVersion(oldSceneProEdit.getVersion() + 1);
|
|
|
-// sceneProEdit.setUpdateTime(Calendar.getInstance().getTime());
|
|
|
-// sceneProEditService.updateById(sceneProEdit);
|
|
|
-//
|
|
|
-// sceneProEditExt.setId(oldSceneProEditeExt.getId());
|
|
|
-// sceneProEditExt.setProId(scenePro.getId());
|
|
|
-// sceneProEditExt.setMapVisi(1);
|
|
|
-// sceneProEditExt.setTourVisi(1);
|
|
|
-// sceneProEditExt.setVrVisi(1);
|
|
|
-// sceneProEditExt.setRulerVisi(1);
|
|
|
-// sceneProEditExt.setCadImgVisi(1);
|
|
|
-// sceneProEditExt.setPanoVisi(1);
|
|
|
-// sceneProEditExt.setM2dVisi(1);
|
|
|
-// sceneProEditExt.setM3dVisi(1);
|
|
|
-// sceneProEditExt.setMeasureVisi(0);
|
|
|
-// sceneProEditExt.setCreateTime(oldSceneProEdit.getCreateTime());
|
|
|
-// sceneProEditExt.setImagesVersion(oldSceneProEditeExt.getImagesVersion() + 1);
|
|
|
-// sceneProEditExt.setUpdateTime(Calendar.getInstance().getTime());
|
|
|
-// sceneProEditExtService.updateById(sceneProEditExt);
|
|
|
-
|
|
|
- }
|
|
|
+ if(sceneKey == null) {
|
|
|
+ sceneKey = "";
|
|
|
+ }
|
|
|
+ sceneProEdit.setSceneKey(sceneKey);
|
|
|
+ if(!sceneKey.equals("")) {
|
|
|
+ sceneProEdit.setNeedKey(1);
|
|
|
+ }else {
|
|
|
+ sceneProEdit.setNeedKey(0);
|
|
|
+ }
|
|
|
|
|
|
- BuildSceneMqMessage buildSceneMqMessage =this.getBuildSceneMqMessage(
|
|
|
- projectNum, cameraName, unicode, cameraType, fileId, prefix, imgsName, isModel,
|
|
|
- userName, algorithm, resolution, buildType, path, scenePro.getId(), scenePro.getSceneName(),
|
|
|
- scenePro.getWebSite(), scenePro.getCreateTime(), scenePro.getUserId(),
|
|
|
- sceneProExt.getDataSource(), scenePro.getSceneStatus(), scenePro.getPayStatus(), scenePro.getThumb());
|
|
|
+ sceneProEdit.setId(oldSceneProEdit.getId());
|
|
|
+ sceneProEdit.setProId(scenePro.getId());
|
|
|
+ sceneProEdit.setFloorLogoSize(100);
|
|
|
+ sceneProEdit.setTbStatus(TbStatus.VALID.code());
|
|
|
+ sceneProEdit.setFloorPublishVer(oldSceneProEdit.getFloorEditVer() + 1);
|
|
|
+ sceneProEdit.setFloorEditVer(oldSceneProEdit.getFloorEditVer() + 1);
|
|
|
+ sceneProEdit.setVersion(oldSceneProEdit.getVersion() + 1);
|
|
|
+ sceneProEdit.setUpdateTime(Calendar.getInstance().getTime());
|
|
|
+ sceneProEditService.updateById(sceneProEdit);
|
|
|
+
|
|
|
+ sceneProEditExt.setId(oldSceneProEditeExt.getId());
|
|
|
+ sceneProEditExt.setProId(scenePro.getId());
|
|
|
+ sceneProEditExt.setMapVisi(1);
|
|
|
+ sceneProEditExt.setTourVisi(1);
|
|
|
+ sceneProEditExt.setVrVisi(1);
|
|
|
+ sceneProEditExt.setRulerVisi(1);
|
|
|
+ sceneProEditExt.setCadImgVisi(1);
|
|
|
+ sceneProEditExt.setPanoVisi(1);
|
|
|
+ sceneProEditExt.setM2dVisi(1);
|
|
|
+ sceneProEditExt.setM3dVisi(1);
|
|
|
+ sceneProEditExt.setMeasureVisi(0);
|
|
|
+ sceneProEditExt.setCreateTime(oldSceneProEdit.getCreateTime());
|
|
|
+ sceneProEditExt.setImagesVersion(oldSceneProEditeExt.getImagesVersion() + 1);
|
|
|
+ sceneProEditExt.setUpdateTime(Calendar.getInstance().getTime());
|
|
|
+ sceneProEditExtService.updateById(sceneProEditExt);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+// BuildSceneMqMessage buildSceneMqMessage =this.getBuildSceneMqMessage(
|
|
|
+// projectNum, cameraName, unicode, cameraType, fileId, prefix, imgsName, isModel,
|
|
|
+// userName, algorithm, resolution, buildType, path, scenePro.getId(), scenePro.getSceneName(),
|
|
|
+// scenePro.getWebSite(), scenePro.getCreateTime(), scenePro.getUserId(),
|
|
|
+// sceneProExt.getDataSource(), scenePro.getSceneStatus(), scenePro.getPayStatus(), scenePro.getThumb());
|
|
|
|
|
|
- sceneProPO.setMqMsg(buildSceneMqMessage);
|
|
|
BeanUtil.copyProperties(sceneProExt, sceneProPO);
|
|
|
BeanUtil.copyProperties(scenePro, sceneProPO);
|
|
|
|
|
@@ -2069,13 +2126,13 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
}
|
|
|
scenejson.put("createTime", new DateTime(new Date()).toString("yyyy-MM-dd HH:mm"));
|
|
|
|
|
|
-// scenejson.put("floorPublishVer", sceneProEdit.getFloorPublishVer());
|
|
|
-// scenejson.put("floorEditVer", sceneProEdit.getFloorEditVer());
|
|
|
+ scenejson.put("floorPublishVer", sceneProEdit.getFloorPublishVer());
|
|
|
+ scenejson.put("floorEditVer", sceneProEdit.getFloorEditVer());
|
|
|
scenejson.put("entry", null);
|
|
|
|
|
|
-// if(!org.springframework.util.StringUtils.isEmpty(sceneProEdit.getHotsIds())){
|
|
|
-// scenejson.put("hots", 1);
|
|
|
-// }
|
|
|
+ if(!org.springframework.util.StringUtils.isEmpty(sceneProEdit.getHotsIds())){
|
|
|
+ scenejson.put("hots", 1);
|
|
|
+ }
|
|
|
|
|
|
File file = new File(ConstantFilePath.SCENE_PATH+"data/data"+projectNum);
|
|
|
if(!file.exists()||!file.isDirectory())
|
|
@@ -2093,6 +2150,228 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
return sceneProPO;
|
|
|
}
|
|
|
|
|
|
+ public Object[] createScenePlus2(String projectNum, Long cameraId, String cameraName, String phoneId, String sceneKey,
|
|
|
+ String unicode, Long cameraType, String fileId, String prefix,
|
|
|
+ String imgsName, String pic, String isModel, Long userId, String userName,
|
|
|
+ String algorithm, Integer sceneShootCount, String sceneName,
|
|
|
+ String sceneDec, Integer sceneType, String gps,Integer type,
|
|
|
+ Integer resolution, String firmwareVersion, String url, String buildType, String ecsType,
|
|
|
+ Long cooperationUser)throws Exception{
|
|
|
+
|
|
|
+// SceneProPO sceneProPO = new SceneProPO();
|
|
|
+// ScenePro scenePro = new ScenePro();
|
|
|
+// SceneProExt sceneProExt = new SceneProExt();
|
|
|
+// scenePro.setWebSite(url+projectNum);
|
|
|
+// scenePro.setCameraId(cameraId);
|
|
|
+// sceneProExt.setPhoneId(phoneId);
|
|
|
+// scenePro.setNum(projectNum);
|
|
|
+ ScenePlusVO scenePlusVO = new ScenePlusVO();
|
|
|
+ ScenePlus scenePlus = new ScenePlus();
|
|
|
+ ScenePlusExt scenePlusExt = new ScenePlusExt();
|
|
|
+ scenePlusExt.setWebSite(url+projectNum);
|
|
|
+ scenePlus.setCameraId(cameraId);
|
|
|
+ scenePlus.setPhoneId(phoneId);
|
|
|
+ scenePlus.setNum(projectNum);
|
|
|
+
|
|
|
+ String path = ConstantFilePath.BUILD_MODEL_PATH + unicode;
|
|
|
+
|
|
|
+ scenePlus.setSceneSource(1);
|
|
|
+ if(cameraType.longValue() == 5 || cameraType.longValue() == 6){
|
|
|
+ //场景来源双目相机
|
|
|
+ scenePlus.setSceneSource(2);
|
|
|
+ scenePlusExt.setDataSource(ConstantFilePath.BUILD_MODEL_PATH + unicode);
|
|
|
+ }else if(cameraType.longValue() == 14){
|
|
|
+
|
|
|
+ scenePlusExt.setDataSource(ConstantFilePath.BUILD_MODEL_LASER_PATH +
|
|
|
+ cameraName.replace("4DKKPRO_", "").replace("-fdage", "").toLowerCase() + File.separator +
|
|
|
+ fileId + File.separator + unicode);
|
|
|
+ path = ConstantFilePath.BUILD_MODEL_LASER_PATH + unicode;
|
|
|
+ log.info("激光相机 dataSource :" + scenePlusExt.getDataSource());
|
|
|
+
|
|
|
+ }else if(cameraType.longValue() >= 3){
|
|
|
+ scenePlusExt.setDataSource(ConstantFilePath.BUILD_MODEL_PATH +
|
|
|
+ cameraName.replace("4DKKPRO_", "").replace("-fdage", "").toLowerCase() + File.separator +
|
|
|
+ fileId + File.separator + unicode);
|
|
|
+ }else {
|
|
|
+ scenePlusExt.setDataSource(prefix+imgsName);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!org.springframework.util.StringUtils.isEmpty(ecsType)){
|
|
|
+ scenePlusExt.setEcs(ecsType);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(resolution == null || resolution.intValue() == 0){
|
|
|
+ scenePlusExt.setSceneScheme(cameraType.intValue());
|
|
|
+ }else {
|
|
|
+ scenePlusExt.setSceneScheme(4);
|
|
|
+ }
|
|
|
+
|
|
|
+ //场景来源双目相机,sceneScheme为4,加载high,low图
|
|
|
+ if(cameraType.longValue() == 5 || cameraType.longValue() == 6){
|
|
|
+ scenePlusExt.setSceneScheme(4);
|
|
|
+ }
|
|
|
+
|
|
|
+ //转台相机用4k图
|
|
|
+ if(cameraType.longValue() == 13 ){
|
|
|
+ scenePlus.setSceneSource(3);
|
|
|
+ scenePlusExt.setSceneScheme(10);
|
|
|
+ }
|
|
|
+
|
|
|
+ //激光相机
|
|
|
+ if(cameraType.longValue() == 14 ){
|
|
|
+ scenePlus.setSceneSource(4);
|
|
|
+ scenePlusExt.setSceneScheme(10);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(pic!=null&&pic.length()>5)
|
|
|
+ {
|
|
|
+ scenePlusExt.setThumb(pic);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ scenePlusExt.setThumb(ConstantUrl.DEFAULT_SCENE_PIC);
|
|
|
+ }
|
|
|
+ scenePlusExt.setThumb(scenePlusExt.getThumb().concat("?t=")+System.currentTimeMillis());
|
|
|
+
|
|
|
+ if(!ObjectUtils.isEmpty(userName)){
|
|
|
+ scenePlus.setUserId(userId);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(sceneShootCount == null)
|
|
|
+ {
|
|
|
+ scenePlusExt.setShootCount(0);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ scenePlusExt.setShootCount(sceneShootCount);
|
|
|
+ }
|
|
|
+ if(sceneName!=null)
|
|
|
+ {
|
|
|
+ scenePlus.setTitle(sceneName);
|
|
|
+ }
|
|
|
+ if(sceneDec!=null)
|
|
|
+ {
|
|
|
+ scenePlus.setDescription("<p>"+ new String(sceneDec.getBytes("UTF-8"))+"</p>");
|
|
|
+ }
|
|
|
+
|
|
|
+ if(sceneType!=null)
|
|
|
+ {
|
|
|
+ scenePlus.setSceneType(sceneType);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(gps!=null&&!gps.trim().equals(""))
|
|
|
+ {
|
|
|
+ scenePlusExt.setGps(gps);
|
|
|
+ }
|
|
|
+
|
|
|
+ scenePlusExt.setAlgorithm(algorithm);
|
|
|
+ if(!org.springframework.util.StringUtils.isEmpty(firmwareVersion)){
|
|
|
+ scenePlusExt.setFirmwareVersion(firmwareVersion);
|
|
|
+ }
|
|
|
+ scenePlusExt.setBuildType(buildType);
|
|
|
+ log.info("场景记录添加到数据库:"+projectNum);
|
|
|
+ //type=0为新生成场景,其余为重新计算场景
|
|
|
+
|
|
|
+ SceneEditInfo sceneEditInfo = new SceneEditInfo();
|
|
|
+ SceneEditInfoExt sceneEditInfoExt = new SceneEditInfoExt();
|
|
|
+ SceneEditControls sceneEditControls = new SceneEditControls();
|
|
|
+ if(type == 0){
|
|
|
+ scenePlus.setSceneStatus(SceneStatus.wait.code());
|
|
|
+ scenePlusService.save(scenePlus);
|
|
|
+ scenePlusExt.setPlusId(scenePlus.getId());
|
|
|
+ scenePlusExtService.save(scenePlusExt);
|
|
|
+
|
|
|
+ sceneEditInfo.setScenePlusId(scenePlus.getId());
|
|
|
+
|
|
|
+ if(StrUtil.isNotBlank(sceneKey)) {
|
|
|
+ sceneEditInfo.setScenePassword(sceneKey);
|
|
|
+ sceneEditControls.setShowLock((int) CommonStatus.YES.code());
|
|
|
+ }
|
|
|
+
|
|
|
+ sceneEditInfoService.save(sceneEditInfo);
|
|
|
+ sceneEditControls.setEditInfoId(sceneEditInfo.getId());
|
|
|
+ sceneEditControlsService.save(sceneEditControls);
|
|
|
+
|
|
|
+ //新增场景时,同时新增场景协作信息
|
|
|
+ if(cooperationUser != null){
|
|
|
+ SceneCooperation sceneCooperationEntity = new SceneCooperation();
|
|
|
+ sceneCooperationEntity.setNum(projectNum);
|
|
|
+ sceneCooperationEntity.setUserId(cooperationUser);
|
|
|
+ sceneCooperationService.save(sceneCooperationEntity);
|
|
|
+
|
|
|
+ List<SceneResourceCamera> resourceCameraList = sceneResourceCameraService.findListByCameraId(cameraId);
|
|
|
+
|
|
|
+ SceneResourceCooperation sceneResourceCooperation = null;
|
|
|
+ if(resourceCameraList != null && resourceCameraList.size() > 0){
|
|
|
+ for (SceneResourceCamera sceneResourceCamera : resourceCameraList) {
|
|
|
+ sceneResourceCooperation = new SceneResourceCooperation();
|
|
|
+ sceneResourceCooperation.setSceneResourceId(sceneResourceCamera.getSceneResourceId());
|
|
|
+ sceneResourceCooperation.setSceneCooperationId(sceneCooperationEntity.getId());
|
|
|
+ sceneResourceCooperationService.save(sceneResourceCooperation);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ ScenePlus oldScene = scenePlusService.getScenePlusByNum(projectNum);
|
|
|
+ scenePlus.setId(oldScene.getId());
|
|
|
+ scenePlus.setSceneStatus(0);
|
|
|
+ scenePlus.setTbStatus(TbStatus.VALID.code());
|
|
|
+ scenePlus.setPayStatus(0);
|
|
|
+ scenePlus.setCreateTime(Calendar.getInstance().getTime());
|
|
|
+
|
|
|
+ ScenePlusExt oldSceneExt = scenePlusExtService.getScenePlusExtByPlusId(oldScene.getId());
|
|
|
+ scenePlusExt.setSpace(oldSceneExt.getSpace());
|
|
|
+ scenePlusExt.setEcs(oldSceneExt.getEcs());
|
|
|
+ scenePlusExt.setViewCount(oldSceneExt.getViewCount());
|
|
|
+ if(sceneName!=null) {
|
|
|
+ scenePlus.setTitle(sceneName);
|
|
|
+ }
|
|
|
+ if(sceneType!=null) {
|
|
|
+ scenePlus.setSceneType(sceneType);
|
|
|
+ }
|
|
|
+ scenePlusService.updateById(scenePlus);
|
|
|
+ scenePlusExtService.updateById(scenePlusExt);
|
|
|
+
|
|
|
+ SceneEditInfo oldSceneEditInfo = sceneEditInfoService.getByScenePlusId(oldScene.getId());
|
|
|
+ SceneEditInfoExt oldSceneEditeIinfoExt = sceneEditInfoExtService.getByEditInfoId(oldSceneEditInfo.getId());
|
|
|
+ if(StrUtil.isNotBlank(sceneKey)) {
|
|
|
+ sceneEditInfo.setScenePassword(sceneKey);
|
|
|
+ sceneEditControls.setShowLock((int) CommonStatus.YES.code());
|
|
|
+ }else{
|
|
|
+ sceneEditInfo.setScenePassword("");
|
|
|
+ sceneEditControls.setShowLock((int)CommonStatus.NO.code());
|
|
|
+ }
|
|
|
+
|
|
|
+ sceneEditInfo.setId(oldSceneEditInfo.getId());
|
|
|
+ sceneEditInfo.setScenePlusId(scenePlus.getId());
|
|
|
+ sceneEditInfo.setFloorLogoSize(100);
|
|
|
+ sceneEditInfo.setTbStatus(TbStatus.VALID.code());
|
|
|
+ sceneEditInfo.setFloorPublishVer(oldSceneEditInfo.getFloorEditVer() + 1);
|
|
|
+ sceneEditInfo.setFloorEditVer(oldSceneEditInfo.getFloorEditVer() + 1);
|
|
|
+ sceneEditInfo.setVersion(oldSceneEditInfo.getVersion() + 1);
|
|
|
+ sceneEditInfoService.updateById(sceneEditInfo);
|
|
|
+
|
|
|
+ sceneEditInfoExt.setId(oldSceneEditeIinfoExt.getId());
|
|
|
+ sceneEditInfoExt.setEditInfoId(sceneEditInfo.getId());
|
|
|
+ sceneEditInfoExt.setScenePlusId(scenePlus.getId());
|
|
|
+ sceneEditInfoExtService.updateById(sceneEditInfoExt);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ BuildSceneMqMessage buildSceneMqMessage =this.getBuildSceneMqMessage(
|
|
|
+ projectNum, cameraName, unicode, cameraType, fileId, prefix, imgsName, isModel,
|
|
|
+ userName, algorithm, resolution, buildType, path, scenePlus.getId(), scenePlus.getTitle(),
|
|
|
+ scenePlusExt.getWebSite(), scenePlus.getCreateTime(), scenePlus.getUserId(),
|
|
|
+ scenePlusExt.getDataSource(), scenePlus.getSceneStatus(), scenePlus.getPayStatus(), scenePlusExt.getThumb());
|
|
|
+
|
|
|
+ BeanUtil.copyProperties(scenePlusExt, scenePlusVO);
|
|
|
+ BeanUtil.copyProperties(scenePlus, scenePlusVO);
|
|
|
+
|
|
|
+
|
|
|
+ //当mq排队数大于指定数量时使用弹性升缩
|
|
|
+ return new Object[]{scenePlusVO, buildSceneMqMessage};
|
|
|
+ }
|
|
|
+
|
|
|
public BuildSceneMqMessage getBuildSceneMqMessage(String projectNum, String cameraName, String unicode,
|
|
|
Long cameraType, String fileId,String prefix, String imgsName,
|
|
|
String isModel, String userName,String algorithm, Integer resolution,
|
|
@@ -2270,7 +2549,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
if(Objects.isNull(scenePlus)){
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
|
}
|
|
|
- ScenePlusExt scenePlusExt = scenePlusExtService.getSceneProExtByPlusId(scenePlus.getId());
|
|
|
+ ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
|
String path = scenePlusExt.getDataSource();
|
|
|
Integer sceneSource = scenePlus.getSceneSource();
|
|
|
String dataSource = scenePlusExt.getDataSource();
|
|
@@ -2372,7 +2651,10 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
userName = user.getUserName();
|
|
|
}
|
|
|
//重算的场景,先移除该场景对应的容量
|
|
|
+ scenePlusService.resetSpace(num);
|
|
|
+ // TODO: 2022/3/19 plus版本稳定后需要删除---------------start
|
|
|
sceneProService.rebuildReduceSpaceBySceneNum(num);
|
|
|
+ // TODO: 2022/3/19 plus版本稳定后需要删除---------------end
|
|
|
|
|
|
JSONObject statusJson = new JSONObject();
|
|
|
//临时将-2改成1,app还没完全更新
|
|
@@ -2422,7 +2704,10 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
|
mqProducer.syncSend(topicModelingAPre, buildSceneMqMessage);
|
|
|
}
|
|
|
|
|
|
+ // TODO: plus版本稳定后删除 -------------------------------start
|
|
|
sceneProService.updateStatus(num,0);
|
|
|
+ // TODO: plus版本稳定后删除 -------------------------------end
|
|
|
+
|
|
|
scenePlusService.update(new LambdaUpdateWrapper<ScenePlus>()
|
|
|
.set(ScenePlus::getSceneStatus, SceneStatus.wait.code())
|
|
|
.eq(ScenePlus::getNum, num));
|