|
|
@@ -69,68 +69,60 @@ public class IFdkkLaserServiceImpl implements IFdkkLaserService {
|
|
|
@Autowired
|
|
|
private ICameraDetailService cameraDetailService;
|
|
|
|
|
|
- public void syncBuildResult(SyncLaserResultBean laserResultBean) {
|
|
|
- log.info("激光转台相机构建结果 同步 请求 ");
|
|
|
- try {
|
|
|
- String num = laserResultBean.getNum();
|
|
|
- String dataSource = laserResultBean.getDataSource();
|
|
|
- Integer sceneStatus = laserResultBean.getSceneStatus();
|
|
|
- Date createTime = laserResultBean.getCreateTime();
|
|
|
- Integer shootCount = laserResultBean.getShootCount();
|
|
|
- Integer slamCount = laserResultBean.getSlamCount();
|
|
|
- Integer payStatus = laserResultBean.getPayStatus();
|
|
|
- Boolean mixture = laserResultBean.getMixture() == CommonStatus.NO.code().intValue() ? false : true;
|
|
|
- String version = SceneVersionType.V4.code();
|
|
|
-
|
|
|
-
|
|
|
- String jgPath = dataSource;
|
|
|
- //创建目录
|
|
|
- if (dataSource.lastIndexOf("/") != -1) {
|
|
|
- jgPath = jgPath + "_laserData";
|
|
|
- } else {
|
|
|
- jgPath = jgPath.substring(0, jgPath.length() - 1) + "_laserData";
|
|
|
- }
|
|
|
+ public void syncBuildResult(SyncLaserResultBean laserResultBean) throws IOException {
|
|
|
+ log.info("开始同步点云场景计算结果, num:{}", laserResultBean.getNum());
|
|
|
+ String num = laserResultBean.getNum();
|
|
|
+ String dataSource = laserResultBean.getDataSource();
|
|
|
+ Integer sceneStatus = laserResultBean.getSceneStatus();
|
|
|
+ Date createTime = laserResultBean.getCreateTime();
|
|
|
+ Integer shootCount = laserResultBean.getShootCount();
|
|
|
+ Integer slamCount = laserResultBean.getSlamCount();
|
|
|
+ Integer payStatus = laserResultBean.getPayStatus();
|
|
|
+ Boolean mixture = laserResultBean.getMixture() == CommonStatus.NO.code().intValue() ? false : true;
|
|
|
+ String version = SceneVersionType.V4.code();
|
|
|
+
|
|
|
+
|
|
|
+ String jgPath = dataSource;
|
|
|
+ //创建目录
|
|
|
+ if (dataSource.lastIndexOf("/") != -1) {
|
|
|
+ jgPath = jgPath + "_laserData";
|
|
|
+ } else {
|
|
|
+ jgPath = jgPath.substring(0, jgPath.length() - 1) + "_laserData";
|
|
|
+ }
|
|
|
|
|
|
- FileUtils.createDir(jgPath + "/extras");
|
|
|
+ FileUtils.createDir(jgPath + "/extras");
|
|
|
|
|
|
- log.info("生成 激光相机目录 " + jgPath);
|
|
|
- //生成data.json
|
|
|
- JSONObject jgDataJson = new JSONObject();
|
|
|
- jgDataJson.put("split_type", "SPLIT_V15");
|
|
|
- jgDataJson.put("skybox_type", "SKYBOX_V5");
|
|
|
- jgDataJson.put("extras", null);
|
|
|
- FileUtils.writeFile(jgPath + File.separator + "data.json", jgDataJson.toString());
|
|
|
+ //生成data.json
|
|
|
+ JSONObject jgDataJson = new JSONObject();
|
|
|
+ jgDataJson.put("split_type", "SPLIT_V15");
|
|
|
+ jgDataJson.put("skybox_type", "SKYBOX_V5");
|
|
|
+ jgDataJson.put("extras", null);
|
|
|
+ FileUtils.writeFile(jgPath + File.separator + "data.json", jgDataJson.toString());
|
|
|
|
|
|
- // result/mesh/mesh.obj --> jgPath/laserData/laser.obj
|
|
|
- log.info("开始拷贝obj文件");
|
|
|
- FileUtils.copyDirectiory(dataSource + "/results/mesh", jgPath + "/laserData/mesh");
|
|
|
+ FileUtils.copyDirectiory(dataSource + "/results/mesh", jgPath + "/laserData/mesh");
|
|
|
|
|
|
+ String srcMeshPlyPath = dataSource + "/results/mesh.ply";
|
|
|
+ if(FileUtil.exist(srcMeshPlyPath)){
|
|
|
FileUtil.copy(dataSource + "/results/mesh.ply", jgPath + "/laserData/meshPly/mesh.ply", true);
|
|
|
+ }
|
|
|
|
|
|
- FileUtils.copyDirectiory(dataSource + "/results/laserData/cover", jgPath + "/extras");
|
|
|
- //删除旧的深度图
|
|
|
- if(FileUtil.exist( jgPath+"/laserData/depthmap/")){
|
|
|
- FileUtil.del(jgPath+"/laserData/depthmap/");
|
|
|
- }
|
|
|
- FileUtils.copyFile(dataSource + "/results/laserData", jgPath, true);
|
|
|
+ FileUtils.copyDirectiory(dataSource + "/results/laserData/cover", jgPath + "/extras");
|
|
|
+ FileUtil.del(jgPath+"/laserData/depthmap/");
|
|
|
+ FileUtils.copyFile(dataSource + "/results/laserData", jgPath, true);
|
|
|
|
|
|
-// updateSceneStatus(scenePlus, scenePlusExt, jgPath + File.separator + "laserData",createTime, algorithmTime, scenePlusExt);
|
|
|
-
|
|
|
- Map<String, Object> params = new HashMap<>();
|
|
|
- params.put("sceneCode", num);
|
|
|
- params.put("status", sceneStatus);
|
|
|
- params.put("version",version);
|
|
|
- params.put("createTime", DateUtil.date2String(createTime, null));
|
|
|
- params.put("algorithmTime", DateUtil.date2String(Calendar.getInstance().getTime(), null));
|
|
|
- params.put("path", jgPath + File.separator + "laserData");
|
|
|
- params.put("shootCount", shootCount);
|
|
|
- params.put("slamCount", slamCount);
|
|
|
- params.put("payStatus", payStatus);
|
|
|
- params.put("mixture", mixture);
|
|
|
- rabbitMqProducer.sendByWorkQueue(updateScene, params);
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("激光转台相机同步失败", e);
|
|
|
- }
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+ params.put("sceneCode", num);
|
|
|
+ params.put("status", sceneStatus);
|
|
|
+ params.put("version",version);
|
|
|
+ params.put("createTime", DateUtil.date2String(createTime, null));
|
|
|
+ params.put("algorithmTime", DateUtil.date2String(Calendar.getInstance().getTime(), null));
|
|
|
+ params.put("path", jgPath + File.separator + "laserData");
|
|
|
+ params.put("shootCount", shootCount);
|
|
|
+ params.put("slamCount", slamCount);
|
|
|
+ params.put("payStatus", payStatus);
|
|
|
+ params.put("mixture", mixture);
|
|
|
+ rabbitMqProducer.sendByWorkQueue(updateScene, params);
|
|
|
+ log.info("结束同步点云场景计算结果, num:{}", laserResultBean.getNum());
|
|
|
}
|
|
|
|
|
|
@Override
|