Kaynağa Gözat

新建环境控制平台

zhuoning 2 yıl önce
ebeveyn
işleme
1269f63228

+ 73 - 0
huimv-env-platform/huimv-env-common/pom.xml

@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>huimv-env-platform</artifactId>
+        <groupId>com.huimv</groupId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <packaging>jar</packaging>
+    <groupId>com.huimv</groupId>
+    <artifactId>huimv-env-common</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+
+    <distributionManagement>
+        <repository>
+            <id>rdc-releases</id>
+            <url>https://repo.rdc.aliyun.com/repository/136471-release-drEU5y/</url>
+        </repository>
+        <snapshotRepository>
+            <id>rdc-snapshots</id>
+            <url>https://repo.rdc.aliyun.com/repository/136471-snapshot-WhviYl/</url>
+        </snapshotRepository>
+    </distributionManagement>
+
+    <dependencies>
+        <!--Mybatis-Plus生成器依赖-->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-generator</artifactId>
+        </dependency>
+        <!--freemarker 模板引擎(没有用原生的模板引擎)-->
+        <dependency>
+            <groupId>org.freemarker</groupId>
+            <artifactId>freemarker</artifactId>
+        </dependency>
+        <!--mybits-plus-->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+        </dependency>
+        <!-- mybatis-plus-extension -->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-extension</artifactId>
+        </dependency>
+        <!-- 连接池 -->
+        <dependency>
+            <!--自动配置-->
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+        </dependency>
+        <!-- velocity -->
+        <dependency>
+            <groupId>org.apache.velocity</groupId>
+            <artifactId>velocity-engine-core</artifactId>
+        </dependency>
+        <!-- freemarker -->
+<!--        <dependency>-->
+<!--            <groupId>org.springframework.boot</groupId>-->
+<!--            <artifactId>spring-boot-starter-freemarker</artifactId>-->
+<!--        </dependency>-->
+        <!-- junit -->
+        <dependency>
+            <groupId>org.junit.platform</groupId>
+            <artifactId>junit-platform-commons</artifactId>
+        </dependency>
+
+    </dependencies>
+
+</project>

+ 31 - 0
huimv-env-platform/huimv-env-common/src/main/java/com/huimv/env/common/utils/RegexUtil.java

@@ -0,0 +1,31 @@
+package com.huimv.env.common.utils;
+
+import org.springframework.stereotype.Component;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.huimv.biosafety.uface.controller
+ * @Description : TODO
+ * @Version : 1.0
+ * @Author : ZhuoNing
+ * @Create : 2020-12-25
+ **/
+@Component
+public class RegexUtil {
+
+    //计算+出现的次数
+    public int countPlus(String str) {//创建countSpace方法用于统计文本的空格个数
+        int count = 0;//创建一个返回值count
+//        Pattern p = Pattern.compile("\\s");//将给定的正则表达式编译并赋予给Pattern类
+        Pattern p = Pattern.compile("\\+");//将给定的正则表达式编译并赋予给Pattern类
+        Matcher m = p.matcher(str);//生成一个给定命名的Matcher对象
+        while(m.find()){//查找类似于Matcher对象的字符
+            count++;//count自加作为标记
+        }
+        return count;//返回count值
+    }
+
+}

+ 115 - 0
huimv-env-platform/huimv-env-common/src/test/java/com/huimv/env/common/CodeGenerator.java

