lyhzzz před 1 rokem
rodič
revize
8b2d84620c

+ 5 - 0
pom.xml

@@ -113,6 +113,11 @@
             <version>3.0.0-SNAPSHOT</version>
         </dependency>
 
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-amqp</artifactId>
+        </dependency>
+
     </dependencies>
 
     <build>

+ 12 - 0
src/main/java/com/fdkankan/task/common/MqConstants.java

@@ -0,0 +1,12 @@
+package com.fdkankan.task.common;
+
+import java.util.Stack;
+
+public class MqConstants {
+    public static String RABBITMQ_QUEUE_v2 = "test_v2";
+    public static String RABBITMQ_QUEUE_v3 = "test_v3";
+
+
+    //583879492512_202401261655490830:;/home/ubuntu/data/583879492512_202401261655490830:;https://zfb-4dkankan.oss-cn-shenzhen.aliyuncs.com/appData/583879492512_202401261655490830:;583879492512_202401261655490830.zip:;zfb-aAqvA8KV5:;0:;THETAYP41136522.OSC:;6:;slam:;:;THETAYP41136522.OSC:;0:;V3
+    public static String v3msg ="%s:;%s:;%s:;%s:;%s:;0:;%s:;6:;slam:;:;%s:;0:;V3";
+}

+ 37 - 0
src/main/java/com/fdkankan/task/config/CreateQueue.java

@@ -0,0 +1,37 @@
+package com.fdkankan.task.config;
+
+import com.fdkankan.task.common.MqConstants;
+import org.springframework.amqp.rabbit.connection.ConnectionFactory;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import java.io.IOException;
+
+/**
+ * 信道构建器
+ *
+ * @author liuqi
+ */
+@Configuration
+public class CreateQueue {
+
+    @Bean
+    public String chargeQueue(@Qualifier("v2ConnectionFactory") ConnectionFactory connectionFactory) {
+        try {
+            connectionFactory.createConnection().createChannel(false).queueDeclare(MqConstants.RABBITMQ_QUEUE_v2, true, false, false, null);
+        }catch (IOException e){
+            e.printStackTrace();
+        }
+        return MqConstants.RABBITMQ_QUEUE_v2;
+    }
+
+    @Bean
+    public String chargeQueue2(@Qualifier("v3ConnectionFactory") ConnectionFactory connectionFactory) {
+        try {
+            connectionFactory.createConnection().createChannel(false).queueDeclare(MqConstants.RABBITMQ_QUEUE_v3, true, false, false, null);
+        }catch (IOException e){
+            e.printStackTrace();
+        }
+        return MqConstants.RABBITMQ_QUEUE_v3;
+    }
+}

+ 95 - 0
src/main/java/com/fdkankan/task/config/RabbitConfig.java

@@ -0,0 +1,95 @@
+package com.fdkankan.task.config;
+
+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.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.autoconfigure.amqp.SimpleRabbitListenerContainerFactoryConfigurer;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
+
+/**
+ * RabbitMq多源配置
+ *
+ * @author lq
+ */
+@Configuration
+public class RabbitConfig {
+
+    @Bean(name = "v2ConnectionFactory")
+    @Primary
+    public ConnectionFactory v2ConnectionFactory(
+            @Value("${spring.rabbitmq.v2.host}") String host,
+            @Value("${spring.rabbitmq.v2.port}") int port,
+            @Value("${spring.rabbitmq.v2.username}") String username,
+            @Value("${spring.rabbitmq.v2.password}") String password,
+            @Value("${spring.rabbitmq.v2.virtual-host}") String virtualHost
+    ) {
+        CachingConnectionFactory connectionFactory = new CachingConnectionFactory();
+
+        connectionFactory.setHost(host);
+        connectionFactory.setPort(port);
+        connectionFactory.setUsername(username);
+        connectionFactory.setPassword(password);
+        connectionFactory.setVirtualHost(virtualHost);
+        return connectionFactory;
+    }
+
+    @Bean(name = "v3ConnectionFactory")
+    public ConnectionFactory v3ConnectionFactory(
+            @Value("${spring.rabbitmq.v3.host}") String host,
+            @Value("${spring.rabbitmq.v3.port}") int port,
+            @Value("${spring.rabbitmq.v3.username}") String username,
+            @Value("${spring.rabbitmq.v3.password}") String password,
+            @Value("${spring.rabbitmq.v3.virtual-host}") String virtualHost
+    ) {
+        CachingConnectionFactory connectionFactory = new CachingConnectionFactory();
+        connectionFactory.setHost(host);
+        connectionFactory.setPort(port);
+        connectionFactory.setUsername(username);
+        connectionFactory.setPassword(password);
+        connectionFactory.setVirtualHost(virtualHost);
+        return connectionFactory;
+    }
+
+    @Bean(name = "v2RabbitTemplate")
+    @Primary
+    public RabbitTemplate v2RabbitTemplate(
+            @Qualifier("v2ConnectionFactory") ConnectionFactory connectionFactory
+    ) {
+        RabbitTemplate v2RabbitTemplate = new RabbitTemplate(connectionFactory);
+        return v2RabbitTemplate;
+    }
+
+    @Bean(name = "v3RabbitTemplate")
+    public RabbitTemplate v3RabbitTemplate(
+            @Qualifier("v3ConnectionFactory") ConnectionFactory connectionFactory
+    ) {
+        RabbitTemplate v3RabbitTemplate = new RabbitTemplate(connectionFactory);
+        return v3RabbitTemplate;
+    }
+
+
+    @Bean(name = "v2Factory")
+    public SimpleRabbitListenerContainerFactory v2Factory(
+            SimpleRabbitListenerContainerFactoryConfigurer configurer,
+            @Qualifier("v2ConnectionFactory") ConnectionFactory connectionFactory
+    ) {
+        SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
+        configurer.configure(factory, connectionFactory);
+        return factory;
+    }
+
+    @Bean(name = "v3Factory")
+    public SimpleRabbitListenerContainerFactory v3Factory(
+            SimpleRabbitListenerContainerFactoryConfigurer configurer,
+            @Qualifier("v3ConnectionFactory") ConnectionFactory connectionFactory
+    ) {
+        SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
+        configurer.configure(factory, connectionFactory);
+        return factory;
+    }
+}

