Commit 82afe199 authored by tangwei's avatar tangwei

消防预案信息修改

parent 64b41969
......@@ -42,5 +42,6 @@ public class EquipmentSpecificVo implements Serializable {
@ApiModelProperty(value = "数据类型:equip 装备,car 车辆")
private String type;
@ApiModelProperty(value = "装备分类code")
private String ecode;
}
......@@ -248,5 +248,5 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
Page<FireFightingSystemDto> fireSysIotEquipCount(Page<Map<String, Object>> page, @Param("bizOrgCode") 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> {
* @return
*/
List<FireFightingSystemDto> fireSysIotEquipAlarmCount(Date date, String bizOrgCode);
List<Map> getwater(Long id);
}
......@@ -2039,4 +2039,9 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
public List<FireFightingSystemDto> fireSysIotEquipAlarmCount(Date date, String 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 {
@Autowired
MarqueeDataMapper marqueeDataMapper;
//消防泵
@Value("${equipment.plan.pump}")
String pumpCodes;
//消防炮
@Value("${equipment.plan.monitor}")
String monitorCodes;
/**
* 泡沫罐KEY
*/
......@@ -233,6 +238,11 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
@Value("${equipment.pressurepump.stop}")
private String pressurePumpStop;
@Value("${emergency.disposal.indicators}")
private String emergencyDisposalIndicators;
private static Boolean bool = Boolean.FALSE;
@Autowired
......@@ -303,9 +313,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
x.setTraceId(finalTraceId);
return x;
}).collect(Collectors.toList());
realTimeDateProcessing(topicEntity, collect);
realTimeDateProcessing(topicEntity, collect, vo);
} else {
realTimeDateProcessing(topicEntity, iotDatalist);
realTimeDateProcessing(topicEntity, iotDatalist,vo);
}
}
......@@ -315,7 +325,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
* @param topicEntity
* @param iotDatalist
*/
public void realTimeDateProcessing(TopicEntityVo topicEntity, List<IotDataVO> iotDatalist) {
public void realTimeDateProcessing(TopicEntityVo topicEntity, List<IotDataVO> iotDatalist,EquipmentSpecificVo vo) {
String iotCode = topicEntity.getIotCode();
if (EquipAndCarEnum.equip.type.equals(topicEntity.getType())) {
......@@ -324,13 +334,13 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
if (ObjectUtils.isEmpty(indexList)) {
return;
}
equipRealTimeDate(iotDatalist, indexList, topicEntity);
equipRealTimeDate(iotDatalist, indexList, topicEntity,vo);
} else {
List<CarProperty> carProperties = carPropertyService.getCarPropListByIotCode(iotCode);
if (ObjectUtils.isEmpty(carProperties)) {
return;
}
carRealTimeDate(iotDatalist, carProperties);
carRealTimeDate(iotDatalist, carProperties,topicEntity);
}
}
......@@ -343,7 +353,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
* @param topicEntity
*/
public void equipRealTimeDate(List<IotDataVO> iotDatalist, List<EquipmentSpecificIndex> indexList,
TopicEntityVo topicEntity) {
TopicEntityVo topicEntity,EquipmentSpecificVo vo) {
List<EquipmentSpecificIndex> equipmentSpecificIndexList = new ArrayList<>();
List<EquipmentSpecificAlarm> equipmentSpecificAlarms = new ArrayList<>();
List<IndexStateVo> indexStateList = new ArrayList<>();
......@@ -498,6 +508,49 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
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 {
}
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<>();
iotDatalist.forEach(iotDataVO -> {
// 对指标key为labels的数据处理
......@@ -673,6 +726,11 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
carTransactionSynch(carProperties, carPropertyVos);
}
});
//通知>消防应急预案
mqttSendGateway.sendToMqtt(emergencyDisposalIndicators, JSONObject.toJSONString(topicEntity));
// 需要在事务提交之后,否侧事务隔离查询不出数据
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
@Override
......
......@@ -155,6 +155,7 @@
SELECT
wes.id,
wes.iot_code AS iotCode,
wes.equipment_code ecode,
'equip' AS type,
(SELECT GROUP_CONCAT(fs.system_type_code) FROM f_fire_fighting_system fs WHERE find_in_set(
`fs`.`id`,
......@@ -167,6 +168,7 @@
SELECT
wc.id,
wc.iot_code AS iotCode,
'' as ecode,
'car' AS type,
wc.car_num AS `code`
FROM
......@@ -2179,4 +2181,18 @@
GROUP BY
fs.id) s
</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>
\ No newline at end of file
......@@ -5345,7 +5345,8 @@
`wc`.`iot_code` AS `iot_code`,
`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_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
`wl_car` `wc`
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