|
@@ -0,0 +1,50 @@
|
|
|
+package com.fdkankan.scene.service.impl;
|
|
|
+
|
|
|
+import com.fdkankan.common.constant.SceneSource;
|
|
|
+import com.fdkankan.rabbitmq.util.RabbitMqProducer;
|
|
|
+import com.fdkankan.scene.entity.Camera;
|
|
|
+import com.fdkankan.scene.entity.CameraDetail;
|
|
|
+import com.fdkankan.scene.entity.ScenePlus;
|
|
|
+import com.fdkankan.scene.service.ICameraDetailService;
|
|
|
+import com.fdkankan.scene.service.ICameraService;
|
|
|
+import com.fdkankan.scene.service.IScenePlusService;
|
|
|
+import com.fdkankan.scene.service.IWbService;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.Objects;
|
|
|
+
|
|
|
+@Slf4j
|
|
|
+@Service
|
|
|
+public class WbServiceImpl implements IWbService {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private RabbitMqProducer mqProducer;
|
|
|
+ @Autowired
|
|
|
+ private IScenePlusService scenePlusService;
|
|
|
+ @Autowired
|
|
|
+ private ICameraService cameraService;
|
|
|
+ @Autowired
|
|
|
+ private ICameraDetailService cameraDetailService;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void sendMq(String num) {
|
|
|
+ try {
|
|
|
+ ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
|
|
|
+ Camera camera = cameraService.getById(scenePlus.getCameraId());
|
|
|
+ CameraDetail cameraDetail = cameraDetailService.findByCameraId(camera.getId());
|
|
|
+ if(Objects.isNull(cameraDetail.getCompanyId()) || cameraDetail.getCompanyId() != 26 || scenePlus.getSceneSource() != SceneSource.ZT.code().intValue()){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+ params.put("sceneCode", num);
|
|
|
+ params.put("sceneName", scenePlus.getTitle());
|
|
|
+ mqProducer.sendByWorkQueue("relics-update-name-queue", params);
|
|
|
+ }catch (Exception e){
|
|
|
+ log.error("发送看见场景到全景看看失败, num:{}", num, e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|