Commit bd2d3fb2 authored by 高建强's avatar 高建强

item:卡片分析右屏bug修改

parent 9c184b81
......@@ -233,39 +233,35 @@ public class EmergencyServiceImpl implements IEmergencyService {
yMap.put("name", name);
Object iotCode = x.get("iotCode");
String prefix = null;
String suffix = null;
if (x.get("iotCode") != null && iotCode.toString().length() > 8) {
prefix = iotCode.toString().substring(0, 8);
suffix = iotCode.toString().substring(8);
ResponseModel responseModel = null;
try {
responseModel = iotFeign.selectListNew(appKey, product, token, prefix, startTime, endTime, null, pressurePumpStart);
} catch (Exception e) {
e.printStackTrace();
}
if (200 == responseModel.getStatus()) {
String json = JSON.toJSONString(responseModel.getResult());
List<Map<String, String>> dataList = (List<Map<String, String>>) JSONArray.parse(json);
if (!CollectionUtils.isEmpty(dataList)) {
Collections.reverse(dataList);
Map<String, List<Map<String, String>>> dataMap = dataList.stream().filter(y -> y.containsKey("createdTime")).collect(Collectors.groupingBy(e -> e.get("createdTime").substring(5, 16)));
timeList.forEach(t -> {
List<Map<String, String>> data = dataMap.get(t);
if (!CollectionUtils.isEmpty(data)) {
List<Map<String, String>> yDataList = data.stream().filter(o -> "true".equals(o.get(pressurePumpStart))).collect(Collectors.toList());
ResponseModel responseModel = iotFeign.selectListNew(appKey, product, token, prefix, startTime, endTime, null, pressurePumpStart);
if (200 == responseModel.getStatus()) {
String json = JSON.toJSONString(responseModel.getResult());
List<Map<String, String>> dataList = (List<Map<String, String>>) JSONArray.parse(json);
if (!CollectionUtils.isEmpty(dataList)) {
Collections.reverse(dataList);
Map<String, List<Map<String, String>>> dataMap = dataList.stream().filter(y -> y.containsKey("createdTime")).collect(Collectors.groupingBy(e -> e.get("createdTime").substring(5, 16)));
List<Map<String, String>> yDataList = null;
for (String t : timeList) {
List<Map<String, String>> data = dataMap.get(t);
if (!CollectionUtils.isEmpty(data)) {
yDataList = data.stream().filter(o -> "true".equalsIgnoreCase(o.get(pressurePumpStart))).collect(Collectors.toList());
}
yList.add(CollectionUtils.isEmpty(yDataList) ? 0 : 1);
} else {
yList.add(0);
}
});
} else {
timeList.forEach(t -> {
yList.add(0);
});
} else {
timeList.forEach(t -> {
yList.add(0);
});
}
}
yMap.put("data", yList);
yData.add(yMap);
} catch (Exception e) {
e.printStackTrace();
}
yMap.put("data", yList);
yData.add(yMap);
}
});
map.put("xData", timeList);
......@@ -319,9 +315,9 @@ public class EmergencyServiceImpl implements IEmergencyService {
AtomicInteger twoNum = new AtomicInteger();
if (!CollectionUtils.isEmpty(specificList)) {
String prefix = null;
String suffix = null;
for (Map<String, Object> x : specificList) {
Object iotCode = x.get("iotCode");
String suffix = null;
if (x.get("iotCode") != null && iotCode.toString().length() > 8) {
prefix = iotCode.toString().substring(0, 8);
suffix = iotCode.toString().substring(8);
......@@ -331,13 +327,13 @@ public class EmergencyServiceImpl implements IEmergencyService {
if (200 == halfResponseModel.getStatus()) {
String json = JSON.toJSONString(halfResponseModel.getResult());
List<Map<String, String>> halfDataList = (List<Map<String, String>>) JSONArray.parse(json);
List<Map<String, String>> halfCollect = halfDataList.stream().filter(o -> "true".equals(o.get(pressurePumpStart))).collect(Collectors.toList());
List<Map<String, String>> halfCollect = halfDataList.stream().filter(o -> "true".equalsIgnoreCase(o.get(pressurePumpStart))).collect(Collectors.toList());
halfNum.addAndGet(halfCollect.size());
}
if (200 == twoResponseModel.getStatus()) {
String json = JSON.toJSONString(twoResponseModel.getResult());
List<Map<String, String>> twoDataList = (List<Map<String, String>>) JSONArray.parse(json);
List<Map<String, String>> twoCollect = twoDataList.stream().filter(o -> "true".equals(o.get(pressurePumpStart))).collect(Collectors.toList());
List<Map<String, String>> twoCollect = twoDataList.stream().filter(o -> "true".equalsIgnoreCase(o.get(pressurePumpStart))).collect(Collectors.toList());
twoNum.addAndGet(twoCollect.size());
}
} catch (Exception e) {
......@@ -353,7 +349,7 @@ public class EmergencyServiceImpl implements IEmergencyService {
List<Map<String, String>> intervalDataList = (List<Map<String, String>>) JSONArray.parse(json);
if (!CollectionUtils.isEmpty(intervalDataList)) {
String value = intervalDataList.get(0).get(pressurePumpStart);
if ("true".equals(value)) {
if ("true".equalsIgnoreCase(value)) {
ResponseModel stopResponseModel = iotFeign.selectOne(appKey, product, token, "1", prefix, null, "false", pressurePumpStart);
if (200 == stopResponseModel.getStatus()) {
String stopJson = JSON.toJSONString(stopResponseModel.getResult());
......
......@@ -1013,22 +1013,16 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
int i = 1;
if (0 < list.size()) {
for (Map<String, Object> m : list) {
List<Map<String, Object>> list1 = new ArrayList();
Map<String, Object> map = new HashMap<>();
Map<String, Object> statusMap = new HashMap<>();
map.put("key", i);
map.put("name", m.get("name"));
map.put("code", m.get("code"));
map.put("systemTypeCode", systemCode);
map.put("img", m.get("shbzImg"));
statusMap.put("name", m.get("status"));
if ("正常".equals(String.valueOf(m.get("status")))) {
statusMap.put("level", "success");
} else {
statusMap.put("level", "warning");
}
list1.add(statusMap);
map.put("status", list1);
map.put("type", m.get("type"));
map.put("status", m.get("status"));
map.put("fullName", m.get("fullName"));
map.put("updateDate", m.get("updateDate").toString().replace("T", " "));
resList.add(map);
i++;
};
......
......@@ -261,10 +261,10 @@
<if test="value != null and value != ''">
AND wesal.equipment_specific_index_value = #{value}
</if>
<if test="isCleanTime != null and isCleanTime = 'false'">
<if test="isCleanTime != null and isCleanTime == 'false'">
AND wesal.clean_time IS NULL
</if>
<if test="isCleanTime != null and isCleanTime = 'true'">
<if test="isCleanTime != null and isCleanTime == 'true'">
AND wesal.clean_time IS NOT NULL
</if>
<if test="bizOrgCode != null and bizOrgCode != ''">
......
......@@ -5575,33 +5575,32 @@
spe.id,
spe.`name`,
spe.`code`,
(
CASE
( SELECT count(*) FROM wl_equipment_specific_alarm wesa WHERE wesa.equipment_specific_id = spe.id AND STATUS = 1 )
WHEN 0 THEN
'正常' ELSE '异常'
END
) `status`,
wle.shbz_img shbzImg
IFNULL( spe.realtime_iot_index_name, '--' ) AS `status`,
wle.shbz_img shbzImg,
ei.is_alarm AS type,
IFNULL( ws.full_name, '--' ) AS fullName,
IFNULL( spe.realtime_iot_index_update_date, '--' ) AS updateDate
FROM
wl_equipment_specific AS spe
LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET( fs.id, spe.system_id )
LEFT JOIN wl_equipment_detail AS det ON spe.equipment_detail_id = det.id
LEFT JOIN wl_equipment AS wle ON wle.id = det.equipment_id
LEFT JOIN wl_equipment_index ei ON spe.realtime_iot_index_id = ei.id
LEFT JOIN wl_warehouse_structure ws ON spe.warehouse_structure_id = ws.id
LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET( fs.id, spe.system_id )
LEFT JOIN wl_equipment_detail AS det ON spe.equipment_detail_id = det.id
LEFT JOIN wl_equipment AS wle ON wle.id = det.equipment_id
WHERE
fs.system_type_code IS NOT NULL
<if test="bizOrgCode != null and bizOrgCode != ''">
AND spe.biz_org_code like concat(#{bizOrgCode}, '%')
</if>
<if test="systemCode != null and systemCode != ''">
AND fs.system_type_code = #{systemCode}
</if>
<if test="categoryCodes != null and categoryCodes.split(',').length >0">
AND
<foreach collection="categoryCodes.split(',')" item="item" index="index" open="(" close=")" separator=" OR ">
LOCATE(#{item}, det.`code`) > 0
</foreach>
</if>
fs.system_type_code IS NOT NULL
<if test="bizOrgCode != null and bizOrgCode != ''">
AND spe.biz_org_code like concat(#{bizOrgCode}, '%')
</if>
<if test="systemCode != null and systemCode != ''">
AND fs.system_type_code = #{systemCode}
</if>
<if test="categoryCodes != null and categoryCodes.split(',').length >0">
AND
<foreach collection="categoryCodes.split(',')" item="item" index="index" open="(" close=")" separator=" OR ">
LOCATE(#{item}, det.`code`) > 0
</foreach>
</if>
GROUP BY spe.id
ORDER BY spe.id
</select>
......
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