|
@@ -32,6 +32,7 @@ import com.fdkankan.model.constants.UploadFilePath;
|
|
import com.fdkankan.rabbitmq.bean.BuildSceneCallMessage;
|
|
import com.fdkankan.rabbitmq.bean.BuildSceneCallMessage;
|
|
import com.fdkankan.rabbitmq.util.RabbitMqProducer;
|
|
import com.fdkankan.rabbitmq.util.RabbitMqProducer;
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
|
|
+import com.fdkankan.web.response.Result;
|
|
import com.fdkankan.web.response.ResultData;
|
|
import com.fdkankan.web.response.ResultData;
|
|
import com.fdkankan.web.util.RSAEncrypt;
|
|
import com.fdkankan.web.util.RSAEncrypt;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -40,16 +41,16 @@ import org.apache.commons.lang3.StringUtils;
|
|
import org.joda.time.DateTime;
|
|
import org.joda.time.DateTime;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
+import org.springframework.http.HttpStatus;
|
|
|
|
+import org.springframework.http.ResponseEntity;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.util.ObjectUtils;
|
|
import org.springframework.util.ObjectUtils;
|
|
|
|
+import org.springframework.web.client.RestTemplate;
|
|
|
|
|
|
import java.io.File;
|
|
import java.io.File;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.nio.charset.StandardCharsets;
|
|
import java.nio.charset.StandardCharsets;
|
|
-import java.util.Calendar;
|
|
|
|
-import java.util.Date;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Objects;
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
@@ -133,6 +134,8 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
@Autowired
|
|
@Autowired
|
|
private IFdkkLaserService fdkkLaserService;
|
|
private IFdkkLaserService fdkkLaserService;
|
|
|
|
|
|
|
|
+ private RestTemplate restTemplate = new RestTemplate();
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public SceneFileBuild findByFileId(String fileId) {
|
|
public SceneFileBuild findByFileId(String fileId) {
|
|
|
|
|
|
@@ -525,6 +528,27 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
cameraType = 11L;
|
|
cameraType = 11L;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ String cameraName = fdageJson.getJSONObject("cam").getString("uuid");
|
|
|
|
+
|
|
|
|
+ Camera camera = cameraService.getByChildName(cameraName);
|
|
|
|
+
|
|
|
|
+ if (camera == null) {
|
|
|
|
+ throw new BusinessException(CameraConstant.FAILURE_6003);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ CameraDetail cameraDetail = cameraDetailService.getByCameraId(camera.getId());
|
|
|
|
+ if (cameraDetail == null) {
|
|
|
|
+ log.error("该相机详情不存在:" + cameraName);
|
|
|
|
+ throw new BusinessException(CameraConstant.FAILURE_6003);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 判断是否是正顺的场景,如果是正顺的场景,则发送到原来的系统进行计算
|
|
|
|
+ if (cameraDetail.getCompanyId().equals(1)) {
|
|
|
|
+ callV3Service(params);
|
|
|
|
+ return ResultData.ok();
|
|
|
|
+ }
|
|
|
|
+
|
|
// 判断是否是V3的场景
|
|
// 判断是否是V3的场景
|
|
ScenePro scenePro = sceneProService.getOne(
|
|
ScenePro scenePro = sceneProService.getOne(
|
|
new LambdaQueryWrapper<ScenePro>().like(ScenePro::getDataSource, fileId));
|
|
new LambdaQueryWrapper<ScenePro>().like(ScenePro::getDataSource, fileId));
|
|
@@ -536,6 +560,15 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
return ResultData.ok();
|
|
return ResultData.ok();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public void callV3Service(String params){
|
|
|
|
+ ResponseEntity<Result> responseEntity = restTemplate.postForEntity("http://172.18.157.42:8086/api/scene/file/uploadSuccessBuild?params=".concat(params), null, Result.class);
|
|
|
|
+ if (responseEntity.getStatusCode() != HttpStatus.OK || responseEntity.getBody().getCode() != HttpStatus.OK.value()) {
|
|
|
|
+ log.error("正顺场景请求V3服务器失败!");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ log.info("正顺场景请求V3服务器成功!");
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public ResultData turntableUploadSuccess(String params) throws Exception {
|
|
public ResultData turntableUploadSuccess(String params) throws Exception {
|
|
log.info("turntableUploadSuccess-params: " + params);
|
|
log.info("turntableUploadSuccess-params: " + params);
|