+ 42 - 0
src/main/java/com/fdkankan/task/config/SendMessage.java

@@ -0,0 +1,42 @@
+package com.fdkankan.task.config;
+
+import com.alibaba.fastjson.JSONObject;
+import com.fdkankan.task.common.MqConstants;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.amqp.core.Message;
+import org.springframework.amqp.core.MessageProperties;
+import org.springframework.amqp.rabbit.core.RabbitTemplate;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+/**
+ * @author liuqi
+ * @version 1.0
+ * @description 向关联方的队列发送消息
+ */
+@Slf4j
+@Service
+public class SendMessage {
+
+    @Resource(name = "v2RabbitTemplate")
+    private RabbitTemplate v2RabbitTemplate;
+
+    @Resource(name = "v3RabbitTemplate")
+    private RabbitTemplate secondRabbitTemplate;
+
+    public void sendTov2Message(JSONObject jsonObject) {
+        MessageProperties messageProperties = new MessageProperties();
+        messageProperties.setContentType("application/json");
+        Message info = new Message(jsonObject.toString().getBytes(), messageProperties);
+        v2RabbitTemplate.convertAndSend(MqConstants.RABBITMQ_QUEUE_v2, info);
+    }
+
+    public void sendTov3Message(JSONObject jsonObject) {
+        MessageProperties messageProperties = new MessageProperties();
+        messageProperties.setContentType("application/json");
+        Message info = new Message(jsonObject.toString().getBytes(), messageProperties);
+        secondRabbitTemplate.convertAndSend(MqConstants.RABBITMQ_QUEUE_v3, info);
+    }
+}
+ 

+ 0 - 96
src/main/java/com/fdkankan/task/controller/TbBuildingController.java

