Commit 2e88c08a authored by zhangsen's avatar zhangsen

跑马灯消息重复问题

parent 909c33bc
......@@ -150,7 +150,7 @@ public interface EquipmentSpecificAlarmMapper extends BaseMapper<EquipmentSpecif
List<FireEquipmentFireAlarm> getFireEquipAlarmDetailsByAlarmId(@Param("list") List<Long> specificAlarmIds, @Param("indexIds") List<Long> equipIndexIds);
Page<Map<String, Object>> pageAlarmsInfo(Page page,@Param("param") CommonPageInfoParam param);
Page<Map<String, Object>> pageAlarmsInfo(Page page, @Param("param") CommonPageInfoParam param);
List<Map<String, Object>> getProObject(@Param("id") Long id);
......@@ -164,6 +164,7 @@ public interface EquipmentSpecificAlarmMapper extends BaseMapper<EquipmentSpecif
Page<EquipSpecificAlarmDTO> getAlarmPage(Page page, @Param("dto") AlarmDTO dto);
Page<EquipSpecificAlarmDTO> getEqPage(Page page, @Param("dto") AlarmDTO dto);
List<EquipmentSpecificAlarmLog> getConfirmUser();
EquipSpecificAlarmDTO getbyqrCode(@Param("code") String code);
......@@ -176,7 +177,6 @@ public interface EquipmentSpecificAlarmMapper extends BaseMapper<EquipmentSpecif
Integer getcountAlarmHandle(@Param("tyep") String tyep);
/**
*
* <pre>
* 根据装备id和查询指定状态告警数据
* </pre>
......@@ -187,4 +187,12 @@ public interface EquipmentSpecificAlarmMapper extends BaseMapper<EquipmentSpecif
*/
List<EquipmentSpecificAlarm> getEquipListBySpecific(@Param("status") Boolean status, @Param("equipmentSpecificId") Long equipmentSpecificId);
/**
* 根据Code 和 indexKey 查设备是否报警
* @param iotCode
* @param indexKey
* @param indexValue
* @return
*/
int selectCountByIotCode(@Param("iotCode") String iotCode, @Param("indexKey") String indexKey, @Param("indexValue") String indexValue);
}
......@@ -1301,8 +1301,12 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
public List<BuildingTreeVo> getBuildingVideoTreeNew() {
//1.组装数据
List<BuildingTreeVo> companyBuildingList = buildBuildingAndCompanyListVos(buildVideoAuthKey);
List<Map<String, Long>> countList = iFormInstanceService.getBuildVideoCount();
Map<Long, Long> countMap = countList.stream().collect(Collectors.toMap(p -> p.get("buildId"), p -> p.get("total")));
companyBuildingList.forEach(c -> {
// 建筑类型数据,填充本级及子级包含的摄像头数量
if (!ALL_BUILDING.equals(c.getGroupType())) {
......
......@@ -264,6 +264,10 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
if (ObjectUtils.isEmpty(iotDatalist)) {
return;
}
int count = equipmentSpecificAlarmMapper.selectCountByIotCode(iotCode, iotDatalist.get(0).getKey(), String.valueOf(iotDatalist.get(0).getValue()));
if (count > 0) {
return;
}
log.info(String.format("收到mqtt消息:%s", message));
realTimeDateProcessing(topicEntity, iotDatalist);
}
......
......@@ -1096,4 +1096,14 @@
</if>
</select>
<select id="selectCountByIotCode" resultType="int">
SELECT
count(*)
FROM
wl_equipment_specific_alarm
WHERE
iot_code = #{iotCode,jdbcType=VARCHAR}
AND equipment_specific_index_value = #{indexValue,jdbcType=VARCHAR}
AND equipment_specific_index_key = #{indexKey,jdbcType=VARCHAR}
</select>
</mapper>
\ 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