|
@@ -3,13 +3,16 @@ 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;
|
|
|
import com.fdkankan.contro.entity.ScenePro;
|
|
|
import com.fdkankan.contro.service.IFdkkLaserService;
|
|
|
+import com.fdkankan.contro.service.IScenePlusExtService;
|
|
|
import com.fdkankan.contro.service.IScenePlusService;
|
|
|
import com.fdkankan.contro.service.ISceneProService;
|
|
|
import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
@@ -17,19 +20,18 @@ import com.fdkankan.rabbitmq.util.RabbitMqProducer;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
+import org.springframework.cloud.context.config.annotation.RefreshScope;
|
|
|
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
|
|
|
+@RefreshScope
|
|
|
public class IFdkkLaserServiceImpl implements IFdkkLaserService {
|
|
|
|
|
|
@Autowired
|
|
@@ -37,6 +39,8 @@ public class IFdkkLaserServiceImpl implements IFdkkLaserService {
|
|
|
|
|
|
@Autowired
|
|
|
private IScenePlusService scenePlusService;
|
|
|
+ @Autowired
|
|
|
+ private IScenePlusExtService scenePlusExtService;
|
|
|
|
|
|
@Autowired
|
|
|
private RabbitMqProducer rabbitMqProducer;
|
|
@@ -63,25 +67,18 @@ public class IFdkkLaserServiceImpl implements IFdkkLaserService {
|
|
|
private FYunFileServiceInterface fYunFileService;
|
|
|
|
|
|
|
|
|
- public void updateSceneStatus(String sceneCode, int sceneStatus, String path, Date createTime, Date algorithmTime, ScenePlusExt scenePlusExt, Integer payStatus) {
|
|
|
- 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("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, ScenePlusExt scenePlusExt, 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) {
|
|
@@ -111,7 +108,19 @@ public class IFdkkLaserServiceImpl implements IFdkkLaserService {
|
|
|
}
|
|
|
FileUtils.copyFile(dataSource + "/results/laserData", jgPath, true);
|
|
|
|
|
|
- updateSceneStatus(sceneNum, 2, jgPath + File.separator + "laserData",createTime, algorithmTime, scenePlusExt, 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);
|
|
|
}
|