lyhzzz 1 год назад
Родитель
Сommit
c8a24f7c2b

+ 0 - 3
README.md

@@ -39,8 +39,5 @@ climb
 novelty
 novelty
 
 
 
 
-41141564_20240218110241:;/home/ubuntu/data/41141564_20240218110241:;http://zfb-zhm-test.oss-cn-shenzhen.aliyuncs.com/41141564_20240218110241/:;zip.Zip:;zhKhE8XTKas:;1:;13853028751:;1:;1058:;sfm
-
-41141564_20240304110435:;/home/ubuntu/data/41141564_20240304110435:;https://zfb-zhm-test.oss-cn-shenzhen.aliyuncs.com/41141564_20240304110435/:;zip.Zip:;zhicLZk5YfP:;1:;13853028751:;1:;1058:;sfm
 
 
 
 

+ 7 - 0
pom.xml

@@ -129,6 +129,13 @@
             <artifactId>4dkankan-utils-fyun-oss</artifactId>
             <artifactId>4dkankan-utils-fyun-oss</artifactId>
             <version>3.0.0-SNAPSHOT</version>
             <version>3.0.0-SNAPSHOT</version>
         </dependency>
         </dependency>
+
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>easyexcel</artifactId>
+            <version>3.1.0</version>
+        </dependency>
     </dependencies>
     </dependencies>
 
 
     <build>
     <build>

+ 2 - 0
src/main/java/com/fdkankan/task/TaskApplication.java

@@ -4,10 +4,12 @@ import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.ComponentScan;
+import org.springframework.scheduling.annotation.EnableScheduling;
 
 
 @SpringBootApplication
 @SpringBootApplication
 @MapperScan("com.fdkankan.**.mapper")
 @MapperScan("com.fdkankan.**.mapper")
 @ComponentScan(basePackages = {"com.fdkankan.*"})
 @ComponentScan(basePackages = {"com.fdkankan.*"})
