|
@@ -8,6 +8,7 @@ import cn.hutool.http.HttpResponse;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.amazonaws.services.dynamodbv2.xspec.S;
|
|
|
import com.gis.constant.CmdConstant;
|
|
|
import com.gis.constant.ConfigConstant;
|
|
|
import com.gis.entity.RelicsSceneInitQueueDTO;
|
|
@@ -89,7 +90,7 @@ public class SceneListener {
|
|
|
}
|
|
|
String traceId = System.currentTimeMillis()+"";
|
|
|
MDC.put("TRACE_ID", traceId);
|
|
|
-
|
|
|
+ String sceneCode="";
|
|
|
long deliveryTag = message.getMessageProperties().getDeliveryTag();
|
|
|
try {
|
|
|
String msg = new String(message.getBody(), StandardCharsets.UTF_8);
|
|
@@ -100,6 +101,7 @@ public class SceneListener {
|
|
|
log.error("参数列表错误(缺少),格式不匹配,{}",param);
|
|
|
channel.basicAck(deliveryTag, false);
|
|
|
}
|
|
|
+ sceneCode=param.getSceneCode();
|
|
|
WorkEntity workEntity=workService.findByNum(param.getSceneCode());
|
|
|
if (ObjectUtil.isEmpty(workEntity)&¶m.getStatus()==0){
|
|
|
//初始化创建work表数据
|
|
@@ -117,6 +119,8 @@ public class SceneListener {
|
|
|
sendStartMq(param);
|
|
|
channel.basicAck(deliveryTag, false);
|
|
|
}else if (ObjectUtil.isNotEmpty(param.getSceneCode())&¶m.getStatus()==1){
|
|
|
+ updateOssStatusJson(param.getSceneCode(),0);
|
|
|
+
|
|
|
//计算完成处理
|
|
|
//1,下载场景的全景图 默认 。scene_view_data/panorama/目录下的全景图图片
|
|
|
workEntity.setAlgorithmTime(param.getAlgorithmTime());
|
|
@@ -190,16 +194,38 @@ public class SceneListener {
|
|
|
workEntity.setCalcStatus(1);
|
|
|
workService.update(workEntity);
|
|
|
sendEndMq(param);
|
|
|
+ updateOssStatusJson(param.getSceneCode(),0);
|
|
|
channel.basicAck(deliveryTag, false);
|
|
|
}
|
|
|
|
|
|
|
|
|
}catch (Exception e){
|
|
|
- e.printStackTrace();
|
|
|
+ if (StrUtil.isNotEmpty(sceneCode)){
|
|
|
+ updateOssStatusJson(sceneCode,0);
|
|
|
+ }
|
|
|
channel.basicAck(deliveryTag, false);
|
|
|
log.error("场景sceneQueue报错{}",e.getMessage());
|
|
|
+ e.printStackTrace();
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ private void updateOssStatusJson(String sceneCode, int status) throws IOException {
|
|
|
+ //修改OSS,status状态 scene_view_data/场景码/data/status.json
|
|
|
+ String statusJson = "scene_view_data/"+sceneCode+"/data/status.json";
|
|
|
+ Boolean exist=aliyunOssUtil.existKey("4dkankan",statusJson);
|
|
|
+ if (exist){
|
|
|
+ String statusJsonUrl = "http://4dkk.4dage.com/"+statusJson;
|
|
|
+ HttpResponse execute = HttpRequest.get(statusJsonUrl+"?m="+System.currentTimeMillis()).execute();
|
|
|
+ if (execute.getStatus()==200){
|
|
|
+ log.info("vision.txt存在: {}");
|
|
|
+ JSONObject statusJsonObj = JSONObject.parseObject(execute.body());
|
|
|
+ statusJsonObj.put("status",status);
|
|
|
+ fileAndOssUtil.upload(statusJsonObj.toJSONString().getBytes(StandardCharsets.UTF_8), statusJson);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void sendStartMq(SceneQueueDTO param) {
|
|
|
RelicsSceneInitQueueDTO relicsSceneInitQueueDTO = new RelicsSceneInitQueueDTO();
|
|
|
relicsSceneInitQueueDTO.setSceneCode(param.getSceneCode());
|