@@ -0,0 +1,115 @@
+package com.huimv.env.common;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.huimv.biosafety.uface.controller
+ * @Description : TODO
+ * @Version : 1.0
+ * @Author : ZhuoNing
+ * @Create : 2020-12-25
+ **/
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.core.exceptions.MybatisPlusException;
+import com.baomidou.mybatisplus.generator.AutoGenerator;
+import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
+import com.baomidou.mybatisplus.generator.config.GlobalConfig;
+import com.baomidou.mybatisplus.generator.config.PackageConfig;
+import com.baomidou.mybatisplus.generator.config.StrategyConfig;
+import com.baomidou.mybatisplus.generator.config.rules.DateType;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import org.junit.platform.commons.util.StringUtils;
+
+import java.util.Scanner;
+
+public class CodeGenerator {
+
+
+    public static String scanner(String tip) {
+        Scanner scanner = new Scanner(System.in);
+        StringBuilder help = new StringBuilder();
+        help.append("请输入" + tip + ":");
+        System.out.println(help.toString());
+        if (scanner.hasNext()) {
+            String ipt = scanner.next();
+            if (StringUtils.isNotBlank(ipt)) {
+                return ipt;
+            }
+        }
+        throw new MybatisPlusException("请输入正确的" + tip + "!");
+    }
+
+    public static void main(String[] args) {
+        // 代码生成器
+        AutoGenerator mpg = new AutoGenerator();
+
+        // 全局配置
+        GlobalConfig gc = new GlobalConfig();
+        String projectPath = System.getProperty("user.dir");
+        //sample
+//        projectPath+="/registration-center";
+        // manager
+        projectPath+="/huimv-env-common";
+        System.out.println("projectPath>>"+projectPath);
+        gc.setOutputDir(projectPath + "/src/main/java");//设置代码生成路径
+        gc.setFileOverride(true);//是否覆盖以前文件
+        gc.setOpen(false);//是否打开生成目录
+        gc.setAuthor("zn");//设置项目作者名称
+        gc.setIdType(IdType.AUTO);//设置主键策略
+        gc.setBaseResultMap(true);//生成基本ResultMap
+        gc.setBaseColumnList(true);//生成基本ColumnList
+        gc.setServiceName("%sService");//去掉服务默认前缀
+        gc.setDateType(DateType.ONLY_DATE);//设置时间类型
+        mpg.setGlobalConfig(gc);
+
+        // 数据源配置
+        DataSourceConfig dsc = new DataSourceConfig();
+        dsc.setUrl("jdbc:mysql://192.168.1.7:3306/huimv-demo-eartag20?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai");
+        dsc.setDriverName("com.mysql.cj.jdbc.Driver");
+        dsc.setUsername("root");
+        dsc.setPassword("hm123456");
+        mpg.setDataSource(dsc);
+
+        // 包配置
+        PackageConfig pc = new PackageConfig();
+        pc.setParent("com.huimv.eartag2.manage2");
+        pc.setMapper("mapper");
+        pc.setXml("mapper.xml");
+        pc.setEntity("pojo");
+        pc.setService("service");
+        pc.setServiceImpl("service.impl");
+        pc.setController("controller");
+        mpg.setPackageInfo(pc);
+
+        // 策略配置
+        StrategyConfig sc = new StrategyConfig();
+        sc.setNaming(NamingStrategy.underline_to_camel);
+        sc.setColumnNaming(NamingStrategy.underline_to_camel);
+        sc.setEntityLombokModel(true);//自动lombok
+        sc.setRestControllerStyle(true);
+        sc.setControllerMappingHyphenStyle(true);
+
+        sc.setLogicDeleteFieldName("deleted");//设置逻辑删除
+
+        //设置自动填充配置
+//        TableFill gmt_create = new TableFill("create_time", FieldFill.INSERT);
+//        TableFill gmt_modified = new TableFill("update_time", FieldFill.INSERT_UPDATE);
+//        ArrayList<TableFill> tableFills=new ArrayList<>();
+//        tableFills.add(gmt_create);
+//        tableFills.add(gmt_modified);
+//        sc.setTableFillList(tableFills);
+
+        //乐观锁
+        sc.setVersionFieldName("version");
+        sc.setRestControllerStyle(true);//驼峰命名
+
+
+
+        //  sc.setTablePrefix("tbl_"); 设置表名前缀
+        sc.setInclude(scanner("表名,多个英文逗号分割").split(","));
+        mpg.setStrategy(sc);
+
+        // 生成代码
+        mpg.execute();
+    }
+
+}

+ 99 - 0
huimv-env-platform/huimv-env-input/pom.xml

@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>huimv-env-platform</artifactId>
+        <groupId>com.huimv</groupId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.huimv</groupId>
+    <artifactId>huimv-env-input</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+
+    <dependencies>
+        <!-- 排除Tomcat容器 -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+            <!-- 移除掉默认支持的 Tomcat -->
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-tomcat</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <!-- 添加 Undertow 容器 -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-undertow</artifactId>
+        </dependency>
+        <!-- JPA -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-jpa</artifactId>
+        </dependency>
+        <!-- mysql -->
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <version>6.0.6</version>
+        </dependency>
+        <!--rabbitmq-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-amqp</artifactId>
+        </dependency>
+        <!-- redis -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+        </dependency>
+        <!-- actuator -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <!-- fastjson -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.huimv</groupId>
+            <artifactId>huimv-env-common</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-resources-plugin</artifactId>
+                <version>2.6</version>
+            </plugin>
+        </plugins>
+    </build>
+</project>

+ 26 - 0
huimv-env-platform/huimv-env-input/src/main/java/com/huimv/env/input/HuimvEnvInputApplication.java

@@ -0,0 +1,26 @@
+package com.huimv.env.input;
+
+import com.huimv.env.input.server.EnvInputServer;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.ComponentScans;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.huimv.biosafety.uface.controller
+ * @Description : TODO
+ * @Version : 1.0
+ * @Author : ZhuoNing
+ * @Create : 2020-12-25
+ **/
+@ComponentScans({@ComponentScan("com.huimv.env.common.utils")})
+@SpringBootApplication
+public class HuimvEnvInputApplication {
+    public static void main(String[] args) throws InterruptedException {
+        ApplicationContext applicationContext = SpringApplication.run(HuimvEnvInputApplication.class, args);
+        // EnvInputServer
+        applicationContext.getBean(EnvInputServer.class).run();
+    }
+}

+ 74 - 0
huimv-env-platform/huimv-env-input/src/main/java/com/huimv/env/input/server/EnvInputServer.java