@@ -1,96 +0,0 @@
-package com.fdkankan.task.controller;
-
-import com.mybatisflex.core.paginate.Page;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.beans.factory.annotation.Autowired;
-import com.fdkankan.task.entity.TbBuilding;
-import com.fdkankan.task.service.TbBuildingService;
-import org.springframework.web.bind.annotation.RestController;
-import java.io.Serializable;
-import java.util.List;
-
-/**
- *  控制层。
- *
- * @author Admin
- * @since 2023-12-02
- */
-@RestController
-@RequestMapping("/tbBuilding")
-public class TbBuildingController {
-
-    @Autowired
-    private TbBuildingService tbBuildingService;
-
-    /**
-     * 添加。
-     *
-     * @param tbBuilding 
-     * @return {@code true} 添加成功,{@code false} 添加失败
-     */
-    @PostMapping("save")
-    public boolean save(@RequestBody TbBuilding tbBuilding) {
-        return tbBuildingService.save(tbBuilding);
-    }
-
-    /**
-     * 根据主键删除。
-     *
-     * @param id 主键
-     * @return {@code true} 删除成功,{@code false} 删除失败
-     */
-    @DeleteMapping("remove/{id}")
-    public boolean remove(@PathVariable Serializable id) {
-        return tbBuildingService.removeById(id);
-    }
-
-    /**
-     * 根据主键更新。
-     *
-     * @param tbBuilding 
-     * @return {@code true} 更新成功,{@code false} 更新失败
-     */
-    @PutMapping("update")
-    public boolean update(@RequestBody TbBuilding tbBuilding) {
-        return tbBuildingService.updateById(tbBuilding);
-    }
-
-    /**
-     * 查询所有。
-     *
-     * @return 所有数据
-     */
-    @GetMapping("list")
-    public List<TbBuilding> list() {
-        return tbBuildingService.list();
-    }
-
-    /**
-     * 根据主键获取详细信息。
-     *
-     * @param id 主键
-     * @return 详情
-     */
-    @GetMapping("getInfo/{id}")
-    public TbBuilding getInfo(@PathVariable Serializable id) {
-        return tbBuildingService.getById(id);
-    }
-
-    /**
-     * 分页查询。
-     *
-     * @param page 分页对象
-     * @return 分页对象
-     */
-    @GetMapping("page")
-    public Page<TbBuilding> page(Page<TbBuilding> page) {
-        return tbBuildingService.page(page);
-    }
-
-}

+ 0 - 96
src/main/java/com/fdkankan/task/controller/TbCameraInstanceController.java

@@ -1,96 +0,0 @@
-package com.fdkankan.task.controller;
-
-import com.mybatisflex.core.paginate.Page;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.beans.factory.annotation.Autowired;
-import com.fdkankan.task.entity.TbCameraInstance;
-import com.fdkankan.task.service.TbCameraInstanceService;
-import org.springframework.web.bind.annotation.RestController;
-import java.io.Serializable;
-import java.util.List;
-
-/**
- *  控制层。
- *
- * @author Admin
- * @since 2023-12-01
- */
-@RestController
-@RequestMapping("/tbCameraInstance")
-public class TbCameraInstanceController {
-
-    @Autowired
-    private TbCameraInstanceService tbCameraInstanceService;
-
-    /**
-     * 添加。
-     *
-     * @param tbCameraInstance 
-     * @return {@code true} 添加成功,{@code false} 添加失败
-     */
-    @PostMapping("save")
-    public boolean save(@RequestBody TbCameraInstance tbCameraInstance) {
-        return tbCameraInstanceService.save(tbCameraInstance);
-    }
-
-    /**
-     * 根据主键删除。
-     *
-     * @param id 主键
-     * @return {@code true} 删除成功,{@code false} 删除失败
-     */
-    @DeleteMapping("remove/{id}")
-    public boolean remove(@PathVariable Serializable id) {
-        return tbCameraInstanceService.removeById(id);
-    }
-
-    /**
-     * 根据主键更新。
-     *
-     * @param tbCameraInstance 
-     * @return {@code true} 更新成功,{@code false} 更新失败
-     */
-    @PutMapping("update")
-    public boolean update(@RequestBody TbCameraInstance tbCameraInstance) {
-        return tbCameraInstanceService.updateById(tbCameraInstance);
-    }
-
-    /**
-     * 查询所有。
-     *
-     * @return 所有数据
-     */
-    @GetMapping("list")
-    public List<TbCameraInstance> list() {
-        return tbCameraInstanceService.list();
-    }
-
-    /**
-     * 根据主键获取详细信息。
-     *
-     * @param id 主键
-     * @return 详情
-     */
-    @GetMapping("getInfo/{id}")
-    public TbCameraInstance getInfo(@PathVariable Serializable id) {
-        return tbCameraInstanceService.getById(id);
-    }
-
-    /**
-     * 分页查询。
-     *
-     * @param page 分页对象
-     * @return 分页对象
-     */
-    @GetMapping("page")
-    public Page<TbCameraInstance> page(Page<TbCameraInstance> page) {
-        return tbCameraInstanceService.page(page);
-    }
-
-}

+ 0 - 96
src/main/java/com/fdkankan/task/controller/TbHouseController.java

