Ver código fonte

1.7.0 对接相机初次提交

xiewj 1 ano atrás
pai
commit
0cf1a2e573
50 arquivos alterados com 3003 adições e 425 exclusões
  1. 7 0
      720yun_fd_consumer/gis_consumer/src/main/java/com/gis/constant/ConfigConstant.java
  2. 107 103
      720yun_fd_consumer/gis_consumer/src/main/java/com/gis/constant/RabbitConfig.java
  3. 40 0
      720yun_fd_consumer/gis_consumer/src/main/java/com/gis/entity/BaseStrEntity.java
  4. 53 0
      720yun_fd_consumer/gis_consumer/src/main/java/com/gis/entity/ScenePanoEntity.java
  5. 44 0
      720yun_fd_consumer/gis_consumer/src/main/java/com/gis/entity/SceneQueueDTO.java
  6. 65 0
      720yun_fd_consumer/gis_consumer/src/main/java/com/gis/entity/WorkEntity.java
  7. 64 0
      720yun_fd_consumer/gis_consumer/src/main/java/com/gis/listener/DoSliceListener.java
  8. 62 62
      720yun_fd_consumer/gis_consumer/src/main/java/com/gis/listener/Fd720Listener.java
  9. 59 59
      720yun_fd_consumer/gis_consumer/src/main/java/com/gis/listener/Fd720Listener_2.java
  10. 326 0
      720yun_fd_consumer/gis_consumer/src/main/java/com/gis/listener/SceneListener.java
  11. 17 0
      720yun_fd_consumer/gis_consumer/src/main/java/com/gis/mapper/IBaseStrMapper.java
  12. 14 0
      720yun_fd_consumer/gis_consumer/src/main/java/com/gis/mapper/ScenePanoMapper.java
  13. 42 0
      720yun_fd_consumer/gis_consumer/src/main/java/com/gis/mapper/WorkMapper.java
  14. 52 0
      720yun_fd_consumer/gis_consumer/src/main/java/com/gis/service/IBaseService.java
  15. 52 0
      720yun_fd_consumer/gis_consumer/src/main/java/com/gis/service/IBaseStrService.java
  16. 14 0
      720yun_fd_consumer/gis_consumer/src/main/java/com/gis/service/ScenePanoService.java
  17. 14 0
      720yun_fd_consumer/gis_consumer/src/main/java/com/gis/service/WorkService.java
  18. 185 0
      720yun_fd_consumer/gis_consumer/src/main/java/com/gis/service/impl/IBaseServiceImpl.java
  19. 193 0
      720yun_fd_consumer/gis_consumer/src/main/java/com/gis/service/impl/IBaseStrServiceImpl.java
  20. 26 0
      720yun_fd_consumer/gis_consumer/src/main/java/com/gis/service/impl/ScenePanoServiceImpl.java
  21. 68 0
      720yun_fd_consumer/gis_consumer/src/main/java/com/gis/service/impl/WorkServiceImpl.java
  22. 36 2
      720yun_fd_consumer/gis_consumer/src/main/java/com/gis/util/FileUtils.java
  23. 286 0
      720yun_fd_consumer/gis_consumer/src/main/java/com/gis/util/JwtUtil.java
  24. 197 0
      720yun_fd_consumer/gis_consumer/src/main/java/com/gis/util/QrCodeUtils.java
  25. 14 2
      720yun_fd_consumer/gis_consumer/src/main/java/com/gis/util/RandomUtils.java
  26. 226 0
      720yun_fd_consumer/gis_consumer/src/main/java/com/gis/util/SnowFlakeUUidUtils.java
  27. 3 0
      720yun_fd_consumer/gis_consumer/src/main/resources/application-dev.yml
  28. 71 0
      720yun_fd_consumer/gis_consumer/src/main/resources/application-loc-site.yml
  29. 3 0
      720yun_fd_consumer/gis_consumer/src/main/resources/application-loc.yml
  30. 3 0
      720yun_fd_consumer/gis_consumer/src/main/resources/application.yml
  31. 105 0
      720yun_fd_consumer/gis_consumer/src/main/resources/data/someData.json
  32. 24 0
      720yun_fd_consumer/gis_consumer/src/main/resources/data/someDataSceneData.json
  33. 71 0
      720yun_fd_consumer/gis_consumer/src/main/resources/data/tour.xml
  34. 7 3
      720yun_fd_consumer/gis_consumer_oss/pom.xml
  35. 47 5
      720yun_fd_consumer/gis_consumer_oss/src/main/java/com/gis/oss/util/AliYunOssUtil.java
  36. 10 5
      720yun_fd_consumer/pom.xml
  37. 1 1
      720yun_fd_consumer/run.sh
  38. 15 8
      720yun_fd_manage/gis_application/src/main/resources/application-locSit.yml
  39. 15 8
      720yun_fd_manage/gis_application/src/main/resources/application-sit.yml
  40. 140 140
      720yun_fd_manage/gis_common/src/main/java/com/gis/common/config/RabbitConfig.java
  41. 81 0
      720yun_fd_manage/gis_common/src/main/java/com/gis/common/mq/RabbitMqProducerUtil.java
  42. 54 0
      720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/entity/ScenePanoEntity.java
  43. 6 2
      720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/entity/WorkEntity.java
  44. 15 0
      720yun_fd_manage/gis_mapper/src/main/java/com/gis/mapper/ScenePanoMapper.java
  45. 14 0
      720yun_fd_manage/gis_service/src/main/java/com/gis/service/ScenePanoService.java
  46. 11 9
      720yun_fd_manage/gis_service/src/main/java/com/gis/service/impl/FodderServiceImpl.java
  47. 26 0
      720yun_fd_manage/gis_service/src/main/java/com/gis/service/impl/ScenePanoServiceImpl.java
  48. 12 6
      720yun_fd_manage/gis_web/src/main/java/com/gis/web/controller/TestController.java
  49. 5 9
      720yun_fd_manage/pom.xml
  50. 1 1
      720yun_fd_manage/run.sh

+ 7 - 0
720yun_fd_consumer/gis_consumer/src/main/java/com/gis/constant/ConfigConstant.java

@@ -38,5 +38,12 @@ public class ConfigConstant {
     @Value("${oss.domain}")
     public  String ossDomain;
 
+    /*********************** 其他参数 ***********************/
 
+    @Value("${domain.4dkk}")
+    public  String domain4dKK;
+
+    /**redis token前缀*/
+    @Value("${redis.token.prefix}")
+    public  String redisTokenPrefix;
 }

+ 107 - 103
720yun_fd_consumer/gis_consumer/src/main/java/com/gis/constant/RabbitConfig.java

@@ -1,103 +1,107 @@
-package com.gis.constant;
-
-import org.springframework.amqp.core.*;
-import org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory;
-import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
-import org.springframework.amqp.rabbit.connection.ConnectionFactory;
-import org.springframework.amqp.rabbit.core.RabbitTemplate;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.beans.factory.config.ConfigurableBeanFactory;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Scope;
-
-/**
- * 即时队列
- */
-
-@Configuration
-public class RabbitConfig {
-
-    @Value("${spring.rabbitmq.address}")
-    private String address;
-
-    @Value("${spring.rabbitmq.username}")
-    private String username;
-
-    @Value("${spring.rabbitmq.password}")
-    private String password;
-
-
-
-
-    /** 全景图队列*/
-    public static final String PANO_QUEUE = "720FdQueue";
-
-    /** 全景图交换机*/
-    public static final String PANO_EXCHANGE = "720FdExchange";
-
-    /** 全景图交换机路由*/
-    public static final String PANO_QUEUE_ROUTING = "720FdQueueRouting";
-
-
-
-
-
-
-    /**
-     * 全景图模型队列
-     */
-    @Bean
-    public Queue panoQueue() {
-        return new Queue(PANO_QUEUE);
-    }
-
-    /**
-     * 全景图交换机
-     */
-    @Bean
-    public Exchange panoExchange(){
-        return new DirectExchange(PANO_EXCHANGE, true, false);
-    }
-
-
-    /**
-     * 全景图队列绑定交换机
-     */
-    @Bean
-    public Binding panoQueueExchange(Queue panoQueue, Exchange panoExchange){
-        return BindingBuilder.bind(panoQueue).to(panoExchange).with(PANO_QUEUE_ROUTING).noargs();
-    }
-
-
-    /**
-     * 以下三个方法是配置集群
-     * @return
-     */
-    @Bean
-    public SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory() {
-        SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
-        factory.setConnectionFactory(connectionFactory());
-        factory.setPrefetchCount(1);
-        return factory;
-    }
-
-    @Bean
-    public ConnectionFactory connectionFactory() {
-        CachingConnectionFactory connectionFactory = new CachingConnectionFactory();
-        connectionFactory.setAddresses(address);
-        connectionFactory.setUsername(username);
-        connectionFactory.setPassword(password);
-        connectionFactory.setVirtualHost("/");
-        connectionFactory.setPublisherConfirms(true);
-        return connectionFactory;
-    }
-
-    @Bean
-    @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
-    public RabbitTemplate rabbitTemplate() {
-        return new RabbitTemplate(connectionFactory());
-    }
-
-
-}
+//package com.gis.constant;
+//
+//import org.springframework.amqp.core.*;
+//import org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory;
+//import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
+//import org.springframework.amqp.rabbit.connection.ConnectionFactory;
+//import org.springframework.amqp.rabbit.core.RabbitTemplate;
+//import org.springframework.beans.factory.annotation.Value;
+//import org.springframework.beans.factory.config.ConfigurableBeanFactory;
+//import org.springframework.context.annotation.Bean;
+//import org.springframework.context.annotation.Configuration;
+//import org.springframework.context.annotation.Scope;
+//
+///**
+// * 即时队列
+// */
+//
+//@Configuration
+//public class RabbitConfig {
+//
+//    @Value("${spring.rabbitmq.address}")
+//    private String address;
+//
+//    @Value("${spring.rabbitmq.username}")
+//    private String username;
+//
+//    @Value("${spring.rabbitmq.password}")
+//    private String password;
+//
+//
+//
+//
+//    /** 全景图队列*/
+//    public static final String PANO_QUEUE = "720FdQueue";
+//
+//    /** 全景图交换机*/
+//    public static final String PANO_EXCHANGE = "720FdExchange";
+//
+//    /** 全景图交换机路由*/
+//    public static final String PANO_QUEUE_ROUTING = "720FdQueueRouting";
+//
+//
+//    public static final String PANO_SCENE_QUEUE = "PanoSceneQueue";
+//    public static final String PANO_SCENE_QUEUE_EXCHANGE = "PanoSceneQueueExchange";
+//
+//
+//
+//    /**
+//     * 全景图模型队列
+//     */
+//    @Bean
+//    public Queue panoQueue() {
+//        return new Queue(PANO_QUEUE);
+//    }
+//
+//    /**
+//     * 全景图交换机
+//     */
+//    @Bean
+//    public Exchange panoExchange(){
+//        return new DirectExchange(PANO_EXCHANGE, true, false);
+//    }
+//
+//
+//
+//
+//
+//    /**
+//     * 全景图队列绑定交换机
+//     */
+//    @Bean
+//    public Binding panoQueueExchange(Queue panoQueue, Exchange panoExchange){
+//        return BindingBuilder.bind(panoQueue).to(panoExchange).with(PANO_QUEUE_ROUTING).noargs();
+//    }
+//
+//
+//    /**
+//     * 以下三个方法是配置集群
+//     * @return
+//     */
+//    @Bean
+//    public SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory() {
+//        SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
+//        factory.setConnectionFactory(connectionFactory());
+//        factory.setPrefetchCount(1);
+//        return factory;
+//    }
+//
+//    @Bean
+//    public ConnectionFactory connectionFactory() {
+//        CachingConnectionFactory connectionFactory = new CachingConnectionFactory();
+//        connectionFactory.setAddresses(address);
+//        connectionFactory.setUsername(username);
+//        connectionFactory.setPassword(password);
+//        connectionFactory.setVirtualHost("/");
+//        connectionFactory.setPublisherConfirms(true);
+//        return connectionFactory;
+//    }
+//
+//    @Bean
+//    @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
+//    public RabbitTemplate rabbitTemplate() {
+//        return new RabbitTemplate(connectionFactory());
+//    }
+//
+//
+//}

+ 40 - 0
720yun_fd_consumer/gis_consumer/src/main/java/com/gis/entity/BaseStrEntity.java

@@ -0,0 +1,40 @@
+package com.gis.entity;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.*;
+import java.util.Date;
+
+@Data
+@MappedSuperclass
+public abstract class BaseStrEntity {
+
+    @Id
+    @Column(name = "id")
+    @ApiModelProperty(value = "对象ID")
+    private String id;
+
+    @ApiModelProperty(value = "创建时间")
+    @Temporal(TemporalType.TIMESTAMP)
+    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    @ApiModelProperty(value = "修改时间")
+    @Temporal(TemporalType.TIMESTAMP)
+    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    /**
+     * 用来批量操作的
+     * 0代表未删除 , 1代表已经删除,默认写0
+     * 需要使用对象类型
+     */
+    @JsonIgnore
+    @JSONField(serialize = false)
+    private Integer isDelete;
+
+
+}

+ 53 - 0
720yun_fd_consumer/gis_consumer/src/main/java/com/gis/entity/ScenePanoEntity.java

@@ -0,0 +1,53 @@
+package com.gis.entity;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 四维看看场景全景图表
+ *
+ * @author Xiewj
+ * @since 2024-04-03 18:01
+ */
+@Data
+@ApiModel("四维看看场景全景图表")
+public class ScenePanoEntity extends BaseEntity implements Serializable  {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty("wordid")
+    private String workId;
+
+    @ApiModelProperty("名称")
+    private String name;
+
+    @ApiModelProperty("服务器存放地址")
+    private String filePath;
+
+    @ApiModelProperty("oss存放地址")
+    private String ossPath;
+
+    @ApiModelProperty("状态")
+    private Integer status;
+
+    @ApiModelProperty("封面图")
+    private String icon;
+
+    @ApiModelProperty("文件名")
+    private String fileName;
+
+    @ApiModelProperty("场景码")
+    private String sceneCode;
+
+    @ApiModelProperty("文件大小,单位MB")
+    private String fileSize;
+
+    @ApiModelProperty("预览图(全景图使用)")
+    private String previewIcon;
+
+    @ApiModelProperty("tour.xml")
+    private String tour;
+}

+ 44 - 0
720yun_fd_consumer/gis_consumer/src/main/java/com/gis/entity/SceneQueueDTO.java

@@ -0,0 +1,44 @@
+package com.gis.entity;
+
+import com.amazonaws.services.dynamodbv2.xspec.S;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.Date;
+import lombok.Data;
+
+/**
+ * @author Xiewj
+ * @date 2024/4/3
+ */
+@Data
+public class SceneQueueDTO {
+
+   private String sceneCode;
+
+    @ApiModelProperty(value = "判断是否为slam场景,深光和深时 以前的场景都是4" +
+            "typedef enum SceneLocation {\n" +
+            "    Scene_Location_Slam  = 0, //slam\n" +
+            "    Scene_Location_SFM 1 ,   //sfm\n" +
+            "    Scene_Location_SFMAI  2,     //SFM + AI\n" +
+            "    Scene_Location_MutiFloor 3 ,    //多楼层\n" +
+            "    Scene_Location_PointCloud 4,    //点云\n" +
+            "    Scene_Location_SLAMPoint 5,    //slam实时拍\n" +
+            "    Scene_Location_SLAMPointAndSFMAI  6   //slam实时拍+站点\n" +
+            "} SceneLocation;")
+    private Integer location;
+
+
+    @ApiModelProperty(value = "场景来源:相机拍摄10以内表示,1表示八目,2双目,3转台,4 激光 5深光  其他来源10以上,11:一键换装,12:123看房,13文通虚拟场景")
+    private Integer sceneSource;
+
+    @ApiModelProperty(value = "计算完成时间")
+    private Date algorithmTime;
+
+    private String phoneNum;
+
+    //0-计算中 1-计算成功  -1-计算失败
+    private int status;
+
+   private String sceneName;
+
+}