+@EnableScheduling
 public class TaskApplication {
 public class TaskApplication {
 
 
     public static void main(String[] args) {
     public static void main(String[] args) {

+ 16 - 8
src/main/java/com/fdkankan/task/config/SendMessage.java

@@ -27,16 +27,24 @@ public class SendMessage {
     @Resource(name = "v3RabbitTemplate")
     @Resource(name = "v3RabbitTemplate")
     private RabbitTemplate secondRabbitTemplate;
     private RabbitTemplate secondRabbitTemplate;
 
 
-    public void sendTov2Message(Object jsonObject) {
-        String messageId = UUID.randomUUID().toString();
-        log.info("开始发送Mq消息,messageId:{},消息队列:{},消息内容:{}",messageId, MqConstants.RABBITMQ_QUEUE_v3, jsonObject);
-        secondRabbitTemplate.convertAndSend(MqConstants.RABBITMQ_QUEUE_v2, jsonObject, message -> {
-            message.getMessageProperties().setMessageId(messageId);
-            message.getMessageProperties().setContentType("application/json");
-            return message;
-        }, new CorrelationData(messageId));
+    public static final String BASE_UNITACC_SYS = "UNITACC.";
+    /**
+     *队列相关
+     */
+    //主题
+    public static final String QUEUE_UNITACC_APP_ADD_ACC_TOPIC = BASE_UNITACC_SYS+"APP.ADD_ACC";
+    //交互器
+    public static final String QUEUE_UNITACC_APP_ADD_ACC_EXCHANGE= QUEUE_UNITACC_APP_ADD_ACC_TOPIC +".EXCHANGE";
+    //路由
+    public static final String QUEUE_UNITACC_APP_ADD_ACC_ROUTINGKEY = QUEUE_UNITACC_APP_ADD_ACC_TOPIC+".ROUTINGKEY";
+    public void sendTov2Message(String msg) {
+        CorrelationData correlationId = new CorrelationData(UUID.randomUUID().toString());
+        log.info("开始发送消息 : " + msg);
+        v2RabbitTemplate.convertAndSend(QUEUE_UNITACC_APP_ADD_ACC_EXCHANGE, QUEUE_UNITACC_APP_ADD_ACC_ROUTINGKEY, msg, correlationId);
+        log.info("结束发送消息 : " + msg);
     }
     }
 
 
+
     public void sendTov3Message(Object jsonObject) {
     public void sendTov3Message(Object jsonObject) {
         String messageId = UUID.randomUUID().toString();
         String messageId = UUID.randomUUID().toString();
         log.info("开始发送Mq消息,messageId:{},消息队列:{},消息内容:{}",messageId, MqConstants.RABBITMQ_QUEUE_v3, jsonObject);
         log.info("开始发送Mq消息,messageId:{},消息队列:{},消息内容:{}",messageId, MqConstants.RABBITMQ_QUEUE_v3, jsonObject);

+ 1 - 1
src/main/java/com/fdkankan/task/config/XxlJobConfig.java

@@ -12,7 +12,7 @@ import org.springframework.context.annotation.Configuration;
  *
  *
  * @author xuxueli 2017-04-28
  * @author xuxueli 2017-04-28
  */
  */
-@Configuration
+//@Configuration
 public class XxlJobConfig {
 public class XxlJobConfig {
     private Logger logger = LoggerFactory.getLogger(XxlJobConfig.class);
     private Logger logger = LoggerFactory.getLogger(XxlJobConfig.class);
 
 

+ 66 - 0
src/main/java/com/fdkankan/task/utils/ExcelUtil.java

@@ -0,0 +1,66 @@
+package com.fdkankan.task.utils;
+
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+public class ExcelUtil {
+
+
+    public static List<HashMap<Integer,String>> getExcelRowList(File multipartFile) throws IOException {
+        //行List,也是最终要返回的List
+        List<HashMap<Integer,String>> rowList=new ArrayList<>();
+        Workbook workbook=getExcelWorkBook(multipartFile);
+        Sheet sheet = workbook.getSheetAt(0);
+        if (sheet == null) {
+            throw new IOException("创建Sheet失败!");
+        }
+        //开始遍历行
+        for (int i=0;i<= sheet.getLastRowNum();i++){
+            Row row = sheet.getRow(i);
+            //列List
+            HashMap<Integer,String> map = new HashMap<>();
+            //转换为List数组
+            for (int cellNum=0;cellNum<= row.getLastCellNum();cellNum++){
+                Cell cell = row.getCell(cellNum);
+                if(cell != null){
+                    String value = fommartNum(cell.toString().trim());
+                    map.put(cellNum,value);
+                }
+            }
+            rowList.add(map);
+        }
+        return rowList;
+    }
+
+  private static  String fommartNum(String value){
+        try {
+            return Double.valueOf(value).intValue() +"";
+        }catch (Exception e){
+            return value;
+        }
+  }
+
+
+    //获取WorkBook对象
+    private static Workbook getExcelWorkBook(File multipartFile) throws IOException {
+        InputStream inputStream= Files.newInputStream(multipartFile.toPath());
+        String originalFileName=multipartFile.getName();
+        String fileType=originalFileName.substring(originalFileName.lastIndexOf(".")+1);
+        if (fileType.equalsIgnoreCase("xls")) {
+            //xls格式
+            return new HSSFWorkbook(inputStream);
+        } else {
+            //xlsx格式
+            return new XSSFWorkbook(inputStream);
+        }
+    }
+}

+ 16 - 0
src/main/java/com/fdkankan/task/utils/TaskTest.java

@@ -0,0 +1,16 @@
+package com.fdkankan.task.utils;
+
+
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+
+@Slf4j
+@Service
+public class TaskTest {
+
+
+}

+ 11 - 1
src/main/resources/application-dev.yml

@@ -67,4 +67,14 @@ xxl:
 #钉钉配置
 #钉钉配置
 dingtalk:
 dingtalk:
   token: 0ba44bdb2345d76ce7348bcb13fa118252e7a351426b90f64fac09b57b123b1c
   token: 0ba44bdb2345d76ce7348bcb13fa118252e7a351426b90f64fac09b57b123b1c
-  secret: SEC687e2967e9a825b839d4d1512a7b98be49f7a19106d13bb6869f7bc33737359a
+  secret: SEC687e2967e9a825b839d4d1512a7b98be49f7a19106d13bb6869f7bc33737359a
+
+fyun:
+  type: oss
+  key: LTAI5tC5Ema4raGNCZYSNrkN
+  secret: BjqU1lSVnNUbJouGkq13JG9DmcpaDx
+  bucketv2: zfb-zhm-test
+  bucket: zfb-4dkankan
+  coldBucket: zfb-4dkk-bak
+  endPoint: http://oss-cn-shenzhen.aliyuncs.com
+  host: https://zfb-4dkankan.oss-cn-shenzhen.aliyuncs.com/

+ 80 - 0
src/main/resources/application-fdkk.yml

@@ -0,0 +1,80 @@
+server:
+  port: 8111
+  servlet:
+    context-path: /
+  tomcat:
+    max-http-form-post-size: -1
+spring:
+  rabbitmq:
+    v2:
+      host: 47.112.166.173
+      port: 5672
+      username: guest
+      password: guest
+      #虚拟host 可以不设置,使用server默认host
+      virtual-host: /
+    v3:
+      host: 120.24.202.7
+      port: 5672
+      username: admin
+      password: admin123
+      virtual-host: /
+
+mybatis-flex:
+  datasource:
+    sale:
+      url: jdbc:mysql://rm-wz90w10465iiwwv09.mysql.rds.aliyuncs.com:3306/4dkankan_v4_sale?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
+      username: root
+      password: D2719bd0cae1a005
+    old-zfb:
+      #47.112.166.173
+      url: jdbc:mysql://47.112.166.173:3306/zhi_house?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
+      username: root
+      password: 4dkankan4dage
+    new-zfb:
+      #120.24.202.7
+      url: jdbc:mysql://120.24.202.7:3306/zhi_house?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
+      username: root
+      password: zfb@20210727%
+
+logging:
+  config: classpath:logback-spring.xml
+  path: /home/backend/4dkankan_v4
+
+
+xxl:
+  job:
+    accessToken:
+    admin:
+      addresses: http://127.0.0.1:8180/xxl-job-admin
+
+    executor:
+      appname: fdkankan-job-executor-lyh
+      ### 执行器注册 [选填]:优先使用该配置作为注册地址,为空时使用内嵌服务 ”IP:PORT“ 作为注册地址。从而更灵活的支持容器类型执行器动态IP和动态映射端口问题。
+      address:
+      ### 执行器IP [选填]:默认为空表示自动获取IP,多网卡时可手动设置指定IP,该IP不会绑定Host仅作为通讯实用;地址信息用于 "执行器注册" 和 "调度中心请求并触发任务";
+      ip:
+      ### 执行器端口号 [选填]:小于等于0则自动获取;默认端口为9999,单机部署多个执行器时,注意要配置不同执行器端口;
+      port: 0
+      ### 执行器运行日志文件存储磁盘路径 [选填] :需要对该路径拥有读写权限;为空则使用默认路径;
+      logpath: /home/backend/4dkankan_v4/fdkankan-task/execuLog
+      ### 执行器日志文件保存天数 [选填] : 过期日志自动清理, 限制值大于等于3时生效; 否则, 如-1, 关闭自动清理功能;
+      logretentiondays: 30
+
+
+
+
+#钉钉配置
+dingtalk:
+  token: 0ba44bdb2345d76ce7348bcb13fa118252e7a351426b90f64fac09b57b123b1c
+  secret: SEC687e2967e9a825b839d4d1512a7b98be49f7a19106d13bb6869f7bc33737359a
+
+
+fyun:
+  type: oss
+  key: LTAI5tJwboCj3r4vUNkSmbyX
+  secret: meDy7VYAWbg8kZCKsoUZcIYQxigWOy
+  bucket: 4dkankan
+  coldBucket: 4dkk-bak
+  endPoint: http://oss-cn-shenzhen-internal.aliyuncs.com
+  host: https://4dkk.4dage.com/

+ 0 - 9
src/main/resources/application.yml

@@ -7,12 +7,3 @@ spring:
       max-file-size: 1024MB
       max-file-size: 1024MB
       # 设置单次请求文件的总大小
       # 设置单次请求文件的总大小
       max-request-size: 1024MB
       max-request-size: 1024MB
-
-fyun:
-  type: oss
-  key: LTAI5tC5Ema4raGNCZYSNrkN
-  secret: BjqU1lSVnNUbJouGkq13JG9DmcpaDx
-  bucket: zfb-4dkankan
-  coldBucket: 4dkk-bak
-  endPoint: http://oss-cn-shenzhen.aliyuncs.com
-  host: https://zfb-4dkankan.oss-cn-shenzhen.aliyuncs.com/

+ 38 - 5
src/test/java/com/fdkankan/task/TaskTestApplication.java

@@ -1,6 +1,11 @@
 package com.fdkankan.task;
 package com.fdkankan.task;
 
 
+import cn.hutool.core.codec.Base64;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.CharsetUtil;
+import cn.hutool.http.HttpRequest;
+import cn.hutool.http.HttpUtil;
+import com.alibaba.fastjson.JSONObject;
 import com.fdkankan.task.entity.Repair;
 import com.fdkankan.task.entity.Repair;
 import com.fdkankan.task.entity.TbBuilding;
 import com.fdkankan.task.entity.TbBuilding;
 import com.fdkankan.task.entity.TbHouse;
 import com.fdkankan.task.entity.TbHouse;
@@ -11,17 +16,23 @@ import com.fdkankan.task.service.RepairService;
 import com.mybatisflex.core.query.QueryWrapper;
 import com.mybatisflex.core.query.QueryWrapper;
 import com.rabbitmq.client.AMQP;
 import com.rabbitmq.client.AMQP;
 import com.rabbitmq.client.Channel;
 import com.rabbitmq.client.Channel;
+import io.netty.handler.codec.http.HttpHeaderNames;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.Test;
 import org.mybatis.spring.annotation.MapperScan;
 import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.amqp.core.AmqpAdmin;
 import org.springframework.amqp.rabbit.core.ChannelCallback;
 import org.springframework.amqp.rabbit.core.ChannelCallback;
 import org.springframework.amqp.rabbit.core.RabbitTemplate;
 import org.springframework.amqp.rabbit.core.RabbitTemplate;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.http.MediaType;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
+import java.awt.*;
+import java.io.IOException;
 import java.util.*;
 import java.util.*;
+import java.util.List;
 
 
 @SpringBootTest
 @SpringBootTest
 public class TaskTestApplication {
 public class TaskTestApplication {
@@ -42,12 +53,34 @@ public class TaskTestApplication {
 
 
     @Test
     @Test
     void test2() {
     void test2() {
-        String queue = "old_scene_build";
-        Long queueModelingA = secondRabbitTemplate.execute(channel -> channel.messageCount(queue));        //ready
-        Long queueModelingB = secondRabbitTemplate.execute(channel -> channel.consumerCount(queue));
-        System.out.println(queueModelingA);
-        System.out.println(queueModelingB);
+        String queue = "QUEUE_MODELING_A";
+        //Long queueModelingA = secondRabbitTemplate.execute(channel -> channel.messageCount(queue));        //ready
+       // Long queueModelingB = secondRabbitTemplate.execute(channel -> channel.consumerCount(queue));
+         getUnackedMessagesCount("http://120.24.202.7:15672","%2F","admin","admin123",queue);
 
 
     }
     }
 
 
+    public void getUnackedMessagesCount(String rabbitMgmtUrl,String vhost, String userName,String password,String queueName) {
+        String url = rabbitMgmtUrl + "/api/queues/" + vhost + "/" + queueName;
+
+        // 添加请求头
+        // 设置认证信息
+        try {
+            HttpRequest request = HttpRequest.get(url)
+                    .header("authorization", "Basic " +
+                            Base64.encode((userName + ":" + password).getBytes(CharsetUtil.UTF_8)));
+            // 发送请求,并获取响应字符串
+            String response = request.execute().body();
+            JSONObject jsonObject = JSONObject.parseObject(response);
+            System.out.println(jsonObject.getIntValue("messages_ready"));
+            System.out.println(jsonObject.getIntValue("messages_unacknowledged"));
+            System.out.println(jsonObject.getIntValue("messages"));
+            System.out.println(jsonObject.getIntValue("consumers"));
+            System.out.println(jsonObject.getString("state"));
+
+        }catch (Exception e){
+
+        }
+    }
+
 }
 }

+ 44 - 0
src/test/java/com/fdkankan/task/Test11.java

@@ -0,0 +1,44 @@
+package com.fdkankan.task;
+
+import org.junit.jupiter.api.Test;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.concurrent.*;
+
+
+public class Test11 {
+
+    public static ExecutorService executorService = Executors.newFixedThreadPool(1);
+
+    @Test
+    public void test22() throws Exception{
+        while (true){
+            executorService = Executors.newFixedThreadPool(1);
+            Callable<Integer> call =   new Callable<Integer>() {
+                @Override
+                public Integer call() throws Exception {
+                    List<Integer> add = new ArrayList<>();
+                    add.add(11111);
+                    System.out.println(add);
+                    Thread.sleep(1111);
+                    return 1;
+                }
+            };
+            Future<Integer> future =executorService.submit(call);
+            future.get(210, TimeUnit.SECONDS);
+            executorService.shutdown();
+            System.out.println(1111);
+        }
+
+    }
+
+    @Test
+    public void test2(){
+        if(!new File("D:\\abc\\capt\\1.txt").getParentFile().exists()){
+            new File("D:\\abc\\capt\\1.txt").getParentFile().mkdirs();
+        }
+    }
+}

+ 40 - 0
src/test/java/com/fdkankan/task/TestFdkk.java

@@ -0,0 +1,40 @@
+package com.fdkankan.task;
+
+import com.fdkankan.fyun.face.FYunFileServiceInterface;
+import com.fdkankan.task.utils.ExcelUtil;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+
+@SpringBootTest
+public class TestFdkk {
+
+    @Autowired
+    FYunFileServiceInterface fYunFileServiceInterface;
+
+   @Test
+    public void  test1() throws IOException {
+        String basePath = "D:\\abc\\data\\";
+        String path = "正顺数据集.xlsx";
+        String ossPath ="images/images%s/tiles/2k/%s_skybox%s.jpg";
+        List<HashMap<Integer, String>> excelRowList = ExcelUtil.getExcelRowList(new File(basePath+path));
+        Integer index = 0;
+        for (HashMap<Integer, String> map : excelRowList) {
+            index ++;
+            if(index == 1){
+                continue;
+            }
+            String sceneOssPath = String.format(ossPath,map.get(1),"48","1");
+            String localPath = basePath + map.get(1);
+            new File(localPath).mkdirs();
+            fYunFileServiceInterface.downloadFile(sceneOssPath,localPath );
+            System.out.println(map);
+            return;
+        }
+    }
+}

+ 24 - 0
src/test/java/com/fdkankan/task/TestZfbOss.java

@@ -0,0 +1,24 @@
+package com.fdkankan.task;
+
+import com.fdkankan.fyun.face.FYunFileServiceInterface;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.test.context.SpringBootTest;
+
+@SpringBootTest
+public class TestZfbOss {
+
+    @Autowired
+    FYunFileServiceInterface fYunFileServiceInterface;
+    @Value("${fyun.bucketv2}")
+    private String bucketv2;
+    @Value("${fyun.bucket}")
+    private String bucketv3;
+    @Value("${fyun.coldBucket}")
+    private String coldBucket;
+    @Test
+    public void test1(){
+        fYunFileServiceInterface.copyFileBetweenBucket(bucketv3,"appData/5838794f3732_202404101346261830",coldBucket,bucketv3+"/appData/5838794f3732_202404101346261830");
+    }
+}

+ 92 - 0
src/test/java/com/fdkankan/task/TestZfbV2.java

@@ -0,0 +1,92 @@
+package com.fdkankan.task;
+
+import cn.hutool.core.date.DateUtil;
+import com.fdkankan.fyun.face.FYunFileServiceInterface;
+import com.fdkankan.task.config.SendMessage;
+import com.fdkankan.task.entity.TbScene;
+import com.fdkankan.task.entity.TbScenePro;
+import com.fdkankan.task.entity.TbUser;
+import com.fdkankan.task.mapper.TbSceneMapper;
+import com.fdkankan.task.mapper.TbUserMapper;
+import com.fdkankan.task.service.TbSceneProService;
+import com.fdkankan.task.service.TbSceneService;
+import com.fdkankan.task.service.TbUserService;
+import com.mybatisflex.annotation.UseDataSource;
+import com.mybatisflex.core.datasource.DataSourceKey;
+import com.mybatisflex.core.query.QueryWrapper;
+import org.apache.commons.lang3.StringUtils;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.concurrent.CompletableFuture;
+
+@SpringBootTest
+public class TestZfbV2 {
+
+    static String dataFmt = "yyyyMMddHHmmssSSSS";
+    @Autowired
+    TbSceneMapper tbSceneMapper;
+    @Autowired
+    TbUserService tbUserService;
+    @Autowired
+    SendMessage sendMessage;
+
+
+    /**
+     * 5838794f1754_202403221055576280:;/home/ubuntu/data/5838794f1754_202403221055576280:;https://zfb-zhm-test.oss-cn-shenzhen.aliyuncs.com/5838794f1754_202403221055576280/:;zip.Zip:;zh1K6M5HIz8:;1:;18036323123:;1:;1058:;sfm
+     41143603_20240321144623:;/home/ubuntu/data/41143603_20240321144623:;https://zfb-zhm-test.oss-cn-shenzhen.aliyuncs.com/41143603_20240321144623/:;zip.Zip:;zh1AgtOB5cm:;1:;15105227207:;1:;1058:;sfm     */
+    @Test
+    void test2() throws Exception {
+        DataSourceKey.use("old-zfb");
+        QueryWrapper queryWrapper = QueryWrapper.create()
+                .where("status = -1 and id  >= 508729 and algorithm!="+"'simple'");
+        List<TbScene> tbScenes = tbSceneMapper.selectListByQuery(queryWrapper);
+        List<String > msgList = new ArrayList<>();
+        for (TbScene tbScene : tbScenes) {
+            TbUser user = tbUserService.getById(tbScene.getUserId());
+            String unicode = getV2DataSource(tbScene.getDatasource());
+            String parametr = "";
+            parametr+=unicode+":;"+v2Path+unicode+":;"+ossMain+unicode+"/:;"+"zip.Zip"+":;"+tbScene.getNum()+":;"+1;
+            parametr+=":;"+user.getUserName();
+            parametr+=":;"+1;
+            parametr += ":;" + user.getCompanyId();
+            parametr+=":;"+tbScene.getAlgorithm();
+            msgList.add(parametr);
+        }
+        System.out.println(msgList.size());
+        for (String msg : msgList) {
+            sendMessage.sendTov2Message(msg);
+            Thread.sleep(1000L);
+        }
+    }
+
+    @Test
+    public void test1(){
+        sendMessage.sendTov2Message("41126488_20240322103814:;/home/ubuntu/data/41126488_20240322103814:;https://zfb-zhm-test.oss-cn-shenzhen.aliyuncs.com/41126488_20240322103814/:;zip.Zip:;zhpznCvKqOL:;1:;15751815667:;1:;1058:;sfm");
+    }
+
+
+    public static String v2Path = "/home/ubuntu/data/";
+    public static String ossMain = "https://zfb-zhm-test.oss-cn-shenzhen.aliyuncs.com/";
+
+
+    public static String getV2DataSource(String ossPath){
+        if(StringUtils.isBlank(ossPath)){
+            return null;
+        }
+        //http://zfb-zhm-test.oss-cn-shenzhen.aliyuncs.com/5603e0f0c45b45be99850bd5a577b0a3_2019032011090494/zip.Zip
+        ossPath = ossPath.replace("http://zfb-zhm-test.oss-cn-shenzhen.aliyuncs.com/","");
+        ossPath = ossPath.replace("https://zfb-zhm-test.oss-cn-shenzhen.aliyuncs.com/","");
+        ossPath = ossPath.replace("/zip.Zip","");
+        return  ossPath;
+    }
+
+
+
+}
+
+

+ 12 - 8
src/test/java/com/fdkankan/task/TestZfb.java

@@ -6,17 +6,16 @@ import com.fdkankan.task.config.SendMessage;
 import com.fdkankan.task.entity.TbScenePro;
 import com.fdkankan.task.entity.TbScenePro;
 import com.fdkankan.task.service.TbSceneProService;
 import com.fdkankan.task.service.TbSceneProService;
 import com.mybatisflex.annotation.UseDataSource;
 import com.mybatisflex.annotation.UseDataSource;
+import com.mybatisflex.core.datasource.DataSourceKey;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.boot.test.context.SpringBootTest;
 
 
-import java.io.IOException;
-import java.util.Arrays;
 import java.util.Date;
 import java.util.Date;
 
 
 @SpringBootTest
 @SpringBootTest
-public class TestZfb {
+public class TestZfbV3 {
 
 
     static String dataFmt = "yyyyMMddHHmmssSSSS";
     static String dataFmt = "yyyyMMddHHmmssSSSS";
     @Autowired
     @Autowired
@@ -26,14 +25,19 @@ public class TestZfb {
     @Autowired
     @Autowired
     SendMessage sendMessage;
     SendMessage sendMessage;
     /*
     /*
-        5838794f37f8_(null):;/home/ubuntu/data/5838794f37f8_(null):;https://zfb-4dkankan.oss-cn-shenzhen.aliyuncs.com/appData/5838794f37f8_(null):;5838794f37f8_(null).zip:;zfb-XX3iSDdxY:;0:;THETAYP41149405.OSC:;6:;slam:;:;THETAYP41149405.OSC:;0:;V3
+        /home/ubuntu/data/5838794f2414_(null)           zfb-0heDvszZk
+        /home/ubuntu/data/5838794f2523_(null)           zfb-8bEa6WlNw
     */
     */
     @Test
     @Test
-    @UseDataSource("new-zfb")
     void test2() throws Exception {
     void test2() throws Exception {
-        String mqMsg =
-                "5838794f37f8_(null):;/home/ubuntu/data/5838794f37f8_(null):;https://zfb-4dkankan.oss-cn-shenzhen.aliyuncs.com/appData/5838794f37f8_(null):;5838794f37f8_(null).zip:;zfb-XX3iSDdxY:;0:;THETAYP41149405.OSC:;6:;slam:;:;THETAYP41149405.OSC:;0:;V3";
-        test3(mqMsg);
+        DataSourceKey.use("new-zfb");
+        String[] res = {
+                "5838794f2414_(null):;/home/ubuntu/data/5838794f2414_(null):;https://zfb-4dkankan.oss-cn-shenzhen.aliyuncs.com/appData/5838794f2414_(null):;5838794f2414_(null).zip:;zfb-0heDvszZk:;0:;THETAYP41146326.OSC:;6:;slam:;:;THETAYP41146326.OSC:;0:;V3",
+                "5838794f2523_(null):;/home/ubuntu/data/5838794f2523_(null):;https://zfb-4dkankan.oss-cn-shenzhen.aliyuncs.com/appData/5838794f2523_(null):;5838794f2523_(null).zip:;zfb-8bEa6WlNw:;0:;THETAYP41146230.OSC:;6:;slam:;:;THETAYP41146230.OSC:;0:;V3",
+        };
+        for (String re : res) {
+            test3(re);
+        }
     }
     }
 
 
     private void test3(String mqMsg) throws Exception  {
     private void test3(String mqMsg) throws Exception  {