|
@@ -2,15 +2,14 @@ package com.fdkankan.contro.service.impl;
|
|
|
|
|
|
import cn.hutool.core.io.FileUtil;
|
|
import cn.hutool.core.io.FileUtil;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
+import com.fdkankan.common.constant.SceneStatus;
|
|
import com.fdkankan.common.util.DateUtil;
|
|
import com.fdkankan.common.util.DateUtil;
|
|
import com.fdkankan.common.util.FileUtils;
|
|
import com.fdkankan.common.util.FileUtils;
|
|
-import com.fdkankan.contro.entity.Camera;
|
|
|
|
-import com.fdkankan.contro.entity.ScenePlus;
|
|
|
|
-import com.fdkankan.contro.entity.ScenePlusExt;
|
|
|
|
-import com.fdkankan.contro.entity.ScenePro;
|
|
|
|
|
|
+import com.fdkankan.contro.entity.*;
|
|
import com.fdkankan.contro.service.IFdkkLaserService;
|
|
import com.fdkankan.contro.service.IFdkkLaserService;
|
|
import com.fdkankan.contro.service.IScenePlusService;
|
|
import com.fdkankan.contro.service.IScenePlusService;
|
|
import com.fdkankan.contro.service.ISceneProService;
|
|
import com.fdkankan.contro.service.ISceneProService;
|
|
|
|
+import com.fdkankan.contro.service.IUserService;
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
import com.fdkankan.rabbitmq.util.RabbitMqProducer;
|
|
import com.fdkankan.rabbitmq.util.RabbitMqProducer;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -56,6 +55,8 @@ public class IFdkkLaserServiceImpl implements IFdkkLaserService {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private FYunFileServiceInterface fYunFileService;
|
|
private FYunFileServiceInterface fYunFileService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IUserService userService;
|
|
|
|
|
|
|
|
|
|
public void updateSceneStatus(String sceneCode, int sceneStatus, String path, Date createTime, Date algorithmTime, Integer shootCount, Integer payStatus) {
|
|
public void updateSceneStatus(String sceneCode, int sceneStatus, String path, Date createTime, Date algorithmTime, Integer shootCount, Integer payStatus) {
|
|
@@ -203,4 +204,63 @@ public class IFdkkLaserServiceImpl implements IFdkkLaserService {
|
|
params.put("businessType", 0);
|
|
params.put("businessType", 0);
|
|
rabbitMqProducer.sendByWorkQueue(cloudPointBuild, params);
|
|
rabbitMqProducer.sendByWorkQueue(cloudPointBuild, params);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public void sendE57ToLaser(ScenePlus scenePlus, ScenePlusExt scenePlusExt) {
|
|
|
|
+ User user = userService.getById(scenePlus.getUserId());
|
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
|
+ params.put("createTime", DateUtil.date2String(scenePlus.getCreateTime(), null));
|
|
|
|
+ params.put("phone", user.getUserName());
|
|
|
|
+ params.put("sceneCode", scenePlus.getNum());
|
|
|
|
+ params.put("status", -scenePlus.getSceneStatus());
|
|
|
|
+ params.put("version",getSceneVersion(scenePlus.getNum()));
|
|
|
|
+ params.put("title", scenePlus.getTitle());
|
|
|
|
+ params.put("userId", scenePlus.getUserId());
|
|
|
|
+ params.put("sceneSource", scenePlus.getSceneSource());
|
|
|
|
+ params.put("location", scenePlusExt.getLocation());
|
|
|
|
+ params.put("payStatus", scenePlus.getPayStatus());
|
|
|
|
+ params.put("shootCount", scenePlusExt.getShootCount());
|
|
|
|
+ if(scenePlus.getSceneStatus() == SceneStatus.wait.code()){
|
|
|
|
+ rabbitMqProducer.sendByWorkQueue("laser-e57-init-scene", params);
|
|
|
|
+ }
|
|
|
|
+ if(scenePlus.getSceneStatus() == SceneStatus.NO_DISPLAY.code()){
|
|
|
|
+ rabbitMqProducer.sendByWorkQueue("laser-e57-update-scene", params);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void syncBuildResult4E57(String dataSource) {
|
|
|
|
+ log.info("激光转台相机构建结果 同步 请求 ");
|
|
|
|
+ try {
|
|
|
|
+ String jgPath = dataSource;
|
|
|
|
+ //创建目录
|
|
|
|
+ if (dataSource.lastIndexOf("/") != -1) {
|
|
|
|
+ jgPath = jgPath + "_laserData";
|
|
|
|
+ } else {
|
|
|
|
+ jgPath = jgPath.substring(0, jgPath.length() - 1) + "_laserData";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ 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());
|
|
|
|
+
|
|
|
|
+ // result/mesh/mesh.obj --> jgPath/laserData/laser.obj
|
|
|
|
+ log.info("开始拷贝obj文件");
|
|
|
|
+ FileUtils.copyDirectiory(dataSource + "/results/mesh", jgPath + "/laserData/mesh");
|
|
|
|
+
|
|
|
|
+ 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);
|
|
|
|
+
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error("激光转台相机同步失败", e);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|