@@ -1,96 +0,0 @@
-package com.fdkankan.task.controller;
-
-import com.mybatisflex.core.paginate.Page;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.beans.factory.annotation.Autowired;
-import com.fdkankan.task.entity.TbHouse;
-import com.fdkankan.task.service.TbHouseService;
-import org.springframework.web.bind.annotation.RestController;
-import java.io.Serializable;
-import java.util.List;
-
-/**
- *  控制层。
- *
- * @author Admin
- * @since 2023-12-02
- */
-@RestController
-@RequestMapping("/tbHouse")
-public class TbHouseController {
-
-    @Autowired
-    private TbHouseService tbHouseService;
-
-    /**
-     * 添加。
-     *
-     * @param tbHouse 
-     * @return {@code true} 添加成功,{@code false} 添加失败
-     */
-    @PostMapping("save")
-    public boolean save(@RequestBody TbHouse tbHouse) {
-        return tbHouseService.save(tbHouse);
-    }
-
-    /**
-     * 根据主键删除。
-     *
-     * @param id 主键
-     * @return {@code true} 删除成功,{@code false} 删除失败
-     */
-    @DeleteMapping("remove/{id}")
-    public boolean remove(@PathVariable Serializable id) {
-        return tbHouseService.removeById(id);
-    }
-
-    /**
-     * 根据主键更新。
-     *
-     * @param tbHouse 
-     * @return {@code true} 更新成功,{@code false} 更新失败
-     */
-    @PutMapping("update")
-    public boolean update(@RequestBody TbHouse tbHouse) {
-        return tbHouseService.updateById(tbHouse);
-    }
-
-    /**
-     * 查询所有。
-     *
-     * @return 所有数据
-     */
-    @GetMapping("list")
-    public List<TbHouse> list() {
-        return tbHouseService.list();
-    }
-
-    /**
-     * 根据主键获取详细信息。
-     *
-     * @param id 主键
-     * @return 详情
-     */
-    @GetMapping("getInfo/{id}")
-    public TbHouse getInfo(@PathVariable Serializable id) {
-        return tbHouseService.getById(id);
-    }
-
-    /**
-     * 分页查询。
-     *
-     * @param page 分页对象
-     * @return 分页对象
-     */
-    @GetMapping("page")
-    public Page<TbHouse> page(Page<TbHouse> page) {
-        return tbHouseService.page(page);
-    }
-
-}

+ 0 - 96
src/main/java/com/fdkankan/task/controller/TbHouseDeleteController.java

@@ -1,96 +0,0 @@
-package com.fdkankan.task.controller;
-
-import com.mybatisflex.core.paginate.Page;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.beans.factory.annotation.Autowired;
-import com.fdkankan.task.entity.TbHouseDelete;
-import com.fdkankan.task.service.TbHouseDeleteService;
-import org.springframework.web.bind.annotation.RestController;
-import java.io.Serializable;
-import java.util.List;
-
-/**
- *  控制层。
- *
- * @author Admin
- * @since 2023-12-18
- */
-@RestController
-@RequestMapping("/tbHouseDelete")
-public class TbHouseDeleteController {
-
-    @Autowired
-    private TbHouseDeleteService tbHouseDeleteService;
-
-    /**
-     * 添加。
-     *
-     * @param tbHouseDelete 
-     * @return {@code true} 添加成功,{@code false} 添加失败
-     */
-    @PostMapping("save")
-    public boolean save(@RequestBody TbHouseDelete tbHouseDelete) {
-        return tbHouseDeleteService.save(tbHouseDelete);
-    }
-
-    /**
-     * 根据主键删除。
-     *
-     * @param id 主键
-     * @return {@code true} 删除成功,{@code false} 删除失败
-     */
-    @DeleteMapping("remove/{id}")
-    public boolean remove(@PathVariable Serializable id) {
-        return tbHouseDeleteService.removeById(id);
-    }
-
-    /**
-     * 根据主键更新。
-     *
-     * @param tbHouseDelete 
-     * @return {@code true} 更新成功,{@code false} 更新失败
-     */
-    @PutMapping("update")
-    public boolean update(@RequestBody TbHouseDelete tbHouseDelete) {
-        return tbHouseDeleteService.updateById(tbHouseDelete);
-    }
-
-    /**
-     * 查询所有。
-     *
-     * @return 所有数据
-     */
-    @GetMapping("list")
-    public List<TbHouseDelete> list() {
-        return tbHouseDeleteService.list();
-    }
-
-    /**
-     * 根据主键获取详细信息。
-     *
-     * @param id 主键
-     * @return 详情
-     */
-    @GetMapping("getInfo/{id}")
-    public TbHouseDelete getInfo(@PathVariable Serializable id) {
-        return tbHouseDeleteService.getById(id);
-    }
-
-    /**
-     * 分页查询。
-     *
-     * @param page 分页对象
-     * @return 分页对象
-     */
-    @GetMapping("page")
-    public Page<TbHouseDelete> page(Page<TbHouseDelete> page) {
-        return tbHouseDeleteService.page(page);
-    }
-
-}

