瀏覽代碼

mqtt设备列表

tjf 1 周之前
父節點
當前提交
74b25ea75e

+ 6 - 6
ruoyi-admin/src/main/resources/application.yml

@@ -8,7 +8,7 @@ logging:
 user:
   password:
     # 密码最大错误次数
-    maxRetryCount: 5
+    maxRetryCount: 10
     # 密码锁定时间(默认10分钟)
     lockTime: 10
 
@@ -19,8 +19,8 @@ spring:
     # 国际化资源文件路径
     basename: i18n/messages
   profiles:
-          active: druid
-#          active: prod
+#          active: druid
+          active: prod
   # 文件上传
   servlet:
     multipart:
@@ -41,7 +41,7 @@ token:
   # 令牌密钥
   secret: abcdefghijklmnopqrstuvwxyz123
   # 令牌有效期(默认30分钟)
-  expireTime: 720
+  expireTime: 7200
 
 # MyBatis配置
 mybatis:
@@ -76,9 +76,9 @@ xss:
 
 # MQTT配置
 mqtt:
-  server-uri: tcp://13.229.167.76:1883
+#  server-uri: tcp://13.229.167.76:1883
 #  server-uri: tcp://60.171.161.56:20009
-#  server-uri: tcp://127.0.0.1:1883
+  server-uri: tcp://127.0.0.1:1883
 #  server-uri: tcp://192.168.101.147:1883
 #  server-uri: tcp://127.0.0.1:1883
   client-id: JavaClientBoMan

+ 7 - 7
ruoyi-system/src/main/java/com/ruoyi/manage/service/impl/WarnManageServiceImpl.java

@@ -144,13 +144,13 @@ public class WarnManageServiceImpl implements IWarnManageService {
                 }
             }
             //插入当月部门数据
-            Map<Long, List<WarnManage>> deptNameCollect = warnManages.stream().filter( e ->e.getDeptId() != null).collect(Collectors.groupingBy(WarnManage::getDeptId));
+            Map<Long, List<WarnManage>> deptNameCollect = warnManages.stream().filter(e -> e.getDeptId() != null).collect(Collectors.groupingBy(WarnManage::getDeptId));
             List<Map<String, Object>> finalDeptNameMapList = new ArrayList<>();
             deptNameCollect.forEach((deptId, v) -> {
                 Map<String, Object> deptMap = new HashMap<>(3);
                 deptMap.put("deptName", v.get(0).getDeptName());
                 deptMap.put("warnNum", String.valueOf(v.size()));
-                deptMap.put("deptId", deptId);
+                deptMap.put("deptId", deptId.toString());
                 finalDeptNameMapList.add(deptMap);
             });
             deptNameMapList = finalDeptNameMapList;
@@ -177,13 +177,13 @@ public class WarnManageServiceImpl implements IWarnManageService {
                     }
                 }
                 //插入上月部门数据
-                Map<Long, List<WarnManage>> deptNameCollect = warnManagesLast.stream().filter( e ->e.getDeptId() != null).collect(Collectors.groupingBy(WarnManage::getDeptId));
+                Map<Long, List<WarnManage>> deptNameCollect = warnManagesLast.stream().filter(e -> e.getDeptId() != null).collect(Collectors.groupingBy(WarnManage::getDeptId));
                 List<Map<String, Object>> finalDeptNameLastMapList = new ArrayList<>();
                 deptNameCollect.forEach((deptId, v) -> {
                     Map<String, Object> deptMap = new HashMap<>(3);
                     deptMap.put("deptName", v.get(0).getDeptName());
                     deptMap.put("warnNum", String.valueOf(v.size()));
-                    deptMap.put("deptId", deptId);
+                    deptMap.put("deptId", deptId.toString());
                     finalDeptNameLastMapList.add(deptMap);
                 });
                 deptNameLastMapList = finalDeptNameLastMapList;
@@ -209,8 +209,8 @@ public class WarnManageServiceImpl implements IWarnManageService {
                 String warnNumLast = "0";
                 if (!finalDeptNameMapList.isEmpty()) {
                     for (Map<String, Object> lastMonthDeptMap : finalDeptNameMapList) {
-                        String deptIdLast = lastMonthDeptMap.get(deptId).toString();
-                        if (StringUtils.isNotEmpty(deptIdLast)) {
+                        String deptIdLast = lastMonthDeptMap.get(("deptId")).toString();
+                        if (deptId.equals(deptIdLast)) {
                             warnNumLast = lastMonthDeptMap.get("warnNum").toString();
                         }
                     }
@@ -394,7 +394,7 @@ public class WarnManageServiceImpl implements IWarnManageService {
             Long channelId = jsonObject.getLong("channelId");
             String parameterSet = jsonObject.getString("parameterSet");
             String algorithmResult = jsonObject.getString("algorithmResult");
-            String photoUrl = jsonObject.getString("photoUrl");
+            String photoUrl = "http://114.99.51.58:15010/prod-api/profile" + jsonObject.getString("photoUrl");
             String videoUrl = jsonObject.getString("videoUrl");
             String rangName = jsonObject.getString("name");
             WarnManage warnManage = new WarnManage();