|
@@ -2,8 +2,11 @@ package com.fdkankan.contro.service.impl;
|
|
|
|
|
|
import cn.hutool.core.io.FileUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.fdkankan.common.constant.CommonStatus;
|
|
|
+import com.fdkankan.common.constant.SceneVersionType;
|
|
|
import com.fdkankan.common.util.DateUtil;
|
|
|
import com.fdkankan.common.util.FileUtils;
|
|
|
+import com.fdkankan.contro.bean.SyncLaserResultBean;
|
|
|
import com.fdkankan.contro.entity.Camera;
|
|
|
import com.fdkankan.contro.entity.ScenePlus;
|
|
|
import com.fdkankan.contro.entity.ScenePlusExt;
|
|
@@ -19,12 +22,10 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
import java.io.File;
|
|
|
import java.io.IOException;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Objects;
|
|
|
+import java.util.*;
|
|
|
|
|
|
@Service
|
|
|
@Slf4j
|
|
@@ -42,6 +43,9 @@ public class IFdkkLaserServiceImpl implements IFdkkLaserService {
|
|
|
@Value("${queue.application.laser.update-scene}")
|
|
|
private String updateScene;
|
|
|
|
|
|
+ @Value("${queue.application.laser.init-scene:laser-init-scene}")
|
|
|
+ private String initScene;
|
|
|
+
|
|
|
@Value("${queue.application.laser.update-build-status}")
|
|
|
private String updateBuildStatus;
|
|
|
|
|
@@ -54,28 +58,22 @@ public class IFdkkLaserServiceImpl implements IFdkkLaserService {
|
|
|
@Value("${4dkk.laserService.cloud-point-fyun-path}")
|
|
|
private String cloudPointFyunPath;
|
|
|
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private FYunFileServiceInterface fYunFileService;
|
|
|
|
|
|
|
|
|
- public void updateSceneStatus(String sceneCode, int sceneStatus, String path, Date createTime, Date algorithmTime, Integer shootCount, Integer payStatus) {
|
|
|
- Map<String, Object> params = new HashMap<>();
|
|
|
- params.put("sceneCode", sceneCode);
|
|
|
- params.put("status", sceneStatus);
|
|
|
- params.put("version",getSceneVersion(sceneCode));
|
|
|
- params.put("createTime", createTime);
|
|
|
- params.put("algorithmTime", algorithmTime);
|
|
|
- if (!ObjectUtils.isEmpty(path)) {
|
|
|
- params.put("path", path);
|
|
|
- }
|
|
|
- params.put("shootCount", shootCount);
|
|
|
- params.put("payStatus", payStatus);
|
|
|
- rabbitMqProducer.sendByWorkQueue(updateScene, params);
|
|
|
- }
|
|
|
-
|
|
|
- public void syncBuildResult(String sceneNum, String dataSource,Date createTime, Date algorithmTime, Integer shootCount, Integer payStatus) {
|
|
|
+ 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 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) {
|
|
@@ -105,7 +103,19 @@ public class IFdkkLaserServiceImpl implements IFdkkLaserService {
|
|
|
}
|
|
|
FileUtils.copyFile(dataSource + "/results/laserData", jgPath, true);
|
|
|
|
|
|
- updateSceneStatus(sceneNum, 2, jgPath + File.separator + "laserData",createTime, algorithmTime, shootCount, payStatus);
|
|
|
+// 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("payStatus", payStatus);
|
|
|
+ params.put("mixture", mixture);
|
|
|
+ rabbitMqProducer.sendByWorkQueue(updateScene, params);
|
|
|
} catch (Exception e) {
|
|
|
log.error("激光转台相机同步失败", e);
|
|
|
}
|
|
@@ -144,7 +154,7 @@ public class IFdkkLaserServiceImpl implements IFdkkLaserService {
|
|
|
params.put("location", fdageJson.getInteger("location"));
|
|
|
}
|
|
|
params.put("payStatus", payStatus);
|
|
|
- rabbitMqProducer.sendByWorkQueue(updateScene, params);
|
|
|
+ rabbitMqProducer.sendByWorkQueue(initScene, params);
|
|
|
}
|
|
|
|
|
|
public void saveScene(ScenePro scenePro, String scenePassword, Camera cameraEntity, String phone, boolean rebuild, Integer payStatus) {
|
|
@@ -167,7 +177,7 @@ public class IFdkkLaserServiceImpl implements IFdkkLaserService {
|
|
|
params.put("title", scenePro.getSceneName());
|
|
|
params.put("userId", scenePro.getUserId());
|
|
|
params.put("payStatus", payStatus);
|
|
|
- rabbitMqProducer.sendByWorkQueue(updateScene, params);
|
|
|
+ rabbitMqProducer.sendByWorkQueue(initScene, params);
|
|
|
}
|
|
|
|
|
|
private String getSceneVersion(String num) {
|