+ 0 - 96
src/main/java/com/fdkankan/task/controller/TbScene3dNumNewController.java

@@ -1,96 +0,0 @@
-package com.fdkankan.task.controller;
-
-import com.mybatisflex.core.paginate.Page;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.beans.factory.annotation.Autowired;
-import com.fdkankan.task.entity.TbScene3dNumNew;
-import com.fdkankan.task.service.TbScene3dNumNewService;
-import org.springframework.web.bind.annotation.RestController;
-import java.io.Serializable;
-import java.util.List;
-
-/**
- *  控制层。
- *
- * @author Admin
- * @since 2023-12-01
- */
-@RestController
-@RequestMapping("/tbScene3dNumNew")
-public class TbScene3dNumNewController {
-
-    @Autowired
-    private TbScene3dNumNewService tbScene3dNumNewService;
-
-    /**
-     * 添加。
-     *
-     * @param tbScene3dNumNew 
-     * @return {@code true} 添加成功,{@code false} 添加失败
-     */
-    @PostMapping("save")
-    public boolean save(@RequestBody TbScene3dNumNew tbScene3dNumNew) {
-        return tbScene3dNumNewService.save(tbScene3dNumNew);
-    }
-
-    /**
-     * 根据主键删除。
-     *
-     * @param id 主键
-     * @return {@code true} 删除成功,{@code false} 删除失败
-     */
-    @DeleteMapping("remove/{id}")
-    public boolean remove(@PathVariable Serializable id) {
-        return tbScene3dNumNewService.removeById(id);
-    }
-
-    /**
-     * 根据主键更新。
-     *
-     * @param tbScene3dNumNew 
-     * @return {@code true} 更新成功,{@code false} 更新失败
-     */
-    @PutMapping("update")
-    public boolean update(@RequestBody TbScene3dNumNew tbScene3dNumNew) {
-        return tbScene3dNumNewService.updateById(tbScene3dNumNew);
-    }
-
-    /**
-     * 查询所有。
-     *
-     * @return 所有数据
-     */
-    @GetMapping("list")
-    public List<TbScene3dNumNew> list() {
-        return tbScene3dNumNewService.list();
-    }
-
-    /**
-     * 根据主键获取详细信息。
-     *
-     * @param id 主键
-     * @return 详情
-     */
-    @GetMapping("getInfo/{id}")
-    public TbScene3dNumNew getInfo(@PathVariable Serializable id) {
-        return tbScene3dNumNewService.getById(id);
-    }
-
-    /**
-     * 分页查询。
-     *
-     * @param page 分页对象
-     * @return 分页对象
-     */
-    @GetMapping("page")
-    public Page<TbScene3dNumNew> page(Page<TbScene3dNumNew> page) {
-        return tbScene3dNumNewService.page(page);
-    }
-
-}

+ 0 - 96
src/main/java/com/fdkankan/task/controller/TbSceneController.java

@@ -1,96 +0,0 @@
-package com.fdkankan.task.controller;
-
-import com.mybatisflex.core.paginate.Page;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.beans.factory.annotation.Autowired;
-import com.fdkankan.task.entity.TbScene;
-import com.fdkankan.task.service.TbSceneService;
-import org.springframework.web.bind.annotation.RestController;
-import java.io.Serializable;
-import java.util.List;
-
-/**
- *  控制层。
- *
- * @author Admin
- * @since 2023-12-01
- */
-@RestController
-@RequestMapping("/tbScene")
-public class TbSceneController {
-
-    @Autowired
-    private TbSceneService tbSceneService;
-
-    /**
-     * 添加。
-     *
-     * @param tbScene 
-     * @return {@code true} 添加成功,{@code false} 添加失败
-     */
-    @PostMapping("save")
-    public boolean save(@RequestBody TbScene tbScene) {
-        return tbSceneService.save(tbScene);
-    }
-
-    /**
-     * 根据主键删除。
-     *
-     * @param id 主键
-     * @return {@code true} 删除成功,{@code false} 删除失败
-     */
-    @DeleteMapping("remove/{id}")
-    public boolean remove(@PathVariable Serializable id) {
-        return tbSceneService.removeById(id);
-    }
-
-    /**
-     * 根据主键更新。
-     *
-     * @param tbScene 
-     * @return {@code true} 更新成功,{@code false} 更新失败
-     */
-    @PutMapping("update")
-    public boolean update(@RequestBody TbScene tbScene) {
-        return tbSceneService.updateById(tbScene);
-    }
-
-    /**
-     * 查询所有。
-     *
-     * @return 所有数据
-     */
-    @GetMapping("list")
-    public List<TbScene> list() {
-        return tbSceneService.list();
-    }
-
-    /**
-     * 根据主键获取详细信息。
-     *
-     * @param id 主键
-     * @return 详情
-     */
-    @GetMapping("getInfo/{id}")
-    public TbScene getInfo(@PathVariable Serializable id) {
-        return tbSceneService.getById(id);
-    }
-
-    /**
-     * 分页查询。
-     *
-     * @param page 分页对象
-     * @return 分页对象
-     */
-    @GetMapping("page")
-    public Page<TbScene> page(Page<TbScene> page) {
-        return tbSceneService.page(page);
-    }
-
-}

