Bladeren bron

新增大华(ICC)采集和生态采集2个子工程。

zhuoning 3 jaren geleden
bovenliggende
commit
40ff511a8f
32 gewijzigde bestanden met toevoegingen van 386 en 27 verwijderingen
  1. 31 0
      huimv-farm-device/huimv-farm-business/pom.xml
  2. 20 0
      huimv-farm-device/huimv-farm-business/src/main/java/com/huimv/business/HuimvBusinessApplication.java
  3. 32 0
      huimv-farm-device/huimv-farm-business/src/main/resources/application-dev.yml
  4. 1 0
      huimv-farm-device/huimv-farm-business/src/main/resources/application-prod.yml
  5. 32 0
      huimv-farm-device/huimv-farm-business/src/main/resources/application-test.yml
  6. 20 0
      huimv-farm-device/huimv-farm-business/src/main/resources/application.properties
  7. 6 1
      huimv-farm-device/huimv-farm-cloud-environ/pom.xml
  8. 1 0
      huimv-farm-device/huimv-farm-cloud-environ/src/main/java/com/huimv/environ/client/test/EchoClientHandler.java
  9. 55 0
      huimv-farm-device/huimv-farm-cloud-environ/src/main/java/com/huimv/environ/client/test/RepeaterClient.java
  10. 6 6
      huimv-farm-device/huimv-farm-cloud-environ/src/main/java/com/huimv/environ/service/impl/EnvironImpl.java
  11. 4 1
      huimv-farm-device/huimv-farm-cloud-environ/src/main/java/com/huimv/environ/utils/Const.java
  12. 0 2
      huimv-farm-device/huimv-farm-cloud-environ/src/main/java/com/huimv/environ/utils/DateUtil.java
  13. 1 1
      huimv-farm-device/huimv-farm-cloud-environ/src/main/resources/application-dev.yml
  14. 1 1
      huimv-farm-device/huimv-farm-cloud-environ/src/main/resources/application-prod.yml
  15. 1 1
      huimv-farm-device/huimv-farm-cloud-environ/src/main/resources/application-test.yml
  16. 3 4
      huimv-farm-device/huimv-farm-cloud-environ/src/main/resources/application.properties
  17. 15 0
      huimv-farm-device/huimv-farm-dahua/pom.xml
  18. 20 0
      huimv-farm-device/huimv-farm-dahua/src/main/java/com/huimv/icc/HuimvICCApplication.java
  19. 16 0
      huimv-farm-device/huimv-farm-dahua/src/main/resources/application-dev.yml
  20. 1 0
      huimv-farm-device/huimv-farm-dahua/src/main/resources/application-prod.yml
  21. 20 0
      huimv-farm-device/huimv-farm-dahua/src/main/resources/application.properties
  22. 15 0
      huimv-farm-device/huimv-farm-eco/pom.xml
  23. 20 0
      huimv-farm-device/huimv-farm-eco/src/main/java/com/huimv/eco/HuimvECOApplication.java
  24. 16 0
      huimv-farm-device/huimv-farm-eco/src/main/resources/application-dev.yml
  25. 1 0
      huimv-farm-device/huimv-farm-eco/src/main/resources/application-prod.yml
  26. 20 0
      huimv-farm-device/huimv-farm-eco/src/main/resources/application.properties
  27. 6 1
      huimv-farm-device/huimv-farm-local-weight/pom.xml
  28. 2 2
      huimv-farm-device/huimv-farm-local-weight/src/main/java/com/huimv/weight/server/WeightServerHandler.java
  29. 1 1
      huimv-farm-device/huimv-farm-local-weight/src/main/resources/application-dev.yml
  30. 1 1
      huimv-farm-device/huimv-farm-local-weight/src/main/resources/application-prod.yml
  31. 1 1
      huimv-farm-device/huimv-farm-local-weight/src/main/resources/application-test.yml
  32. 17 4
      huimv-farm-device/pom.xml

+ 31 - 0
huimv-farm-device/huimv-farm-business/pom.xml

@@ -0,0 +1,31 @@
+<?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-farm-device</artifactId>
+        <groupId>com.huimv</groupId>
+        <version>0.0.1-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>huimv-farm-business</artifactId>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>1.2.28</version>
+        </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>
+        </dependency>
+    </dependencies>
+</project>

