|
@@ -0,0 +1,66 @@
|
|
|
+package com.fdkankan.contro.service.impl;
|
|
|
+
|
|
|
+import com.fdkankan.common.constant.SceneSource;
|
|
|
+import com.fdkankan.contro.entity.*;
|
|
|
+import com.fdkankan.contro.service.*;
|
|
|
+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.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 IScenePlusExtService scenePlusExtService;
|
|
|
+ @Autowired
|
|
|
+ private ICameraService cameraService;
|
|
|
+ @Autowired
|
|
|
+ private IUserService userService;
|
|
|
+ @Autowired
|
|
|
+ private ICameraDetailService cameraDetailService;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void sendMq(String num, Integer status) {
|
|
|
+ try {
|
|
|
+ ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
|
|
|
+ ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
|
+ Camera camera = cameraService.getById(scenePlus.getCameraId());
|
|
|
+ CameraDetail cameraDetail = cameraDetailService.getByCameraId(camera.getId());
|
|
|
+ if(Objects.isNull(cameraDetail.getCompanyId()) || cameraDetail.getCompanyId() != 26 || scenePlus.getSceneSource() != SceneSource.ZT.code().intValue()){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ String phoneNum = null;
|
|
|
+ if(Objects.nonNull(scenePlus.getUserId())){
|
|
|
+ SSOUser user = userService.getSSOUserByUserId(scenePlus.getUserId());
|
|
|
+ phoneNum = user.getUserName();
|
|
|
+ }
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+ params.put("sceneCode", num);
|
|
|
+ params.put("location", scenePlusExt.getLocation());
|
|
|
+ params.put("sceneSource", scenePlus.getSceneSource());
|
|
|
+ params.put("algorithmTime", scenePlusExt.getAlgorithmTime());
|
|
|
+ params.put("createTime", scenePlus.getCreateTime());
|
|
|
+ params.put("phoneNum", phoneNum);
|
|
|
+ params.put("userId", scenePlus.getUserId());
|
|
|
+ params.put("snCode", camera.getSnCode());
|
|
|
+ params.put("status", status);
|
|
|
+ params.put("sceneName", scenePlus.getTitle());
|
|
|
+ params.put("shootCount", scenePlusExt.getShootCount());
|
|
|
+ mqProducer.sendByWorkQueue("relics-init-queue", params);
|
|
|
+ }catch (Exception e){
|
|
|
+ log.error("发送看见场景到全景看看失败, num:{}", num, e);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+}
|