@@ -0,0 +1,74 @@
+package com.huimv.env.input.server;
+
+import io.netty.bootstrap.ServerBootstrap;
+import io.netty.channel.ChannelFuture;
+import io.netty.channel.ChannelInitializer;
+import io.netty.channel.EventLoopGroup;
+import io.netty.channel.nio.NioEventLoopGroup;
+import io.netty.channel.socket.SocketChannel;
+import io.netty.channel.socket.nio.NioServerSocketChannel;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.huimv.biosafety.uface.controller
+ * @Description : TODO
+ * @Version : 1.0
+ * @Author : ZhuoNing
+ * @Create : 2020-12-25
+ **/
+@Component
+public class EnvInputServer {
+    @Autowired
+    private EnvInputServerHandler serverHandler;
+    //监听端口
+    private int port = 8012;
+    //创建构造方法
+    public EnvInputServer(){
+    }
+
+    public static void main(String[] args) throws InterruptedException {
+        new EnvInputServer().run();
+    }
+/**
+ *
+ * 功能描述: 启动方法前台多个服务  处理多个线程
+ *
+ * @param:
+ * @return:
+ * @auther: LiGang
+ * @date: 2019/3/26 11:31
+ */
+    /**
+     * 启动流程
+     */
+    public void run() throws InterruptedException {
+        //配置服务端线程组
+        EventLoopGroup bossGroup=new NioEventLoopGroup();
+        EventLoopGroup workGroup=new NioEventLoopGroup();
+
+        try{
+            //引导整个server的启动
+            ServerBootstrap serverBootstrap = new ServerBootstrap();
+            serverBootstrap.group(bossGroup,workGroup)
+                    .channel(NioServerSocketChannel.class)    //指定处理的连接类型
+                    .childHandler(new ChannelInitializer<SocketChannel>() {
+                        @Override
+                        protected void initChannel(SocketChannel socketChannel) throws Exception {
+                            socketChannel.pipeline().addLast(serverHandler);
+                        }
+                    });
+            System.out.println("# 耳标及采集器设备数据接收服务器已经启动,监听端口(Port):"+port);
+            System.out.println("# 准备接收数据:");
+            //绑定端口,同步等待成功
+            ChannelFuture cf = serverBootstrap.bind(port).sync();
+            // 等待服务端监听端口关闭
+            cf.channel().closeFuture().sync();
+        }finally {
+            //优雅的退出
+            bossGroup.shutdownGracefully();
+            workGroup.shutdownGracefully();
+        }
+    }
+}

+ 258 - 0
huimv-env-platform/huimv-env-input/src/main/java/com/huimv/env/input/server/EnvInputServerHandler.java

