wenhongquan 9 months ago
parent
commit
b61bde683a

+ 2 - 1
ruoyi-modules/ruoyi-khy/src/main/java/org/dromara/system/controller/CommonController.java

@@ -209,7 +209,7 @@ public class CommonController extends TblBaseController {
                         c.put("offline","0");
                         c.put("offline","0");
                         if(((JSONObject)item2).getStr("type").equals("cabinet")){
                         if(((JSONObject)item2).getStr("type").equals("cabinet")){
                            Map offline = CacheUtils.get("offline",((JSONObject)item2).getStr("code"));
                            Map offline = CacheUtils.get("offline",((JSONObject)item2).getStr("code"));
-                           if(offline.keySet().size()>0){
+                           if(offline!=null && offline.keySet().size()>0){
                                c.put("offline","1");
                                c.put("offline","1");
                            }
                            }
                         }
                         }
@@ -218,6 +218,7 @@ public class CommonController extends TblBaseController {
                 }
                 }
             });
             });
         }catch (Exception e){
         }catch (Exception e){
+            log.error(e.getMessage());
 
 
         }
         }
         return devMap;
         return devMap;

+ 2 - 0
ruoyi-modules/ruoyi-khy/src/main/java/org/dromara/util/SPlatUtils.java

@@ -8,6 +8,7 @@ import cn.hutool.http.HttpUtil;
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
 import cn.hutool.json.JSONUtil;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
+import org.dromara.common.log.annotation.Log;
 
 
 import java.util.HashMap;
 import java.util.HashMap;
 import java.util.List;
 import java.util.List;
@@ -44,6 +45,7 @@ public class SPlatUtils {
             params.put("deviceLatitude",i.getStr("location").split(",")[1]);
             params.put("deviceLatitude",i.getStr("location").split(",")[1]);
             HttpResponse response = HttpUtil.createPost(url).header("satoken",token).body(JSONUtil.toJsonStr( params))
             HttpResponse response = HttpUtil.createPost(url).header("satoken",token).body(JSONUtil.toJsonStr( params))
                 .execute();
                 .execute();
+            log.info(response.body());
         }
         }
 
 
     }
     }