+ 65 - 0
720yun_fd_consumer/gis_consumer/src/main/java/com/gis/entity/WorkEntity.java

@@ -0,0 +1,65 @@
+package com.gis.entity;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Entity;
+import javax.persistence.Table;
+import java.io.Serializable;
+
+/**
+ * 作品表
+ */
+@Data
+@Entity
+@Table(name = "tb_work")
+public class WorkEntity extends BaseStrEntity implements Serializable {
+
+    private static final long serialVersionUID = 6827754544317282072L;
+    @ApiModelProperty(value = "名称")
+    private String name;
+
+    @ApiModelProperty(value = "简介")
+    private String description;
+
+    @ApiModelProperty(value = "状态, 0:默认不显示, 1:显示")
+    private Integer status;
+
+    @ApiModelProperty(value = "创建人")
+    private String userId;
+
+    @ApiModelProperty(value = "封面图")
+    private String icon;
+
+    @ApiModelProperty(value = "访问量")
+    private Integer visit;
+
+    @JSONField(serialize = false)
+    @ApiModelProperty(value = "作品密码, 默认0:不需要密码")
+    private String password;
+
+
+    @ApiModelProperty(value = "二维码")
+    private String qrCode;
+
+    @ApiModelProperty(value = "分享地址(二维码扫描后地址)")
+    private String share;
+
+    @ApiModelProperty(value = "是否有密码,0:没有, 1:有")
+    private Integer isPassword;
+
+    /** 用来关联删除素材时使用*/
+    @ApiModelProperty(value = "场景码")
+    private String sceneCodes;
+
+    @ApiModelProperty(value = "作品类型:pano:全是全景图 | 4dkk: 全是四维看看 : mix:混合(pano+4dkk), 通过sceneCodes判断")
+    private String type;
+
+    //计算状态
+    @ApiModelProperty(value = "计算状态:0-计算中 1-计算成功  -1-计算失败")
+    private Integer calcStatus;
+
+    @ApiModelProperty(value = "四维看看场景码")
+    private String num;
+}

+ 64 - 0
720yun_fd_consumer/gis_consumer/src/main/java/com/gis/listener/DoSliceListener.java

@@ -0,0 +1,64 @@
+package com.gis.listener;
+
+import com.alibaba.fastjson.JSONObject;
+import com.gis.service.FodderService;
+import com.rabbitmq.client.Channel;
+import lombok.extern.slf4j.Slf4j;
+import org.slf4j.MDC;
+import org.springframework.amqp.core.Message;
+import org.springframework.amqp.rabbit.annotation.Queue;
+import org.springframework.amqp.rabbit.annotation.RabbitListener;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.util.ObjectUtils;
+
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.util.Map;
+
+/**
+ * 消息监听器
+ *
+ * @author Xiewj
+ * @version 1.0
+ * @since 2023/08/07
+ */
+@Component
+@Slf4j
+public class DoSliceListener {
+    @Autowired
+    FodderService fodderService;
+
+    /**
+     * 全景场景初始化方法
+     *
+     * @param channel
+     * @param message
+     * @throws Exception the io exception  这里异常需要处理
+     */
+    @RabbitListener(
+            queuesToDeclare = @Queue("${queue.do-slice-queue}"),concurrency = "2"
+    )
+    public void doSliceQueue(Channel channel, Message message) throws IOException {
+        if (ObjectUtils.isEmpty(message.getBody())) {
+            log.error("消息内容为空,退出构建,当前服务器id:{}" );
+            return;
+        }
+        String traceId = System.currentTimeMillis()+"";
+        MDC.put("TRACE_ID", traceId);
+        long deliveryTag = message.getMessageProperties().getDeliveryTag();
+        try {
+            String msg = new String(message.getBody(), StandardCharsets.UTF_8);
+            String messageId = message.getMessageProperties().getMessageId();
+            log.info("场景doSliceQueue开始,id:{},deliveryTag:{},消息体:{}", messageId,deliveryTag,msg);
+            Map<String,Long> map = JSONObject.parseObject(msg, Map.class);
+            fodderService.doSlice(map.get("id"), traceId);
+            channel.basicAck(deliveryTag, false);
+        }catch (Exception e){
+            e.printStackTrace();
+            channel.basicAck(deliveryTag, false);
+            log.error("场景doSliceQueue报错{}",e.getMessage());
+        }
+
+    }
+}

+ 62 - 62
720yun_fd_consumer/gis_consumer/src/main/java/com/gis/listener/Fd720Listener.java

@@ -1,62 +1,62 @@
-package com.gis.listener;
-
-import com.gis.constant.RabbitConfig;
-import com.gis.service.FodderService;
-import lombok.extern.slf4j.Slf4j;
-import org.slf4j.MDC;
-import org.springframework.amqp.rabbit.annotation.RabbitHandler;
-import org.springframework.amqp.rabbit.annotation.RabbitListener;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-
-/**
- * Created by owen on 2021/1/12 0012 10:05
- */
-@Slf4j
-@Component
-@RabbitListener(queues = RabbitConfig.PANO_QUEUE,concurrency="1") // 指定监听队列
-public class Fd720Listener {
-
-
-
-
-    @Autowired
-    FodderService fodderService;
-
-
-    // 链路id
-    static String traceId;
-
-
-    @RabbitHandler
-    public void getMessage(Long param)  {
-        traceId = System.currentTimeMillis()+"";
-        MDC.put("TRACE_ID", traceId);
-
-        log.info("监听消息_1_start: {}, uuid: {}", param, traceId);
-        try {
-            Thread.sleep(300);
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-        }
-
-        fodderService.doSlice(param, traceId);
-
-
-        log.info("监听消息_1_end: {}, uuid: {}", param, traceId);
-    }
-
-
-
-
-
-
-
-
-
-
-
-
-
-}
+//package com.gis.listener;
+//
+//import com.gis.constant.RabbitConfig;
+//import com.gis.service.FodderService;
+//import lombok.extern.slf4j.Slf4j;
+//import org.slf4j.MDC;
+//import org.springframework.amqp.rabbit.annotation.RabbitHandler;
+//import org.springframework.amqp.rabbit.annotation.RabbitListener;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.stereotype.Component;
+//
+//
+///**
+// * Created by owen on 2021/1/12 0012 10:05
+// */
+//@Slf4j
+//@Component
+//@RabbitListener(queues = RabbitConfig.PANO_QUEUE,concurrency="1") // 指定监听队列
+//public class Fd720Listener {
+//
+//
+//
+//
+//    @Autowired
+//    FodderService fodderService;
+//
+//
+//    // 链路id
+//    static String traceId;
+//
+//
+//    @RabbitHandler
+//    public void getMessage(Long param)  {
+//        traceId = System.currentTimeMillis()+"";
+//        MDC.put("TRACE_ID", traceId);
+//
+//        log.info("监听消息_1_start: {}, uuid: {}", param, traceId);
+//        try {
+//            Thread.sleep(300);
+//        } catch (InterruptedException e) {
+//            e.printStackTrace();
+//        }
+//
+//        fodderService.doSlice(param, traceId);
+//
+//
+//        log.info("监听消息_1_end: {}, uuid: {}", param, traceId);
+//    }
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//}

+ 59 - 59
720yun_fd_consumer/gis_consumer/src/main/java/com/gis/listener/Fd720Listener_2.java

@@ -1,59 +1,59 @@
-package com.gis.listener;
-
-import com.gis.constant.RabbitConfig;
-import com.gis.service.FodderService;
-import lombok.extern.slf4j.Slf4j;
-import org.slf4j.MDC;
-import org.springframework.amqp.rabbit.annotation.RabbitHandler;
-import org.springframework.amqp.rabbit.annotation.RabbitListener;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-
-/**
- * Created by owen on 2021/12/24 0012 10:05
- *
- * 开启两个线程监听
- */
-@Slf4j
-@Component
-@RabbitListener(queues = RabbitConfig.PANO_QUEUE) // 指定监听队列
-public class Fd720Listener_2 {
-
-
-    @Autowired
-    FodderService fodderService;
-
-
-    // 链路id
-    static String traceId;
-
-
-    @RabbitHandler
-    public void getMessage(Long param)  {
-        traceId = System.currentTimeMillis()+"";
-        MDC.put("TRACE_ID", traceId);
-
-        log.info("监听消息_2_start: {}, uuid: {}", param, traceId);
-        try {
-            Thread.sleep(300);
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-        }
-
-        fodderService.doSlice(param, traceId);
-
-
-        log.info("监听消息_2_end: {}, uuid: {}", param, traceId);
-    }
-
-
-
-
-
-
-
-
-
-
-}
+//package com.gis.listener;
+//
+//import com.gis.constant.RabbitConfig;
+//import com.gis.service.FodderService;
+//import lombok.extern.slf4j.Slf4j;
+//import org.slf4j.MDC;
+//import org.springframework.amqp.rabbit.annotation.RabbitHandler;
+//import org.springframework.amqp.rabbit.annotation.RabbitListener;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.stereotype.Component;
+//
+//
+///**
+// * Created by owen on 2021/12/24 0012 10:05
+// *
+// * 开启两个线程监听
+// */
+//@Slf4j
+//@Component
+//@RabbitListener(queues = RabbitConfig.PANO_QUEUE) // 指定监听队列
+//public class Fd720Listener_2 {
+//
+//
+//    @Autowired
+//    FodderService fodderService;
+//
+//
+//    // 链路id
+//    static String traceId;
+//
+//
+//    @RabbitHandler
+//    public void getMessage(Long param)  {
+//        traceId = System.currentTimeMillis()+"";
+//        MDC.put("TRACE_ID", traceId);
+//
+//        log.info("监听消息_2_start: {}, uuid: {}", param, traceId);
+//        try {
+//            Thread.sleep(300);
+//        } catch (InterruptedException e) {
+//            e.printStackTrace();
+//        }
+//
+//        fodderService.doSlice(param, traceId);
+//
+//
+//        log.info("监听消息_2_end: {}, uuid: {}", param, traceId);
+//    }
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//}

+ 326 - 0
720yun_fd_consumer/gis_consumer/src/main/java/com/gis/listener/SceneListener.java

@@ -0,0 +1,326 @@
+package com.gis.listener;
+
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.gis.constant.CmdConstant;
+import com.gis.constant.ConfigConstant;
+import com.gis.entity.ScenePanoEntity;
+import com.gis.entity.SceneQueueDTO;
+import com.gis.entity.WorkEntity;
+import com.gis.exception.BaseRuntimeException;
+import com.gis.oss.util.AliYunOssUtil;
+import com.gis.oss.util.FileAndOssUtil;
+import com.gis.service.ScenePanoService;
+import com.gis.service.WorkService;
+import com.gis.util.CmdUtils;
+import com.gis.util.FileUtils;
+import com.gis.util.QrCodeUtils;
+import com.gis.util.RandomUtils;
+import com.rabbitmq.client.Channel;
+import lombok.extern.slf4j.Slf4j;
+import org.slf4j.MDC;
+import org.springframework.amqp.core.Message;
+import org.springframework.amqp.rabbit.annotation.Queue;
+import org.springframework.amqp.rabbit.annotation.RabbitListener;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.util.ObjectUtils;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.nio.charset.StandardCharsets;
+import java.util.*;
+import java.util.concurrent.*;
+
+/**
+ * 消息监听器
+ *
+ * @author Xiewj
+ * @version 1.0
+ * @since 2023/08/07
+ */
+@Component
+@Slf4j
+public class SceneListener {
+
+    @Autowired
+    AliYunOssUtil aliyunOssUtil;
+    @Autowired
+    ConfigConstant configConstant;
+    @Autowired
+    FileAndOssUtil fileAndOssUtil;
+    @Autowired
+    WorkService workService;
+    @Autowired
+    QrCodeUtils qrCodeUtils;
+    @Autowired
+    ScenePanoService scenePanoService;
+
+
+    /**
+     * 全景场景初始化方法
+     *
+     * @param channel
+     * @param message
+     * @throws Exception the io exception  这里异常需要处理
+     */
+    @RabbitListener(
+            queuesToDeclare = @Queue("${queue.scene-queue}"),concurrency = "1"
+    )
+    public void sceneQueue(Channel channel, Message message) throws IOException {
+            if (ObjectUtils.isEmpty(message.getBody())) {
+                log.error("消息内容为空,退出构建,当前服务器id:{}" );
+                return;
+            }
+        String traceId = System.currentTimeMillis()+"";
+        MDC.put("TRACE_ID", traceId);
+
+        long deliveryTag = message.getMessageProperties().getDeliveryTag();
+        try {
+            String msg = new String(message.getBody(), StandardCharsets.UTF_8);
+            String messageId = message.getMessageProperties().getMessageId();
+            log.info("场景sceneQueue开始,id:{},deliveryTag:{},消息体:{}", messageId,deliveryTag,msg);
+            SceneQueueDTO param = JSONObject.parseObject(msg, SceneQueueDTO.class);
+            if (ObjectUtil.isEmpty(param.getSceneCode())) {
+                log.error("参数列表错误(缺少),格式不匹配,{}",param);
+                channel.basicAck(deliveryTag, false);
+            }
+            if (ObjectUtil.isNotEmpty(param.getSceneCode())&&param.getStatus()==0){
+                //初始化创建work表数据
+                workService.entityAdd(param.getPhoneNum(),param.getSceneCode(),param.getStatus(),param.getSceneName());
+                channel.basicAck(deliveryTag, false);
+            }else {
+                //计算完成处理
+                WorkEntity workEntity=workService.findByNum(param.getSceneCode());
+                //处理业务
+                //1,下载场景的全景图 默认 。scene_view_data/panorama/目录下的全景图图片
+                String ossPath =  "/scene_view_data/"+param.getSceneCode()+"/panorama/";
+                List<String> list=aliyunOssUtil.getFileFolder("4dkankan",ossPath);
+//            workEntity.setIcon(someDataJson.getString("icon"));
+//            workEntity.setShare(someDataJson.getString("share"));
+//            workEntity.setQrCode(someDataJson.getString("qrCode"));
+
+                //2,使用krpano工具生成全景图数据
+                List<ScenePanoEntity> scenePanoEntities=new ArrayList<>();
+                List<Map<String,Object>> scenes=new ArrayList<>();
+                list.forEach(item->{
+                    log.info("key:{}",item);
+                    Map<String,Object> scene=new HashMap<>();
+                    String sceneCode = RandomUtils.getSceneCode("fd720_");
+                    String newName = sceneCode + ".jpg";
+                    String savePath = configConstant.serverBasePath + sceneCode+ "/" + newName;
+                    aliyunOssUtil.downloadFile("4dkankan",item,savePath );
+                    ScenePanoEntity scenePanoEntity = this.doSlice(traceId, savePath, sceneCode, param.getSceneCode(), workEntity.getId());
+                    scenePanoEntities.add(scenePanoEntity);
+
+                    //  "icon": "https://ossxiaoan.4dage.com/720yun_fd_manage/fd720_8nRkFlzpp/vtour/panos/fd720_8nRkFlzpp.tiles/thumb.jpg",
+                    //   "sceneCode": "fd720_8nRkFlzpp",
+                    // "sceneTitle": "0",
+                    //  "category": 1,
+                    //   "type": "pano",
+                    //  "id": "s_xId8vevp",
+                    scene.put("icon", scenePanoEntity.getIcon());
+                    scene.put("sceneCode", scenePanoEntity.getSceneCode());
+                    scene.put("sceneTitle", param.getSceneName());
+                    scene.put("category", 1);
+                    scene.put("type", "pano");
+                    //id生成规则是 s_ 拼接,随机8位字符串,字母加数字组合,有大小写
+                    String customId = generateCustomId();
+                    scene.put("id", customId);
+                    scenes.add(scene);
+                });
+
+                log.info("场景切图完成组装json");
+                //3,修改json文件,并创建work作品表数据,增加作品类型为相机拍摄全景图
+                this.editSomeData(workEntity.getId(),scenes);
+
+
+                channel.basicAck(deliveryTag, false);
+            }
+
+
+        }catch (Exception e){
+            e.printStackTrace();
+            channel.basicAck(deliveryTag, false);
+            log.error("场景sceneQueue报错{}",e.getMessage());
+        }
+    }
+    private static final String CHARACTERS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
+
+    public static String generateRandomId() {
+        Random random = new Random();
+        StringBuilder sb = new StringBuilder();
+        for (int i = 0; i < 8; i++) {
+            int index = random.nextInt(CHARACTERS.length());
+            sb.append(CHARACTERS.charAt(index));
+        }
+        return sb.toString();
+    }
+
+    public static String generateCustomId() {
+        return "s_" + generateRandomId();
+    }
+    private ScenePanoEntity doSlice(String traceId,String filePath,String sceneCode,String num,String workId){
+        ScenePanoEntity entity = new ScenePanoEntity();
+        entity.setFilePath(filePath);
+        entity.setFileName(FileUtil.getName(filePath));
+        entity.setSceneCode(num);
+        entity.setWorkId(workId);
+        scenePanoService.save(entity);
+
+
+        log.info("切图流程开始 : " + filePath);
+        long start = System.currentTimeMillis();
+
+        String cmd = CmdConstant.PANO_KRPANO + filePath;
+        // 超时处理机制
+        final ExecutorService exec = Executors.newFixedThreadPool(1);
+        Callable<String> call = new Callable<String>() {
+            @Override
+            public String call() throws Exception {
+                MDC.put("TRACE_ID", traceId);
+                CmdUtils.callLine(cmd, 200);
+                long end = System.currentTimeMillis();
+                log.info("切图完成耗时: {} s" ,(end-start)/1000);
+                return "执行完成";
+            }
+        };
+        // 超时回调
+        Future<String> future = exec.submit(call);
+        try {
+            String obj = future.get(20, TimeUnit.MINUTES); //任务处理超时时间设为 3分钟
+            entity.setStatus(3);
+            String tourXmlScene = this.getTourXmlScene(sceneCode);
+            entity.setTour(tourXmlScene);
+            // 上传切图
+            this.uploadOss(sceneCode);
+            String ossUrl = configConstant.ossDomain + configConstant.ossBasePath + sceneCode+"/vtour/panos/"+sceneCode+".tiles/thumb.jpg";
+            log.info("切图预览图ossUrl: {}",ossUrl);
+            entity.setIcon(ossUrl);
+            log.info("任务成功返回: " + obj);
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+            entity.setStatus(2);
+            StringWriter trace=new StringWriter();
+            log.error(trace.toString());
+            log.error("异常了 InterruptedException");
+        } catch (ExecutionException | BaseRuntimeException e) {
+            e.printStackTrace();
+            StringWriter trace=new StringWriter();
+            e.printStackTrace(new PrintWriter(trace));
+            log.error("超时了 1");
+            // 异常日志要打印,不然不会出现在日志文件中,只会出现在控制台
+            log.error(trace.toString());
+            entity.setStatus(2);
+            future.cancel(true);
+        } catch (TimeoutException e) {
+            e.printStackTrace();
+            StringWriter trace=new StringWriter();
+            e.printStackTrace(new PrintWriter(trace));
+            log.error("超时了 2");
+            log.error(trace.toString());
+            entity.setStatus(2);
+            future.cancel(true);
+        } finally {
+            scenePanoService.update(entity);
+            log.info("切图流程, 更新数据库完成 : ");
+        }
+        log.info("切图流程结束 : ");
+        return entity;
+    }
+    // 获取切图后的tour.xml
+    private String getTourXmlScene(String code) {
+        log.info("处理tour.xml");
+        String tourPath = configConstant.serverBasePath + code + "/vtour/tour.xml";
+        log.info("tourPath: {}", tourPath);
+        BaseRuntimeException.isTrue(!FileUtil.isFile(tourPath), null, code + "_tour.xml文件不存在");
+
+        String tour = FileUtil.readString(tourPath, "utf-8");
+        tour = StrUtil.subAfter(tour, "</action>", true);
+        tour = StrUtil.subBefore(tour, "</krpano>", true);
+        String trim = StrUtil.trim(tour);
+        // log.info("trim: {}", trim);
+        BaseRuntimeException.isTrue(StrUtil.isAllBlank(trim), null, code + "_tour.xml文件不存在");
+
+        // 2022-09-15 加入相对路径
+        String basePath = "%CURRENTXML%../" + code + "/vtour/panos/";
+        trim = trim.replaceAll("panos/", basePath);
+
+        return trim;
+    }
+    private void uploadOss(String sceneCode) {
+        long start = System.currentTimeMillis();
+        String filePath = "/mnt/720yun_fd_manage_data/" + sceneCode;
+        String ossKey = "/720yun_fd_manage/" + sceneCode;
+        fileAndOssUtil.uploadBySh(filePath, ossKey);
+        long end = System.currentTimeMillis();
+        log.info("切图上传完成, 耗时:{} s" , (end-start)/1000 );
+    }
+
+
+    private void editSomeData(String id, List<Map<String, Object>> scenes){
+        // 如基someData作出修改,记得把代码里的someData 跟服务器里的someData都修改
+        String baseSomeDataPath = configConstant.serverBasePath + "baseData/someData.json";
+        String baseSomeDataSceneDataPath = configConstant.serverBasePath + "baseData/someDataSceneData.json.json";
+        log.info("服务器base someData.json path: {}", baseSomeDataPath);
+        // someData.json 内容
+        String content = null;
+        if (FileUtil.isFile(baseSomeDataPath)) {
+            log.info("使用服务器someData.json");
+            content = FileUtil.readUtf8String(baseSomeDataPath);
+        } else {
+            // 获取文件内容
+            log.info("创建someData.json");
+            content = FileUtils.getResourceContent("data/someData.json");
+            FileUtil.writeUtf8String(content, baseSomeDataPath);
+        }
+        String someDataSceneDatContent = null;
+        if (FileUtil.isFile(baseSomeDataSceneDataPath)) {
+            log.info("使用服务器SomeDataSceneData.json");
+            someDataSceneDatContent = FileUtil.readUtf8String(baseSomeDataSceneDataPath);
+        } else {
+            // 获取文件内容
+            log.info("创建SomeDataSceneData.json");
+            someDataSceneDatContent = FileUtils.getResourceContent("data/someData.json");
+            FileUtil.writeUtf8String(someDataSceneDatContent, baseSomeDataSceneDataPath);
+        }
+
+
+        JSONObject jsonObject = JSONObject.parseObject(content);
+        jsonObject.put("id", id + "");
+
+
+        // 创建二维码、二维码url
+        String shareUrl = configConstant.domain4dKK + "/panorama/showMobile.html?id=" + id;
+        String qrCode = qrCodeUtils.generateLogoQrCode(shareUrl, configConstant.serverBasePath, configConstant.ossBasePath, configConstant.ossDomain, id);
+        jsonObject.put("share", shareUrl);
+        jsonObject.put("qrCode", qrCode);
+
+        String ossKeyPath = configConstant.ossBasePath + id + "/someData.json";
+
+
+
+        JSONObject SomeDataSceneDataJsonObject = JSONObject.parseObject(someDataSceneDatContent);
+        JSONArray scenesJson = new JSONArray();
+        for (Map<String, Object> scene : scenes) {
+            JSONObject newData =SomeDataSceneDataJsonObject;
+            newData.putAll(scene);
+            scenesJson.add(newData);
+        }
+        jsonObject.remove("scenes");
+        jsonObject.put("scenes", scenesJson);
+
+        try {
+            fileAndOssUtil.upload(jsonObject.toJSONString().getBytes(), ossKeyPath);
+
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        String ossUrl = configConstant.ossDomain + ossKeyPath;
+        log.info("ossSomeData:{}", ossUrl);
+    }
+}

+ 17 - 0
720yun_fd_consumer/gis_consumer/src/main/java/com/gis/mapper/IBaseStrMapper.java

@@ -0,0 +1,17 @@
+package com.gis.mapper;
+
+import com.gis.entity.BaseStrEntity;
+import tk.mybatis.mapper.common.BaseMapper;
+import tk.mybatis.mapper.common.ConditionMapper;
+import tk.mybatis.mapper.common.IdsMapper;
+import tk.mybatis.mapper.common.special.InsertListMapper;
+
+import java.io.Serializable;
+
+/**
+ * Created by owen on 2020/2/18 0018 11:27
+ */
+
+public interface IBaseStrMapper<T extends BaseStrEntity, ID extends Serializable> extends BaseMapper<T>,
+        ConditionMapper<T>, IdsMapper<T>, InsertListMapper<T> {
+}

+ 14 - 0
720yun_fd_consumer/gis_consumer/src/main/java/com/gis/mapper/ScenePanoMapper.java

@@ -0,0 +1,14 @@
+package com.gis.mapper;
+
+import com.gis.entity.ScenePanoEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+* 四维看看场景全景图表 Mapper
+*
+* @author Xiewj
+* @since 2024-04-03 18:01
+*/
+@Mapper
+public interface ScenePanoMapper extends IBaseMapper<ScenePanoEntity,Long> {
+}

+ 42 - 0
720yun_fd_consumer/gis_consumer/src/main/java/com/gis/mapper/WorkMapper.java

@@ -0,0 +1,42 @@
+package com.gis.mapper;
+
+
+import com.gis.entity.WorkEntity;
+import org.apache.ibatis.annotations.*;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+
+@Component
+@Mapper
+public interface WorkMapper extends IBaseStrMapper<WorkEntity, String> {
+
+
+    @Update("UPDATE tb_work SET visit= visit + 1 where id = #{id}")
+    void addVisit(String id);
+
+    @Select("select id, name, scene_codes from tb_work where is_delete = 0 and user_id = #{userId} and scene_codes like #{sceneCode}")
+    List<WorkEntity> likeSceneCode(String sceneCode, String userId);
+    /**
+     * for update 锁表更新完,才能进行更新,需要开启事务
+     * 并发量大作会出现脏数据
+     *
+     * @param id
+     * @return
+     */
+    @Select("select id, name, scene_codes, user_id from tb_work where is_delete = 0 and id = #{id} for update")
+    WorkEntity findByIdForUpdate(String id);
+
+    /***
+     * 2022-3-18
+     * 真删除无效时数据
+     * @param now
+     */
+    @Delete("delete from tb_work where is_delete=0 and status=0 and DATE_FORMAT( create_time, '%Y%m' ) <= DATE_FORMAT(#{now} , '%Y%m' )")
+    void delByTime(String now);
+
+
+    @Select("select id from tb_work where is_delete=0 and status=#{status}")
+    List<String> getIdByStatus(int status);
+}

+ 52 - 0
720yun_fd_consumer/gis_consumer/src/main/java/com/gis/service/IBaseService.java

@@ -0,0 +1,52 @@
+package com.gis.service;
+
+import com.github.pagehelper.PageInfo;
+import tk.mybatis.mapper.entity.Condition;
+
+import java.io.Serializable;
+import java.util.List;
+
+public interface IBaseService<T, ID extends Serializable> {
+
+    public abstract T findById(ID id);
+
+    public abstract T findOne(T entity);
+
+    public abstract List<T> findByIds(String ids);
+
+    public abstract long count();
+
+    public abstract boolean exists(ID id);
+
+    public abstract int save(T entity);
+
+    public abstract int update(T entity);
+
+    public abstract int updateAll(T entity);
+
+    public abstract int deleteById(ID id);
+
+    public abstract int deleteByIds(String ids);
+
+    public abstract int delete(T entity);
+
+    public abstract List<T> findAll(Condition condition, String orderBy);
+
+    public abstract List<T> findAll(Condition condition);
+
+    public abstract List<T> findAll();
+
+    public abstract PageInfo<T> findAll(int pageNum, int pageSize);
+
+    public abstract PageInfo<T> findAll(int pageNum, int pageSize, String orderBy);
+
+    public abstract PageInfo<T> findAll(Condition condition, int pageNum, int pageSize);
+
+    public abstract PageInfo<T> findAll(Condition condition, int pageNum, int pageSize, String orderBy);
+
+
+    public abstract String getUserNameForToken();
+
+
+
+}

+ 52 - 0
720yun_fd_consumer/gis_consumer/src/main/java/com/gis/service/IBaseStrService.java

@@ -0,0 +1,52 @@
+package com.gis.service;
+
+import com.github.pagehelper.PageInfo;
+import tk.mybatis.mapper.entity.Condition;
+
+import java.io.Serializable;
+import java.util.List;
+
+public interface IBaseStrService<T, ID extends Serializable> {
+
+    public abstract T findById(ID id);
+
+    public abstract T findOne(T entity);
+
+    public abstract List<T> findByIds(String ids);
+
+    public abstract long count();
+
+    public abstract boolean exists(ID id);
+
+    public abstract int save(T entity);
+
+    public abstract int update(T entity);
+
+    public abstract int updateAll(T entity);
+
+    public abstract int deleteById(ID id);
+
+    public abstract int deleteByIds(String ids);
+
+    public abstract int delete(T entity);
+
+    public abstract List<T> findAll(Condition condition, String orderBy);
+
+    public abstract List<T> findAll(Condition condition);
+
+    public abstract List<T> findAll();
+
+    public abstract PageInfo<T> findAll(int pageNum, int pageSize);
+
+    public abstract PageInfo<T> findAll(int pageNum, int pageSize, String orderBy);
+
+    public abstract PageInfo<T> findAll(Condition condition, int pageNum, int pageSize);
+
+    public abstract PageInfo<T> findAll(Condition condition, int pageNum, int pageSize, String orderBy);
+
+
+    public abstract String getUserNameForToken();
+
+
+
+}

+ 14 - 0
720yun_fd_consumer/gis_consumer/src/main/java/com/gis/service/ScenePanoService.java

@@ -0,0 +1,14 @@
+package com.gis.service;
+
+
+import com.gis.entity.ScenePanoEntity;
+
+/**
+ * 四维看看场景全景图表 服务类接口
+ *
+ * @author Xiewj
+ * @since 2024-04-03 18:01
+ */
+public interface ScenePanoService extends IBaseService<ScenePanoEntity,Long> {
+
+}

+ 14 - 0
720yun_fd_consumer/gis_consumer/src/main/java/com/gis/service/WorkService.java

@@ -0,0 +1,14 @@
+package com.gis.service;
+
+
+import com.gis.entity.WorkEntity;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:14
+ */
+public interface WorkService extends IBaseService<WorkEntity, String>{
+
+    WorkEntity entityAdd(String phoneNum, String sceneCode, int status, String sceneName);
+    WorkEntity findByNum(String num);
+}

+ 185 - 0
720yun_fd_consumer/gis_consumer/src/main/java/com/gis/service/impl/IBaseServiceImpl.java

@@ -0,0 +1,185 @@
+package com.gis.service.impl;
+
+import com.gis.constant.ConfigConstant;
+import com.gis.entity.BaseEntity;
+import com.gis.mapper.IBaseMapper;
+import com.gis.service.IBaseService;
+import com.gis.util.JwtUtil;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.StringUtils;
+import tk.mybatis.mapper.entity.Condition;
+
+import javax.servlet.http.HttpServletRequest;
+import java.io.Serializable;
+import java.lang.reflect.ParameterizedType;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Created by owen on 2020/2/18 0018 11:22
+ */
+@Transactional
+public abstract class IBaseServiceImpl<T extends BaseEntity, ID extends Serializable> implements IBaseService<T, ID> {
+
+    @Autowired
+    public ConfigConstant configConstant;
+
+    @Autowired
+    protected HttpServletRequest request;
+
+    public abstract IBaseMapper<T, ID> getBaseMapper();
+
+    private Class<T> entityClass;
+
+    public IBaseServiceImpl(){
+        ParameterizedType pt = (ParameterizedType) this.getClass().getGenericSuperclass();
+        entityClass = (Class<T>) pt.getActualTypeArguments()[0];
+    }
+
+    @Override
+    public T findById(ID id){
+        Condition condition = new Condition(entityClass);
+        condition.createCriteria().andEqualTo("id", id);
+        condition.and().andEqualTo("isDelete", 0);
+        List<T> ts = getBaseMapper().selectByCondition(condition);
+        if (ts != null && ts.size() > 0){
+            return ts.get(0);
+        }else{
+            return null;
+        }
+    }
+
+    @Override
+    public T findOne(T entity){
+        entity.setIsDelete(0);
+        return getBaseMapper().selectOne(entity);
+    }
+
+    @Override
+    public List<T> findAll(){
+        Condition condition = new Condition(entityClass);
+        condition.createCriteria().andEqualTo("isDelete", 0);
+        return getBaseMapper().selectByCondition(condition);
+    }
+
+    /**
+     * 根据主键字符串进行查询,类中只有存在一个带有@Id注解的字段
+     *
+     * @param ids 如 "1,2,3,4"
+     * @return
+     */
+    @Override
+    public List<T> findByIds(String ids){
+        return getBaseMapper().selectByIds(ids);
+    }
+
+    @Override
+    public long count(){
+        List<T> all = this.findAll();
+        if (all != null && all.size() > 0){
+            return all.size();
+        }
+        return 0;
+    }
+
+    @Override
+    public boolean exists(ID id){
+        return getBaseMapper().existsWithPrimaryKey(id);
+    }
+
+    @Override
+    public int save(T entity) {
+        //migration之后要删掉判断
+            entity.setCreateTime(new Date());
+            entity.setUpdateTime(new Date());
+        return getBaseMapper().insertSelective(entity);
+    }
+
+    @Override
+    public int update(T entity) {
+        //migration之后要删掉判断
+            entity.setUpdateTime(new Date());
+        return getBaseMapper().updateByPrimaryKeySelective(entity);
+    }
+
+    @Override
+    public int updateAll(T entity) {
+        //migration之后要删掉判断
+            entity.setUpdateTime(new Date());
+        return getBaseMapper().updateByPrimaryKey(entity);
+    }
+
+    @Override
+    public int deleteById(ID id) {
+        return getBaseMapper().deleteByPrimaryKey(id);
+    }
+
+    @Override
+    public int deleteByIds(String ids){
+        return getBaseMapper().deleteByIds(ids);
+    }
+
+    @Override
+    public int delete(T entity){
+        return getBaseMapper().delete(entity);
+    }
+
+    public List<T> findAll(Condition condition){
+        condition.and().andEqualTo("isDelete", 0);
+        return getBaseMapper().selectByCondition(condition);
+    }
+
+    public List<T> findAll(Condition condition, String orderBy){
+        condition.and().andEqualTo("isDelete", 0);
+        if (!StringUtils.isEmpty(orderBy)){
+            PageHelper.orderBy(orderBy);
+        }
+        return getBaseMapper().selectByCondition(condition);
+    }
+
+    public PageInfo<T> findAll(int pageNum, int pageSize){
+        PageHelper.startPage(pageNum, pageSize);
+        return new PageInfo<>(this.findAll());
+    }
+
+    public PageInfo<T> findAll(int pageNum, int pageSize, String orderBy){
+        PageHelper.startPage(pageNum, pageSize);
+        if (!StringUtils.isEmpty(orderBy)){
+            PageHelper.orderBy(orderBy);
+        }
+        return new PageInfo<>(this.findAll());
+    }
+
+    public PageInfo<T> findAll(Condition condition, int pageNum, int pageSize){
+        PageHelper.startPage(pageNum, pageSize);
+        return new PageInfo<>(this.findAll(condition));
+    }
+
+    public PageInfo<T> findAll(Condition condition, int pageNum, int pageSize, String orderBy){
+        PageHelper.startPage(pageNum, pageSize);
+        if (!StringUtils.isEmpty(orderBy)){
+            PageHelper.orderBy(orderBy);
+        }
+        return new PageInfo<>(this.findAll(condition));
+    }
+
+
+
+
+    public String getUserNameForToken(){
+        /** 获取header token */
+        String token = request.getHeader("token");
+        if (org.apache.commons.lang3.StringUtils.isNotBlank(token)){
+            return JwtUtil.getUsername(token);
+        }
+        return null;
+    }
+
+    public String getToken(){
+        /** 获取header token */
+        return request.getHeader("token");
+    }
+}

+ 193 - 0
720yun_fd_consumer/gis_consumer/src/main/java/com/gis/service/impl/IBaseStrServiceImpl.java

@@ -0,0 +1,193 @@
+package com.gis.service.impl;
+
+import cn.hutool.core.util.StrUtil;
+import com.gis.constant.ConfigConstant;
+import com.gis.entity.BaseStrEntity;
+import com.gis.mapper.IBaseStrMapper;
+import com.gis.service.IBaseStrService;
+import com.gis.util.JwtUtil;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.StringUtils;
+import tk.mybatis.mapper.entity.Condition;
+
+import javax.servlet.http.HttpServletRequest;
+import java.io.Serializable;
+import java.lang.reflect.ParameterizedType;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Created by owen on 2020/2/18 0018 11:22
+ */
+@Transactional
+public abstract class IBaseStrServiceImpl<T extends BaseStrEntity, ID extends Serializable> implements IBaseStrService<T, ID> {
+
+    @Autowired
+    public ConfigConstant configConstant;
+
+    @Autowired
+    protected HttpServletRequest request;
+
+    public abstract IBaseStrMapper<T, ID> getBaseMapper();
+
+    private Class<T> entityClass;
+
+    public IBaseStrServiceImpl(){
+        ParameterizedType pt = (ParameterizedType) this.getClass().getGenericSuperclass();
+        entityClass = (Class<T>) pt.getActualTypeArguments()[0];
+    }
+
+    @Override
+    public T findById(ID id){
+        Condition condition = new Condition(entityClass);
+        condition.createCriteria().andEqualTo("id", id);
+        condition.and().andEqualTo("isDelete", 0);
+        List<T> ts = getBaseMapper().selectByCondition(condition);
+        if (ts != null && ts.size() > 0){
+            return ts.get(0);
+        }else{
+            return null;
+        }
+    }
+
+    @Override
+    public T findOne(T entity){
+        entity.setIsDelete(0);
+        return getBaseMapper().selectOne(entity);
+    }
+
+    @Override
+    public List<T> findAll(){
+        Condition condition = new Condition(entityClass);
+        condition.createCriteria().andEqualTo("isDelete", 0);
+        return getBaseMapper().selectByCondition(condition);
+    }
+
+    /**
+     * 根据主键字符串进行查询,类中只有存在一个带有@Id注解的字段
+     *
+     * @param ids 如 "1,2,3,4"
+     * @return
+     */
+    @Override
+    public List<T> findByIds(String ids){
+        return getBaseMapper().selectByIds(ids);
+    }
+
+    @Override
+    public long count(){
+        List<T> all = this.findAll();
+        if (all != null && all.size() > 0){
+            return all.size();
+        }
+        return 0;
+    }
+
+    @Override
+    public boolean exists(ID id){
+        return getBaseMapper().existsWithPrimaryKey(id);
+    }
+
+    @Override
+    public int save(T entity) {
+        //migration之后要删掉判断
+            entity.setCreateTime(new Date());
+            entity.setUpdateTime(new Date());
+        return getBaseMapper().insertSelective(entity);
+    }
+
+    @Override
+    public int update(T entity) {
+        //migration之后要删掉判断
+            entity.setUpdateTime(new Date());
+        return getBaseMapper().updateByPrimaryKeySelective(entity);
+    }
+
+    @Override
+    public int updateAll(T entity) {
+        //migration之后要删掉判断
+            entity.setUpdateTime(new Date());
+        return getBaseMapper().updateByPrimaryKey(entity);
+    }
+
+    @Override
+    public int deleteById(ID id) {
+        return getBaseMapper().deleteByPrimaryKey(id);
+    }
+
+    @Override
+    public int deleteByIds(String ids){
+        return getBaseMapper().deleteByIds(ids);
+    }
+
+    @Override
+    public int delete(T entity){
+        return getBaseMapper().delete(entity);
+    }
+
+    public List<T> findAll(Condition condition){
+        condition.and().andEqualTo("isDelete", 0);
+        return getBaseMapper().selectByCondition(condition);
+    }
+
+    public List<T> findAll(Condition condition, String orderBy){
+        condition.and().andEqualTo("isDelete", 0);
+        if (!StringUtils.isEmpty(orderBy)){
+            PageHelper.orderBy(orderBy);
+        }
+        return getBaseMapper().selectByCondition(condition);
+    }
+
+    public PageInfo<T> findAll(int pageNum, int pageSize){
+        PageHelper.startPage(pageNum, pageSize);
+        return new PageInfo<>(this.findAll());
+    }
+
+    public PageInfo<T> findAll(int pageNum, int pageSize, String orderBy){
+        PageHelper.startPage(pageNum, pageSize);
+        if (!StringUtils.isEmpty(orderBy)){
+            PageHelper.orderBy(orderBy);
+        }
+        return new PageInfo<>(this.findAll());
+    }
+
+    public PageInfo<T> findAll(Condition condition, int pageNum, int pageSize){
+        PageHelper.startPage(pageNum, pageSize);
+        return new PageInfo<>(this.findAll(condition));
+    }
+
+    public PageInfo<T> findAll(Condition condition, int pageNum, int pageSize, String orderBy){
+        PageHelper.startPage(pageNum, pageSize);
+        if (!StringUtils.isEmpty(orderBy)){
+            PageHelper.orderBy(orderBy);
+        }
+        return new PageInfo<>(this.findAll(condition));
+    }
+
+
+
+
+    public String getUserNameForToken(){
+        /** 获取header token */
+        String token = request.getHeader("token");
+        if (org.apache.commons.lang3.StringUtils.isNotBlank(token)){
+            return JwtUtil.getUsername(token);
+        }
+        return null;
+    }
+
+    public String getToken(){
+        /** 获取header token */
+        return request.getHeader("token");
+    }
+
+    public Integer getIsAdmin(){
+        if (StrUtil.isBlank(getToken())){
+            return null;
+        }
+        return JwtUtil.getIsAdmin(getToken());
+    }
+}

+ 26 - 0
720yun_fd_consumer/gis_consumer/src/main/java/com/gis/service/impl/ScenePanoServiceImpl.java

@@ -0,0 +1,26 @@
+package com.gis.service.impl;
+
+import com.gis.entity.ScenePanoEntity;
+import com.gis.mapper.IBaseMapper;
+import com.gis.mapper.ScenePanoMapper;
+import com.gis.service.ScenePanoService;
+import com.gis.service.impl.IBaseServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 四维看看场景全景图表 服务实现类
+ *
+ * @author Xiewj
+ * @since 2024-04-03 18:01
+ */
+@Service
+public class ScenePanoServiceImpl extends IBaseServiceImpl<ScenePanoEntity, Long> implements ScenePanoService {
+    @Autowired
+
+    private ScenePanoMapper scenePanoMapper;
+    @Override
+    public IBaseMapper<ScenePanoEntity, Long> getBaseMapper() {
+        return this.scenePanoMapper;
+    }
+}

+ 68 - 0
720yun_fd_consumer/gis_consumer/src/main/java/com/gis/service/impl/WorkServiceImpl.java

@@ -0,0 +1,68 @@
+package com.gis.service.impl;
+
+import com.gis.constant.ConfigConstant;
+import com.gis.entity.WorkEntity;
+import com.gis.mapper.IBaseStrMapper;
+import com.gis.mapper.WorkMapper;
+import com.gis.oss.util.FileAndOssUtil;
+import com.gis.service.WorkService;
+import com.gis.util.QrCodeUtils;
+import com.gis.util.SnowFlakeUUidUtils;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:16
+ */
+@Slf4j
+@Service
+public class WorkServiceImpl extends IBaseStrServiceImpl<WorkEntity, String> implements WorkService {
+    @Autowired
+    ConfigConstant configConstant;
+
+    @Autowired
+    private WorkMapper entityMapper;
+    @Autowired
+    FileAndOssUtil fileAndOssUtil;
+    @Autowired
+    QrCodeUtils qrCodeUtils;
+
+    @Override
+    public WorkEntity findByNum(String num) {
+        WorkEntity one=new WorkEntity();
+        one.setNum(num);
+        return getBaseMapper().selectOne(one);
+    }
+
+    @Override
+    public WorkEntity entityAdd(String phoneNum, String sceneCode, int status, String sceneName) {
+
+        WorkEntity entity = new WorkEntity();
+        entity.setId(SnowFlakeUUidUtils.getUuid("WK"));
+        entity.setUserId(phoneNum);
+        entity.setStatus(0);
+        Date date = new Date();
+        entity.setCreateTime(date);
+        entity.setUpdateTime(date);
+        entity.setCalcStatus(status);
+        entity.setNum(sceneCode);
+        entity.setType("pro");
+        entity.setName(sceneName);
+        this.save(entity);
+
+        String id = entity.getId();
+        log.info("创建对象完成: {}", id);
+
+        return entity;
+    }
+
+    @Override
+    public IBaseStrMapper<WorkEntity, String> getBaseMapper() {
+        return this.entityMapper;
+    }
+
+}

+ 36 - 2
720yun_fd_consumer/gis_consumer/src/main/java/com/gis/util/FileUtils.java

@@ -4,10 +4,10 @@ import cn.hutool.core.io.FileUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.junit.Test;
+import org.springframework.core.io.ClassPathResource;
 import org.springframework.stereotype.Component;
 
-import java.io.File;
-import java.io.IOException;
+import java.io.*;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -75,5 +75,39 @@ public class FileUtils {
         }
     }
 
