Commit 9c2afe93 authored by zhangsen's avatar zhangsen

bug修改

parent f2a68435
......@@ -362,39 +362,41 @@ public class ConfigureController extends AbstractBaseController {
item.put("startAndStopNum", 0);
item.put("update_time", "--");
item.put("equipment_index_name", "--");
String prefix = null;
String suffix = null;
String iotCode = item.get("iot_code").toString();
if (iotCode.length() > 8) {
prefix = iotCode.substring(0, 8);
suffix = iotCode.substring(8);
} else {
throw new BadRequest("装备物联编码错误,请确认!");
}
if (item.containsKey("iot_code") && StringUtil.isNotEmpty(item.get("iot_code"))) {
String prefix = null;
String suffix = null;
String iotCode = item.get("iot_code").toString();
if (iotCode.length() > 8) {
prefix = iotCode.substring(0, 8);
suffix = iotCode.substring(8);
} else {
throw new BadRequest("装备物联编码错误,请确认!");
}
String nowStrLong = DateUtils.getNowStrLong();
Date startDate = DateUtils.dateAddMinutes(null, -4);
String startDateStr = DateUtils.convertDateToString(startDate, DateUtils.DATE_TIME_PATTERN);
ResponseModel entity1 = null;
ResponseModel entity2 = null;
try {
entity1 = iotFeign.selectList(getAppKey(), getProduct(), getToken(), startDateStr, nowStrLong, prefix, suffix, pressurePumpStart);
entity2 = iotFeign.selectList(getAppKey(), getProduct(), getToken(), startDateStr, nowStrLong, prefix, suffix, pressurePumpStop);
} catch (Exception e) {
e.printStackTrace();
}
if (200 == entity1.getStatus() && 200 == entity2.getStatus()) {
String json1 = JSON.toJSONString(entity1.getResult());
List<Map<String, String>> listObject1 = (List<Map<String, String>>) JSONArray.parse(json1);
String json2 = JSON.toJSONString(entity2.getResult());
List<Map<String, String>> listObject2 = (List<Map<String, String>>) JSONArray.parse(json2);
listObject1.addAll(listObject2);
List<Map<String, String>> collect = listObject1.stream().filter(t -> (t.containsKey(pressurePumpStart) && t.get(pressurePumpStart).equals("true")) || (t.containsKey(pressurePumpStop) && t.get(pressurePumpStop).equals("true"))).collect(Collectors.toList());
int num = collect.size();
item.put("startAndStopNum", num);
String nowStrLong = DateUtils.getNowStrLong();
Date startDate = DateUtils.dateAddMinutes(null, -4);
String startDateStr = DateUtils.convertDateToString(startDate, DateUtils.DATE_TIME_PATTERN);
ResponseModel entity1 = null;
ResponseModel entity2 = null;
try {
entity1 = iotFeign.selectList(getAppKey(), getProduct(), getToken(), startDateStr, nowStrLong, prefix, suffix, pressurePumpStart);
entity2 = iotFeign.selectList(getAppKey(), getProduct(), getToken(), startDateStr, nowStrLong, prefix, suffix, pressurePumpStop);
} catch (Exception e) {
e.printStackTrace();
}
if (200 == entity1.getStatus() && 200 == entity2.getStatus()) {
String json1 = JSON.toJSONString(entity1.getResult());
List<Map<String, String>> listObject1 = (List<Map<String, String>>) JSONArray.parse(json1);
String json2 = JSON.toJSONString(entity2.getResult());
List<Map<String, String>> listObject2 = (List<Map<String, String>>) JSONArray.parse(json2);
listObject1.addAll(listObject2);
List<Map<String, String>> collect = listObject1.stream().filter(t -> (t.containsKey(pressurePumpStart) && t.get(pressurePumpStart).equals("true")) || (t.containsKey(pressurePumpStop) && t.get(pressurePumpStop).equals("true"))).collect(Collectors.toList());
int num = collect.size();
item.put("startAndStopNum", num);
}
}
resultMap.put("normalNum", (Integer) item.get("startAndStopNum") <= 1 && Integer.parseInt(String.valueOf(item.get("isAlarm"))) == 0 ? (resultMap.get("normalNum") + 1) : resultMap.get("normalNum"));
resultMap.put("unNormalNum", (Integer) item.get("startAndStopNum") > 1 || Integer.parseInt(String.valueOf(item.get("isAlarm"))) > 0 ? (resultMap.get("unNormalNum") + 1) : resultMap.get("unNormalNum"));
resultMap.put("unNormalNum", (Integer) item.get("startAndStopNum") > 1 || Integer.parseInt(String.valueOf(item.get("isAlarm"))) > 0 ? (resultMap.get("unNormalNum") + 1) : resultMap.get("unNormalNum"));
return item;
}).collect(Collectors.toList());
return CommonResponseUtil.success(resultMap);
......
......@@ -728,7 +728,7 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
String key = entry.getKey();
List<EquipAlarmLineVo> collect = entry.getValue().stream().filter(x -> indexName.equals(x.getIndexName())).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(collect)) {
yData.add(collect.get(0).getTotal());
yData.add(collect.stream().mapToInt(EquipAlarmLineVo::getTotal).sum());
} else {
yData.add(0);
}
......
......@@ -2847,7 +2847,6 @@
LEFT JOIN wl_equipment_specific_alarm esa ON esa.equipment_specific_id = es.id
WHERE
ed.`code` LIKE '92010800%'
AND es.iot_code IS NOT NULL
AND es.biz_org_code like concat(#{bizOrgCode}, '%')
<if test="systemCode!=null and systemCode!=''">
AND fs.code = #{systemCode,jdbcType=VARCHAR}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment