Commit c056f165 authored by KeYong's avatar KeYong

修改bug

parent 03b40294
...@@ -205,7 +205,7 @@ ...@@ -205,7 +205,7 @@
cwr.is_delete = 1 cwr.is_delete = 1
AND cwr.resource_type = #{map.fireHydrant} AND cwr.resource_type = #{map.fireHydrant}
<if test="map.bizOrgCode != null and map.bizOrgCode != ''"> <if test="map.bizOrgCode != null and map.bizOrgCode != ''">
AND cwr.biz_org_code = #{map.bizOrgCode} AND cwr.biz_org_code LIKE concat(#{map.bizOrgCode}, '%')
</if> </if>
) AS fireHydrant, ) AS fireHydrant,
( (
...@@ -217,7 +217,7 @@ ...@@ -217,7 +217,7 @@
cwr.is_delete = 1 cwr.is_delete = 1
AND cwr.resource_type = #{map.firePool} AND cwr.resource_type = #{map.firePool}
<if test="map.bizOrgCode != null and map.bizOrgCode != ''"> <if test="map.bizOrgCode != null and map.bizOrgCode != ''">
AND cwr.biz_org_code = #{map.bizOrgCode} AND cwr.biz_org_code LIKE concat(#{map.bizOrgCode}, '%')
</if> </if>
) AS firePool, ) AS firePool,
( (
...@@ -229,7 +229,7 @@ ...@@ -229,7 +229,7 @@
cwr.is_delete = 1 cwr.is_delete = 1
AND cwr.resource_type = #{map.fireWaterTank} AND cwr.resource_type = #{map.fireWaterTank}
<if test="map.bizOrgCode != null and map.bizOrgCode != ''"> <if test="map.bizOrgCode != null and map.bizOrgCode != ''">
AND cwr.biz_org_code = #{map.bizOrgCode} AND cwr.biz_org_code LIKE concat(#{map.bizOrgCode}, '%')
</if> </if>
) AS fireWaterTank ) AS fireWaterTank
</select> </select>
......
...@@ -528,23 +528,15 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate ...@@ -528,23 +528,15 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
} }
List<Map> mapList = JSONObject.parseArray(json, Map.class); List<Map> mapList = JSONObject.parseArray(json, Map.class);
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
mapList.forEach(x -> map.put(String.valueOf(x.get("name")), x.get("type"))); mapList.forEach(x -> map.put(String.valueOf(x.get("nameKey")), x.get("type")));
map.put("bizOrgCode", bizOrgCode); map.put("bizOrgCode", bizOrgCode);
Map<String, Object> result = waterResourceMapper.getWaterResourceInfoList(map); Map<String, Object> result = waterResourceMapper.getWaterResourceInfoList(map);
List<Map<String, Object>> list = new ArrayList<>(); List<Map<String, Object>> list = new ArrayList<>();
result.keySet().forEach(x -> { mapList.forEach(y -> {
Map<String, Object> tempMap = new HashMap<>(); Map<String, Object> tempMap = new HashMap<>();
if ("fireHydrant".equals(String.valueOf(x))) { tempMap.put("name", y.get("name"));
tempMap.put("name", "消火栓"); tempMap.put("code", y.get("nameKey"));
tempMap.put("total", result.get("fireHydrant")); tempMap.put("total", result.get(y.get("nameKey")));
} else if ("firePool".equals(String.valueOf(x))) {
tempMap.put("name", "消防水池");
tempMap.put("total", result.get("firePool"));
} else {
tempMap.put("name", "消防水箱");
tempMap.put("total", result.get("fireWaterTank"));
}
tempMap.put("code", x);
list.add(tempMap); list.add(tempMap);
}); });
return list; return list;
......
...@@ -618,7 +618,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -618,7 +618,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
List<Map<String, Object>> getSystemAlarmInfoList(@Param("startDate") String startDate, @Param("endDate") String endDate); List<Map<String, Object>> getSystemAlarmInfoList(@Param("startDate") String startDate, @Param("endDate") String endDate);
List<Map<String, Object>> getSystemCountInfo(); Map<String, Object> getSystemCountInfo();
Map<String, Object> getSystemRunningInfoList(); Map<String, Object> getSystemRunningInfoList();
......
...@@ -1947,27 +1947,18 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -1947,27 +1947,18 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
} }
List<Map> mapList = JSONObject.parseArray(json, Map.class); List<Map> mapList = JSONObject.parseArray(json, Map.class);
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
mapList.forEach(x -> map.put(String.valueOf(x.get("name")), x.get("code"))); mapList.forEach(x -> map.put(String.valueOf(x.get("nameKey")), x.get("code")));
map.put("bizOrgCode", bizOrgCode); map.put("bizOrgCode", bizOrgCode);
Map<String, Object> result = equipmentSpecificMapper.getEquipmentStatisticsInfo(map); Map<String, Object> result = equipmentSpecificMapper.getEquipmentStatisticsInfo(map);
List<Map<String, Object>> list = new ArrayList<>(); List<Map<String, Object>> list = new ArrayList<>();
result.keySet().forEach(x -> { mapList.forEach(y -> {
Map<String, Object> tempMap = new HashMap<>(); Map<String, Object> tempMap = new HashMap<>();
if ("extinguisher".equals(String.valueOf(x))) { tempMap.put("name", y.get("name"));
tempMap.put("name", "灭火器"); tempMap.put("code", y.get("nameKey"));
tempMap.put("total", result.get("extinguisher")); tempMap.put("total", result.get(y.get("nameKey")));
} else if ("car".equals(String.valueOf(x))) {
tempMap.put("name", "消防车");
tempMap.put("total", result.get("car"));
} else {
tempMap.put("name", "泡沫罐");
tempMap.put("total", result.get("foamtank"));
}
tempMap.put("code", x);
list.add(tempMap); list.add(tempMap);
}); });
return list; return list;
} }
@Override @Override
......
...@@ -106,6 +106,9 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -106,6 +106,9 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
@Value("classpath:/json/systemIndex.json") @Value("classpath:/json/systemIndex.json")
private Resource systemIndex; private Resource systemIndex;
@Value("classpath:/json/systemCode.json")
private Resource systemCode;
@Autowired @Autowired
private IEqDynamicFormGroupService iEqDynamicFormGroupService; private IEqDynamicFormGroupService iEqDynamicFormGroupService;
...@@ -2047,62 +2050,27 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -2047,62 +2050,27 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
@Override @Override
public List<Map<String, Object>> getSystemRunningInfoList() { public List<Map<String, Object>> getSystemRunningInfoList() {
List<Map<String, Object>> list = fireFightingSystemMapper.getSystemCountInfo(); Map<String, Object> totalMap = fireFightingSystemMapper.getSystemCountInfo();
Map<String, Object> alarmNumMap = fireFightingSystemMapper.getSystemRunningInfoList(); Map<String, Object> alarmNumMap = fireFightingSystemMapper.getSystemRunningInfoList();
List<Map<String, Object>> resultList = new ArrayList<>(); String json = null;
if (0 < list.size()) { try {
list.forEach(x -> { json = IOUtils.toString(systemCode.getInputStream(), java.lang.String.valueOf(StandardCharsets.UTF_8));
Map<String, Object> resultMap = new HashMap<>(); } catch (IOException e) {
if (SystemTypeEnum.fireWaterSys.getCode().equals(String.valueOf(x.get("systemTypeCode")))) { e.printStackTrace();
resultMap.put("name", SystemTypeEnum.fireWaterSys.getDesc()); }
resultMap.put("code", SystemTypeEnum.fireWaterSys.getCode()); List<Map> mapList = JSONObject.parseArray(json, Map.class);
resultMap.put("total", x.get("sysNum")); Map<String, Object> map = new HashMap<>();
resultMap.put("alarmNum", alarmNumMap.get("waterSysNum")); mapList.forEach(x -> map.put(String.valueOf(x.get("nameKey")), x.get("code")));
} else if (SystemTypeEnum.fireCAFSSys.getCode().equals(String.valueOf(x.get("systemTypeCode")))) { List<Map<String, Object>> list = new ArrayList<>();
resultMap.put("name", SystemTypeEnum.fireCAFSSys.getDesc()); mapList.forEach(y -> {
resultMap.put("code", SystemTypeEnum.fireCAFSSys.getCode()); Map<String, Object> tempMap = new HashMap<>();
resultMap.put("total", x.get("sysNum")); tempMap.put("name", y.get("name"));
resultMap.put("alarmNum", alarmNumMap.get("cafsSysNum")); tempMap.put("code", y.get("code"));
} else if (SystemTypeEnum.fireAlarmSys.getCode().equals(String.valueOf(x.get("systemTypeCode")))) { tempMap.put("total", totalMap.get(y.get("code")));
resultMap.put("name", SystemTypeEnum.fireAlarmSys.getDesc()); tempMap.put("alarmNum", alarmNumMap.get(y.get("code")));
resultMap.put("code", SystemTypeEnum.fireAlarmSys.getCode()); list.add(tempMap);
resultMap.put("total", x.get("sysNum")); });
resultMap.put("alarmNum", alarmNumMap.get("fireAlarmSysNum")); return list;
} else {
resultMap.put("name", SystemTypeEnum.fireONLSys.getDesc());
resultMap.put("code", SystemTypeEnum.fireONLSys.getCode());
resultMap.put("total", x.get("sysNum"));
resultMap.put("alarmNum", alarmNumMap.get("onlSysNum"));
}
resultList.add(resultMap);
});
} else {
Map<String, Object> map1 = new HashMap<>();
map1.put("name", SystemTypeEnum.fireWaterSys.getDesc());
map1.put("code", SystemTypeEnum.fireWaterSys.getCode());
map1.put("total", 0);
map1.put("alarmNum", 0);
resultList.add(map1);
Map<String, Object> map2 = new HashMap<>();
map2.put("name", SystemTypeEnum.fireCAFSSys.getDesc());
map2.put("code", SystemTypeEnum.fireCAFSSys.getCode());
map2.put("total", 0);
map2.put("alarmNum", 0);
resultList.add(map2);
Map<String, Object> map3 = new HashMap<>();
map3.put("name", SystemTypeEnum.fireAlarmSys.getDesc());
map3.put("code", SystemTypeEnum.fireAlarmSys.getCode());
map3.put("total", 0);
map3.put("alarmNum", 0);
resultList.add(map3);
Map<String, Object> map4 = new HashMap<>();
map4.put("name", SystemTypeEnum.fireONLSys.getDesc());
map4.put("code", SystemTypeEnum.fireONLSys.getCode());
map4.put("total", 0);
map4.put("alarmNum", 0);
resultList.add(map4);
}
return resultList;
} }
@Override @Override
......
...@@ -884,6 +884,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -884,6 +884,8 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
equipmentSpecificAlarm.setEmergencyLevel(equipmentSpecificIndex.getEmergencyLevel()); equipmentSpecificAlarm.setEmergencyLevel(equipmentSpecificIndex.getEmergencyLevel());
equipmentSpecificAlarm.setEmergencyLevelColor(equipmentSpecificIndex.getEmergencyLevelColor()); equipmentSpecificAlarm.setEmergencyLevelColor(equipmentSpecificIndex.getEmergencyLevelColor());
equipmentSpecificAlarm.setEmergencyLevelDescribe(equipmentSpecificIndex.getEmergencyLevelDescribe()); equipmentSpecificAlarm.setEmergencyLevelDescribe(equipmentSpecificIndex.getEmergencyLevelDescribe());
equipmentSpecificAlarm.setBizOrgCode(equipmentSpecificIndex.getBizOrgCode());
equipmentSpecificAlarm.setBizOrgName(equipmentSpecificIndex.getBizOrgName());
equipmentSpecificAlarms.add(equipmentSpecificAlarm); equipmentSpecificAlarms.add(equipmentSpecificAlarm);
return equipmentSpecificAlarms; return equipmentSpecificAlarms;
} }
...@@ -1205,10 +1207,11 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -1205,10 +1207,11 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
// 冗余字段,alarm_log表更新时使用 // 冗余字段,alarm_log表更新时使用
action.setEquipmentSpecificCode(equipmentSpcIndex.getEquipmentSpecificCode()); action.setEquipmentSpecificCode(equipmentSpcIndex.getEquipmentSpecificCode());
action.setBuildId(equipmentSpcIndex.getBuildId()); action.setBuildId(equipmentSpcIndex.getBuildId());
action.setBizOrgName(equipmentSpcIndex.getBizOrgName());
action.setBizOrgCode(equipmentSpcIndex.getBizOrgCode());
equipmentSpecificAlarms.add(action); equipmentSpecificAlarms.add(action);
} }
} }
return equipmentSpecificAlarms; return equipmentSpecificAlarms;
} }
......
[ [
{ {
"name": "灭火器",
"code": "3104", "code": "3104",
"name": "extinguisher" "nameKey": "extinguisher"
}, },
{ {
"code": "92031900", "name": "消防车",
"name": "car" "code": "210",
"nameKey": "car"
}, },
{ {
"code": "210", "name": "泡沫罐",
"name": "foamtank" "code": "92031900",
"nameKey": "foamtank"
} }
] ]
\ No newline at end of file
[
{
"name": "排油系统",
"code": "fireONLSys"
},
{
"name": "消防给水系统",
"code": "fireWaterSys"
},
{
"name": "火灾报警系统",
"code": "fireAlarmSys"
},
{
"name": "压缩空气泡沫系统",
"code": "fireCAFSSys"
}
]
\ No newline at end of file
...@@ -1982,31 +1982,31 @@ ...@@ -1982,31 +1982,31 @@
WHERE WHERE
wed.`code` LIKE CONCAT(#{map.extinguisher},'%') wed.`code` LIKE CONCAT(#{map.extinguisher},'%')
<if test="map.bizOrgCode != null and map.bizOrgCode != ''"> <if test="map.bizOrgCode != null and map.bizOrgCode != ''">
AND wes.biz_org_code = #{map.bizOrgCode} AND wes.biz_org_code LIKE concat(#{map.bizOrgCode}, '%')
</if> </if>
) AS 'extinguisher', ) AS 'extinguisher',
( (
SELECT SELECT
COUNT(DISTINCT wes.id) COUNT(DISTINCT c.id)
FROM FROM
`wl_equipment_specific` wes `wl_car` c
LEFT JOIN wl_equipment_detail wed ON wed.id = wes.equipment_detail_id LEFT JOIN wl_equipment we ON we.id = c.equipment_id
WHERE WHERE
wed.`code` LIKE CONCAT(#{map.car},'%') we.`code` LIKE CONCAT(#{map.car},'%')
<if test="map.bizOrgCode != null and map.bizOrgCode != ''"> <if test="map.bizOrgCode != null and map.bizOrgCode != ''">
AND wes.biz_org_code = #{map.bizOrgCode} AND c.biz_org_code LIKE concat(#{map.bizOrgCode}, '%')
</if> </if>
) AS 'car', ) AS 'car',
( (
SELECT SELECT
COUNT(DISTINCT c.id) COUNT(DISTINCT wes.id)
FROM FROM
`wl_car` c `wl_equipment_specific` wes
LEFT JOIN wl_equipment we ON we.id = c.equipment_id LEFT JOIN wl_equipment_detail wed ON wed.id = wes.equipment_detail_id
WHERE WHERE
we.`code` LIKE CONCAT(#{map.foamtank},'%') wed.`code` LIKE CONCAT(#{map.foamtank},'%')
<if test="map.bizOrgCode != null and map.bizOrgCode != ''"> <if test="map.bizOrgCode != null and map.bizOrgCode != ''">
AND c.biz_org_code = #{map.bizOrgCode} AND wes.biz_org_code LIKE concat(#{map.bizOrgCode}, '%')
</if> </if>
) AS 'foamtank' ) AS 'foamtank'
</select> </select>
......
...@@ -5208,13 +5208,10 @@ ...@@ -5208,13 +5208,10 @@
<select id="getSystemCountInfo" resultType="java.util.Map"> <select id="getSystemCountInfo" resultType="java.util.Map">
SELECT SELECT
fs.`name`, ( SELECT COUNT( 1 ) AS sysNum FROM `f_fire_fighting_system` `fs` WHERE fs.system_type_code IS NOT NULL AND fs.system_type_code = 'fireWaterSys' ) AS fireWaterSys,
fs.system_type_code AS systemTypeCode, ( SELECT COUNT( 1 ) AS sysNum FROM `f_fire_fighting_system` `fs` WHERE fs.system_type_code IS NOT NULL AND fs.system_type_code = 'fireCAFSSys' ) AS fireCAFSSys,
COUNT(1) AS sysNum ( SELECT COUNT( 1 ) AS sysNum FROM `f_fire_fighting_system` `fs` WHERE fs.system_type_code IS NOT NULL AND fs.system_type_code = 'fireAlarmSys' ) AS fireAlarmSys,
FROM ( SELECT COUNT( 1 ) AS sysNum FROM `f_fire_fighting_system` `fs` WHERE fs.system_type_code IS NOT NULL AND fs.system_type_code = 'fireONLSys' ) AS fireONLSys
`f_fire_fighting_system` `fs`
WHERE fs.system_type_code IS NOT NULL AND fs.system_type_code IN ('fireWaterSys', 'fireCAFSSys', 'fireAlarmSys', 'fireONLSys')
GROUP BY fs.system_type_code
</select> </select>
<select id="getSystemRunningInfoList" resultType="java.util.Map"> <select id="getSystemRunningInfoList" resultType="java.util.Map">
SELECT SELECT
...@@ -5229,7 +5226,7 @@ ...@@ -5229,7 +5226,7 @@
fs.system_type_code IS NOT NULL fs.system_type_code IS NOT NULL
AND fs.system_type_code = 'fireWaterSys' AND fs.system_type_code = 'fireWaterSys'
AND ( wesi.is_alarm = 1 AND wesi.`value` = 'true' OR wesi.is_alarm = 0 AND wesi.`value` = 'false' ) AND ( wesi.is_alarm = 1 AND wesi.`value` = 'true' OR wesi.is_alarm = 0 AND wesi.`value` = 'false' )
) waterSysNum, ) fireWaterSys,
( (
SELECT SELECT
COUNT( DISTINCT fs.id ) COUNT( DISTINCT fs.id )
...@@ -5241,7 +5238,7 @@ ...@@ -5241,7 +5238,7 @@
fs.system_type_code IS NOT NULL fs.system_type_code IS NOT NULL
AND fs.system_type_code = 'fireCAFSSys' AND fs.system_type_code = 'fireCAFSSys'
AND ( wesi.is_alarm = 1 AND wesi.`value` = 'true' OR wesi.is_alarm = 0 AND wesi.`value` = 'false' ) AND ( wesi.is_alarm = 1 AND wesi.`value` = 'true' OR wesi.is_alarm = 0 AND wesi.`value` = 'false' )
) cafsSysNum, ) fireCAFSSys,
( (
SELECT SELECT
COUNT( DISTINCT fs.id ) COUNT( DISTINCT fs.id )
...@@ -5253,7 +5250,7 @@ ...@@ -5253,7 +5250,7 @@
fs.system_type_code IS NOT NULL fs.system_type_code IS NOT NULL
AND fs.system_type_code = 'fireAlarmSys' AND fs.system_type_code = 'fireAlarmSys'
AND ( wesi.is_alarm = 1 AND wesi.`value` = 'true' OR wesi.is_alarm = 0 AND wesi.`value` = 'false' ) AND ( wesi.is_alarm = 1 AND wesi.`value` = 'true' OR wesi.is_alarm = 0 AND wesi.`value` = 'false' )
) fireAlarmSysNum, ) fireAlarmSys,
( (
SELECT SELECT
COUNT( DISTINCT fs.id ) COUNT( DISTINCT fs.id )
...@@ -5265,7 +5262,7 @@ ...@@ -5265,7 +5262,7 @@
fs.system_type_code IS NOT NULL fs.system_type_code IS NOT NULL
AND fs.system_type_code = 'fireONLSys' AND fs.system_type_code = 'fireONLSys'
AND ( wesi.is_alarm = 1 AND wesi.`value` = 'true' OR wesi.is_alarm = 0 AND wesi.`value` = 'false' ) AND ( wesi.is_alarm = 1 AND wesi.`value` = 'true' OR wesi.is_alarm = 0 AND wesi.`value` = 'false' )
) onlSysNum ) fireONLSys
</select> </select>
<select id="getFireCarInfoByYJYA" resultType="java.util.Map"> <select id="getFireCarInfoByYJYA" resultType="java.util.Map">
......
[ [
{ {
"name": "消火栓",
"type": "hydrant", "type": "hydrant",
"name": "fireHydrant" "nameKey": "fireHydrant"
}, },
{ {
"name": "消防水池",
"type": "pool", "type": "pool",
"name": "firePool" "nameKey": "firePool"
}, },
{ {
"name": "消防水箱",
"type": "waterTank", "type": "waterTank",
"name": "fireWaterTank" "nameKey": "fireWaterTank"
} }
] ]
\ No newline at end of file
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