+    // jar包运行,只能用文件流的形式获取文件
+    public static InputStream getResource(String path){
+        ClassPathResource classPathResource = new ClassPathResource(path);
+        InputStream inputStream = null;
+        try {
+            inputStream = classPathResource.getInputStream();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return inputStream;
+    }
+    /**
+     * 读取资源文内容
+     * @param resourcePath : data/someData.json
+     * @return
+     */
+    public static String getResourceContent(String resourcePath){
+        InputStream resource = FileUtils.getResource(resourcePath);
+        StringBuilder sb = new StringBuilder();
+        String line;
+        String str = null ;
+        BufferedReader br = new BufferedReader(new InputStreamReader(resource));
+        while (true) {
+            try {
+                if ((line = br.readLine()) == null) break;
+                sb.append(line);
+                str = sb.toString();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return str;
+    }
+
 
 }

+ 286 - 0
720yun_fd_consumer/gis_consumer/src/main/java/com/gis/util/JwtUtil.java

@@ -0,0 +1,286 @@
+package com.gis.util;
+
+import com.auth0.jwt.JWT;
+import com.auth0.jwt.interfaces.Claim;
+import com.auth0.jwt.interfaces.DecodedJWT;
+import com.gis.exception.BaseRuntimeException;
+import io.jsonwebtoken.Claims;
+import io.jsonwebtoken.JwtBuilder;
+import io.jsonwebtoken.Jwts;
+import io.jsonwebtoken.SignatureAlgorithm;
+import lombok.extern.log4j.Log4j2;
+import org.junit.Test;
+import org.springframework.util.Assert;
+
+import java.util.*;
+
+@Log4j2
+public class JwtUtil {
+
+    //生成签名的时候使用的秘钥secret
+    private static final String SECRET = "XX#$%()(#*!()!KL<><MQLMNQNQJQK&sdfkjsdrow32234545fdf>?N<:{LWPW";
+
+    /**
+     * 用户登录成功后生成Jwt
+     * 使用Hs256算法  私匙使用用户密码
+     *
+     * @param ttlMillis jwt过期时间
+     * @param userName  用户名
+     * @return
+     */
+    public static String createJWT(long ttlMillis, String userName) {
+        //指定签名的时候使用的签名算法,也就是header那部分,jjwt已经将这部分内容封装好了。
+        SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.HS256;
+
+        //生成JWT的时间
+        long nowMillis = System.currentTimeMillis();
+        Date now = new Date(nowMillis);
+
+        //创建payload的私有声明(根据特定的业务需要添加,如果要拿这个做验证,一般是需要和jwt的接收方提前沟通好验证方式的)
+        Map<String, Object> claims = new HashMap<String, Object>();
+        claims.put("userName", userName);
+
+        //下面就是在为payload添加各种标准声明和私有声明了
+        //这里其实就是new一个JwtBuilder,设置jwt的body
+        JwtBuilder builder = Jwts.builder()
+                //如果有私有声明,一定要先设置这个自己创建的私有的声明,这个是给builder的claim赋值,一旦写在标准的声明赋值之后,就是覆盖了那些标准的声明的
+                .setClaims(claims)
+                //设置jti(JWT ID):是JWT的唯一标识,根据业务需要,这个可以设置为一个不重复的值,主要用来作为一次性token,从而回避重放攻击。
+                .setId(UUID.randomUUID().toString())
+                //iat: jwt的签发时间
+                .setIssuedAt(now)
+                //代表这个JWT的主体,即它的所有人,这个是一个json格式的字符串,可以存放什么userid,roldid之类的,作为什么用户的唯一标志。
+                .setSubject(userName)
+                //设置签名使用的签名算法和签名使用的秘钥
+                .signWith(signatureAlgorithm, SECRET);
+
+        if (ttlMillis >= 0) {
+            long expMillis = nowMillis + ttlMillis;
+            Date exp = new Date(expMillis);
+            //设置过期时间
+            builder.setExpiration(exp);
+        }/*else{
+            //设置过期时间半小时
+            DateTime expDate = new DateTime().plusMinutes(30);
+            builder.setExpiration(expDate.toDate());
+        }*/
+        return builder.compact();
+    }
+
+
+    /**
+     * Token的解密
+     *
+     * @param token 加密后的token
+     * @return
+     */
+    public static Claims parseJWT(String token) {
+        //得到DefaultJwtParser
+        Claims claims = Jwts.parser()
+                //设置签名的秘钥
+                .setSigningKey(SECRET)
+                //设置需要解析的jwt
+                .parseClaimsJws(token).getBody();
+        return claims;
+    }
+
+    public static String getTokenStringValueByKey(String token, String key) {
+        DecodedJWT jwt = JWT.decode(token);
+        Claim value = jwt.getClaim(key);
+
+        if (value == null) {
+            log.error("token key is null");
+            throw new BaseRuntimeException(5001, "token invalid");
+        }
+        return value.asString();
+    }
+
+
+    /**
+     * 是否超级管理员
+     */
+    public static Integer getIsAdmin(String token) {
+        DecodedJWT jwt = JWT.decode(token);
+        Claim id = jwt.getClaim("isAdmin");
+        Assert.notNull(id, "token id is null ");
+        return id.asInt()==null ? 0:1;
+    }
+
+
+    /**
+     * 校验token
+     * 在这里可以使用官方的校验,我这里校验的是token中携带的密码于数据库一致的话就校验通过
+     *
+     * @param token
+     * @param userName
+     * @return
+     */
+    public static Boolean isVerify(String token, String userName) {
+
+        //得到DefaultJwtParser
+        Claims claims = Jwts.parser()
+                //设置签名的秘钥
+                .setSigningKey(SECRET)
+                //设置需要解析的jwt
+                .parseClaimsJws(token).getBody();
+
+        return claims.get("userName").equals(userName);
+    }
+
+    /**
+     * 获得token中的信息无需secret解密也能获得
+     *
+     * @return token中包含的用户名
+     */
+    public static String getUsername(String token) {
+        DecodedJWT jwt = JWT.decode(token);
+        Claim userName = jwt.getClaim("userName");
+        Assert.notNull(userName, "token userName is null ");
+        return userName.asString();
+    }
+
+
+    public static List getUserRole(String token) {
+        DecodedJWT jwt = JWT.decode(token);
+        Claim role = jwt.getClaim("role");
+        Assert.notNull(role, "token role is null ");
+        return role.as(List.class);
+    }
+
+
+    public static String createJWT(long ttlMillis, Map<String, Object> paramMap) {
+        //指定签名的时候使用的签名算法,也就是header那部分,jjwt已经将这部分内容封装好了。
+        SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.HS256;
+
+        String userName = paramMap.get("userName").toString();
+
+        //生成JWT的时间
+        long nowMillis = System.currentTimeMillis();
+        Date now = new Date(nowMillis);
+
+        //创建payload的私有声明(根据特定的业务需要添加,如果要拿这个做验证,一般是需要和jwt的接收方提前沟通好验证方式的)
+        Map<String, Object> claims = new HashMap<String, Object>();
+        claims.put("userName", userName);
+        claims.put("id", paramMap.get("id"));
+        claims.put("role", paramMap.get("role"));
+        claims.put("manager", paramMap.get("manager"));
+
+        //下面就是在为payload添加各种标准声明和私有声明了
+        //这里其实就是new一个JwtBuilder,设置jwt的body
+        JwtBuilder builder = Jwts.builder()
+                //如果有私有声明,一定要先设置这个自己创建的私有的声明,这个是给builder的claim赋值,一旦写在标准的声明赋值之后,就是覆盖了那些标准的声明的
+                .setClaims(claims)
+                //设置jti(JWT ID):是JWT的唯一标识,根据业务需要,这个可以设置为一个不重复的值,主要用来作为一次性token,从而回避重放攻击。
+                .setId(UUID.randomUUID().toString())
+                //iat: jwt的签发时间
+                .setIssuedAt(now)
+                //代表这个JWT的主体,即它的所有人,这个是一个json格式的字符串,可以存放什么userid,roldid之类的,作为什么用户的唯一标志。
+                .setSubject(userName)
+                //设置签名使用的签名算法和签名使用的秘钥
+                .signWith(signatureAlgorithm, SECRET);
+
+        if (ttlMillis >= 0) {
+            long expMillis = nowMillis + ttlMillis;
+            Date exp = new Date(expMillis);
+            //设置过期时间
+            builder.setExpiration(exp);
+        }/*else{
+            //设置过期时间半小时
+            DateTime expDate = new DateTime().plusMinutes(30);
+            builder.setExpiration(expDate.toDate());
+        }*/
+        return builder.compact();
+    }
+
+    /**
+     * 获取用户id
+     */
+    public static Long getUserId(String token) {
+        DecodedJWT jwt = JWT.decode(token);
+        Claim id = jwt.getClaim("id");
+        Assert.notNull(id, "token id is null ");
+        return id.asLong();
+    }
+
+
+    /**
+     * 管理者 ,0:是, 1:否
+     */
+    public static Boolean getUserManager(String token) {
+        DecodedJWT jwt = JWT.decode(token);
+        Claim id = jwt.getClaim("manager");
+        Assert.notNull(id, "token manager is null ");
+        Integer integer = id.asInt();
+        return integer == 0;
+    }
+
+    public static void main(String[] args) {
+        long nowMillis = System.currentTimeMillis();
+        System.out.println(nowMillis);
+        Date exp = new Date(nowMillis);
+        System.out.println(exp);
+    }
+
+    public static void test2() {
+        String token = "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsInJvbGUiOlsiYWRtaW4iLCJyb290Il0sImlkIjoxLCJ1c2VyTmFtZSI6ImFkbWluIiwiaWF0IjoxNTgzODA5MzkzLCJqdGkiOiJkNjZiZTFkYi00MTQ0LTQxMTYtYTNlNi01ZDBjNjhlNTI3ODAifQ.-4AdsVP2RwmPS2grtO4aC8ov9PwkilzaGdThGetBJok";
+        System.out.println(getUserRole(token));
+
+    }
+
+    public static void test3() {
+        HashMap<String, Object> map = new HashMap<>();
+
+        ArrayList<Object> list = new ArrayList<>();
+        list.add("admin");
+        list.add("root");
+
+        map.put("userName", "admin");
+        map.put("id", Long.valueOf("1"));
+        map.put("role", list);
+
+        String token = createJWT(-1, map);
+        System.out.println(token);
+
+        Boolean isVerify = isVerify(token, "admin");
+        System.out.println(isVerify);
+
+    }
+
+    private static void testList() {
+        ArrayList<Object> list = new ArrayList<>();
+        list.add("admin");
+        list.add("root");
+    }
+
+    /**
+     * 检查token是否有效
+     */
+    @Test
+    public void testCheckToken(){
+        String token = "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMzExMjMxMTE3OCIsInVzZXJOYW1lIjoiMTMxMTIzMTExNzgiLCJpYXQiOjE2MTM2MjAzNjcsImp0aSI6IjMyYTAwZDNiLTE2ODctNDUzNi04NmIwLWY4OTMzODQzNzNjMiJ9.5sV47Yf0HU4m6u77jmCziR3KhAGfiL5aUKxo57MImTI";
+        String username = getUsername(token);
+        Long userId = getUserId(token);
+        System.out.println(username);
+        System.out.println("id: " + userId );
+    }
+
+
+    @Test
+    public void testIsVerify(){
+        String token = "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMzExMjMxMTE3OCIsInVzZXJOYW1lIjoiMTMxMTIzMTExNzgiLCJpYXQiOjE2MTM2MjAzNjcsImp0aSI6IjMyYTAwZDNiLTE2ODctNDUzNi04NmIwLWY4OTMzODQzNzNjMiJ9.5sV47Yf0HU4m6u77jmCziR3KhAGfiL5aUKxo57MImTI";
+       String userName = "13112311178";
+        Boolean verify = isVerify(token, userName);
+        System.out.println(verify);
+    }
+
+
+    /**
+     * 解析出来是一个对象
+     */
+    @Test
+    public void testParseJWT(){
+        String token = "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsInJvbGUiOlsiYWRtaW4iLCJyb290Il0sImlkIjoxLCJ1c2VyTmFtZSI6ImFkbWluIiwiaWF0IjoxNTgzODA5MzkzLCJqdGkiOiJkNjZiZTFkYi00MTQ0LTQxMTYtYTNlNi01ZDBjNjhlNTI3ODAifQ.-4AdsVP2RwmPS2grtO4aC8ov9PwkilzaGdThGetBJok";
+        System.out.println(parseJWT(token));
+    }
+
+}

+ 197 - 0
720yun_fd_consumer/gis_consumer/src/main/java/com/gis/util/QrCodeUtils.java

@@ -0,0 +1,197 @@
+package com.gis.util;
+
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.img.ImgUtil;
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.util.IdUtil;
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.http.HttpUtil;
+import com.gis.constant.ConfigConstant;
+import com.gis.oss.util.FileAndOssUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.iherus.codegen.qrcode.SimpleQrcodeGenerator;
+import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Date;
+
+/**
+ * Created by owen on 2020/12/17 0017 16:49
+ *
+ * 二维码
+ */
+@Component
+@Slf4j
+public class QrCodeUtils {
+
+    @Autowired
+    FileAndOssUtil fileAndOssUtil;
+    @Autowired
+    ConfigConstant configConstant;
+
+    @Test
+    public void test(){
+        try {
+            new SimpleQrcodeGenerator().generate("http://ossxiaoan.4dage.com/cms_zhen/image/20201218_142627638.png?123").toFile("F:\\test\\ngin\\cms_wuhu_gov_data\\qrCode\\3.jpg");
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    /**
+     * 创建普通二维码
+     */
+    @Test
+    public  void generateQrCode(){
+        String url = "www.baidu.com";
+        String savePath = "E:\\cache\\";
+        // 保存地址
+        String time = DateUtil.format(new Date(), "yyyyMMdd_HHmmssSSS") + ".jpg";
+        String dirType = "qrCode/";
+        savePath = savePath + dirType;
+
+        // 创建目录
+        if (!FileUtil.isDirectory(savePath)) {
+            FileUtil.mkdir(savePath);
+        }
+        savePath = savePath + time;
+        log.info("savePath: {}", savePath);
+        // 创建二维码tpt
+        try {
+            new SimpleQrcodeGenerator().generate(url).toFile(savePath);
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+
+    /**
+     * 附带logo小图标二维码
+     */
+    public String generateLogoQrCode(String url, String serverBasePath, String ossBasePath, String ossDomain, String id){
+        // 保存地址
+        String savePath = serverBasePath + id;
+
+        String logoPath = serverBasePath + "img/kankan_icon.png";
+        if (!FileUtil.isFile(logoPath)) {
+            InputStream resource = FileUtils.getResource("img/kankan_icon.png");
+            FileUtil.writeFromStream(resource, logoPath);
+            log.info("logo写入完成");
+        }
+        log.info("logoPath: {}", logoPath);
+
+        // 创建目录
+        if (!FileUtil.isDirectory(savePath)) {
+            FileUtil.mkdir(savePath);
+        }
+        savePath = savePath + "/qrCode.jpg";
+//        log.info("savePath: {}", savePath);
+        // 创建二维码tpt
+        try {
+            new SimpleQrcodeGenerator().setLogo(logoPath).generate(url).toFile(savePath);
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+        // 二维码上传oss
+        String ossPath = ossBasePath + id + "/qrCode.jpg";
+        fileAndOssUtil.upload(savePath, ossPath);
+        String ossUrl = ossDomain + ossPath;
+        log.info("ossUrl: {}", ossUrl);
+
+        // 删除服务器临时文件
+
+        return ossUrl;
+    }
+
+
+    /**
+     * 自定义logo小图标二维码
+     * @param url 二维码内容url
+     * @param serverBasePath
+     * @param ossBasePath
+     * @param ossDomain
+     * @param id 目录
+     * @param logoPath 小logo图片地址
+     * @return
+     */
+    public String diyLogoQrCode(String url, String serverBasePath, String ossBasePath, String ossDomain, String id, String logoPath){
+
+        String savePath = serverBasePath + id;
+
+        // 创建目录
+        if (!FileUtil.isDirectory(savePath)) {
+            FileUtil.mkdir(savePath);
+        }
+        savePath = savePath + "/qrCode.jpg";
+//        log.info("savePath: {}", savePath);
+        // 创建二维码tpt
+        try {
+            new SimpleQrcodeGenerator().setLogo(logoPath).generate(url).toFile(savePath);
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+        // 二维码上传oss
+        String ossPath = ossBasePath + id + "/qrCode.jpg";
+        fileAndOssUtil.upload(savePath, ossPath);
+        String ossUrl = ossDomain + ossPath;
+        log.info("ossUrl: {}", ossUrl);
+
+        return ossUrl;
+    }
+    /**
+     * 附带logo小图标二维码
+     */
+    public String generateLogoQrCodeBase64(String logo,String text){
+        String serverBasePath=configConstant.serverBasePath;
+
+        String savePath =  serverBasePath +File.separator+"gerQrcode"+File.separator+ IdUtil.getSnowflakeNextId()+File.separator;
+        // 创建目录
+        if (!FileUtil.isDirectory(savePath)) {
+            FileUtil.mkdir(savePath);
+        }
+        String logoPath = serverBasePath + "img/kankan_icon.png";
+        if (StrUtil.isNotEmpty(logo)){
+            File file = HttpUtil.downloadFileFromUrl(logo, savePath);
+                 logoPath=file.getPath();
+                log.info("diy_logoPath{}",logoPath);
+
+        }else {
+             if (!FileUtil.isFile(logoPath)) {
+                InputStream resource = FileUtils.getResource("img/kankan_icon.png");
+                FileUtil.writeFromStream(resource, logoPath);
+                log.info("logo写入完成");
+            }
+        }
+        log.info("logoPath: {}", logoPath);
+        BufferedImage test = new SimpleQrcodeGenerator().setLogo(logoPath).generate(text).getImage();
+        System.out.println(test);
+        String png = ImgUtil.toBase64(test, "jpg");
+        png = "data:image/jpg;base64," + png;
+        if (StrUtil.isNotEmpty(logo)&&!logoPath.contains("kankan_icon.png")){
+            boolean del = FileUtil.del(savePath);
+            log.info("删除logo:{}",del);
+        }
+        return png;
+    }
+    /**
+     * 附带logo小图标二维码
+     */
+    public static void main(String[] args) {
+        String logoPath = "C:\\Users\\4DAGE\\Downloads\\img"+File.separator+ IdUtil.getSnowflakeNextId()+File.separator;
+        String logo="https://ossxiaoan.4dage.com/720yun_fd_manage/fd720_gxqoc32gt/vtour/panos/fd720_gxqoc32gt.tiles/thumb.jpg";
+        if (StrUtil.isNotEmpty(logo)) {
+            if (!FileUtil.isDirectory(logoPath)) {
+                FileUtil.mkdir(logoPath);
+            }
+            File file = HttpUtil.downloadFileFromUrl(logo, logoPath);
+            System.out.println(file.getPath());
+        }
+    }
+
+
+ }

+ 14 - 2
720yun_fd_consumer/gis_consumer/src/main/java/com/gis/util/RandomUtils.java

@@ -11,13 +11,13 @@ import org.springframework.stereotype.Component;
 @Component
 public class RandomUtils {
 
-    public static String randowString(int length){
+    public static String randomString(int length){
         String baseString = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
         return RandomUtil.randomString(baseString, length);
     }
 
     public static void main(String[] args) {
-        System.out.println(randowString(9));
+        System.out.println(randomString(9));
     }
 
     /**
@@ -25,7 +25,19 @@ public class RandomUtils {
      * preStr: 8位id前缀
      * @return
      */
+    public static String getUuid(){
+        return SnowFlakeUUidUtils.generaUUid(null, null, "pano");
 
+    }
+
+    /**
+     * 场景码
+     * @return
+     */
+    public static String getSceneCode(String prefix){
+        String sceneCode = RandomUtils.randomString(9);
+        return  prefix +sceneCode;
+    }
 
     private static String randowInt(int length){
         String baseString = "0123456789";

+ 226 - 0
720yun_fd_consumer/gis_consumer/src/main/java/com/gis/util/SnowFlakeUUidUtils.java

@@ -0,0 +1,226 @@
+package com.gis.util;
+
+import lombok.extern.log4j.Log4j2;
+import org.apache.commons.lang3.StringUtils;
+
+import java.lang.management.ManagementFactory;
+import java.net.InetAddress;
+import java.net.NetworkInterface;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
+/**
+ * 2 * @Author: Abner
+ * 3 * @Date: 2020/12/9 16:07
+ * 4
+ */
+@Log4j2
+public class SnowFlakeUUidUtils {
+
+    // 时间起始标记点,作为基准,一般取系统的最近时间(一旦确定不能变动)
+    //起始标记点
+    private final static long twepoch = 1288834974657L;
+    // 机器标识位数
+    private final static long workerIdBits = 5L;
+    // 数据中心标识位数
+    private final static long datacenterIdBits = 5L;
+    // 机器ID最大值
+    private final static long maxWorkerId = -1L ^ (-1L << workerIdBits);
+    // 数据中心ID最大值
+    private final static long maxDatacenterId = -1L ^ (-1L << datacenterIdBits);
+    // 毫秒内自增位
+    private final static long sequenceBits = 12L;
+    // 机器ID偏左移12位
+    private final static long workerIdShift = sequenceBits;
+    // 数据中心ID左移17位
+    private final static long datacenterIdShift = sequenceBits + workerIdBits;
+    // 时间毫秒左移22位
+    private final static long timestampLeftShift = sequenceBits + workerIdBits + datacenterIdBits;
+
+    private final static long sequenceMask = -1L ^ (-1L << sequenceBits);
+
+    private final static Lock myLock = new ReentrantLock();
+    /* 上次生产id时间戳 */
+    private static long lastTimestamp = -1L;
+    // 0,并发控制
+    private long sequence = 0L;
+
+    private final long workerId;
+    // 数据标识id部分
+    private final long datacenterId;
+
+    private static volatile SnowFlakeUUidUtils snowFlakeUUidUtils;
+
+
+    private static SnowFlakeUUidUtils getSingleInstance(Long workerId, Long datacenterId){
+        if(null == snowFlakeUUidUtils){
+            synchronized (SnowFlakeUUidUtils.class){
+                if(null == snowFlakeUUidUtils){
+                    if(null != workerId && null != datacenterId){
+                        snowFlakeUUidUtils = new SnowFlakeUUidUtils(workerId , datacenterId);
+                    }else{
+                        snowFlakeUUidUtils = new SnowFlakeUUidUtils();
+                    }
+                }
+            }
+        }
+        return snowFlakeUUidUtils;
+    }
+
+    /**
+     * @param workerId 自定义的应用所在的服务器的机器ID,使用默认读取本机则无需传,传个NULL即可
+     * @param datacenterId 自定义的应用所在的服务器的数据中心ID,使用默认读取本机则无需传,传个NULL即可
+     * @param preStr 自定义的ID前缀
+     * **/
+    public static String generaUUid(Long workerId, Long datacenterId , String preStr){
+        StringBuilder resultId = new StringBuilder();
+        SnowFlakeUUidUtils snowFlakeUUidUtils = getSingleInstance(workerId , datacenterId);
+        if(StringUtils.isNotBlank(preStr)){
+            return resultId.append(preStr).append(snowFlakeUUidUtils.nextId()).toString();
+        }else{
+            return resultId.append(snowFlakeUUidUtils.nextId()).toString();
+        }
+    }
+
+    public SnowFlakeUUidUtils(){
+        this.datacenterId = getDatacenterId(maxDatacenterId);
+        this.workerId = getMaxWorkerId(datacenterId, maxWorkerId);
+    }
+    /**
+     * @param workerId
+     *            工作机器ID
+     * @param datacenterId
+     *            序列号
+     */
+    public SnowFlakeUUidUtils(long workerId, long datacenterId) {
+        if (workerId > maxWorkerId || workerId < 0) {
+            throw new IllegalArgumentException(String.format("worker Id can't be greater than %d or less than 0", maxWorkerId));
+        }
+        if (datacenterId > maxDatacenterId || datacenterId < 0) {
+            throw new IllegalArgumentException(String.format("datacenter Id can't be greater than %d or less than 0", maxDatacenterId));
+        }
+        this.workerId = workerId;
+        this.datacenterId = datacenterId;
+    }
+    /**
+     * 获取下一个ID
+     * 线程安全
+     * @return NULL 抢锁失败,需要重新调用
+     *         数字串 抢锁成功,则生成20位的数字串
+     */
+    public  Long nextId() {
+        try {
+
+            if(myLock.tryLock(700 , TimeUnit.MILLISECONDS)){
+                try {
+                    long timestamp = timeGen();
+                    if (timestamp < lastTimestamp) {
+                        throw new RuntimeException(String.format("Clock moved backwards.  Refusing to generate id for %d milliseconds", lastTimestamp - timestamp));
+                    }
+
+                    if (lastTimestamp == timestamp) {
+                        // 当前毫秒内,则+1
+                        sequence = (sequence + 1) & sequenceMask;
+                        if (sequence == 0) {
+                            // 当前毫秒内计数满了,则等待下一秒
+                            timestamp = tilNextMillis(lastTimestamp);
+                        }
+                    } else {
+                        sequence = 0L;
+                    }
+                    lastTimestamp = timestamp;
+                    // ID偏移组合生成最终的ID,并返回ID
+                    Long nextId = ((timestamp - twepoch) << timestampLeftShift)
+                            | (datacenterId << datacenterIdShift)
+                            | (workerId << workerIdShift) | sequence;
+
+                    return nextId;
+                }catch (Exception e){
+                    log.info("生成UUID抢锁失败:{}" , e);
+                }finally {
+                    myLock.unlock();
+                }
+            }else{
+                return null;
+            }
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+        return null;
+
+    }
+
+    private long tilNextMillis(final long lastTimestamp) {
+        long timestamp = this.timeGen();
+        while (timestamp <= lastTimestamp) {
+            timestamp = this.timeGen();
+        }
+        return timestamp;
+    }
+
+    private long timeGen() {
+        return System.currentTimeMillis();
+    }
+
+    /**
+     * <p>
+     * 获取 maxWorkerId
+     * </p>
+     */
+    protected static long getMaxWorkerId(long datacenterId, long maxWorkerId) {
+        StringBuffer mpid = new StringBuffer();
+        mpid.append(datacenterId);
+        String name = ManagementFactory.getRuntimeMXBean().getName();
+        if (!name.isEmpty()) {
+            /*
+             * GET jvmPid
+             */
+            mpid.append(name.split("@")[0]);
+        }
+        /*
+         * MAC + PID 的 hashcode 获取16个低位
+         */
+        return (mpid.toString().hashCode() & 0xffff) % (maxWorkerId + 1);
+    }
+
+    /**
+     *
+     * @param prefix 前缀
+     * @return
+     */
+    public static String getUuid(String prefix){
+        String s = prefix.toUpperCase();
+        return generaUUid(null, null, s);
+
+    }
+
+    /**
+     * <p>
+     * 数据标识id部分
+     * </p>
+     */
+    protected static long getDatacenterId(long maxDatacenterId) {
+        long id = 0L;
+        try {
+            InetAddress ip = InetAddress.getLocalHost();
+            NetworkInterface network = NetworkInterface.getByInetAddress(ip);
+            if (network == null) {
+                id = 1L;
+            } else {
+                byte[] mac = network.getHardwareAddress();
+                id = ((0x000000FF & (long) mac[mac.length - 1])
+                        | (0x0000FF00 & (((long) mac[mac.length - 2]) << 8))) >> 6;
+                id = id % (maxDatacenterId + 1);
+            }
+        } catch (Exception e) {
+            System.out.println(" getDatacenterId: " + e.getMessage());
+        }
+        return id;
+    }
+
+    public static void main(String[] args) {
+        System.out.println(SnowFlakeUUidUtils.generaUUid(null, null, null));
+    }
+
+}

+ 3 - 0
720yun_fd_consumer/gis_consumer/src/main/resources/application-dev.yml

@@ -54,3 +54,6 @@ spring:
         virtual-host: /
 tlog:
     enable-invoke-time-print: true
+queue:
+    scene-queue: queue-pano-scene
+    do-slice-queue: queue-do-slice

+ 71 - 0
720yun_fd_consumer/gis_consumer/src/main/resources/application-loc-site.yml

@@ -0,0 +1,71 @@
+logging:
+    config: classpath:logback-spring.xml
+    fdkk:
+        level: INFO
+        maxHistory: 180
+    level:
+        com:
+            gis: info
+    path: E:/javaProject/${project.name}_log
+oss:
+    bucket: oss-xiaoan
+    domain: https://ossxiaoan.4dage.com/
+    file:
+        path: 720yun_fd_manage/
+    key: LTAI5tJwboCj3r4vUNkSmbyX
+    point: http://oss-cn-shenzhen-internal.aliyuncs.com
+    secrecy: meDy7VYAWbg8kZCKsoUZcIYQxigWOy
+    type: oss
+server:
+    file:
+        path: i:\test\ngin\${project.name}_data\
+spring:
+    datasource:
+        driver-class-name: com.mysql.cj.jdbc.Driver
+        druid:
+            initial-size: 5
+            max-active: 20
+            max-evictable-idle-time-millis: 90000
+            max-wait: 60000
+            min-evictable-idle-time-millis: 30000
+            min-idle: 10
+            password: 4dkk2020test%
+            stat-view-servlet:
+                enabled: true
+            test-on-borrow: false
+            test-on-return: false
+            test-while-idle: true
+            time-between-eviction-runs-millis: 60000
+            url: jdbc:mysql://120.25.146.52:3306/720yun_fd_manage?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+            username: root
+            validation-query: SELECT 1 FROM DUAL
+            web-stat-filter:
+                enabled: true
+        type: com.alibaba.druid.pool.DruidDataSource
+    rabbitmq:
+        host: 120.24.144.164
+        port: 5672
+        username: admin
+        password: adminv41234
+        virtual-host: 4dkankan
+        connection-timeout: 0
+        listener:
+            simple:
+                prefetch: 1
+                max-concurrency: 2
+                acknowledge-mode: manual #开启消费者手动确认
+                # retry:
+                #   enabled: true           # 开启消费者出现异常情况下,进行重试消费,默认false
+                #   max-attempts: 5         # 最大重试次数,默认为3
+                #   max-interval: 10000   # 重试最大间隔时间
+                #   initial-interval: 2000  # 重试初始间隔时间
+                #   multiplier: 2 # 间隔时间乘子,间隔时间*乘子=下一次的间隔时间,最大不能超过设置的最大间隔时间
+        #开启消息投递确认机制
+        publisher-confirm-type: correlated
+tlog:
+    enable-invoke-time-print: true
+queue:
+    scene-queue: queue-pano-scene
+    do-slice-queue: queue-do-slice
+domain:
+    4dkk: https://test.4dkankan.com

+ 3 - 0
720yun_fd_consumer/gis_consumer/src/main/resources/application-loc.yml

@@ -54,3 +54,6 @@ spring:
         virtual-host: /
 tlog:
     enable-invoke-time-print: true
+queue:
+    scene-queue: queue-pano-scene
+    do-slice-queue: queue-do-slice

+ 3 - 0
720yun_fd_consumer/gis_consumer/src/main/resources/application.yml

@@ -23,3 +23,6 @@ spring:
             enabled: true
             max-file-size: 256MB
             max-request-size: 256MB
+redis:
+    token:
+        prefix: token#

+ 105 - 0
720yun_fd_consumer/gis_consumer/src/main/resources/data/someData.json

@@ -0,0 +1,105 @@
+{
+  "isPassword": 0,
+  "password": "",
+  "ossSomeData": "",
+  "icon": "",
+  "description": "",
+  "updateTime": "",
+  "sceneIndex": "",
+  "catalogRoot": [
+    {
+      "id": 100,
+      "name": "一级分组",
+      "children": [
+        1
+      ]
+    }
+  ],
+  "firstScene": "",
+  "userId": "",
+  "isLogo": 1,
+  "appIcon": "",
+  "qrCode": "",
+  "createTime": "",
+  "catalogs": [
+    {
+      "id": 1,
+      "name": "默认二级分组"
+    }
+  ],
+  "isRemind": 1,
+  "name": "",
+  "pcIcon": "",
+  "scenes": [
+                    {
+                        "customMask": {
+                            "sky": {
+                                "fodderId": "",
+                                "icon": "",
+                                "scale": 1,
+                                "antidistorted": true,
+                                "isShow": false
+                            },
+                            "earth": {
+                                "fodderId": "",
+                                "icon": "",
+                                "scale": 1,
+                                "antidistorted": true,
+                                "isShow": false
+                            }
+                        },
+                        "initVisual": {
+                            "vlookat": 0,
+                            "hlookat": 0,
+                            "vlookatmin": -90,
+                            "vlookatmax": 90
+                        }
+                    }
+                ],
+  "isAuto": 1,
+  "logo": "",
+  "logoChange": false,
+  "share": "",
+  "id": "",
+  "remindTime": 1,
+  "status": 0,
+  "isShowOpeningAnimation": true,
+  "openingAnimationType": "小行星开场",
+  "backgroundMusic": {
+    "id": "",
+    "name": "",
+    "ossPath": ""
+  },
+
+  "customButton": [
+    {
+      "type": "电话",
+      "name": "电话",
+      "value": "",
+      "openMethod": "弹出层打开",
+      "isShow": false
+    },
+    {
+      "type": "链接",
+      "name": "链接",
+      "value": "",
+      "openMethod": "弹出层打开",
+      "isShow": false
+    }
+  ],
+
+
+
+  "coverPc":"",
+  "coverPcLoc":"",
+  "coverMo":"",
+  "coverSelect":"",
+
+  "explanation": {
+    "audioId": "",
+    "audioName": "",
+    "audioUrl": "",
+    "openByDefault": true,
+    "repeat": true
+  }
+}

+ 24 - 0
720yun_fd_consumer/gis_consumer/src/main/resources/data/someDataSceneData.json

@@ -0,0 +1,24 @@
+{
+                        "customMask": {
+                            "sky": {
+                                "fodderId": "",
+                                "icon": "",
+                                "scale": 1,
+                                "antidistorted": true,
+                                "isShow": false
+                            },
+                            "earth": {
+                                "fodderId": "",
+                                "icon": "",
+                                "scale": 1,
+                                "antidistorted": true,
+                                "isShow": false
+                            }
+                        },
+                        "initVisual": {
+                            "vlookat": 0,
+                            "hlookat": 0,
+                            "vlookatmin": -90,
+                            "vlookatmax": 90
+                        }
+}

+ 71 - 0
720yun_fd_consumer/gis_consumer/src/main/resources/data/tour.xml

@@ -0,0 +1,71 @@
+<krpano version="1.19" title="Virtual Tour">
+
+    <include url="%SWFPATH%/skin/vtourskin.xml" />
+
+    <!-- customize skin settings: maps, gyro, webvr, thumbnails, tooltips, layout, design, ... -->
+    <skin_settings maps="false"
+                   maps_type="google"
+                   maps_bing_api_key=""
+                   maps_google_api_key=""
+                   maps_zoombuttons="false"
+                   gyro="true"
+                   webvr="true"
+                   webvr_gyro_keeplookingdirection="false"
+                   webvr_prev_next_hotspots="true"
+                   littleplanetintro="false"
+                   title="true"
+                   thumbs="true"
+                   thumbs_width="120" thumbs_height="80" thumbs_padding="10" thumbs_crop="0|40|240|160"
+                   thumbs_opened="false"
+                   thumbs_text="false"
+                   thumbs_dragging="true"
+                   thumbs_onhoverscrolling="false"
+                   thumbs_scrollbuttons="false"
+                   thumbs_scrollindicator="false"
+                   thumbs_loop="false"
+                   tooltips_buttons="false"
+                   tooltips_thumbs="false"
+                   tooltips_hotspots="false"
+                   tooltips_mapspots="false"
+                   deeplinking="false"
+                   loadscene_flags="MERGE"
+                   loadscene_blend="OPENBLEND(0.5, 0.0, 0.75, 0.05, linear)"
+                   loadscene_blend_prev="SLIDEBLEND(0.5, 180, 0.75, linear)"
+                   loadscene_blend_next="SLIDEBLEND(0.5,   0, 0.75, linear)"
+                   loadingtext="loading..."
+                   layout_width="100%"
+                   layout_maxwidth="814"
+                   controlbar_width="-24"
+                   controlbar_height="40"
+                   controlbar_offset="20"
+                   controlbar_offset_closed="-40"
+                   controlbar_overlap.no-fractionalscaling="10"
+                   controlbar_overlap.fractionalscaling="0"
+                   design_skin_images="vtourskin.png"
+                   design_bgcolor="0x2D3E50"
+                   design_bgalpha="0.8"
+                   design_bgborder="0"
+                   design_bgroundedge="1"
+                   design_bgshadow="0 4 10 0x000000 0.3"
+                   design_thumbborder_bgborder="3 0xFFFFFF 1.0"
+                   design_thumbborder_padding="2"
+                   design_thumbborder_bgroundedge="0"
+                   design_text_css="color:#FFFFFF; font-family:Arial;"
+                   design_text_shadow="1"
+    />
+
+
+
+    <!-- startup action - load the first scene -->
+    <action name="startup" autorun="onstart">
+        if(startscene === null OR !scene[get(startscene)], copy(startscene,scene[0].name); );
+        loadscene(get(startscene), null, MERGE);
+        if(startactions !== null, startactions() );
+    </action>
+
+
+
+
+
+
+</krpano>

+ 7 - 3
720yun_fd_consumer/gis_consumer_oss/pom.xml

@@ -186,10 +186,14 @@
 
         <!--rabbit MQ-->
         <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-amqp</artifactId>
+            <groupId>com.fdkankan</groupId>
+            <artifactId>4dkankan-utils-rabbitmq</artifactId>
+            <version>3.0.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.iherus</groupId>
+            <artifactId>qrext4j</artifactId>
         </dependency>
-
 
 
     </dependencies>

+ 47 - 5
720yun_fd_consumer/gis_consumer_oss/src/main/java/com/gis/oss/util/AliYunOssUtil.java

@@ -1,6 +1,8 @@
 package com.gis.oss.util;
 
+import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.util.RuntimeUtil;
+import com.alibaba.fastjson.JSON;
 import com.aliyun.oss.OSSClient;
 import com.aliyun.oss.model.*;
 import com.gis.oss.command.CmdConstant;
@@ -8,15 +10,14 @@ import com.gis.oss.command.CmdUtils;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
 
 import java.io.ByteArrayInputStream;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * 阿里云oss工具类
@@ -146,7 +147,48 @@ public class AliYunOssUtil {
         log.info("批量上传阿里云完毕:" + new Date().toString());
     }
 
-
+    public List<String> getFileFolder(String bucket, String keyName) {
+        log.info("获取文件夹bucket-{},路径{}",bucket,keyName);
+        OSSClient ossClient = init();
+        List<String> keyList = new ArrayList<>();
+        try {
+            boolean flag = true;
+            String nextMaker = null;
+            ListObjectsRequest listObjectsRequest = new ListObjectsRequest(bucket);
+            //指定下一级文件
+            listObjectsRequest.setPrefix(keyName);
+            //设置分页的页容量
+            listObjectsRequest.setMaxKeys(200);
+            do {
+                //获取下一页的起始点,它的下一项
+                listObjectsRequest.setMarker(nextMaker);
+                ObjectListing objectListing = ossClient.listObjects(listObjectsRequest);
+                List<String> collect = objectListing.getObjectSummaries().parallelStream()
+                        .map(OSSObjectSummary::getKey).collect(Collectors.toList());
+                if (!CollectionUtils.isEmpty(collect)) {
+                    keyList.addAll(collect);
+                }
+                nextMaker = objectListing.getNextMarker();
+                //全部执行完后,为false
+                flag = objectListing.isTruncated();
+            } while (flag);
+        } catch (Exception e) {
+            log.error("获取文件列表失败,path=" + keyName, e);
+            e.printStackTrace();
+        }
+        log.info("获取文件夹集合={}", JSON.toJSONString(keyList));
+        return keyList;
+    }
+    public ObjectMetadata downloadFile(String bucket, String pathKey, String file) {
+        OSSClient ossClient = init();
+        GetObjectRequest request = new GetObjectRequest(bucket, pathKey);
+        log.info("下载开始:下载bucket={},下载pathKey={},下载filePath={}", bucket, pathKey, file);
+        File downloadFile = new File(file);
+        if (!FileUtil.exist(downloadFile.getParent())){
+            FileUtil.mkdir(downloadFile.getParent());
+        }
+        return ossClient.getObject(request, downloadFile);
+    }
     /**
      * 可以删除目录
      *

+ 10 - 5
720yun_fd_consumer/pom.xml

@@ -44,6 +44,8 @@
         <pagehelper.version>1.2.5</pagehelper.version>
         <knife4j.version>2.0.2</knife4j.version>
         <junit.version>4.12</junit.version>
+        <qrext4j.version>1.3.1</qrext4j.version>
+
     </properties>
 
 
@@ -96,12 +98,11 @@
 
             <!--rabbit MQ-->
             <dependency>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-starter-amqp</artifactId>
-                <version>${spring.boot.version}</version>
+                <groupId>com.fdkankan</groupId>
+                <artifactId>4dkankan-utils-rabbitmq</artifactId>
+                <version>3.0.0-SNAPSHOT</version>
             </dependency>
 
-
             <!-- lombok -->
             <dependency>
                 <groupId>org.projectlombok</groupId>
@@ -220,7 +221,11 @@
                 <version>${junit.version}</version>
             </dependency>
 
-
+            <dependency>
+                <groupId>org.iherus</groupId>
+                <artifactId>qrext4j</artifactId>
+                <version>${qrext4j.version}</version>
+            </dependency>
         </dependencies>
     </dependencyManagement>
 

+ 1 - 1
720yun_fd_consumer/run.sh

@@ -14,7 +14,7 @@ startApp(){
     	echo "程序已经在运行了"
     else
     	echo "执行 start 方法"
-    	nohup java -jar -XX:MetaspaceSize=1500m -XX:MaxMetaspaceSize=1500m -Xms4072m -Xmx4072m -Xmn1024m -Xss1m -XX:SurvivorRatio=8 ./$APP_NAME --spring.profiles.active=$APP_EVN --server.port=$APP_PORT > logs.log 2>error.log &  # 说明pid为空
+    	nohup java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5530 -jar -XX:MetaspaceSize=1500m -XX:MaxMetaspaceSize=1500m -Xms4072m -Xmx4072m -Xmn1024m -Xss1m -XX:SurvivorRatio=8 ./$APP_NAME --spring.profiles.active=$APP_EVN --server.port=$APP_PORT > logs.log 2>error.log &  # 说明pid为空
 	echo Start Success!
 fi
 }

+ 15 - 8
720yun_fd_manage/gis_application/src/main/resources/application-locSit.yml

@@ -47,15 +47,19 @@ spring:
                 enabled: true
         type: com.alibaba.druid.pool.DruidDataSource
     rabbitmq:
-        address: 120.25.146.52:5672
-        connection-timeout: 15000
-        password: guest
+        host: 120.24.144.164
+        port: 5672
+        username: admin
+        password: adminv41234
+        virtual-host: 4dkankan
+        connection-timeout: 0
+        listener:
+            simple:
+                prefetch: 1
+                max-concurrency: 2
+                acknowledge-mode: manual #开启消费者手动确认
+        #开启消息投递确认机制
         publisher-confirm-type: correlated
-        publisher-returns: true
-        template:
-            mandatory: true
-        username: guest
-        virtual-host: /
     redis:
         database: 0
         host: 120.24.144.164
@@ -88,3 +92,6 @@ forest:
     log-response-content: true # 打开/关闭Forest响应内容日志(默认为 false)
     base-address-scheme: https
     base-address-host: test.4dkankan.com
+queue:
+    scene-queue: queue-pano-scene
+    do-slice-queue: queue-do-slice

+ 15 - 8
720yun_fd_manage/gis_application/src/main/resources/application-sit.yml

@@ -47,15 +47,19 @@ spring:
                 enabled: true
         type: com.alibaba.druid.pool.DruidDataSource
     rabbitmq:
-        address: 127.0.0.1:5672
-        connection-timeout: 15000
-        password: 4dagecui2019$
+        host: 172.18.156.39
+        port: 5672
+        username: admin
+        password: adminv41234
+        virtual-host: 4dkankan
+        connection-timeout: 0
+        listener:
+            simple:
+                prefetch: 1
+                max-concurrency: 2
+                acknowledge-mode: manual #开启消费者手动确认
+        #开启消息投递确认机制
         publisher-confirm-type: correlated
-        publisher-returns: true
-        template:
-            mandatory: true
-        username: guest
-        virtual-host: /
     redis:
         database: 0
         host: 172.18.156.39
@@ -88,3 +92,6 @@ forest:
     log-response-content: true # 打开/关闭Forest响应内容日志(默认为 false)
     base-address-scheme: https
     base-address-host: test.4dkankan.com
+queue:
+    scene-queue: queue-pano-scene
+    do-slice-queue: queue-do-slice

+ 140 - 140
720yun_fd_manage/gis_common/src/main/java/com/gis/common/config/RabbitConfig.java

@@ -1,140 +1,140 @@
-package com.gis.common.config;
-
-import org.springframework.amqp.core.*;
-import org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory;
-import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
-import org.springframework.amqp.rabbit.connection.ConnectionFactory;
-import org.springframework.amqp.rabbit.core.RabbitTemplate;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.beans.factory.config.ConfigurableBeanFactory;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Scope;
-
-/**
- * 即时队列
- */
-
-@Configuration
-public class RabbitConfig {
-
-
-    @Value("${spring.rabbitmq.address}")
-    private String address;
-
-    @Value("${spring.rabbitmq.username}")
-    private String username;
-
-    @Value("${spring.rabbitmq.password}")
-    private String password;
-
-
-
-    /** 全景图队列*/
-    public static final String PANO_QUEUE = "720FdQueue";
-
-    /** 全景图交换机*/
-    public static final String PANO_EXCHANGE = "720FdExchange";
-
-    /** 全景图交换机路由*/
-    public static final String PANO_QUEUE_ROUTING = "720FdQueueRouting";
-
-
-    /** 全景图队列*/
-    public static final String TEST_QUEUE = "testOwenQueue";
-
-    /** 全景图交换机*/
-    public static final String TEST_EXCHANGE = "testOwenExchange";
-
-    /** 全景图交换机路由*/
-    public static final String TEST_QUEUE_ROUTING = "testOwenQueueRouting";
-
-
-
-
-
-
-    /**
-     * 全景图模型队列
-     */
-    @Bean
-    public Queue panoQueue() {
-        return new Queue(PANO_QUEUE);
-    }
-
-    /**
-     * 全景图交换机
-     */
-    @Bean
-    public Exchange panoExchange(){
-        return new DirectExchange(PANO_EXCHANGE, true, false);
-    }
-
-
-    /**
-     * 全景图队列绑定交换机
-     */
-    @Bean
-    public Binding panoQueueExchange(Queue panoQueue, Exchange panoExchange){
-        return BindingBuilder.bind(panoQueue).to(panoExchange).with(PANO_QUEUE_ROUTING).noargs();
-    }
-
-
-    /**
-     * 全景图模型队列
-     */
-    @Bean
-    public Queue testQueue() {
-        return new Queue(TEST_QUEUE);
-    }
-
-    /**
-     * 全景图交换机
-     */
-    @Bean
-    public Exchange testExchange(){
-        return new DirectExchange(TEST_EXCHANGE, true, false);
-    }
-
-
-    /**
-     * 全景图队列绑定交换机
-     */
-    @Bean
-    public Binding testQueueExchange(Queue testQueue, Exchange testExchange){
-        return BindingBuilder.bind(testQueue).to(testExchange).with(TEST_QUEUE_ROUTING).noargs();
-    }
-
-
-    /**
-     * 以下三个方法是配置集群
-     * @return
-     */
-    @Bean
-    public SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory() {
-        SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
-        factory.setConnectionFactory(connectionFactory());
-        factory.setPrefetchCount(1);
-        return factory;
-    }
-
-    @Bean
-    public ConnectionFactory connectionFactory() {
-        CachingConnectionFactory connectionFactory = new CachingConnectionFactory();
-        connectionFactory.setAddresses(address);
-        connectionFactory.setUsername(username);
-        connectionFactory.setPassword(password);
-        connectionFactory.setVirtualHost("/");
-        connectionFactory.setPublisherConfirms(true);
-        return connectionFactory;
-    }
-
-    @Bean
-    @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
-    public RabbitTemplate rabbitTemplate() {
-        return new RabbitTemplate(connectionFactory());
-    }
-
-
-
-}
+//package com.gis.common.config;
+//
+//import org.springframework.amqp.core.*;
+//import org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory;
+//import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
+//import org.springframework.amqp.rabbit.connection.ConnectionFactory;
+//import org.springframework.amqp.rabbit.core.RabbitTemplate;
+//import org.springframework.beans.factory.annotation.Value;
+//import org.springframework.beans.factory.config.ConfigurableBeanFactory;
+//import org.springframework.context.annotation.Bean;
+//import org.springframework.context.annotation.Configuration;
+//import org.springframework.context.annotation.Scope;
+//
+///**
+// * 即时队列
+// */
+//
+//@Configuration
+//public class RabbitConfig {
+//
+//
+//    @Value("${spring.rabbitmq.address}")
+//    private String address;
+//
+//    @Value("${spring.rabbitmq.username}")
+//    private String username;
+//
+//    @Value("${spring.rabbitmq.password}")
+//    private String password;
+//
+//
+//
+//    /** 全景图队列*/
+//    public static final String PANO_QUEUE = "720FdQueue";
+//
+//    /** 全景图交换机*/
+//    public static final String PANO_EXCHANGE = "720FdExchange";
+//
+//    /** 全景图交换机路由*/
+//    public static final String PANO_QUEUE_ROUTING = "720FdQueueRouting";
+//
+//
+//    /** 全景图队列*/
+//    public static final String TEST_QUEUE = "testOwenQueue";
+//
+//    /** 全景图交换机*/
+//    public static final String TEST_EXCHANGE = "testOwenExchange";
+//
+//    /** 全景图交换机路由*/
+//    public static final String TEST_QUEUE_ROUTING = "testOwenQueueRouting";
+//
+//
+//
+//
+//
+//
+//    /**
+//     * 全景图模型队列
+//     */
+//    @Bean
+//    public Queue panoQueue() {
+//        return new Queue(PANO_QUEUE);
+//    }
+//
+//    /**
+//     * 全景图交换机
+//     */
+//    @Bean
+//    public Exchange panoExchange(){
+//        return new DirectExchange(PANO_EXCHANGE, true, false);
+//    }
+//
+//
+//    /**
+//     * 全景图队列绑定交换机
+//     */
+//    @Bean
+//    public Binding panoQueueExchange(Queue panoQueue, Exchange panoExchange){
+//        return BindingBuilder.bind(panoQueue).to(panoExchange).with(PANO_QUEUE_ROUTING).noargs();
+//    }
+//
+//
+//    /**
+//     * 全景图模型队列
+//     */
+//    @Bean
+//    public Queue testQueue() {
+//        return new Queue(TEST_QUEUE);
+//    }
+//
+//    /**
+//     * 全景图交换机
+//     */
+//    @Bean
+//    public Exchange testExchange(){
+//        return new DirectExchange(TEST_EXCHANGE, true, false);
+//    }
+//
+//
+//    /**
+//     * 全景图队列绑定交换机
+//     */
+//    @Bean
+//    public Binding testQueueExchange(Queue testQueue, Exchange testExchange){
+//        return BindingBuilder.bind(testQueue).to(testExchange).with(TEST_QUEUE_ROUTING).noargs();
+//    }
+//
+//
+//    /**
+//     * 以下三个方法是配置集群
+//     * @return
+//     */
+//    @Bean
+//    public SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory() {
+//        SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
+//        factory.setConnectionFactory(connectionFactory());
+//        factory.setPrefetchCount(1);
+//        return factory;
+//    }
+//
+//    @Bean
+//    public ConnectionFactory connectionFactory() {
+//        CachingConnectionFactory connectionFactory = new CachingConnectionFactory();
+//        connectionFactory.setAddresses(address);
+//        connectionFactory.setUsername(username);
+//        connectionFactory.setPassword(password);
+//        connectionFactory.setVirtualHost("/");
+//        connectionFactory.setPublisherConfirms(true);
+//        return connectionFactory;
+//    }
+//
+//    @Bean
+//    @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
+//    public RabbitTemplate rabbitTemplate() {
+//        return new RabbitTemplate(connectionFactory());
+//    }
+//
+//
+//
+//}

+ 81 - 0
720yun_fd_manage/gis_common/src/main/java/com/gis/common/mq/RabbitMqProducerUtil.java

@@ -0,0 +1,81 @@
+package com.gis.common.mq;
+
+import com.alibaba.fastjson.JSONObject;
+import com.rabbitmq.client.AMQP.Queue.DeclareOk;
+import com.rabbitmq.client.Channel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.amqp.rabbit.connection.CorrelationData;
+import org.springframework.amqp.rabbit.core.ChannelCallback;
+import org.springframework.amqp.rabbit.core.RabbitTemplate;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.UUID;
+
+/**
+ * <p>
+ * TODO
+ * </p>
+ *
+ * @author dengsixing
+ * @since 2022/4/19
+ **/
+@Component
+public class RabbitMqProducerUtil {
+
+    private Logger log = LoggerFactory.getLogger(this.getClass().getName());
+
+
+    @Autowired
+    private RabbitTemplate rabbitTemplate;
+
+    /**
+     * 工作队列模式发送消息
+     * @param queue 队列名
+     * @param content 载荷
+     */
+    public void sendByWorkQueue(String queue, Object content){
+        String messageId = UUID.randomUUID().toString();
+        String jsonObject = JSONObject.toJSONString(content);
+        log.info("开始发送Mq消息,messageId:{},消息队列:{},消息内容:{}",messageId, queue,jsonObject);
+        rabbitTemplate.convertAndSend(queue, content, message -> {
+            message.getMessageProperties().setMessageId(messageId);
+            return message;
+        }, new CorrelationData(messageId));
+    }
+
+    /**
+     * 工作队列模式发送带优先级消息
+     * @param queue 队列名
+     * @param content 载荷
+     * @param priority 优先级,正整数,值越大优先级越高,当值大于队列设置的最大优先级时,效果等同于最大优先级
+     */
+    public void sendByWorkQueue(String queue, Object content, Integer priority){
+        String messageId = UUID.randomUUID().toString();
+        String jsonObject = JSONObject.toJSONString(content);
+        log.info("开始发送Mq消息,messageId:{},消息队列:{},消息内容:{}",messageId, queue, jsonObject);
+        rabbitTemplate.convertAndSend(queue, content, message -> {
+            message.getMessageProperties().setMessageId(messageId);
+            message.getMessageProperties().setPriority(priority);
+            return message;
+        }, new CorrelationData(messageId));
+    }
+
+    /**
+     * 获取队列未被消费的消息数量
+     * @return
+     */
+    public int getMessageCount(String queueName) {
+        DeclareOk declareOk = rabbitTemplate.execute(new ChannelCallback<DeclareOk>() {
+            public DeclareOk doInRabbit(Channel channel) throws Exception {
+                return channel.queueDeclarePassive(queueName);
+            }
+        });
+
+        return declareOk.getMessageCount();
+    }
+
+
+
+}

+ 54 - 0
720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/entity/ScenePanoEntity.java

@@ -0,0 +1,54 @@
+package com.gis.domain.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+import javax.persistence.*;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 四维看看场景全景图表
+ *
+ * @author Xiewj
+ * @since 2024-04-03 18:01
+ */
+@Data
+@ApiModel("四维看看场景全景图表")
+public class ScenePanoEntity  extends BaseEntity implements Serializable  {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty("wordid")
+    private String workId;
+
+    @ApiModelProperty("名称")
+    private String name;
+
+    @ApiModelProperty("服务器存放地址")
+    private String filePath;
+
+    @ApiModelProperty("oss存放地址")
+    private String ossPath;
+
+    @ApiModelProperty("状态")
+    private Integer status;
+
+    @ApiModelProperty("封面图")
+    private String icon;
+
+    @ApiModelProperty("文件名")
+    private String fileName;
+
+    @ApiModelProperty("场景码")
+    private String sceneCode;
+
+    @ApiModelProperty("文件大小,单位MB")
+    private String fileSize;
+
+    @ApiModelProperty("预览图(全景图使用)")
+    private String previewIcon;
+
+    @ApiModelProperty("tour.xml")
+    private String tour;
+}

+ 6 - 2
720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/entity/WorkEntity.java

@@ -53,9 +53,13 @@ public class WorkEntity extends BaseStrEntity implements Serializable {
     @ApiModelProperty(value = "场景码")
     private String sceneCodes;
 
-    @ApiModelProperty(value = "作品类型:pano:全是全景图 | 4dkk: 全是四维看看 : mix:混合(pano+4dkk), 通过sceneCodes判断")
+    @ApiModelProperty(value = "作品类型:pano:全是全景图 | 4dkk: 全是四维看看 : mix:混合(pano+4dkk), 通过sceneCodes判断 | pro 四维看看直接拍摄生成")
     private String type;
 
+    //计算状态
+    @ApiModelProperty(value = "计算状态:0-计算中 1-计算成功  -1-计算失败")
+    private Integer calcStatus;
 
-
+    @ApiModelProperty(value = "四维看看场景码")
+    private String num;
 }

+ 15 - 0
720yun_fd_manage/gis_mapper/src/main/java/com/gis/mapper/ScenePanoMapper.java

@@ -0,0 +1,15 @@
+package com.gis.mapper;
+
+import org.apache.ibatis.annotations.Mapper;
+import com.gis.domain.entity.ScenePanoEntity;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+* 四维看看场景全景图表 Mapper
+*
+* @author Xiewj
+* @since 2024-04-03 18:01
+*/
+@Mapper
+public interface ScenePanoMapper extends IBaseMapper<ScenePanoEntity,Long> {
+}

+ 14 - 0
720yun_fd_manage/gis_service/src/main/java/com/gis/service/ScenePanoService.java

@@ -0,0 +1,14 @@
+package com.gis.service;
+
+import com.gis.domain.entity.ScenePanoEntity;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 四维看看场景全景图表 服务类接口
+ *
+ * @author Xiewj
+ * @since 2024-04-03 18:01
+ */
+public interface ScenePanoService extends IBaseService<ScenePanoEntity,Long> {
+
+}

+ 11 - 9
720yun_fd_manage/gis_service/src/main/java/com/gis/service/impl/FodderServiceImpl.java

@@ -6,13 +6,12 @@ import cn.hutool.core.io.FileTypeUtil;
 import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
-import com.amazonaws.services.dynamodbv2.xspec.S;
-import com.gis.common.config.RabbitConfig;
 import com.gis.common.constant.CmdConstant;
 import com.gis.common.constant.ConfigConstant;
 import com.gis.common.constant.ErrorEnum;
 import com.gis.common.constant.RedisConstant;
 import com.gis.common.exception.BaseRuntimeException;
+import com.gis.common.mq.RabbitMqProducerUtil;
 import com.gis.common.util.*;
 import com.gis.domain.dto.*;
 import com.gis.domain.entity.*;
@@ -32,6 +31,7 @@ import org.junit.Test;
 import org.springframework.amqp.rabbit.core.RabbitTemplate;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.web.multipart.MultipartFile;
@@ -56,10 +56,7 @@ public class FodderServiceImpl extends IBaseServiceImpl<FodderEntity, Long> impl
     FodderMapper entityMapper;
 
     @Autowired
-    RabbitTemplate rabbitTemplate;
-
-    @Autowired
-    RabbitConfig rabbitConfig;
+    RabbitMqProducerUtil rabbitMqProducer;
 
     @Autowired
     ConfigConstant configConstant;
@@ -85,7 +82,8 @@ public class FodderServiceImpl extends IBaseServiceImpl<FodderEntity, Long> impl
     @Autowired
     RedisUtil redisUtil;
 
-
+    @Value("${queue.do-slice-queue}")
+    String doSliceQueue;
 
     // 用户最大空间3G
     static int MAX_SIZE = 1024 * 1024 * 3;
@@ -231,7 +229,9 @@ public class FodderServiceImpl extends IBaseServiceImpl<FodderEntity, Long> impl
             if (type.equals("pano")) {
                 log.info("准备发送消息: " + entity.getId());
                 //发消息到mq
-                rabbitTemplate.convertAndSend(RabbitConfig.PANO_EXCHANGE, RabbitConfig.PANO_QUEUE_ROUTING, entity.getId());
+                Map<String,Object> map=new HashMap<>();
+                map.put("id", entity.getId());
+                rabbitMqProducer.sendByWorkQueue(doSliceQueue,map);
                 log.info("发送消息到队列完成: " + entity.getId());
             }
             long end = System.currentTimeMillis();
@@ -732,7 +732,9 @@ public class FodderServiceImpl extends IBaseServiceImpl<FodderEntity, Long> impl
         List<FodderEntity> fodderEntities = getBaseMapper().selectByCondition(condition);
         log.info("重新入队数量{}",fodderEntities.size());
         for (FodderEntity fodderEntity : fodderEntities) {
-            rabbitTemplate.convertAndSend(RabbitConfig.PANO_EXCHANGE, RabbitConfig.PANO_QUEUE_ROUTING, fodderEntity.getId());
+            Map<String,Object> map=new HashMap<>();
+            map.put("id",  fodderEntity.getId());
+            rabbitMqProducer.sendByWorkQueue(doSliceQueue,map);
         }
     }
 }

+ 26 - 0
720yun_fd_manage/gis_service/src/main/java/com/gis/service/impl/ScenePanoServiceImpl.java

@@ -0,0 +1,26 @@
+package com.gis.service.impl;
+
+import com.gis.mapper.IBaseMapper;
+import com.gis.service.ScenePanoService;
+import com.gis.domain.entity.ScenePanoEntity;
+import com.gis.mapper.ScenePanoMapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 四维看看场景全景图表 服务实现类
+ *
+ * @author Xiewj
+ * @since 2024-04-03 18:01
+ */
+@Service
+public class ScenePanoServiceImpl extends IBaseServiceImpl<ScenePanoEntity, Long> implements ScenePanoService {
+    @Autowired
+
+    private ScenePanoMapper scenePanoMapper;
+    @Override
+    public IBaseMapper<ScenePanoEntity, Long> getBaseMapper() {
+        return this.scenePanoMapper;
+    }
+}

+ 12 - 6
720yun_fd_manage/gis_web/src/main/java/com/gis/web/controller/TestController.java

@@ -3,6 +3,7 @@ package com.gis.web.controller;
 import cn.hutool.core.io.FileUtil;
 import com.gis.common.constant.ConfigConstant;
 import com.gis.common.config.RabbitConfig;
+import com.gis.common.mq.RabbitMqProducerUtil;
 import com.gis.common.util.Result;
 import com.gis.domain.dto.TestShDto;
 import com.gis.domain.entity.WorkEntity;
@@ -19,6 +20,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.junit.Test;
 import org.springframework.amqp.rabbit.core.RabbitTemplate;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
@@ -28,7 +30,9 @@ import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
 import java.io.*;
 import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.concurrent.TimeUnit;
 
 /**
@@ -68,8 +72,10 @@ public class TestController extends BaseController {
 
     @Autowired
     WorkService workService;
-
-
+    @Autowired
+    RabbitMqProducerUtil rabbitMqProducer;
+    @Value("${queue.do-slice-queue}")
+    String doSliceQueue;
 
 
     /**
@@ -165,11 +171,11 @@ public class TestController extends BaseController {
     @GetMapping("testSendMq")
     @ApiOperation(value = "rabbitMQ发送", position = 1)
     public Result testSendMq(){
-        String param = "owen" + new Date();
-        log.info("MQ param: " + param);
         //发消息到mq
-        rabbitTemplate.convertAndSend(RabbitConfig.TEST_EXCHANGE, RabbitConfig.TEST_QUEUE_ROUTING, param);
-        return Result.success(param);
+        Map<String,Object> map=new HashMap<>();
+        map.put("id",  1);
+        rabbitMqProducer.sendByWorkQueue(doSliceQueue,map);
+        return Result.success(map);
     }
 
 

+ 5 - 9
720yun_fd_manage/pom.xml

@@ -150,15 +150,6 @@
                 <version>${spring.boot.version}</version>
             </dependency>
 
-
-            <!--rabbit MQ-->
-            <dependency>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-starter-amqp</artifactId>
-                <version>${spring.boot.version}</version>
-            </dependency>
-
-
             <!-- lombok -->
             <dependency>
                 <groupId>org.projectlombok</groupId>
@@ -311,6 +302,11 @@
                 <artifactId>qrext4j</artifactId>
                 <version>${qrext4j.version}</version>
             </dependency>
+            <dependency>
+                <groupId>com.fdkankan</groupId>
+                <artifactId>4dkankan-utils-rabbitmq</artifactId>
+                <version>3.0.0-SNAPSHOT</version>
+            </dependency>
         </dependencies>
     </dependencyManagement>
 

+ 1 - 1
720yun_fd_manage/run.sh

@@ -14,7 +14,7 @@ startApp(){
     	echo "程序已经在运行了"
     else
     	echo "执行 start 方法"
-    	nohup java -jar -Xmx3072M -Xms512M ./$APP_NAME --spring.profiles.active=$APP_EVN --server.port=$APP_PORT > logs.log 2>error.log &  # 说明pid为空
+    	nohup java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5531 -jar -Xmx3072M -Xms512M ./$APP_NAME --spring.profiles.active=$APP_EVN --server.port=$APP_PORT > logs.log 2>error.log &  # 说明pid为空
 	echo Start Success!
 fi
 }