Commit 82afe199 authored by tangwei's avatar tangwei

消防预案信息修改

parent 64b41969
...@@ -42,5 +42,6 @@ public class EquipmentSpecificVo implements Serializable { ...@@ -42,5 +42,6 @@ public class EquipmentSpecificVo implements Serializable {
@ApiModelProperty(value = "数据类型:equip 装备,car 车辆") @ApiModelProperty(value = "数据类型:equip 装备,car 车辆")
private String type; private String type;
@ApiModelProperty(value = "装备分类code")
private String ecode;
} }
...@@ -248,5 +248,5 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> { ...@@ -248,5 +248,5 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
Page<FireFightingSystemDto> fireSysIotEquipCount(Page<Map<String, Object>> page, @Param("bizOrgCode") String bizOrgCode); Page<FireFightingSystemDto> fireSysIotEquipCount(Page<Map<String, Object>> page, @Param("bizOrgCode") String bizOrgCode);
List<FireFightingSystemDto> fireSysIotEquipAlarmCount(Date date, String bizOrgCode); List<FireFightingSystemDto> fireSysIotEquipAlarmCount(Date date, String bizOrgCode);
List<Map> getwater(@Param("id") Long id);
} }
...@@ -265,4 +265,8 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> { ...@@ -265,4 +265,8 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> {
* @return * @return
*/ */
List<FireFightingSystemDto> fireSysIotEquipAlarmCount(Date date, String bizOrgCode); List<FireFightingSystemDto> fireSysIotEquipAlarmCount(Date date, String bizOrgCode);
List<Map> getwater(Long id);
} }
...@@ -2039,4 +2039,9 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -2039,4 +2039,9 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
public List<FireFightingSystemDto> fireSysIotEquipAlarmCount(Date date, String bizOrgCode) { public List<FireFightingSystemDto> fireSysIotEquipAlarmCount(Date date, String bizOrgCode) {
return equipmentSpecificMapper.fireSysIotEquipAlarmCount(date, bizOrgCode); return equipmentSpecificMapper.fireSysIotEquipAlarmCount(date, bizOrgCode);
} }
@Override
public List<Map> getwater(Long id) {
return equipmentSpecificMapper.getwater(id);
}
} }
...@@ -102,7 +102,12 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -102,7 +102,12 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
@Autowired @Autowired
MarqueeDataMapper marqueeDataMapper; MarqueeDataMapper marqueeDataMapper;
//消防泵
@Value("${equipment.plan.pump}")
String pumpCodes;
//消防炮
@Value("${equipment.plan.monitor}")
String monitorCodes;
/** /**
* 泡沫罐KEY * 泡沫罐KEY
*/ */
...@@ -233,6 +238,11 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -233,6 +238,11 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
@Value("${equipment.pressurepump.stop}") @Value("${equipment.pressurepump.stop}")
private String pressurePumpStop; private String pressurePumpStop;
@Value("${emergency.disposal.indicators}")
private String emergencyDisposalIndicators;
private static Boolean bool = Boolean.FALSE; private static Boolean bool = Boolean.FALSE;
@Autowired @Autowired
...@@ -303,9 +313,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -303,9 +313,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
x.setTraceId(finalTraceId); x.setTraceId(finalTraceId);
return x; return x;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
realTimeDateProcessing(topicEntity, collect); realTimeDateProcessing(topicEntity, collect, vo);
} else { } else {
realTimeDateProcessing(topicEntity, iotDatalist); realTimeDateProcessing(topicEntity, iotDatalist,vo);
} }
} }
...@@ -315,7 +325,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -315,7 +325,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
* @param topicEntity * @param topicEntity
* @param iotDatalist * @param iotDatalist
*/ */
public void realTimeDateProcessing(TopicEntityVo topicEntity, List<IotDataVO> iotDatalist) { public void realTimeDateProcessing(TopicEntityVo topicEntity, List<IotDataVO> iotDatalist,EquipmentSpecificVo vo) {
String iotCode = topicEntity.getIotCode(); String iotCode = topicEntity.getIotCode();
if (EquipAndCarEnum.equip.type.equals(topicEntity.getType())) { if (EquipAndCarEnum.equip.type.equals(topicEntity.getType())) {
...@@ -324,13 +334,13 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -324,13 +334,13 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
if (ObjectUtils.isEmpty(indexList)) { if (ObjectUtils.isEmpty(indexList)) {
return; return;
} }
equipRealTimeDate(iotDatalist, indexList, topicEntity); equipRealTimeDate(iotDatalist, indexList, topicEntity,vo);
} else { } else {
List<CarProperty> carProperties = carPropertyService.getCarPropListByIotCode(iotCode); List<CarProperty> carProperties = carPropertyService.getCarPropListByIotCode(iotCode);
if (ObjectUtils.isEmpty(carProperties)) { if (ObjectUtils.isEmpty(carProperties)) {
return; return;
} }
carRealTimeDate(iotDatalist, carProperties); carRealTimeDate(iotDatalist, carProperties,topicEntity);
} }
} }
...@@ -343,7 +353,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -343,7 +353,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
* @param topicEntity * @param topicEntity
*/ */
public void equipRealTimeDate(List<IotDataVO> iotDatalist, List<EquipmentSpecificIndex> indexList, public void equipRealTimeDate(List<IotDataVO> iotDatalist, List<EquipmentSpecificIndex> indexList,
TopicEntityVo topicEntity) { TopicEntityVo topicEntity,EquipmentSpecificVo vo) {
List<EquipmentSpecificIndex> equipmentSpecificIndexList = new ArrayList<>(); List<EquipmentSpecificIndex> equipmentSpecificIndexList = new ArrayList<>();
List<EquipmentSpecificAlarm> equipmentSpecificAlarms = new ArrayList<>(); List<EquipmentSpecificAlarm> equipmentSpecificAlarms = new ArrayList<>();
List<IndexStateVo> indexStateList = new ArrayList<>(); List<IndexStateVo> indexStateList = new ArrayList<>();
...@@ -498,6 +508,49 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -498,6 +508,49 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
publishDataToDCCenterPage(equipmentSpecificIndexList); publishDataToDCCenterPage(equipmentSpecificIndexList);
} }
}); });
if(vo.getEcode()!=null){
String ecode= vo.getEcode();
boolean flag=false;
//消防泵
String[] strings = pumpCodes.split(",");
for (String string : strings) {
if(ecode.startsWith(string)){
//通知>消防应急预案
topicEntity.setType("xfb");
mqttSendGateway.sendToMqtt(emergencyDisposalIndicators, JSONObject.toJSONString(topicEntity));
flag=true;
break;
}
}
// 消防炮
String[] stringxfp = monitorCodes.split(",");
if(!flag){
for (String string1 : stringxfp) {
if(ecode.startsWith(string1)){
//通知>消防应急预案
topicEntity.setType("xfp");
mqttSendGateway.sendToMqtt(emergencyDisposalIndicators, JSONObject.toJSONString(topicEntity));
flag=true;
break;
}
}
}
//消防水源
if(!flag){
List<Map> lit= iEquipmentSpecificSerivce.getwater(vo.getId());
if(lit!=null&& lit.size()>0){
topicEntity.setType("xfsy");
mqttSendGateway.sendToMqtt(emergencyDisposalIndicators, JSONObject.toJSONString(topicEntity));
}
}
}
} }
...@@ -637,7 +690,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -637,7 +690,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
} }
public void carRealTimeDate(List<IotDataVO> iotDatalist, List<CarProperty> carProperties) { public void carRealTimeDate(List<IotDataVO> iotDatalist, List<CarProperty> carProperties,TopicEntityVo topicEntity) {
List<CarProperty> carIndexsList = new ArrayList<>(); List<CarProperty> carIndexsList = new ArrayList<>();
iotDatalist.forEach(iotDataVO -> { iotDatalist.forEach(iotDataVO -> {
// 对指标key为labels的数据处理 // 对指标key为labels的数据处理
...@@ -673,6 +726,11 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -673,6 +726,11 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
carTransactionSynch(carProperties, carPropertyVos); carTransactionSynch(carProperties, carPropertyVos);
} }
}); });
//通知>消防应急预案
mqttSendGateway.sendToMqtt(emergencyDisposalIndicators, JSONObject.toJSONString(topicEntity));
// 需要在事务提交之后,否侧事务隔离查询不出数据 // 需要在事务提交之后,否侧事务隔离查询不出数据
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() { TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
@Override @Override
......
...@@ -155,6 +155,7 @@ ...@@ -155,6 +155,7 @@
SELECT SELECT
wes.id, wes.id,
wes.iot_code AS iotCode, wes.iot_code AS iotCode,
wes.equipment_code ecode,
'equip' AS type, 'equip' AS type,
(SELECT GROUP_CONCAT(fs.system_type_code) FROM f_fire_fighting_system fs WHERE find_in_set( (SELECT GROUP_CONCAT(fs.system_type_code) FROM f_fire_fighting_system fs WHERE find_in_set(
`fs`.`id`, `fs`.`id`,
...@@ -167,6 +168,7 @@ ...@@ -167,6 +168,7 @@
SELECT SELECT
wc.id, wc.id,
wc.iot_code AS iotCode, wc.iot_code AS iotCode,
'' as ecode,
'car' AS type, 'car' AS type,
wc.car_num AS `code` wc.car_num AS `code`
FROM FROM
...@@ -2179,4 +2181,18 @@ ...@@ -2179,4 +2181,18 @@
GROUP BY GROUP BY
fs.id) s fs.id) s
</select> </select>
<select id="getwater" resultType="java.util.Map">
SELECT
ei.equipment_specific_id
FROM
cb_water_resource r
LEFT JOIN cb_water_resource_pool rp ON rp.resource_id = r.sequence_nbr
LEFT JOIN wl_equipment_specific_index ei ON ei.equipment_specific_id = rp.level_device_id
WHERE
r.resource_type in ( 'industryPool','pool')
AND r.is_delete = 1
and ei.equipment_specific_id is not null
and ei.equipment_specific_id =#{id}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -5345,7 +5345,8 @@ ...@@ -5345,7 +5345,8 @@
`wc`.`iot_code` AS `iot_code`, `wc`.`iot_code` AS `iot_code`,
`wc`.`name` AS `name`, `wc`.`name` AS `name`,
IFNULL( max( CASE WHEN ( `wcp`.`equipment_index_key` = 'FireCar_WaterCapacity' ) THEN `wcp`.`value` END ), 0 ) AS `waterCapacity`, IFNULL( max( CASE WHEN ( `wcp`.`equipment_index_key` = 'FireCar_WaterCapacity' ) THEN `wcp`.`value` END ), 0 ) AS `waterCapacity`,
IFNULL( max( CASE WHEN ( `wcp`.`equipment_index_key` = 'FireCar_FoamCapacity' ) THEN `wcp`.`value` END ), 0 ) AS `foamCapacity` IFNULL( max( CASE WHEN ( `wcp`.`equipment_index_key` = 'FireCar_FoamCapacity' ) THEN `wcp`.`value` END ), 0 ) AS `foamCapacity`,
(select value from wl_car_property where wl_car_property.car_id=`wc`.`id` and equipment_index_key ='FireCar_Start') AS startup
FROM FROM
`wl_car` `wc` `wl_car` `wc`
LEFT JOIN `wl_car_property` `wcp` ON `wcp`.`car_id` = `wc`.`id` LEFT JOIN `wl_car_property` `wcp` ON `wcp`.`car_id` = `wc`.`id`
......
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