+ 0 - 96
src/main/java/com/fdkankan/task/controller/TbSceneDeleteController.java

@@ -1,96 +0,0 @@
-package com.fdkankan.task.controller;
-
-import com.mybatisflex.core.paginate.Page;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.beans.factory.annotation.Autowired;
-import com.fdkankan.task.entity.TbSceneDelete;
-import com.fdkankan.task.service.TbSceneDeleteService;
-import org.springframework.web.bind.annotation.RestController;
-import java.io.Serializable;
-import java.util.List;
-
-/**
- *  控制层。
- *
- * @author Admin
- * @since 2023-12-18
- */
-@RestController
-@RequestMapping("/tbSceneDelete")
-public class TbSceneDeleteController {
-
-    @Autowired
-    private TbSceneDeleteService tbSceneDeleteService;
-
-    /**
-     * 添加。
-     *
-     * @param tbSceneDelete 
-     * @return {@code true} 添加成功,{@code false} 添加失败
-     */
-    @PostMapping("save")
-    public boolean save(@RequestBody TbSceneDelete tbSceneDelete) {
-        return tbSceneDeleteService.save(tbSceneDelete);
-    }
-
-    /**
-     * 根据主键删除。
-     *
-     * @param id 主键
-     * @return {@code true} 删除成功,{@code false} 删除失败
-     */
-    @DeleteMapping("remove/{id}")
-    public boolean remove(@PathVariable Serializable id) {
-        return tbSceneDeleteService.removeById(id);
-    }
-
-    /**
-     * 根据主键更新。
-     *
-     * @param tbSceneDelete 
-     * @return {@code true} 更新成功,{@code false} 更新失败
-     */
-    @PutMapping("update")
-    public boolean update(@RequestBody TbSceneDelete tbSceneDelete) {
-        return tbSceneDeleteService.updateById(tbSceneDelete);
-    }
-
-    /**
-     * 查询所有。
-     *
-     * @return 所有数据
-     */
-    @GetMapping("list")
-    public List<TbSceneDelete> list() {
-        return tbSceneDeleteService.list();
-    }
-
-    /**
-     * 根据主键获取详细信息。
-     *
-     * @param id 主键
-     * @return 详情
-     */
-    @GetMapping("getInfo/{id}")
-    public TbSceneDelete getInfo(@PathVariable Serializable id) {
-        return tbSceneDeleteService.getById(id);
-    }
-
-    /**
-     * 分页查询。
-     *
-     * @param page 分页对象
-     * @return 分页对象
-     */
-    @GetMapping("page")
-    public Page<TbSceneDelete> page(Page<TbSceneDelete> page) {
-        return tbSceneDeleteService.page(page);
-    }
-
-}

+ 0 - 96
src/main/java/com/fdkankan/task/controller/TbSceneNumController.java