+ 20 - 0
huimv-farm-device/huimv-farm-business/src/main/java/com/huimv/business/HuimvBusinessApplication.java

@@ -0,0 +1,20 @@
+package com.huimv.business;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.ApplicationContext;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.huimv.biosafety.uface.controller
+ * @Description : TODO
+ * @Version : 1.0
+ * @Author : ZhuoNing
+ * @Create : 2020-12-25
+ **/
+@SpringBootApplication
+public class HuimvBusinessApplication {
+    public static void main(String[] args) {
+        ApplicationContext applicationContext = SpringApplication.run(HuimvBusinessApplication.class, args);
+    }
+}

+ 32 - 0
huimv-farm-device/huimv-farm-business/src/main/resources/application-dev.yml

@@ -0,0 +1,32 @@
+server:
+  port: 8091
+spring:
+  application:
+    name: pigfarm-local-device
+  #------DataSource-----
+  datasource:
+    url: jdbc:mysql://192.168.1.7:3306/huimv-farm-device?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
+    username: root
+    password: hm123456
+    driver-class-name: com.mysql.cj.jdbc.Driver
+#    driver-class-name: com.mysql.jdbc.Driver
+  jpa:
+    hibernate:
+      ddl-auto: update
+    database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
+
+# Socket配置
+#socket:
+  # 监听端口 9001
+#  listen:
+#    #ip: 192.168.16.3
+#    ip: 192.168.1.49
+#    port: 10020
+  # 线程池 - 保持线程数 20
+  #pool-keep: 20
+  # 线程池 - 核心线程数 10
+  #pool-core: 10
+  # 线程池 - 最大线程数 20
+  #pool-max: 30
+  # 线程队列容量 10
+  #pool-queue-init: 10

File diff suppressed because it is too large
+ 1 - 0
huimv-farm-device/huimv-farm-business/src/main/resources/application-prod.yml


+ 32 - 0
huimv-farm-device/huimv-farm-business/src/main/resources/application-test.yml

@@ -0,0 +1,32 @@
+server:
+  port: 8091
+spring:
+  application:
+    name: pigfarm-local-device
+  #------DataSource-----
+  datasource:
+    url: jdbc:mysql://192.168.1.7:3306/huimv-farm-device?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
+    username: root
+    password: hm123456
+    driver-class-name: com.mysql.cj.jdbc.Driver
+#    driver-class-name: com.mysql.jdbc.Driver
+  jpa:
+    hibernate:
+      ddl-auto: update
+    database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
+
+## Socket配置
+#socket:
+#  # 监听端口 9001
+#  listen:
+#    #ip: 192.168.16.3
+#    ip: 192.168.1.49
+#    port: 10020
+  # 线程池 - 保持线程数 20
+  #pool-keep: 20
+  # 线程池 - 核心线程数 10
+  #pool-core: 10
+  # 线程池 - 最大线程数 20
+  #pool-max: 30
+  # 线程队列容量 10
+  #pool-queue-init: 10

+ 20 - 0
huimv-farm-device/huimv-farm-business/src/main/resources/application.properties

@@ -0,0 +1,20 @@
+spring.profiles.active=dev
+#spring.profiles.active=prod
+
+#时间格式配置
+spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
+spring.jackson.time-zone=GMT+8
+
+# 数据中心数据推送地址
+dataCenter.ipAddr=http://115.238.57.190
+dataCenter.port=:10091
+# 日总称重数据服务
+dataCenter.service.dayWeight=/receiver/farm/weight/putDayWeight
+# 批次称重数据服务
+dataCenter.service.batchWeight=/receiver/farm/weight/putBatchWeight
+# 部署牧场ID(base_farm.id)
+local.farmID=1
+# 批次计算间隔
+weight.batch_interval=4
+weight.batch.prefix=W
+weight.batchCode.spacemark=-

+ 6 - 1
huimv-farm-device/huimv-farm-cloud-environ/pom.xml

@@ -33,7 +33,12 @@
             <groupId>mysql</groupId>
             <artifactId>mysql-connector-java</artifactId>
         </dependency>