@@ -0,0 +1,258 @@
+package com.huimv.env.input.server;
+
+import com.alibaba.fastjson.JSONArray;
+import com.huimv.env.common.utils.RegexUtil;
+import io.netty.buffer.ByteBuf;
+import io.netty.buffer.Unpooled;
+import io.netty.channel.ChannelHandler;
+import io.netty.channel.ChannelHandlerContext;
+import io.netty.channel.ChannelInboundHandlerAdapter;
+import io.netty.util.CharsetUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.text.ParseException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.huimv.biosafety.uface.controller
+ * @Description : TODO
+ * @Version : 1.0
+ * @Author : ZhuoNing
+ * @Create : 2020-12-25
+ **/
+@ChannelHandler.Sharable
+@Component
+@Slf4j
+public class EnvInputServerHandler extends ChannelInboundHandlerAdapter {
+    @Autowired
+    private RegexUtil regexUtil;
+    private StringBuilder askTextSb = null;
+    private int num = 0;
+
+    //
+    public void appendClientAsk(String text){
+        if(this.askTextSb == null){
+            askTextSb = new StringBuilder();
+        }
+        askTextSb.append(text);
+    }
+
+    @Override
+    public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
+        ByteBuf data = (ByteBuf) msg;
+        String clientAskText = data.toString(CharsetUtil.UTF_8);
+//        System.out.println((++num)+"次, 客户端消息clientAskText>>"+clientAskText);
+        //保存实例内的客户端请求
+        appendClientAsk(clientAskText);
+        //临时写入耳标数据到文件
+//        writeTxt(clientAskText,"all");
+    }
+
+    @Override
+    public void channelReadComplete(ChannelHandlerContext ctx) throws Exception {
+//        ctx.writeAndFlush("111");
+//        System.out.println("EchoServerHandle channelReadComplete");
+        if(askTextSb.toString().indexOf("end") != -1){
+//            System.out.println("askTextSb.内容()>>"+askTextSb.toString());
+//            System.out.println("askTextSb.内容长度>>"+askTextSb.length());
+//            System.out.println("输入完成.");
+            // 处理客户端消息
+            handleClientEartagMessage(askTextSb.toString(),ctx);
+            //清空重置;
+            askTextSb.delete(0,askTextSb.length());
+            num = 0;
+//            System.out.println("清空sb实例. 长度>>"+askTextSb.length());
+        }
+    }
+
+    @Override
+    public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
+//        System.out.println("cause.getMessage()>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"+cause.getMessage());
+        if(cause.getMessage().indexOf("Connection reset") != -1){
+            log.info("相关采集器设备正在重启:"+cause.toString());
+        }
+//        cause.printStackTrace();
+        ctx.close();
+    }
+
+    /**
+     * @Method      : handleClientMessage
+     * @Description : 处理请求小心
+     * @Params      : [clientAskText, ctx]
+     * @Return      : void
+     * 
+     * @Author      : ZhuoNing
+     * @Date        : 2022/3/28       
+     * @Time        : 17:36
+     */
+    private void handleClientEartagMessage(String clientAskText,ChannelHandlerContext ctx) throws ParseException, IOException {
+        clientAskText = clientAskText.replaceAll("\r","").replaceAll("\n","");
+
+        //{}
+        int countPlus = regexUtil.countPlus(clientAskText);
+        if (countPlus < 4) {
+            System.out.println("当前数据为不完整数据,故丢弃.>>" + clientAskText);
+        } else {
+            //--处理客户端请求数据
+            //{拆分粘包数据}
+            JSONArray askJa = getPerData(clientAskText);
+            for (int a = 0; a < askJa.size(); a++) {
+                String askText = askJa.getString(a);
+//                if (dataInputFlow == 1) {
+//                    //{处理请求内容}
+//                    handleAskText(askText, ctx);
+//                } else {
+                    //{处理请求内容2}
+                    handleAskText2(askText, ctx);
+//                }
+            }
+        }
+    }
+
+    /**
+     * @Method : handleAskText2
+     * @Description :
+     * @Params : [askText, ctx]
+     * @Return : void
+     * @Author : ZhuoNing
+     * @Date : 2022/3/23
+     * @Time : 18:08
+     */
+    private void handleAskText2(String askText, ChannelHandlerContext ctx) throws ParseException, IOException {
+        String[] dataArray = askText.split("\\+");
+        String cmdHeader = dataArray[0];
+        //芯片id/设备编码
+        String idCode = dataArray[1];
+        String cmd = dataArray[2];
+        Map map = new HashMap();
+        map.put("askText", askText);
+        if (cmdHeader.trim().equalsIgnoreCase("hm")) {
+            //采集器应答数据
+            if (cmd.trim().equalsIgnoreCase("0")) {
+                //不需要处理
+                System.out.println("==>命令0");
+            } else if (cmd.trim().equalsIgnoreCase("1")) {
+//                System.out.println("==>命令1请求 askText>>" + askText.trim());
+//                //处理获取设备编码命令
+//                //{读取设备编码}
+//                String deviceCode = dataService.getDeviceCodeByChipId(idCode);
+//                log.info("获取设备编码结果,芯片id>>" + idCode + " ,deviceCode>>" + deviceCode);
+//                if (deviceCode != null) {
+//                    String answer = "hm+1+0+" + deviceCode + "+123+8+end";
+//                    log.info(">>命令1设备编码-应答数据>>" + answer);
+//                    ctx.writeAndFlush(Unpooled.copiedBuffer(answer.getBytes()));
+//                } else {
+//                    log.error("检测到未注册的采集器设备,已舍弃请求.");
+//                }
+            } else if (cmd.trim().equalsIgnoreCase("2")) {
+//                System.out.println("==>命令2获取服务器时间请求 askText>>" + askText);
+//                if (dataService.isEffectiveDevice(idCode)) {
+//                    //处理服务器时间命令
+//                    String answer = "hm+2+" + dateUtil.getNowText() + "+4+end";
+//                    log.info(">>命令2服务器时间-应答数据>>" + answer);
+//                    ctx.writeAndFlush(Unpooled.copiedBuffer(answer.getBytes()));
+//                }else {
+//                    System.out.println("##获取服务器时间-无效设备编码 idCode=" + idCode);
+//                }
+            } else if (cmd.trim().equalsIgnoreCase("3")) {
+//                System.out.println("==>命令3心跳包请求 askText>>" + askText);
+//                //处理心跳包命令
+//                //{设备心跳应答}
+//                if (dataService.isEffectiveDevice(idCode)) {
+//                    String answer = "hm+3+6+end";
+//                    log.info(">>命令3心跳包-应答数据>>" + answer);
+//                    ctx.writeAndFlush(Unpooled.copiedBuffer(answer.getBytes()));
+//
+//                    //{发送到设备处理消息队列}
+//                    dataService.sendDeviceMQ(map);
+//                    log.info(">>发送设备心跳数据消息到MQ."+map);
+//                } else {
+//                    System.out.println("##心跳包-无效设备编码(" + idCode+"),请求拒绝。");
+//                }
+            } else if (cmd.trim().equalsIgnoreCase("4")) {
+                System.out.println("==>命令4环境温度请求 askText>>" + askText);
+                //处理设备环境温度命令
+                //{设备环境温度应答}
+//                if (dataService.isEffectiveDevice(idCode)) {
+//                    String answer = "hm+4+7+end";
+//                    log.info(">>命令4环境温度-应答数据>>" + answer);
+//                    ctx.writeAndFlush(Unpooled.copiedBuffer(answer.getBytes()));
+//
+//                    //{发送到设备处理消息队列}
+//                    dataService.sendDeviceMQ(map);
+//                    log.info(">>发送设备环境温度数据消息到MQ."+map);
+//                } else {
+//                    System.out.println("##环境温度-无效设备编码(" + idCode+"),请求拒绝。");
+//                }
+            } else {
+                System.out.println("==>未知命令");
+                log.error(">>当前数据为非法数据>>" + askText);
+            }
+        } else if (cmdHeader.trim().equalsIgnoreCase("zj")) {
+            System.out.println("==>耳标命令请求 askText>>"+askText);
+            //测试-临时写入耳标数据到文件
+            if(askText.trim().indexOf("330110002000002") != -1){
+//                writeTxt(askText,"input");
+            }
+            //耳标应答数据(不需要应答)
+//            if (checkValidEarmark(cmd)) {
+//                log.error(">>舍弃掉未配置耳标号的耳标," + askText + "");
+//            } else {
+                //{检查设备是否在处于工作状态或待机状态}
+//                if (dataService.isWorkStatusDevice(idCode)) {
+//                if (dataService.isEffectiveDevice(idCode)) {
+//                    //{发送到耳标处理消息队列}
+//                    dataService.sendEartagMQ(map);
+//                    log.info(">>发送耳标数据消息到MQ."+map);
+//                }else{
+//                    System.out.println("无效设备编码 idCode="+idCode);
+//                }
+//            }
+        } else {
+            System.out.println("==>未知命令");
+            log.error("##当前请求数据为非法数据>>" + askText);
+        }
+    }
+
+    //检查无效耳标
+    public boolean checkValidEarmark(String earmark) {
+        if (earmark.trim().equalsIgnoreCase("ffffffffffffffff") || earmark.trim().equalsIgnoreCase("0000000000000000")) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    //拆分粘包数据
+    public JSONArray getPerData(String text) {
+        String key = "end";
+        Pattern pattern = Pattern.compile(key);
+        Matcher matcher = pattern.matcher(text);
+        int count = 0;
+        while (matcher.find()) {
+            count++;
+        }
+        JSONArray dataJa = new JSONArray();
+        if (count == 1) {
+            dataJa.add(text);
+        } else {
+            for (int a = 0; a < count; a++) {
+                int p1 = text.indexOf("end");
+                dataJa.add(text.substring(0, p1 + 3));
+                text = text.substring(p1 + 3, text.length());
+            }
+        }
+        return dataJa;
+    }
+}