@@ -1,96 +0,0 @@
-package com.fdkankan.task.controller;
-
-import com.mybatisflex.core.paginate.Page;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.beans.factory.annotation.Autowired;
-import com.fdkankan.task.entity.TbSceneNum;
-import com.fdkankan.task.service.TbSceneNumService;
-import org.springframework.web.bind.annotation.RestController;
-import java.io.Serializable;
-import java.util.List;
-
-/**
- *  控制层。
- *
- * @author Admin
- * @since 2023-12-01
- */
-@RestController
-@RequestMapping("/tbSceneNum")
-public class TbSceneNumController {
-
-    @Autowired
-    private TbSceneNumService tbSceneNumService;
-
-    /**
-     * 添加。
-     *
-     * @param tbSceneNum 
-     * @return {@code true} 添加成功,{@code false} 添加失败
-     */
-    @PostMapping("save")
-    public boolean save(@RequestBody TbSceneNum tbSceneNum) {
-        return tbSceneNumService.save(tbSceneNum);
-    }
-
-    /**
-     * 根据主键删除。
-     *
-     * @param id 主键
-     * @return {@code true} 删除成功,{@code false} 删除失败
-     */
-    @DeleteMapping("remove/{id}")
-    public boolean remove(@PathVariable Serializable id) {
-        return tbSceneNumService.removeById(id);
-    }
-
-    /**
-     * 根据主键更新。
-     *
-     * @param tbSceneNum 
-     * @return {@code true} 更新成功,{@code false} 更新失败
-     */
-    @PutMapping("update")
-    public boolean update(@RequestBody TbSceneNum tbSceneNum) {
-        return tbSceneNumService.updateById(tbSceneNum);
-    }
-
-    /**
-     * 查询所有。
-     *
-     * @return 所有数据
-     */
-    @GetMapping("list")
-    public List<TbSceneNum> list() {
-        return tbSceneNumService.list();
-    }
-
-    /**
-     * 根据主键获取详细信息。
-     *
-     * @param id 主键
-     * @return 详情
-     */
-    @GetMapping("getInfo/{id}")
-    public TbSceneNum getInfo(@PathVariable Serializable id) {
-        return tbSceneNumService.getById(id);
-    }
-
-    /**
-     * 分页查询。
-     *
-     * @param page 分页对象
-     * @return 分页对象
-     */
-    @GetMapping("page")
-    public Page<TbSceneNum> page(Page<TbSceneNum> page) {
-        return tbSceneNumService.page(page);
-    }
-
-}

+ 0 - 96
src/main/java/com/fdkankan/task/controller/TbSceneProController.java

@@ -1,96 +0,0 @@
-package com.fdkankan.task.controller;
-
-import com.mybatisflex.core.paginate.Page;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.beans.factory.annotation.Autowired;
-import com.fdkankan.task.entity.TbScenePro;
-import com.fdkankan.task.service.TbSceneProService;
-import org.springframework.web.bind.annotation.RestController;
-import java.io.Serializable;
-import java.util.List;
-
-/**
- *  控制层。
- *
- * @author Admin
- * @since 2023-12-01
- */
-@RestController
-@RequestMapping("/tbScenePro")
-public class TbSceneProController {
-
-    @Autowired
-    private TbSceneProService tbSceneProService;
-
-    /**
-     * 添加。
-     *
-     * @param tbScenePro 
-     * @return {@code true} 添加成功,{@code false} 添加失败
-     */
-    @PostMapping("save")
-    public boolean save(@RequestBody TbScenePro tbScenePro) {
-        return tbSceneProService.save(tbScenePro);
-    }
-
-    /**
-     * 根据主键删除。
-     *
-     * @param id 主键
-     * @return {@code true} 删除成功,{@code false} 删除失败
-     */
-    @DeleteMapping("remove/{id}")
-    public boolean remove(@PathVariable Serializable id) {
-        return tbSceneProService.removeById(id);
-    }
-
-    /**
-     * 根据主键更新。
-     *
-     * @param tbScenePro 
-     * @return {@code true} 更新成功,{@code false} 更新失败
-     */
-    @PutMapping("update")
-    public boolean update(@RequestBody TbScenePro tbScenePro) {
-        return tbSceneProService.updateById(tbScenePro);
-    }
-
-    /**
-     * 查询所有。
-     *
-     * @return 所有数据
-     */
-    @GetMapping("list")
-    public List<TbScenePro> list() {
-        return tbSceneProService.list();
-    }
-
-    /**
-     * 根据主键获取详细信息。
-     *
-     * @param id 主键
-     * @return 详情
-     */
-    @GetMapping("getInfo/{id}")
-    public TbScenePro getInfo(@PathVariable Serializable id) {
-        return tbSceneProService.getById(id);
-    }
-
-    /**
-     * 分页查询。
-     *
-     * @param page 分页对象
-     * @return 分页对象
-     */
-    @GetMapping("page")
-    public Page<TbScenePro> page(Page<TbScenePro> page) {
-        return tbSceneProService.page(page);
-    }
-
-}

+ 0 - 96
src/main/java/com/fdkankan/task/controller/TbUserController.java