-
+        <!-- https://mvnrepository.com/artifact/io.netty/netty-all -->
+        <dependency>
+            <groupId>io.netty</groupId>
+            <artifactId>netty-all</artifactId>
+            <version>4.1.16.Final</version>
+        </dependency>
         <!-- jwt -->
         <dependency>
             <groupId>com.auth0</groupId>

+ 1 - 0
huimv-farm-device/huimv-farm-cloud-environ/src/main/java/com/huimv/environ/client/test/EchoClientHandler.java

@@ -20,6 +20,7 @@ import io.netty.util.CharsetUtil;
 public class EchoClientHandler extends SimpleChannelInboundHandler<ByteBuf> {
     @Override
     public void channelActive(ChannelHandlerContext ctx) throws Exception {
+        System.out.println("ctx.name()>>"+ctx.name());
         //当被通知Channel是活跃的时候,发送一条消息
         ctx.writeAndFlush(Unpooled.copiedBuffer("Netty rocks!", CharsetUtil.UTF_8));
     }

+ 55 - 0
huimv-farm-device/huimv-farm-cloud-environ/src/main/java/com/huimv/environ/client/test/RepeaterClient.java

@@ -0,0 +1,55 @@
+package com.huimv.environ.client.test;
+
+
+import io.netty.bootstrap.Bootstrap;
+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.NioSocketChannel;
+
+import java.net.InetSocketAddress;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.huimv.biosafety.uface.controller
+ * @Description : TODO
+ * @Version : 1.0
+ * @Author : ZhuoNing
+ * @Create : 2020-12-25
+ **/
+public class RepeaterClient {
+    private final static String HOST = "36.26.62.70";
+    private final static int PORT = 10010;
+//    private final static int PORT = 10070;
+
+    public void start(String text) {
+        EventLoopGroup group = new NioEventLoopGroup();
+        Bootstrap bootstrap = new Bootstrap();
+        bootstrap.group(group)
+                .channel(NioSocketChannel.class)
+                .remoteAddress(new InetSocketAddress(HOST, PORT))
+                .handler(new ChannelInitializer<SocketChannel>() {
+                    @Override
+                    protected void initChannel(SocketChannel socketChannel) throws Exception {
+                        socketChannel.pipeline().addLast(new EchoClientHandler());
+                    }
+                });
+        try {
+            ChannelFuture f = bootstrap.connect().sync();
+            f.channel().closeFuture().sync();
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }finally {
+            group.shutdownGracefully();
+        }
+    }
+
+    public static void main(String[] args) {
+        RepeaterClient client = new RepeaterClient();
+        String text = "";
+        client.start(text);
+    }
+
+}

+ 6 - 6
huimv-farm-device/huimv-farm-cloud-environ/src/main/java/com/huimv/environ/service/impl/EnvironImpl.java

@@ -184,32 +184,32 @@ public class EnvironImpl implements IEnviron {
             if(new BigDecimal(environJo.getString("adPj")).compareTo(new BigDecimal(thresholdJo.getString("ammonia"))) > -1){
                 String alarmInfo = "当前氨氮数据为"+environJo.getString("adPj")+"高于或等于阈值"+thresholdJo.getString("ammonia")+",特此警告.";
                 //向数据中心发送警报
-                _sendAlarmToCenter(alarmInfo);
+                _sendAlarmToCenter(alarmInfo,Const.TYPE_ALARM_AD);
             }
 
             //环保COD数据>=阈值COD数据
             if(new BigDecimal(environJo.getString("hxxylPj")).compareTo(new BigDecimal(thresholdJo.getString("cOD"))) > -1){
                 String alarmInfo = "当前化学需氧量数据为"+environJo.getString("hxxylPj")+"高于或等于阈值"+thresholdJo.getString("cOD")+",特此警告.";
                 //向数据中心发送警报
-                _sendAlarmToCenter(alarmInfo);
+                _sendAlarmToCenter(alarmInfo,Const.TYPE_ALARM_COD);
             }
             //环保PH数据>=阈值PH数据
             if(new BigDecimal(environJo.getString("phPj")).compareTo(new BigDecimal(thresholdJo.getString("ph"))) > -1){
                 String alarmInfo = "当前PH值数据为"+environJo.getString("phPj")+"高于或等于阈值"+thresholdJo.getString("ph")+",特此警告.";
                 //向数据中心发送警报
-                _sendAlarmToCenter(alarmInfo);
+                _sendAlarmToCenter(alarmInfo,Const.TYPE_ALARM_PH);
             }
             //环保污水浓度数据>=阈值污水浓度数据
             if(new BigDecimal(environJo.getString("wsPj")).compareTo(new BigDecimal(thresholdJo.getString("flow"))) > -1){
                 String alarmInfo = "当前污水浓度数据为"+environJo.getString("wsPj")+"高于或等于阈值"+thresholdJo.getString("flow")+",特此警告.";
                 //向数据中心发送警报
-                _sendAlarmToCenter(alarmInfo);
+                _sendAlarmToCenter(alarmInfo,Const.TYPE_ALARM_WS);
             }
         }
     }
 
     //向数据中心发送警报
