浏览代码

【feat】 添加对外服务 api

523096025 1 年之前
父节点
当前提交
cbe1162e9f

+ 1 - 1
huimv-eartag2-platform/huimv-eartag2-admin/src/main/java/com/huimv/eartag2/admin/controller/YourApplication.java

@@ -14,7 +14,7 @@ public class YourApplication {
     @Autowired
     private IAppEncryptedService appEncryptedService;
 
-    @Scheduled(cron = "0 0 * * * ?")
+//    @Scheduled(cron = "0 0 * * * ?")
     private   void getMac() throws Exception {
         String macAddress = MacAddressExample.getMACAddress();
         String diskAddress = MacAddressExample.getDiskId();

+ 7 - 0
huimv-eartag2-platform/huimv-eartag2-eartag/src/main/java/com/huimv/eartag2/eartag/listener/EartagListener.java

@@ -70,6 +70,9 @@ public class EartagListener {
 
         //{处理请求报文}
         Map askMap = handleAskText(askText);
+        if (askMap == null){
+            return;
+        }
         String type = askMap.get("type").toString();
         JSONObject dataJo = (JSONObject) askMap.get("data");
         System.out.println("######## eartagJo="+dataJo);
@@ -183,6 +186,10 @@ public class EartagListener {
             dataJo.put("bat", dataArray[3]);
             //耳标温度
             dataJo.put("earTemp", dataArray[4]);
+            if (earTemp<2 ||earTemp >40){
+                System.out.println("温度数据有误,使用上一包数据");
+                return null;
+            }
             dataJo.put("earTemp1", earTemp);
             dataJo.put("earTemp2", earTemp2);
             //环境温度

+ 2 - 2
huimv-eartag2-platform/huimv-eartag2-eartag/src/main/resources/application.properties

@@ -1,8 +1,8 @@
 #spring.profiles.active=test
 #spring.profiles.active=local
 #spring.profiles.active=dev
-spring.profiles.active=prod2
-#spring.profiles.active=prod3
+#spring.profiles.active=prod2
+spring.profiles.active=prod3
 #spring.profiles.active=test2
 
 device.register.prefix=device_register_

+ 1 - 1
huimv-eartag2-platform/huimv-eartag2-manage2/src/main/resources/application.properties

@@ -1,6 +1,6 @@
 #spring.profiles.active=dev2
+#spring.profiles.active=prod3
 spring.profiles.active=prod2
-#spring.profiles.active=prod
 
 # mysql:/cache:
 device.online.access_mode=mysql