|
@ -1250,7 +1250,9 @@ public class MonitorPlatformService {
|
|
|
result.put("iotCount", 0);
|
|
|
result.put("grantCount", 0);
|
|
|
result.put("lostContact", 0);
|
|
|
if (deviceType.contains("1") || deviceType.contains("2")) {
|
|
|
List<String> deviceTypeTmp = Arrays.asList(deviceType.split(",").clone());
|
|
|
|
|
|
if (deviceTypeTmp.contains("1") || deviceTypeTmp.contains("2")) {
|
|
|
StringBuffer sql = new StringBuffer("SELECT a.category_code type,a.device_name,a.c as 'using',b.c-a.c as 'stock',b.c as 'total' from ( ");
|
|
|
StringBuffer sqlCondition = new StringBuffer();
|
|
|
if (org.apache.commons.lang3.StringUtils.isNoneBlank(deviceName)) {
|
|
@ -1340,10 +1342,10 @@ public class MonitorPlatformService {
|
|
|
}
|
|
|
|
|
|
//deviceType包含小屋且设备名称为空||deviceType包含小屋且设备名称为健康小屋。
|
|
|
if ((deviceType.contains("5") && org.apache.commons.lang3.StringUtils.isBlank(deviceName))
|
|
|
|| (deviceType.contains("5") && org.apache.commons.lang3.StringUtils.isNoneBlank(deviceName) && deviceName.contains("健康小屋"))
|
|
|
|| (deviceType.contains("22") && org.apache.commons.lang3.StringUtils.isBlank(deviceName))
|
|
|
|| (deviceType.contains("22") && org.apache.commons.lang3.StringUtils.isNoneBlank(deviceName) && deviceName.contains("智慧药房"))
|
|
|
if ((deviceTypeTmp.contains("5") && org.apache.commons.lang3.StringUtils.isBlank(deviceName))
|
|
|
|| (deviceTypeTmp.contains("5") && org.apache.commons.lang3.StringUtils.isNoneBlank(deviceName) && deviceName.contains("健康小屋"))
|
|
|
|| (deviceTypeTmp.contains("22") && org.apache.commons.lang3.StringUtils.isBlank(deviceName))
|
|
|
|| (deviceTypeTmp.contains("22") && org.apache.commons.lang3.StringUtils.isNoneBlank(deviceName) && deviceName.contains("智慧药房"))
|
|
|
) {
|
|
|
String sql = "select COUNT(*) from xmiot.iot_equipmet_detail";
|
|
|
|
|
@ -1358,19 +1360,43 @@ public class MonitorPlatformService {
|
|
|
JSONObject tmp = new JSONObject();
|
|
|
|
|
|
if ("0".equals(showLevel)) {
|
|
|
String typeTmp = "";
|
|
|
Integer usingTmp = 0;
|
|
|
Integer totalTmp = 0;
|
|
|
Integer stockTmp = 0;
|
|
|
if (deviceTypeTmp.contains("5")&&deviceName.contains("健康小屋")){
|
|
|
if (org.apache.commons.lang3.StringUtils.isBlank(typeTmp)){
|
|
|
typeTmp+="5";
|
|
|
}else {
|
|
|
typeTmp+=",5";
|
|
|
}
|
|
|
usingTmp +=count;
|
|
|
totalTmp +=count;
|
|
|
}
|
|
|
if (deviceTypeTmp.contains("22")&&deviceName.contains("智慧药房")){
|
|
|
if (org.apache.commons.lang3.StringUtils.isBlank(typeTmp)){
|
|
|
typeTmp+="22";
|
|
|
}else {
|
|
|
typeTmp+=",22";
|
|
|
}
|
|
|
usingTmp +=ygusing;
|
|
|
totalTmp +=ygtotal;
|
|
|
stockTmp +=ygstock;
|
|
|
}
|
|
|
|
|
|
tmp.put("device_name", "组合一体机");
|
|
|
tmp.put("Subdivision", true);
|
|
|
tmp.put("using", count + ygusing);
|
|
|
tmp.put("total", count + ygtotal);
|
|
|
tmp.put("type", "5,22");
|
|
|
tmp.put("stock", 0 + ygstock);
|
|
|
tmp.put("using", usingTmp);
|
|
|
tmp.put("total", totalTmp);
|
|
|
tmp.put("type", typeTmp);
|
|
|
tmp.put("stock", stockTmp);
|
|
|
result.getJSONArray("deviceInfo").add(tmp);
|
|
|
tmp.put("showLevel", Integer.parseInt(showLevel));
|
|
|
} else {
|
|
|
/*string用,分割*/
|
|
|
String[] arrays = deviceType.split(",");
|
|
|
for (String string : arrays) {
|
|
|
if ("5".equals(string)) {
|
|
|
if ("5".equals(string)&&deviceName.contains("健康小屋")) {
|
|
|
/*健康小屋*/
|
|
|
tmp.put("device_name", "健康小屋");
|
|
|
tmp.put("Subdivision", false);
|
|
@ -1381,22 +1407,26 @@ public class MonitorPlatformService {
|
|
|
tmp.put("showLevel", Integer.parseInt(showLevel));
|
|
|
result.getJSONArray("deviceInfo").add(tmp);
|
|
|
}
|
|
|
if ("22".equals(string)) {
|
|
|
if ("22".equals(string)&&deviceName.contains("智慧药房")) {
|
|
|
//智慧药房
|
|
|
medicinecabinetCount.put("Subdivision", false);
|
|
|
medicinecabinetCount.put("showLevel", Integer.parseInt(showLevel));
|
|
|
medicinecabinetCount.put("type", 22);
|
|
|
result.getJSONArray("deviceInfo").add(medicinecabinetCount);
|
|
|
result.put("grantCount", result.getInteger("grantCount") + count);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
if (deviceTypeTmp.contains("5")&&deviceName.contains("健康小屋")){
|
|
|
result.put("grantCount", result.getInteger("grantCount") +count);
|
|
|
//统计健康小屋数据/ 小屋全部统计为正常使用
|
|
|
sql = "select count(*) from xmiot.iot_equipmet_detail where device_code in (select DISTINCT sn device_model from xmiot.wlyy_iot_m)";
|
|
|
count = jdbcTemplate.queryForObject(sql, Integer.class);
|
|
|
result.put("iotCount", result.getInteger("iotCount") + count);//小屋物联
|
|
|
}
|
|
|
if (deviceTypeTmp.contains("22")&&deviceName.contains("智慧药房")){
|
|
|
result.put("grantCount", result.getInteger("grantCount") +ygtotal);
|
|
|
}
|
|
|
|
|
|
|
|
|
//统计健康小屋数据/ 小屋全部统计为正常使用
|
|
|
sql = "select count(*) from xmiot.iot_equipmet_detail where device_code in (select DISTINCT sn device_model from xmiot.wlyy_iot_m)";
|
|
|
count = jdbcTemplate.queryForObject(sql, Integer.class);
|
|
|
result.put("iotCount", result.getInteger("iotCount") + count);//小屋物联
|
|
|
}
|
|
|
|
|
|
arrTmp = result.getJSONArray("deviceInfo");
|