瀏覽代碼

Merge branch 'feature-scrb' into release

dengsixing 7 月之前
父節點
當前提交
0b1adb150e
共有 1 個文件被更改,包括 17 次插入17 次删除
  1. 17 17
      src/main/java/com/fdkankan/contro/mq/service/impl/BuildSceneServiceImpl.java

+ 17 - 17
src/main/java/com/fdkankan/contro/mq/service/impl/BuildSceneServiceImpl.java

@@ -390,8 +390,12 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
                 commonService.sendEmail(sceneCode, "standar");
             }
 
+            //发送到文保系统
             wbService.sendMq(sceneCode, CommonSuccessStatus.SUCCESS.code());
 
+            //四川日报打包消费
+            this.sendMqToPackScene4Scrb(sceneCode);
+
             log.info("场景计算结果处理结束,场景码:{}", sceneCode);
 
         }catch (Exception e){
@@ -406,23 +410,19 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
         }
     }
 
-//    private void cachePanorama(String dataSource, String num){
-//        String cachedImagesPath = String.format(ConstantFilePath.SCENE_CACHE_IMAGES, num);
-//        //将全景图缓存到缓存目录
-//        List<String> imagesList = FileUtil.listFileNames(dataSource + "/caches/images");
-//        //先清除旧的全景图
-//        cn.hutool.core.io.FileUtil.del(cachedImagesPath);
-//        String visionPath = dataSource + "/results/vision.txt";
-//        List<String> panoramaImageList = SceneUtil.getPanoramaImageList(visionPath);
-//        imagesList.stream().forEach(fileName -> {
-//            if (panoramaImageList.contains(fileName)) {
-//                String srcPath = dataSource + "/caches/images/" + fileName;
-//                String targetPath = cachedImagesPath + fileName;
-//                log.info("源文件:{}, 目标文件:{}", srcPath, targetPath);
-//                cn.hutool.core.io.FileUtil.copy(srcPath, targetPath, true);
-//            }
-//        });
-//    }
+    private void sendMqToPackScene4Scrb(String num){
+        ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
+        if(Objects.isNull(scenePlus.getCameraId())){
+            return;
+        }
+        CameraDetail cameraDetail = cameraDetailService.getByCameraId(scenePlus.getCameraId());
+        if(Objects.isNull(cameraDetail) || Objects.isNull(cameraDetail.getCompanyId()) || cameraDetail.getCompanyId() != 30){
+            return;
+        }
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("num", num);
+        mqProducer.sendByWorkQueue("scrb-package-scene", jsonObject);
+    }