|
@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONException;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.huimv.env.admin.common.utils.Result;
|
|
|
import com.huimv.env.admin.common.utils.ResultCode;
|
|
|
import com.huimv.env.admin.common.utils.ResultUtil;
|
|
@@ -135,11 +136,14 @@ public class BasePigpenServiceImpl extends ServiceImpl<BasePigpenMapper, BasePig
|
|
|
Integer offGateway = 0;
|
|
|
Integer onTerminal = 0;
|
|
|
Integer offTerminal = 0;
|
|
|
- Integer infoGateway = 0;//暂时不管
|
|
|
- Integer infoTerminal = 0;//暂时不管
|
|
|
+// Integer infoGateway = 0;//暂时不管
|
|
|
+// Integer infoTerminal = 0;//暂时不管
|
|
|
Integer onPort = 0;
|
|
|
Integer offPort = 0;
|
|
|
- Integer infoPort = 0;
|
|
|
+// Integer infoPort = 0;
|
|
|
+ Integer tempCount = 0;//高温报警
|
|
|
+ Integer chargingCount = 0;//充电报警
|
|
|
+ Integer leakageCount = 0;//漏电报警
|
|
|
QueryWrapper<Gateway> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("location_id", id);
|
|
|
List<Gateway> gateways = gatewayMapper.selectList(queryWrapper);
|
|
@@ -179,22 +183,44 @@ public class BasePigpenServiceImpl extends ServiceImpl<BasePigpenMapper, BasePig
|
|
|
} else {
|
|
|
onPort++;
|
|
|
}
|
|
|
-
|
|
|
+ if (terminal.getHeightTempWarning() == 1) {
|
|
|
+ tempCount++;
|
|
|
+ }
|
|
|
+ if (terminal.getChargingWarning() == 1) {
|
|
|
+ chargingCount++;
|
|
|
+ }
|
|
|
+ if (terminal.getLeakageWarning() == 1) {
|
|
|
+ leakageCount++;
|
|
|
+ }
|
|
|
}
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("onGateway", onGateway);
|
|
|
jsonObject.put("offGateway", offGateway);
|
|
|
jsonObject.put("onTerminal", onTerminal);
|
|
|
jsonObject.put("offTerminal", offTerminal);
|
|
|
- jsonObject.put("infoGateway", infoGateway);
|
|
|
- jsonObject.put("infoTerminal", infoTerminal);
|
|
|
+// jsonObject.put("infoGateway", infoGateway);//
|
|
|
+// jsonObject.put("infoTerminal", infoTerminal);//
|
|
|
jsonObject.put("offPort", offPort);
|
|
|
jsonObject.put("onPort", onPort);
|
|
|
- jsonObject.put("infoPort", infoPort);
|
|
|
+ jsonObject.put("tempCount", tempCount);
|
|
|
+ jsonObject.put("chargingCount", chargingCount);
|
|
|
+ jsonObject.put("leakageCount", leakageCount);
|
|
|
+// jsonObject.put("infoPort", infoPort);
|
|
|
return new Result(ResultCode.SUCCESS,jsonObject);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ public Result getGateway(Map<String, Integer> map) {
|
|
|
+ Integer id = map.get("id");
|
|
|
+ Integer pageNum = map.get("pageNum");
|
|
|
+ Integer pageSize = map.get("pageSize");
|
|
|
+ Page<Gateway> page = new Page(pageNum,pageSize);
|
|
|
+ QueryWrapper<Gateway> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("location_id", id);
|
|
|
+ return new Result(ResultCode.SUCCESS, gatewayMapper.selectPage(page,queryWrapper));
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
public Result list(String farmCode, String buildName, String stageCode, String type) {
|
|
|
QueryWrapper<BasePigpen> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.like(StringUtils.isNotBlank(buildName), "build_name", buildName);
|