|
@@ -1,5 +1,6 @@
|
|
package com.huimv.beeboxs.controller;
|
|
package com.huimv.beeboxs.controller;
|
|
|
|
|
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.huimv.beeboxs.common.token.TokenSign;
|
|
import com.huimv.beeboxs.common.token.TokenSign;
|
|
import com.huimv.beeboxs.common.utils.Result;
|
|
import com.huimv.beeboxs.common.utils.Result;
|
|
@@ -40,6 +41,9 @@ public class OpenCotroller {
|
|
return new Result(ResultCode.SUCCESS,null);
|
|
return new Result(ResultCode.SUCCESS,null);
|
|
}
|
|
}
|
|
List<BaseHiveFarm> location = baseHiveFarmService.list(new QueryWrapper<BaseHiveFarm>().like("location", areaId));
|
|
List<BaseHiveFarm> location = baseHiveFarmService.list(new QueryWrapper<BaseHiveFarm>().like("location", areaId));
|
|
|
|
+ if (ObjectUtil.isEmpty(location)){
|
|
|
|
+ return new Result(ResultCode.SUCCESS,null);
|
|
|
|
+ }
|
|
List<Integer> farmIds = new ArrayList<>();
|
|
List<Integer> farmIds = new ArrayList<>();
|
|
for (BaseHiveFarm baseHiveFarm : location) {
|
|
for (BaseHiveFarm baseHiveFarm : location) {
|
|
farmIds.add( baseHiveFarm.getId());
|
|
farmIds.add( baseHiveFarm.getId());
|
|
@@ -74,11 +78,21 @@ public class OpenCotroller {
|
|
return new Result(ResultCode.SUCCESS,endMap);
|
|
return new Result(ResultCode.SUCCESS,endMap);
|
|
}
|
|
}
|
|
List<BaseHiveFarm> location = baseHiveFarmService.list(new QueryWrapper<BaseHiveFarm>().like("location", areaId));
|
|
List<BaseHiveFarm> location = baseHiveFarmService.list(new QueryWrapper<BaseHiveFarm>().like("location", areaId));
|
|
|
|
+ if (ObjectUtil.isEmpty(location)){
|
|
|
|
+ Map endMap = new HashMap();
|
|
|
|
+ endMap.put("stationNum",0);
|
|
|
|
+ endMap.put("onStationNum",0);
|
|
|
|
+ endMap.put("offStationNum",0);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return new Result(ResultCode.SUCCESS,endMap);
|
|
|
|
+ }
|
|
List<Integer> farmIds = new ArrayList<>();
|
|
List<Integer> farmIds = new ArrayList<>();
|
|
for (BaseHiveFarm baseHiveFarm : location) {
|
|
for (BaseHiveFarm baseHiveFarm : location) {
|
|
farmIds.add( baseHiveFarm.getId());
|
|
farmIds.add( baseHiveFarm.getId());
|
|
}
|
|
}
|
|
QueryWrapper<HiveBaseBeehive> wrapper = new QueryWrapper<>();
|
|
QueryWrapper<HiveBaseBeehive> wrapper = new QueryWrapper<>();
|
|
|
|
+
|
|
wrapper.in("farm_id",farmIds);
|
|
wrapper.in("farm_id",farmIds);
|
|
wrapper.eq("type",2);
|
|
wrapper.eq("type",2);
|
|
|
|
|