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

item:卡片分析右屏bug修改

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