@@ -1,96 +0,0 @@
-package com.fdkankan.task.controller;
-
-import com.mybatisflex.core.paginate.Page;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.beans.factory.annotation.Autowired;
-import com.fdkankan.task.entity.TbUser;
-import com.fdkankan.task.service.TbUserService;
-import org.springframework.web.bind.annotation.RestController;
-import java.io.Serializable;
-import java.util.List;
-
-/**
- *  控制层。
- *
- * @author Admin
- * @since 2023-12-02
- */
-@RestController
-@RequestMapping("/tbUser")
-public class TbUserController {
-
-    @Autowired
-    private TbUserService tbUserService;
-
-    /**
-     * 添加。
-     *
-     * @param tbUser 
-     * @return {@code true} 添加成功,{@code false} 添加失败
-     */
-    @PostMapping("save")
-    public boolean save(@RequestBody TbUser tbUser) {
-        return tbUserService.save(tbUser);
-    }
-
-    /**
-     * 根据主键删除。
-     *
-     * @param id 主键
-     * @return {@code true} 删除成功,{@code false} 删除失败
-     */
-    @DeleteMapping("remove/{id}")
-    public boolean remove(@PathVariable Serializable id) {
-        return tbUserService.removeById(id);
-    }
-
-    /**
-     * 根据主键更新。
-     *
-     * @param tbUser 
-     * @return {@code true} 更新成功,{@code false} 更新失败
-     */
-    @PutMapping("update")
-    public boolean update(@RequestBody TbUser tbUser) {
-        return tbUserService.updateById(tbUser);
-    }
-
-    /**
-     * 查询所有。
-     *
-     * @return 所有数据
-     */
-    @GetMapping("list")
-    public List<TbUser> list() {
-        return tbUserService.list();
-    }
-
-    /**
-     * 根据主键获取详细信息。
-     *
-     * @param id 主键
-     * @return 详情
-     */
-    @GetMapping("getInfo/{id}")
-    public TbUser getInfo(@PathVariable Serializable id) {
-        return tbUserService.getById(id);
-    }
-
-    /**
-     * 分页查询。
-     *
-     * @param page 分页对象
-     * @return 分页对象
-     */
-    @GetMapping("page")
-    public Page<TbUser> page(Page<TbUser> page) {
-        return tbUserService.page(page);
-    }
-
-}

+ 13 - 3
src/main/java/com/fdkankan/task/jobhandler/zfb/ZfbXxlJob.java

@@ -126,6 +126,7 @@ public class ZfbXxlJob {
                     List<TbCameraInstance> tbCameraInstances = tbCameraInstanceMapper.selectListByQuery(queryWrapper);
                     if(!tbCameraInstances.isEmpty()){
                         logger.info("oldZfbCameraAdd-已存在-error:{}",childName);
+                        continue;
                     }
                     TbCameraInstance tbCameraInstance = new TbCameraInstance();
                     tbCameraInstance.setChildName(childName);
@@ -279,10 +280,19 @@ public class ZfbXxlJob {
 
     public static void main(String[] args) {
         JSONArray jsonArray = new JSONArray();
-        String userName = "13967143520";
+        String userName = "15967035271";
         String[] res = {
-                "THETAYP41148397.OSC",
-                "THETAYP41133486.OSC"
+                "THETAYP41143330.OSC",
+                "THETAYP41143331.OSC",
+                "THETAYP41143332.OSC",
+                "THETAYP41143333.OSC",
+                "THETAYP41143334.OSC",
+                "THETAYP41143335.OSC",
+                "THETAYP41143336.OSC",
+                "THETAYP41143337.OSC",
+                "THETAYP41143338.OSC",
+                "THETAYP41143518.OSC",
+
         };
         for (String re : res) {
             JSONObject jsonObject = new JSONObject();

+ 15 - 17
src/main/resources/application.yml

@@ -4,23 +4,21 @@ server:
     context-path: /
   tomcat:
     max-http-form-post-size: -1
-#spring:
-#  datasource:
-#    type: com.zaxxer.hikari.HikariDataSource          # 数据源类型:HikariCP
-#    driver-class-name: com.mysql.cj.jdbc.Driver          # mysql驱动
-#    #国内正式环境
-#    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
-#    hikari:
-#      connection-timeout: 30000         # 等待连接池分配连接的最大时长(毫秒),超过这个时长还没可用的连接则发生SQLException, 默认:30秒
-#      minimum-idle: 5                   # 最小连接数
-#      maximum-pool-size: 20             # 最大连接数
-#      auto-commit: true                 # 事务自动提交
-#      idle-timeout: 600000              # 连接超时的最大时长(毫秒),超时则被释放(retired),默认:10分钟
-#      pool-name: DateSourceHikariCP     # 连接池名字
-#      max-lifetime: 1800000             # 连接的生命时长(毫秒),超时而且没被使用则被释放(retired),默认:30分钟 1800000ms
-#      connection-test-query: SELECT 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: