1
zhang
昨天 d35e2accdca4b3762359231f4fe479c9538b6f6f
1
6个文件已删除
4 文件已重命名
16个文件已添加
8个文件已修改
357 ■■■■■ 已修改文件
component/component-Influxdb/pom.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
component/component-Influxdb/src/main/java/com/zy/component/influxdb/config/InfluxDBAutoConfiguration.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
component/component-Influxdb/src/main/java/com/zy/component/influxdb/properties/InfluxDBProperties.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
component/component-Influxdb/src/main/java/com/zy/component/influxdb/service/InfluxDBService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
component/component-Influxdb/src/main/resources/META-INF/additional-spring-configuration-metadata.json 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
component/component-Influxdb/src/main/resources/META-INF/spring.factories 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
component/component-Influxdb/target/classes/META-INF/additional-spring-configuration-metadata.json 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
component/component-Influxdb/target/classes/META-INF/spring-configuration-metadata.json 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
component/component-Influxdb/target/classes/META-INF/spring.factories 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
component/component-Influxdb/target/classes/com/zy/component/influxdb/config/InfluxDBAutoConfiguration.class 补丁 | 查看 | 原始文档 | blame | 历史
component/component-Influxdb/target/classes/com/zy/component/influxdb/properties/InfluxDBProperties.class 补丁 | 查看 | 原始文档 | blame | 历史
component/component-Influxdb/target/classes/com/zy/component/influxdb/service/InfluxDBService.class 补丁 | 查看 | 原始文档 | blame | 历史
component/component-Influxdb/target/classes/com/zy/influxdb/base/BaseTemperature.class 补丁 | 查看 | 原始文档 | blame | 历史
component/component-Influxdb/target/classes/com/zy/influxdb/config/InfluxDBAutoConfiguration.class 补丁 | 查看 | 原始文档 | blame | 历史
component/component-Influxdb/target/classes/com/zy/influxdb/config/InfluxDBProperties.class 补丁 | 查看 | 原始文档 | blame | 历史
component/component-Influxdb/target/classes/com/zy/influxdb/service/InfluxDBService.class 补丁 | 查看 | 原始文档 | blame | 历史
component/component-Influxdb/target/component-Influxdb-1.0.0.jar 补丁 | 查看 | 原始文档 | blame | 历史
component/component-Influxdb/target/maven-archiver/pom.properties 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
component/component-Influxdb/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
component/component-Influxdb/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
component/component-Influxdb/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst 补丁 | 查看 | 原始文档 | blame | 历史
component/component-Influxdb/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-cv/src/main/java/com/zy/core/operation/handler/InOperationHandler.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-hex/pom.xml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-hex/src/main/java/com/zy/acs/hex/HexApplication.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-hex/src/main/java/com/zy/acs/hex/config/MessageConverterConfig.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-hex/src/main/java/com/zy/acs/hex/config/RabbitConfig.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-hex/src/main/java/com/zy/acs/hex/constant/RabbitConstant.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-hex/src/main/java/com/zy/acs/hex/consumer/DownMessageListener.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-hex/src/main/java/com/zy/acs/hex/consumer/MessageListener.java 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-hex/src/main/java/com/zy/acs/hex/consumer/UpMessageListener.java 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-hex/src/main/java/com/zy/acs/hex/consumer/listener/AbstractListener.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-hex/src/main/java/com/zy/acs/hex/controller/TestController.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-hex/src/main/resources/application.yml 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
component/component-Influxdb/pom.xml
@@ -42,11 +42,6 @@
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
component/component-Influxdb/src/main/java/com/zy/component/influxdb/config/InfluxDBAutoConfiguration.java
File was renamed from component/component-Influxdb/src/main/java/com/zy/influxdb/config/InfluxDBAutoConfiguration.java
@@ -1,6 +1,7 @@
package com.zy.influxdb.config;
package com.zy.component.influxdb.config;
import com.influxdb.v3.client.InfluxDBClient;
import com.zy.component.influxdb.properties.InfluxDBProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
component/component-Influxdb/src/main/java/com/zy/component/influxdb/properties/InfluxDBProperties.java
File was renamed from component/component-Influxdb/src/main/java/com/zy/influxdb/config/InfluxDBProperties.java
@@ -1,4 +1,4 @@
package com.zy.influxdb.config;
package com.zy.component.influxdb.properties;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
component/component-Influxdb/src/main/java/com/zy/component/influxdb/service/InfluxDBService.java
File was renamed from component/component-Influxdb/src/main/java/com/zy/influxdb/service/InfluxDBService.java
@@ -1,9 +1,8 @@
package com.zy.influxdb.service;
package com.zy.component.influxdb.service;
import com.influxdb.v3.client.InfluxDBClient;
import com.influxdb.v3.client.Point;
import com.influxdb.v3.client.write.WritePrecision;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -58,6 +57,7 @@
        try {
            // 执行查询
            Stream<Object[]> query = influxDBClient.query(sql);
            logger.info("查询数据:{}", query);
            // 转换为 Map 列表(便于后续处理)
            List<Map<String, Object>> collect = query.map(record -> {
                        Map<String, Object> map = new LinkedHashMap<>();
component/component-Influxdb/src/main/resources/META-INF/additional-spring-configuration-metadata.json
New file
@@ -0,0 +1,10 @@
{
  "properties": [
    {
      "name": "influxdb3.enabled",
      "type": "java.lang.Boolean",
      "description": "Enables influxdb functionality.",
      "defaultValue": "true"
    }
  ]
}
component/component-Influxdb/src/main/resources/META-INF/spring.factories
@@ -1,2 +1 @@
com.zy.influxdb.service.InfluxDBService
org.springframework.boot.autoconfigure.EnableAutoConfiguration=com.zy.component.influxdb.service.InfluxDBService
component/component-Influxdb/target/classes/META-INF/additional-spring-configuration-metadata.json
New file
@@ -0,0 +1,10 @@
{
  "properties": [
    {
      "name": "influxdb3.enabled",
      "type": "java.lang.Boolean",
      "description": "Enables influxdb functionality.",
      "defaultValue": "true"
    }
  ]
}
component/component-Influxdb/target/classes/META-INF/spring-configuration-metadata.json
@@ -14,6 +14,12 @@
      "sourceType": "com.zy.influxdb.config.InfluxDBProperties"
    },
    {
      "name": "influxdb3.enabled",
      "type": "java.lang.Boolean",
      "description": "Enables mqtt functionality.",
      "defaultValue": "true"
    },
    {
      "name": "influxdb3.token",
      "type": "java.lang.String",
      "description": "token",
component/component-Influxdb/target/classes/META-INF/spring.factories
@@ -1,2 +1 @@
com.zy.influxdb.service.InfluxDBService
org.springframework.boot.autoconfigure.EnableAutoConfiguration=com.zy.component.influxdb.service.InfluxDBService
component/component-Influxdb/target/classes/com/zy/component/influxdb/config/InfluxDBAutoConfiguration.class
Binary files differ
component/component-Influxdb/target/classes/com/zy/component/influxdb/properties/InfluxDBProperties.class
Binary files differ
component/component-Influxdb/target/classes/com/zy/component/influxdb/service/InfluxDBService.class
Binary files differ
component/component-Influxdb/target/classes/com/zy/influxdb/base/BaseTemperature.class
Binary files differ
component/component-Influxdb/target/classes/com/zy/influxdb/config/InfluxDBAutoConfiguration.class
Binary files differ
component/component-Influxdb/target/classes/com/zy/influxdb/config/InfluxDBProperties.class
Binary files differ
component/component-Influxdb/target/classes/com/zy/influxdb/service/InfluxDBService.class
Binary files differ
component/component-Influxdb/target/component-Influxdb-1.0.0.jar
Binary files differ
component/component-Influxdb/target/maven-archiver/pom.properties
New file
@@ -0,0 +1,3 @@
artifactId=component-Influxdb
groupId=com.zy
version=1.0.0
component/component-Influxdb/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
New file
@@ -0,0 +1,3 @@
com\zy\component\influxdb\service\InfluxDBService.class
com\zy\component\influxdb\properties\InfluxDBProperties.class
com\zy\component\influxdb\config\InfluxDBAutoConfiguration.class
component/component-Influxdb/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
New file
@@ -0,0 +1,3 @@
D:\office\code\rcs-flow\component\component-Influxdb\src\main\java\com\zy\influxdb\config\InfluxDBProperties.java
D:\office\code\rcs-flow\component\component-Influxdb\src\main\java\com\zy\influxdb\service\InfluxDBService.java
D:\office\code\rcs-flow\component\component-Influxdb\src\main\java\com\zy\influxdb\config\InfluxDBAutoConfiguration.java
component/component-Influxdb/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst
component/component-Influxdb/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst
zy-acs-cv/src/main/java/com/zy/core/operation/handler/InOperationHandler.java
@@ -75,10 +75,10 @@
                            if (job != null) {
                                Integer workNo = staProtocol.getWorkNo();
                                Integer targetSta = inSta.getTargetSta();
//                                staProtocol.setWorkNo(0);
//                                staProtocol.setStaNo(0);
//                                MessageQueue.offer(SlaveType.Devp, 1, new Task(2, staProtocol));
//                                Thread.sleep(1500L);
                                staProtocol.setWorkNo(0);
                                staProtocol.setStaNo(0);
                                MessageQueue.offer(SlaveType.Devp, 1, new Task(2, staProtocol));
                                Thread.sleep(1500L);
                                staProtocol.setWorkNo(workNo);
                                staProtocol.setStaNo(targetSta);
                                boolean result = MessageQueue.offer(SlaveType.Devp, 1, new Task(2, staProtocol));
zy-acs-hex/pom.xml
@@ -16,6 +16,8 @@
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <spring-boot.version>2.5.3</spring-boot.version>
        <fastjson.version>1.2.58</fastjson.version>
        <!-- Dependency Versions -->
        <influxdb-java.version>1.7.0</influxdb-java.version>
    </properties>
@@ -25,6 +27,11 @@
        <artifactId>acs-common</artifactId>
        <version>1.0.0</version>
    </dependency>
        <dependency>
            <groupId>com.zy</groupId>
            <artifactId>component-Influxdb</artifactId>
            <version>1.0.0</version>
        </dependency>
        <!-- SpringBoot Web -->
        <dependency>
zy-acs-hex/src/main/java/com/zy/acs/hex/HexApplication.java
@@ -3,7 +3,9 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
@ComponentScan(basePackages = {"com.zy.component","com.zy.acs"})
@SpringBootApplication
public class HexApplication {
zy-acs-hex/src/main/java/com/zy/acs/hex/config/MessageConverterConfig.java
File was deleted
zy-acs-hex/src/main/java/com/zy/acs/hex/config/RabbitConfig.java
New file
@@ -0,0 +1,31 @@
package com.zy.acs.hex.config;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Slf4j
@Configuration
public class RabbitConfig {
    @Bean
    public RabbitTemplate rabbitTemplate(CachingConnectionFactory connectionFactory) {
        RabbitTemplate rabbitTemplate = new RabbitTemplate(connectionFactory);
        rabbitTemplate.setConfirmCallback((correlationData, ack, cause) -> {
            if (ack) {
                log.info("消息成功发送到Exchange");
            } else {
                log.info("消息发送失败:" + cause);
            }
        });
        // 也可以设置返回类型为mandatory,这样当消息无法路由到任何队列时,会返回给生产者一个Basic.Return。
        rabbitTemplate.setMandatory(true);
        rabbitTemplate.setReturnCallback((message, replyCode, replyText, exchange, routingKey) -> {
            log.info("消息无法路由到队列: " + replyText);
        });
        return rabbitTemplate;
    }
}
zy-acs-hex/src/main/java/com/zy/acs/hex/constant/RabbitConstant.java
File was renamed from zy-acs-hex/src/main/java/com/zy/acs/hex/config/RabbitMQConfig.java
@@ -1,9 +1,4 @@
package com.zy.acs.hex.config;
import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
package com.zy.acs.hex.constant;
/**
@@ -11,9 +6,12 @@
 *
 * @author ken
 */
@Configuration
public class RabbitMQConfig {
public class RabbitConstant {
    public static final String DURABLE = "true";
    public static final String TOPIC_EXCHANGE_TYPE = "topic";
    // ========================== 主题模式 ==========================
    /**
zy-acs-hex/src/main/java/com/zy/acs/hex/consumer/DownMessageListener.java
New file
@@ -0,0 +1,44 @@
package com.zy.acs.hex.consumer;
import com.rabbitmq.client.Channel;
import com.zy.acs.hex.constant.RabbitConstant;
import com.zy.acs.hex.consumer.listener.AbstractListener;
import com.zy.component.influxdb.service.InfluxDBService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.amqp.support.AmqpHeaders;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.handler.annotation.Header;
import org.springframework.stereotype.Component;
/**
 * 消费者
 */
@Slf4j
@Component
@RabbitListener(bindings = @QueueBinding(
        value = @Queue(name = RabbitConstant.TOPIC_QUEUE_DOWN, durable = RabbitConstant.DURABLE),
        exchange = @Exchange(name = RabbitConstant.TOPIC_EXCHANGE,type = RabbitConstant.TOPIC_EXCHANGE_TYPE),
        key = RabbitConstant.ROUTING_KEY_DOWN
))
public class DownMessageListener  implements AbstractListener {
    @Autowired
    private RabbitTemplate rabbitTemplate;
    @Autowired
    private InfluxDBService influxDBService;
    @RabbitHandler
    public void handle(String msg, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long tag) {
        log.info("receive down message: {}" ,  msg);
    }
}
zy-acs-hex/src/main/java/com/zy/acs/hex/consumer/MessageListener.java
File was deleted
zy-acs-hex/src/main/java/com/zy/acs/hex/consumer/UpMessageListener.java
New file
@@ -0,0 +1,56 @@
package com.zy.acs.hex.consumer;
import com.rabbitmq.client.Channel;
import com.zy.acs.hex.constant.RabbitConstant;
import com.zy.acs.hex.consumer.listener.AbstractListener;
import com.zy.component.influxdb.service.InfluxDBService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.amqp.support.AmqpHeaders;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.handler.annotation.Header;
import org.springframework.stereotype.Component;
import java.io.IOException;
/**
 * 消费者
 */
@Slf4j
@Component
@RabbitListener(bindings = @QueueBinding(
        value = @Queue(name = RabbitConstant.TOPIC_QUEUE_UP, durable = RabbitConstant.DURABLE),
        exchange = @Exchange(name = RabbitConstant.TOPIC_EXCHANGE, type = RabbitConstant.TOPIC_EXCHANGE_TYPE),
        key = RabbitConstant.ROUTING_KEY_UP
))
public class UpMessageListener implements AbstractListener {
    @Autowired
    private RabbitTemplate rabbitTemplate;
    @Autowired
    private InfluxDBService influxDBService;
    @RabbitHandler
    public void handle(String msg, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long tag) {
        log.info("receive up message: {}" ,  msg);
        try {
            channel.basicAck(tag,true);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        // 进入消息消费业务逻辑。
        //String data = new String(message.getBody());
        //log.info("收到消息:{}" ,data );
        //influxDBService.writeData();
    }
}
zy-acs-hex/src/main/java/com/zy/acs/hex/consumer/listener/AbstractListener.java
New file
@@ -0,0 +1,9 @@
package com.zy.acs.hex.consumer.listener;
import com.rabbitmq.client.Channel;
import org.springframework.amqp.support.AmqpHeaders;
import org.springframework.messaging.handler.annotation.Header;
public interface AbstractListener {
    void handle(String event, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long tag);
}
zy-acs-hex/src/main/java/com/zy/acs/hex/controller/TestController.java
New file
@@ -0,0 +1,36 @@
package com.zy.acs.hex.controller;
import com.zy.acs.hex.constant.RabbitConstant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@Slf4j
@RequestMapping(value = "/message")
public class TestController {
    @Autowired
    private RabbitTemplate rabbitTemplate;
    /**
     * 发送消息test1
     * @return
     */
    @GetMapping(value = "/test1")
    public void sendTest1() {
        String router = RabbitConstant.ROUTING_KEY_UP.replaceFirst("\\*", "1").replaceFirst("\\*", "2");
        rabbitTemplate.convertAndSend(RabbitConstant.TOPIC_EXCHANGE,router,"1212321323");
    }
    /**
     * 发送消息test2
     * @return
     */
    @GetMapping(value = "/test2")
    public void sendTest2() {
        rabbitTemplate.convertAndSend(RabbitConstant.TOPIC_EXCHANGE, RabbitConstant.ROUTING_KEY_DOWN,  "qswaqsaasas");
    }
}
zy-acs-hex/src/main/resources/application.yml
@@ -6,22 +6,20 @@
  rabbitmq:
    host: localhost
    port: 5672
    username: admin
    password: 123456
    username: root
    password: xltys1995
    # 虚拟host可以不设置,默认/
    virtual-host: /
    # 生产者确认配置
    publisher-confirm-type: correlated
    publisher-returns: true
    # 消费者配置
    listener:
      simple:
        # 手动确认模式
        acknowledge-mode: manual
        # 消费者线程数
        concurrency: 1
        # 最大消费者线程数
        max-concurrency: 5
        # 每次从队列中获取的消息数量
        prefetch: 1
      direct:
        acknowledge-mode: manual
influxdb3:
  enabled: true
  url: http://127.0.0.1:8181
  token: apiv3_Jx1SvmBMV_kikGhc4eZJQbeGmNYN7KX1GdpoR9MClkKzMxSJ0MPKM_O2Xt3o1hVyRikMmlxZ_h9zfy6ybC5Idg
  database: rcs