+ 104 - 0
huimv-env-platform/huimv-env-input/src/main/resources/application-dev.yml

@@ -0,0 +1,104 @@
+server:
+  port: 8090
+
+spring:
+  application:
+    name: huimv-eartag2-input
+
+  datasource:
+    url: jdbc:mysql://192.168.1.7:3306/huimv-demo-eartag20?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
+    username: root
+    password: hm123456
+    driver-class-name: com.mysql.cj.jdbc.Driver
+  jpa:
+    show-sql: true
+    database: mysql
+    hibernate:
+      ddl-auto: update
+    database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
+    open-in-view: true
+
+  #配置rabbitMq 服务器
+#  rabbitmq:
+#    host: 10.0.0.4
+#    port: 5672
+#    username: huimv
+#    password: hm123456
+#    #虚拟host 可以不设置,使用server默认host
+#    virtual-host: /
+  rabbitmq:
+    host: 192.168.1.82
+    port: 5672
+    username: admin
+    password: admin
+    #虚拟host 可以不设置,使用server默认host
+    virtual-host: /
+
+    #确认消息已发送到交换机(Exchange)
+#    publisher-confirms: true #(过时、弃用)
+    publisher-confirm-type: correlated
+    #确认消息已发送到队列(Queue)
+    publisher-returns: true
+
+  #redis
+  redis:
+    database: 0
+    host: 192.168.1.68
+    port: 6379
+    password: hm123456
+    timeout: 5000ms
+    jedis:
+      pool:
+        max-active: 20
+        max-wait: -1
+        max-idle: 10
+        min-idle: 0
+    lettuce:
+      pool:
+        max-active: 3
+        min-idle: 2
+        max-idle: 3
+        max-wait: 1
+      shutdown-timeout: 100
+
+  data:
+    redis:
+      repositories:
+        enabled: false
+
+  #是否缓存空值
+  cache:
+    redis:
+      cache-null-values: false
+
+
+
+    #server:
+#  port: 9110
+#spring:
+#  application:
+#    name: huimv-hy-autoGetData
+#
+#  datasource:
+##    url: jdbc:mysql://47.98.175.112:3306/huimv_ql_farm_haiyan?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
+#    #    url: jdbc:mysql://36.22.189.214:3306/huimv_ql_farm?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
+#        url: jdbc:mysql://192.168.1.7:3306/huimv_ql_farm?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
+#    username: root
+#    password: hm123456
+#    driver-class-name: com.mysql.cj.jdbc.Driver
+#  jpa:
+#    properties:
+#      hibernate:
+#        enable_lazy_load_no_trans: true
+#    show-sql: true
+#    database: mysql
+#    hibernate:
+#      ddl-auto: update
+#    database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
+#    open-in-view: true
+management:
+  endpoints:
+    web:
+      exposure:
+        include: "*"   # * 在yaml 文件属于关键字,所以需要加引号
+

+ 104 - 0
huimv-env-platform/huimv-env-input/src/main/resources/application-test.yml

@@ -0,0 +1,104 @@
+server:
+  port: 8090
+
+spring:
+  application:
+    name: huimv-eartag2-input
+
+  datasource:
+    url: jdbc:mysql://192.168.1.7:3306/huimv-demo-eartag20?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
+    username: root
+    password: hm123456
+    driver-class-name: com.mysql.cj.jdbc.Driver
+  jpa:
+    show-sql: true
+    database: mysql
+    hibernate:
+      ddl-auto: update
+    database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
+    open-in-view: true
+
+  #配置rabbitMq 服务器
+#  rabbitmq:
+#    host: 10.0.0.4
+#    port: 5672
+#    username: huimv
+#    password: hm123456
+#    #虚拟host 可以不设置,使用server默认host
+#    virtual-host: /
+  rabbitmq:
+    host: 192.168.1.82
+    port: 5672
+    username: admin
+    password: admin
+    #虚拟host 可以不设置,使用server默认host
+    virtual-host: /
+
+    #确认消息已发送到交换机(Exchange)
+#    publisher-confirms: true #(过时、弃用)
+    publisher-confirm-type: correlated
+    #确认消息已发送到队列(Queue)
+    publisher-returns: true
+
+  #redis
+  redis:
+    database: 0
+    host: 192.168.1.68
+    port: 6379
+    password: hm123456
+    timeout: 5000ms
+    jedis:
+      pool:
+        max-active: 20
+        max-wait: -1
+        max-idle: 10
+        min-idle: 0
+    lettuce:
+      pool:
+        max-active: 3
+        min-idle: 2
+        max-idle: 3
+        max-wait: 1
+      shutdown-timeout: 100
+
+  data:
+    redis:
+      repositories:
+        enabled: false
+
+  #是否缓存空值
+  cache:
+    redis:
+      cache-null-values: false
+
+
+
+    #server:
+#  port: 9110
+#spring:
+#  application:
+#    name: huimv-hy-autoGetData
+#
+#  datasource:
+##    url: jdbc:mysql://47.98.175.112:3306/huimv_ql_farm_haiyan?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
+#    #    url: jdbc:mysql://36.22.189.214:3306/huimv_ql_farm?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
+#        url: jdbc:mysql://192.168.1.7:3306/huimv_ql_farm?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
+#    username: root
+#    password: hm123456
+#    driver-class-name: com.mysql.cj.jdbc.Driver
+#  jpa:
+#    properties:
+#      hibernate:
+#        enable_lazy_load_no_trans: true
+#    show-sql: true
+#    database: mysql
+#    hibernate:
+#      ddl-auto: update
+#    database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
+#    open-in-view: true
+management:
+  endpoints:
+    web:
+      exposure:
+        include: "*"   # * 在yaml 文件属于关键字,所以需要加引号
+

+ 31 - 0
huimv-env-platform/huimv-env-input/src/main/resources/application.properties

@@ -0,0 +1,31 @@
+spring.profiles.active=dev
+
+#开启健康监控
+management.endpoints.web.exposure.include=*
+
+#########################################################
+###             配置undertow取代tomcat                ###
+#########################################################
+# 是否打开 undertow 日志,默认为 false
+server.undertow.accesslog.enabled=false
+# 设置访问日志所在目录
+server.undertow.accesslog.dir=logs
+# 指定工作者线程的 I/0 线程数,默认为 2 或者 CPU 的个数
+server.undertow.io-threads=
+# 指定工作者线程个数,默认为 I/O 线程个数的 8 倍
+server.undertow.worker-threads=
+# 设置 HTTP POST 内容的最大长度,默认不做限制
+server.undertow.max-http-post-size=0
+
+#########################################################
+###   Actuator Monitor  --   Actuator configuration   ###
+#########################################################
+management.security.enabled=false
+
+# 数据处理流程
+data.input.flow=2
+
+# 是否写入测试数据(1:写入 0:不写入)
+data.test.input=0
+
+

+ 24 - 0
huimv-env-platform/huimv-env-input/src/main/resources/assembly.xml

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<assembly>
+    <id>jar-with-dependencies</id>
+    <formats>
+        <format>jar</format>
+    </formats>
+    <includeBaseDirectory>false</includeBaseDirectory>
+    <dependencySets>
+        <!-- 默认的配置 -->
+        <dependencySet>
+            <outputDirectory>/</outputDirectory>
+            <useProjectArtifact>true</useProjectArtifact>
+            <unpack>true</unpack>
+            <scope>runtime</scope>
+        </dependencySet>
+        <!-- 增加scope类型为system的配置 -->
+        <dependencySet>
+            <outputDirectory>/</outputDirectory>
+            <useProjectArtifact>true</useProjectArtifact>
+            <unpack>true</unpack>
+            <scope>system</scope>
+        </dependencySet>
+    </dependencySets>
+</assembly>

+ 116 - 0
huimv-env-platform/huimv-env-manage/pom.xml

@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>huimv-env-platform</artifactId>
+        <groupId>com.huimv</groupId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.huimv</groupId>
+    <artifactId>huimv-env-manage</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <!-- 排除Tomcat容器 -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+            <!-- 移除掉默认支持的 Tomcat -->
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-tomcat</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <!-- 添加 Undertow 容器 -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-undertow</artifactId>
+        </dependency>
+        <!-- JPA -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-jpa</artifactId>
+        </dependency>
+        <!-- mysql -->
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <version>6.0.6</version>
+        </dependency>
+        <!--Mybatis-Plus生成器依赖-->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-generator</artifactId>
+        </dependency>
+        <!--freemarker 模板引擎(没有用原生的模板引擎)-->
+        <dependency>
+            <groupId>org.freemarker</groupId>
+            <artifactId>freemarker</artifactId>
+        </dependency>
+        <!--mybits-plus-->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+        </dependency>
+        <!-- mybatis-plus-extension -->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-extension</artifactId>
+        </dependency>
+        <!-- 连接池 -->
+        <dependency>
+            <!--自动配置-->
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+        </dependency>
+        <!-- velocity -->
+        <dependency>
+            <groupId>org.apache.velocity</groupId>
+            <artifactId>velocity-engine-core</artifactId>
+        </dependency>
+        <!-- freemarker -->
+<!--        <dependency>-->
+<!--            <groupId>org.springframework.boot</groupId>-->
+<!--            <artifactId>spring-boot-starter-freemarker</artifactId>-->
+<!--        </dependency>-->
+        <!-- junit -->
+        <dependency>
+            <groupId>org.junit.platform</groupId>
+            <artifactId>junit-platform-commons</artifactId>
+        </dependency>
+        <!--rabbitmq-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-amqp</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-resources-plugin</artifactId>
+                <version>2.6</version>
+            </plugin>
+        </plugins>
+    </build>
+</project>

+ 34 - 0
huimv-env-platform/huimv-env-manage/src/main/java/com/huimv/env/manage/HuimvEnvManageApplication.java