-    public void _sendAlarmToCenter(String alarmInfo) throws ParseException {
+    public void _sendAlarmToCenter(String alarmInfo,Integer alarmType) throws ParseException {
         log.info("警报内容>>"+alarmInfo);
         String url = ipAddr + port + alarmService;
         log.info("推送警报地址>>"+url);
@@ -219,7 +219,7 @@ public class EnvironImpl implements IEnviron {
         alarmJo.put("info",alarmInfo);
         alarmJo.put("level", Const.INFO_FIRST_LEVEL);
         alarmJo.put("levelName",Const.INFO_FIRST_LEVEL_ALARM);
-        alarmJo.put("alarmType",Const.INFO_ALARM_TYPE);
+        alarmJo.put("alarmType",alarmType);
         alarmJo.put("warningName",Const.INFO_ALARM_TYPE_NAME);
         alarmJo.put("alarmTime",dateUtil.getTodayText());
         //发送警报

+ 4 - 1
huimv-farm-device/huimv-farm-cloud-environ/src/main/java/com/huimv/environ/utils/Const.java

@@ -19,7 +19,10 @@ public class Const {
     public static final String INFO_THIRD_LEVEL="三级";
     public static final String INFO_THIRD_LEVEL_ALARM="三级警报";
 
-    public static final Integer INFO_ALARM_TYPE = 8;
+    public static final Integer TYPE_ALARM_AD = 17;
+    public static final Integer TYPE_ALARM_COD = 15;
+    public static final Integer TYPE_ALARM_PH = 16;
+    public static final Integer TYPE_ALARM_WS = 18;
     public static final String INFO_ALARM_TYPE_NAME = "环境监测";
 
 }

+ 0 - 2
huimv-farm-device/huimv-farm-cloud-environ/src/main/java/com/huimv/environ/utils/DateUtil.java

@@ -68,8 +68,6 @@ public class DateUtil {
         return date.getTime();
     }
 
-
-
     //
     public Date getTodayDate() throws ParseException {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");

+ 1 - 1
huimv-farm-device/huimv-farm-cloud-environ/src/main/resources/application-dev.yml

@@ -1,5 +1,5 @@
 server:
-  port: 8096
+  port: 8093
 spring:
   application:
     name: huimv-farm-cloud-environ

File diff suppressed because it is too large
+ 1 - 1
huimv-farm-device/huimv-farm-cloud-environ/src/main/resources/application-prod.yml


+ 1 - 1
huimv-farm-device/huimv-farm-cloud-environ/src/main/resources/application-test.yml

@@ -1,5 +1,5 @@
 server:
-  port: 8096
+  port: 8093
   additionalPorts: 8096
   listen:
     port: 8096

+ 3 - 4
huimv-farm-device/huimv-farm-cloud-environ/src/main/resources/application.properties

@@ -4,15 +4,14 @@ spring.profiles.active=prod
 # 时间格式配置
 spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
 spring.jackson.time-zone=GMT+8
-#spring.profiles.active=test
 # 数据中心数据推送地址
 dataCenter.ipAddr=http://115.238.57.190
 dataCenter.port=:10091
 # 小时环境数据服务
-dataCenter.service.hourEnviron=/cloud/environ/putHourEnviron
+dataCenter.service.hourEnviron=/receiver/cloud/environ/putHourEnviron
 # 实时环境数据服务
-dataCenter.service.realTimeEnviron=/cloud/environ/putRealTimeEnviron
+dataCenter.service.realTimeEnviron=/receiver/cloud/environ/putRealTimeEnviron
 # 环境警报服务
-dataCenter.service.alarm=/alarm/environ/putEnvironAlarm
+dataCenter.service.alarm=/receiver/alarm/environ/putEnvironAlarm
 # 部署牧场ID(base_farm.id)
 local.farmID=1

+ 15 - 0
huimv-farm-device/huimv-farm-dahua/pom.xml

@@ -0,0 +1,15 @@
+<?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-farm-device</artifactId>
+        <groupId>com.huimv</groupId>
+        <version>0.0.1-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>huimv-farm-dahua</artifactId>
+
+
+</project>

+ 20 - 0
huimv-farm-device/huimv-farm-dahua/src/main/java/com/huimv/icc/HuimvICCApplication.java

@@ -0,0 +1,20 @@
+package com.huimv.icc;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.ApplicationContext;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.huimv.biosafety.uface.controller
+ * @Description : TODO
+ * @Version : 1.0
+ * @Author : ZhuoNing
+ * @Create : 2020-12-25
+ **/
+@SpringBootApplication
+public class HuimvICCApplication {
+    public static void main(String[] args) {
+        ApplicationContext applicationContext = SpringApplication.run(HuimvICCApplication.class, args);
+    }
+}

+ 16 - 0
huimv-farm-device/huimv-farm-dahua/src/main/resources/application-dev.yml

@@ -0,0 +1,16 @@
+server:
+  port: 8097
+spring:
+  application:
+    name: huimv-farm-dahua
+  #------DataSource-----
+  datasource:
+    url: jdbc:mysql://192.168.1.7:3306/huimv-farm-device?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
+    username: root
+    password: hm123456
+    driver-class-name: com.mysql.cj.jdbc.Driver
+#    driver-class-name: com.mysql.jdbc.Driver
+  jpa:
+    hibernate:
+      ddl-auto: update
+    database-platform: org.hibernate.dialect.MySQL5InnoDBDialect

File diff suppressed because it is too large
+ 1 - 0
huimv-farm-device/huimv-farm-dahua/src/main/resources/application-prod.yml


+ 20 - 0
huimv-farm-device/huimv-farm-dahua/src/main/resources/application.properties

@@ -0,0 +1,20 @@
+spring.profiles.active=dev
+#spring.profiles.active=prod
+
+#时间格式配置
+spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
+spring.jackson.time-zone=GMT+8
+
+# 数据中心数据推送地址
+dataCenter.ipAddr=http://115.238.57.190
+dataCenter.port=:10091
+# 日总称重数据服务
+dataCenter.service.dayWeight=/receiver/farm/weight/putDayWeight
+# 批次称重数据服务
+dataCenter.service.batchWeight=/receiver/farm/weight/putBatchWeight
+# 部署牧场ID(base_farm.id)
+local.farmID=1
+# 批次计算间隔
+weight.batch_interval=4
+weight.batch.prefix=W
+weight.batchCode.spacemark=-

+ 15 - 0
huimv-farm-device/huimv-farm-eco/pom.xml

@@ -0,0 +1,15 @@
+<?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-farm-device</artifactId>
+        <groupId>com.huimv</groupId>
+        <version>0.0.1-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>huimv-farm-eco</artifactId>
+
+
+</project>

+ 20 - 0
huimv-farm-device/huimv-farm-eco/src/main/java/com/huimv/eco/HuimvECOApplication.java

@@ -0,0 +1,20 @@
+package com.huimv.eco;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.ApplicationContext;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.huimv.biosafety.uface.controller
+ * @Description : TODO
+ * @Version : 1.0
+ * @Author : ZhuoNing
+ * @Create : 2020-12-25
+ **/
+@SpringBootApplication
+public class HuimvECOApplication {
+    public static void main(String[] args) {
+        ApplicationContext applicationContext = SpringApplication.run(HuimvECOApplication.class, args);
+    }
+}

+ 16 - 0
huimv-farm-device/huimv-farm-eco/src/main/resources/application-dev.yml

@@ -0,0 +1,16 @@
+server:
+  port: 8099
+spring:
+  application:
+    name: huimv-farm-eco
+  #------DataSource-----
+  datasource:
+    url: jdbc:mysql://192.168.1.7:3306/huimv-farm-device?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
+    username: root
+    password: hm123456
+    driver-class-name: com.mysql.cj.jdbc.Driver
+#    driver-class-name: com.mysql.jdbc.Driver
+  jpa:
+    hibernate:
+      ddl-auto: update
+    database-platform: org.hibernate.dialect.MySQL5InnoDBDialect

File diff suppressed because it is too large
+ 1 - 0
huimv-farm-device/huimv-farm-eco/src/main/resources/application-prod.yml


+ 20 - 0
huimv-farm-device/huimv-farm-eco/src/main/resources/application.properties

@@ -0,0 +1,20 @@
+spring.profiles.active=dev
+#spring.profiles.active=prod
+
+#时间格式配置
+spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
+spring.jackson.time-zone=GMT+8
+
+# 数据中心数据推送地址
+dataCenter.ipAddr=http://115.238.57.190
+dataCenter.port=:10091
+# 日总称重数据服务
+dataCenter.service.dayWeight=/receiver/farm/weight/putDayWeight
+# 批次称重数据服务
+dataCenter.service.batchWeight=/receiver/farm/weight/putBatchWeight
+# 部署牧场ID(base_farm.id)
+local.farmID=1
+# 批次计算间隔
+weight.batch_interval=4
+weight.batch.prefix=W
+weight.batchCode.spacemark=-

+ 6 - 1
huimv-farm-device/huimv-farm-local-weight/pom.xml

@@ -39,6 +39,11 @@
             <version>5.7.16</version>
             <scope>compile</scope>
         </dependency>
-
+        <!-- https://mvnrepository.com/artifact/io.netty/netty-all -->
+        <dependency>
+            <groupId>io.netty</groupId>
+            <artifactId>netty-all</artifactId>
+            <version>4.1.16.Final</version>
+        </dependency>
     </dependencies>
 </project>

+ 2 - 2
huimv-farm-device/huimv-farm-local-weight/src/main/java/com/huimv/weight/server/WeightServerHandler.java

@@ -40,8 +40,8 @@ public class WeightServerHandler extends ChannelInboundHandlerAdapter{
         //处理数据
         weightDataHandle.handleReceiveData(receiveInfo);
 
-        //将接收到的消息写给发送者,而不冲刷出站消息 (应答)
-        ctx.write(in);
+        //将接收到的消息写给发送者,而不冲刷出站消息
+//        ctx.write(in);
     }
 
     @Override

+ 1 - 1
huimv-farm-device/huimv-farm-local-weight/src/main/resources/application-dev.yml

@@ -1,5 +1,5 @@
 server:
-  port: 8097
+  port: 8095
 spring:
   application:
     name: pigfarm-local-device

File diff suppressed because it is too large
+ 1 - 1
huimv-farm-device/huimv-farm-local-weight/src/main/resources/application-prod.yml


+ 1 - 1
huimv-farm-device/huimv-farm-local-weight/src/main/resources/application-test.yml

@@ -1,5 +1,5 @@
 server:
-  port: 8097
+  port: 8095
 spring:
   application:
     name: pigfarm-local-device

+ 17 - 4
huimv-farm-device/pom.xml

@@ -6,6 +6,9 @@
     <modules>
         <module>huimv-farm-local-weight</module>
         <module>huimv-farm-cloud-environ</module>
+        <module>huimv-farm-business</module>
+        <module>huimv-farm-dahua</module>
+        <module>huimv-farm-eco</module>
     </modules>
     <parent>
         <groupId>org.springframework.boot</groupId>
@@ -39,11 +42,21 @@
             <version>1.16.18</version>
             <scope>provided</scope>
         </dependency>
-        <!-- https://mvnrepository.com/artifact/io.netty/netty-all -->
+        <!-- fastjson -->
         <dependency>
-            <groupId>io.netty</groupId>
-            <artifactId>netty-all</artifactId>
-            <version>4.1.16.Final</version>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>1.2.28</version>
+        </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>
         </dependency>
     </dependencies>