|
@@ -3,6 +3,7 @@ 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.CommonStatus;
|
|
import com.fdkankan.common.constant.CommonStatus;
|
|
|
|
+import com.fdkankan.common.constant.SceneVersionType;
|
|
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.Camera;
|
|
@@ -10,6 +11,7 @@ import com.fdkankan.contro.entity.ScenePlus;
|
|
import com.fdkankan.contro.entity.ScenePlusExt;
|
|
import com.fdkankan.contro.entity.ScenePlusExt;
|
|
import com.fdkankan.contro.entity.ScenePro;
|
|
import com.fdkankan.contro.entity.ScenePro;
|
|
import com.fdkankan.contro.service.IFdkkLaserService;
|
|
import com.fdkankan.contro.service.IFdkkLaserService;
|
|
|
|
+import com.fdkankan.contro.service.IScenePlusExtService;
|
|
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.fyun.face.FYunFileServiceInterface;
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
@@ -23,10 +25,7 @@ import org.springframework.util.ObjectUtils;
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import java.io.File;
|
|
import java.io.File;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
-import java.util.Date;
|
|
|
|
-import java.util.HashMap;
|
|
|
|
-import java.util.Map;
|
|
|
|
-import java.util.Objects;
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
@Service
|
|
@Service
|
|
@Slf4j
|
|
@Slf4j
|
|
@@ -37,6 +36,8 @@ public class IFdkkLaserServiceImpl implements IFdkkLaserService {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private IScenePlusService scenePlusService;
|
|
private IScenePlusService scenePlusService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IScenePlusExtService scenePlusExtService;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private RabbitMqProducer rabbitMqProducer;
|
|
private RabbitMqProducer rabbitMqProducer;
|
|
@@ -63,27 +64,35 @@ public class IFdkkLaserServiceImpl implements IFdkkLaserService {
|
|
private FYunFileServiceInterface fYunFileService;
|
|
private FYunFileServiceInterface fYunFileService;
|
|
|
|
|
|
|
|
|
|
- public void updateSceneStatus(String sceneCode, int sceneStatus, String path, Date createTime, Date algorithmTime, ScenePlusExt scenePlusExt) {
|
|
|
|
- Map<String, Object> params = new HashMap<>();
|
|
|
|
- params.put("sceneCode", sceneCode);
|
|
|
|
- params.put("status", sceneStatus);
|
|
|
|
- params.put("version",getSceneVersion(sceneCode));
|
|
|
|
- params.put("createTime", DateUtil.date2String(createTime, null));
|
|
|
|
- params.put("algorithmTime", DateUtil.date2String(algorithmTime, null));
|
|
|
|
- if (!ObjectUtils.isEmpty(path)) {
|
|
|
|
- params.put("path", path);
|
|
|
|
- }
|
|
|
|
- params.put("shootCount", shootCount);
|
|
|
|
- params.put("payStatus", payStatus);
|
|
|
|
- params.put("shootCount", scenePlusExt.getShootCount());
|
|
|
|
- params.put("mixture", scenePlusExt.getMixture() == CommonStatus.NO.code().intValue() ? false : true);
|
|
|
|
- rabbitMqProducer.sendByWorkQueue(updateScene, params);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- public void syncBuildResult(String sceneNum, String dataSource,Date createTime, Date algorithmTime, Integer shootCount, Integer payStatus) {
|
|
|
|
- public void syncBuildResult(String sceneNum, String dataSource,Date createTime, Date algorithmTime, ScenePlusExt scenePlusExt) {
|
|
|
|
|
|
+ public void syncBuildResult(String num) {
|
|
log.info("激光转台相机构建结果 同步 请求 ");
|
|
log.info("激光转台相机构建结果 同步 请求 ");
|
|
try {
|
|
try {
|
|
|
|
+ String dataSource = null;
|
|
|
|
+ Integer sceneStatus = null;
|
|
|
|
+ Date createTime = null;
|
|
|
|
+ Integer shootCount = null;
|
|
|
|
+ Integer payStatus = null;
|
|
|
|
+ Boolean mixture = false;
|
|
|
|
+ String version = SceneVersionType.V4.code();
|
|
|
|
+ ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
|
|
|
|
+ if(Objects.nonNull(scenePlus)){
|
|
|
|
+ ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
|
|
+ dataSource = scenePlusExt.getDataSource();
|
|
|
|
+ sceneStatus = scenePlus.getSceneStatus();
|
|
|
|
+ createTime = scenePlus.getCreateTime();
|
|
|
|
+ shootCount = scenePlusExt.getShootCount();
|
|
|
|
+ payStatus = scenePlus.getPayStatus();
|
|
|
|
+ mixture = scenePlusExt.getMixture() == CommonStatus.NO.code().intValue() ? false : true;
|
|
|
|
+ }else{
|
|
|
|
+ ScenePro scenePro = sceneProService.getByNum(num);
|
|
|
|
+ dataSource = scenePro.getDataSource();
|
|
|
|
+ sceneStatus = scenePro.getStatus();
|
|
|
|
+ version = SceneVersionType.V3.code();
|
|
|
|
+ createTime = scenePro.getCreateTime();
|
|
|
|
+ shootCount = scenePro.getShootCount();
|
|
|
|
+ payStatus = scenePro.getPayStatus();
|
|
|
|
+ }
|
|
|
|
+
|
|
String jgPath = dataSource;
|
|
String jgPath = dataSource;
|
|
//创建目录
|
|
//创建目录
|
|
if (dataSource.lastIndexOf("/") != -1) {
|
|
if (dataSource.lastIndexOf("/") != -1) {
|
|
@@ -113,8 +122,21 @@ public class IFdkkLaserServiceImpl implements IFdkkLaserService {
|
|
}
|
|
}
|
|
FileUtils.copyFile(dataSource + "/results/laserData", jgPath, true);
|
|
FileUtils.copyFile(dataSource + "/results/laserData", jgPath, true);
|
|
|
|
|
|
- updateSceneStatus(sceneNum, 2, jgPath + File.separator + "laserData",createTime, algorithmTime, shootCount, payStatus);
|
|
|
|
- updateSceneStatus(sceneNum, 2, jgPath + File.separator + "laserData",createTime, algorithmTime, scenePlusExt);
|
|
|
|
|
|
+// 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));
|
|
|
|
+ if (!ObjectUtils.isEmpty(jgPath)) {
|
|
|
|
+ params.put("path", jgPath);
|
|
|
|
+ }
|
|
|
|
+ params.put("shootCount", shootCount);
|
|
|
|
+ params.put("payStatus", payStatus);
|
|
|
|
+ params.put("mixture", mixture);
|
|
|
|
+ rabbitMqProducer.sendByWorkQueue(updateScene, params);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
log.error("激光转台相机同步失败", e);
|
|
log.error("激光转台相机同步失败", e);
|
|
}
|
|
}
|