@@ -0,0 +1,34 @@
+package com.huimv.env.manage;
+
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Import;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.web.client.RestTemplate;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.huimv.biosafety.uface.controller
+ * @Description : TODO
+ * @Version : 1.0
+ * @Author : ZhuoNing
+ * @Create : 2020-12-25
+ **/
+@SpringBootApplication
+@EnableScheduling
+@MapperScan("com.huimv.env.common.mapper")
+//@Import(InterceptorConfig.class)
+public class HuimvEnvManageApplication {
+    public static void main(String[] args) throws InterruptedException {
+
+        ApplicationContext applicationContext =   SpringApplication.run(HuimvEnvManageApplication.class, args);
+//        applicationContext.getBean(EartagServer.class).run();
+    }
+    @Bean
+    public static RestTemplate getRestTemplate(){
+        return new RestTemplate();
+    }
+}

+ 113 - 0
huimv-env-platform/huimv-env-manage/src/main/resources/application-dev.yml

@@ -0,0 +1,113 @@
+server:
+  port: 8096
+spring:
+  application:
+    name: huimv-eartag2-manage
+
+  datasource:
+    url: jdbc:mysql://192.168.1.7:3306/huimv-demo-eartag20?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
+    username: root
+    password: hm123456
+    driver-class-name: com.mysql.cj.jdbc.Driver
+  jpa:
+    show-sql: true
+    database: mysql
+    hibernate:
+      ddl-auto: update
+
+    database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
+    open-in-view: true
+
+
+  #配置rabbitMq 服务器
+#  rabbitmq:
+#    host: 10.0.0.4
+#    port: 5672
+#    username: huimv
+#    password: hm123456
+#    #虚拟host 可以不设置,使用server默认host
+#    virtual-host: /
+  #redis
+#  redis:
+#    database: 0
+#    host: 192.168.1.68
+#    port: 6379
+#    password: hm123456
+#    timeout: 5000ms
+#    jedis:
+#      pool:
+#        max-active: 20
+#        max-wait: -1
+#        max-idle: 10
+#        min-idle: 0
+#    lettuce:
+#      pool:
+#        max-active: 3
+#        min-idle: 2
+#        max-idle: 3
+#        max-wait: 1
+#      shutdown-timeout: 100
+
+#  data:
+#    redis:
+#      repositories:
+#        enabled: false
+
+  #是否缓存空值
+#  cache:
+#    redis:
+#      cache-null-values: false
+    #server:
+#  port: 9110
+#spring:
+#  application:
+#    name: huimv-hy-autoGetData
+#
+#  datasource:
+##    url: jdbc:mysql://47.98.175.112:3306/huimv_ql_farm_haiyan?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
+#    #    url: jdbc:mysql://36.22.189.214:3306/huimv_ql_farm?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
+#        url: jdbc:mysql://192.168.1.7:3306/huimv_ql_farm?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
+#    username: root
+#    password: hm123456
+#    driver-class-name: com.mysql.cj.jdbc.Driver
+#  jpa:
+#    properties:
+#      hibernate:
+#        enable_lazy_load_no_trans: true
+#    show-sql: true
+#    database: mysql
+#    hibernate:
+#      ddl-auto: update
+#    database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
+#    open-in-view: true
+
+  rabbitmq:
+    host: 121.36.134.218
+    port: 5672
+    username: admin
+    password: admin
+    #虚拟host 可以不设置,使用server默认host
+    virtual-host: /registration_center
+    listener:
+      simple:
+        acknowledge-mode: none
+
+  #redis
+  redis:
+    database: 0
+    host: 122.112.224.199
+    port: 6379
+    password: hm123456
+    timeout: 5000ms
+    jedis:
+      pool:
+        max-active: 20
+        max-wait: -1
+        max-idle: 10
+        min-idle: 0
+
+mybatis-plus:
+  configuration:
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+  # mapper.xml文件所存放的位置
+  mapper-locations: classpath*:com/huimv/eartag2/manage2/mapper/xml/*.xml  # 不加这一行出错:“org.apache.ibatis.binding.BindingException:  Invalid bound statement (not found)”

+ 39 - 0
huimv-env-platform/huimv-env-manage/src/main/resources/application.properties

@@ -0,0 +1,39 @@
+spring.profiles.active=dev2
+#spring.profiles.active=prod2
+
+# mysql:/cache:
+device.online.access_mode=mysql
+
+# ��ӻ������豸����ʱ��
+cache.chipIdExpire=48
+
+#
+service.farmAllStatus.url=/deviceController/updateFarmAllStatus
+service.farmAllStatus.host=192.168.1.68
+service.farmAllStatus.ip=8092
+
+###################################################����undertowȡ��tomcat
+# �Ƿ�� undertow ��־��Ĭ��Ϊ false
+server.undertow.accesslog.enabled=false
+# ���÷�����־����Ŀ¼
+server.undertow.accesslog.dir=logs
+# ָ���������̵߳� I/0 �߳�����Ĭ��Ϊ 2 ���� CPU �ĸ���
+server.undertow.io-threads=
+# ָ���������̸߳�����Ĭ��Ϊ I/O �̸߳����� 8 ��
+server.undertow.worker-threads=
+# ���� HTTP POST ���ݵ���󳤶ȣ�Ĭ�ϲ�������
+server.undertow.max-http-post-size=0
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ 161 - 0
huimv-env-platform/pom.xml

@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>2.6.2</version>
+    </parent>
+
+    <groupId>com.huimv</groupId>
+    <artifactId>huimv-env-platform</artifactId>
+    <packaging>pom</packaging>
+    <version>1.0-SNAPSHOT</version>
+    <modules>
+        <module>huimv-env-common</module>
+        <module>huimv-env-input</module>
+        <module>huimv-env-manage</module>
+    </modules>
+
+    <properties>
+        <java.version>1.8</java.version>
+        <maven.compile>1.8</maven.compile>
+        <druid.version>1.1.14</druid.version>
+        <junit.version>4.13.2</junit.version>
+        <hutool.version>5.8.1</hutool.version>
+        <velocity.version>2.0</velocity.version>
+        <lombok.version>1.16.18</lombok.version>
+        <netty.version>4.1.45.Final</netty.version>
+        <fastjson.version>1.2.28</fastjson.version>
+        <httpClient.version>4.5.5</httpClient.version>
+        <servletApi.version>3.1.0</servletApi.version>
+        <freemarker.version>2.3.31</freemarker.version>
+        <commonsLang3.version>3.7</commonsLang3.version>
+        <mybatisPlus.version>3.4.3.4</mybatisPlus.version>
+        <huimvCommon.version>0.0.6-SNAPSHOT</huimvCommon.version>
+        <huimvEnvCommon.version>0.0.1-SNAPSHOT</huimvEnvCommon.version>
+        <junitPlatformCommons.version>1.8.2</junitPlatformCommons.version>
+        <mybatisPlusGenerator.version>3.3.2</mybatisPlusGenerator.version>
+        <mybatisPlusExtension.version>3.5.2</mybatisPlusExtension.version>
+    </properties>
+
+    <dependencyManagement>
+        <dependencies>
+            <!-- fastjson -->
+            <dependency>
+                <groupId>com.alibaba</groupId>
+                <artifactId>fastjson</artifactId>
+                <version>${fastjson.version}</version>
+            </dependency>
+            <!-- mysql -->
+            <dependency>
+                <groupId>mysql</groupId>
+                <artifactId>mysql-connector-java</artifactId>
+            </dependency>
+            <!--hutool-->
+            <dependency>
+                <groupId>cn.hutool</groupId>
+                <artifactId>hutool-all</artifactId>
+                <version>${hutool.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.httpcomponents</groupId>
+                <artifactId>httpclient</artifactId>
+                <version>${httpClient.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>junit</groupId>
+                <artifactId>junit</artifactId>
+                <scope>test</scope>
+                <version>${junit.version}</version>
+            </dependency>
+            <!-- lombok -->
+            <dependency>
+                <groupId>org.projectlombok</groupId>
+                <artifactId>lombok</artifactId>
+                <version>${lombok.version}</version>
+                <scope>compile</scope>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.commons</groupId>
+                <artifactId>commons-lang3</artifactId>
+                <version>${commonsLang3.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>javax.servlet</groupId>
+                <artifactId>javax.servlet-api</artifactId>
+                <version>${servletApi.version}</version>
+            </dependency>
+            <!--Mybatis-Plus生成器依赖-->
+            <dependency>
+                <groupId>com.baomidou</groupId>
+                <artifactId>mybatis-plus-generator</artifactId>
+                <version>${mybatisPlusGenerator.version}</version>
+            </dependency>
+            <!--freemarker 模板引擎(没有用原生的模板引擎)-->
+            <dependency>
+                <groupId>org.freemarker</groupId>
+                <artifactId>freemarker</artifactId>
+                <version>${freemarker.version}</version>
+            </dependency>
+            <!--mybits-plus-->
+            <dependency>
+                <groupId>com.baomidou</groupId>
+                <artifactId>mybatis-plus-boot-starter</artifactId>
+                <version>${mybatisPlus.version}</version>
+            </dependency>
+            <!-- mybatis-plus-extension -->
+            <dependency>
+                <groupId>com.baomidou</groupId>
+                <artifactId>mybatis-plus-extension</artifactId>
+                <version>${mybatisPlusExtension.version}</version>
+            </dependency>
+            <!-- 连接池 -->
+            <dependency>
+                <!--自动配置-->
+                <groupId>com.alibaba</groupId>
+                <artifactId>druid-spring-boot-starter</artifactId>
+                <version>${druid.version}</version>
+            </dependency>
+            <!-- velocity -->
+            <dependency>
+                <groupId>org.apache.velocity</groupId>
+                <artifactId>velocity-engine-core</artifactId>
+                <version>${velocity.version}</version>
+            </dependency>
+            <!-- freemarker -->
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-starter-freemarker</artifactId>
+            </dependency>
+            <!-- netty -->
+            <dependency>
+                <groupId>io.netty</groupId>
+                <artifactId>netty-all</artifactId>
+                <version>${netty.version}</version>
+            </dependency>
+            <!-- junit -->
+            <dependency>
+                <groupId>org.junit.platform</groupId>
+                <artifactId>junit-platform-commons</artifactId>
+                <version>${junitPlatformCommons.version}</version>
+            </dependency>
+            <!-- 二方包统一版本管理 -->
+            <dependency>
+                <groupId>com.huimv</groupId>
+                <artifactId>huimv-common</artifactId>
+                <version>${huimvCommon.version}</version>
+            </dependency>
+            <!-- 一方包统一版本管理 -->
+            <dependency>
+                <groupId>com.huimv</groupId>
+                <artifactId>huimv-env-common</artifactId>
+                <version>${huimvEnvCommon.version}</version>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+</project>