Procházet zdrojové kódy

基础搭建添加

523096025 před 3 roky
rodič
revize
4b665d0dda

+ 5 - 3
beeboxs/src/main/java/com/huimv/beeboxs/controller/HiveBaseBeehiveController.java

@@ -1,6 +1,7 @@
 package com.huimv.beeboxs.controller;
 
 
+import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.huimv.beeboxs.common.utils.Result;
 import com.huimv.beeboxs.entity.HiveBaseBeehive;
@@ -46,9 +47,10 @@ public class HiveBaseBeehiveController {
 
 
         HiveBaseStation hex = baseStationService.getOne(new QueryWrapper<HiveBaseStation>().eq("ap_uid_hex", hiveBaseBeehive.getApUidHex()));
-
-        hiveBaseBeehive.setFarmId(hex.getFarmId());
-        hiveBaseBeehive.setApName(hex.getApName());
+        if (ObjectUtil.isNotEmpty(hex)){
+            hiveBaseBeehive.setFarmId(hex.getFarmId());
+            hiveBaseBeehive.setApName(hex.getApName());
+        }
         baseBeehiveService.updateById(hiveBaseBeehive);
         return new Result(10000,"绑定成功",true);
     }

+ 12 - 1
beeboxs/src/main/java/com/huimv/beeboxs/controller/OpenCotroller.java

@@ -4,6 +4,7 @@ import com.huimv.beeboxs.common.token.TokenSign;
 import com.huimv.beeboxs.common.utils.Result;
 import com.huimv.beeboxs.common.utils.ResultCode;
 import com.huimv.beeboxs.entity.SysAccountMultilevel;
+import com.huimv.beeboxs.service.IHiveBaseStationService;
 import com.huimv.beeboxs.service.ILoginService;
 import com.huimv.beeboxs.session.AccessToken;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -14,6 +15,8 @@ import org.springframework.web.bind.annotation.RestController;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
 
 @RestController
 @RequestMapping("/hive")
@@ -22,6 +25,9 @@ public class OpenCotroller {
     @Autowired
     ILoginService iLoginService;
 
+    @Autowired
+    private IHiveBaseStationService baseStationService;
+
     @GetMapping("/token")
     public  Result test(@RequestParam(name = "account") String account,
                         @RequestParam(name = "password") String password,
@@ -59,6 +65,11 @@ public class OpenCotroller {
                         @RequestParam(name = "pageSize") String pageSize,
                         @RequestParam(name = "netstatus") String netstatus){
 
-return null;
+        Map map  = new HashMap();
+        map.put("current",pageNo);
+        map.put("pageSize",pageSize);
+        map.put("",netstatus);
+
+        return baseStationService.searchList(map);
     }
 }