|
|
@@ -140,15 +140,36 @@ public class IotAlarmDataServiceImpl extends ServiceImpl<IotAlarmDataMapper, Iot
|
|
|
}
|
|
|
List<DeviceTypeCountVo> list = baseMapper.selectDeviceTypeCount(requestDto);
|
|
|
for (DeviceTypeCountVo vo : list) {
|
|
|
- if (SensorTypeEnum.SMOKE.getType().equals(vo.getDeviceType())){
|
|
|
- sensorAlarmCountVo.setSmokeCount(vo.getDeviceTypeCount());
|
|
|
- sensorAlarmCountVo.setSmokeAlarmCount(vo.getDeviceTypeAlarmCount());
|
|
|
- } else if (SensorTypeEnum.GAS.getType().equals(vo.getDeviceType())) {
|
|
|
- sensorAlarmCountVo.setGasCount(vo.getDeviceTypeCount());
|
|
|
- sensorAlarmCountVo.setGasAlarmCount(vo.getDeviceTypeAlarmCount());
|
|
|
- } else if (SensorTypeEnum.TEMPERATURE_HUMIDITY.getType().equals(vo.getDeviceType())) {
|
|
|
- sensorAlarmCountVo.setTemperatureAndHumidityCount(vo.getDeviceTypeCount());
|
|
|
- sensorAlarmCountVo.setTemperatureAndHumidityAlarmCount(vo.getDeviceTypeAlarmCount());
|
|
|
+ String deviceType = vo.getDeviceType();
|
|
|
+ switch (deviceType){
|
|
|
+ case "4181"://红外
|
|
|
+ sensorAlarmCountVo.setInfraredCount(vo.getDeviceTypeCount());
|
|
|
+ sensorAlarmCountVo.setInfraredAlarmCount(vo.getDeviceTypeAlarmCount());
|
|
|
+ break;
|
|
|
+ case "4182"://烟感
|
|
|
+ sensorAlarmCountVo.setSmokeCount(vo.getDeviceTypeCount());
|
|
|
+ sensorAlarmCountVo.setSmokeAlarmCount(vo.getDeviceTypeAlarmCount());
|
|
|
+ break;
|
|
|
+ case "4183"://温湿度
|
|
|
+ sensorAlarmCountVo.setTemperatureAndHumidityCount(vo.getDeviceTypeCount());
|
|
|
+ sensorAlarmCountVo.setTemperatureAndHumidityAlarmCount(vo.getDeviceTypeAlarmCount());
|
|
|
+ break;
|
|
|
+ case "4184"://水浸
|
|
|
+ sensorAlarmCountVo.setWaterCount(vo.getDeviceTypeCount());
|
|
|
+ sensorAlarmCountVo.setWaterAlarmCount(vo.getDeviceTypeAlarmCount());
|
|
|
+ break;
|
|
|
+ case "4188"://门磁
|
|
|
+ sensorAlarmCountVo.setDoorCount(vo.getDeviceTypeCount());
|
|
|
+ sensorAlarmCountVo.setDoorAlarmCount(vo.getDeviceTypeAlarmCount());
|
|
|
+ break;
|
|
|
+ case "41881"://防盗
|
|
|
+ sensorAlarmCountVo.setThiefCount(vo.getDeviceTypeCount());
|
|
|
+ sensorAlarmCountVo.setThiefAlarmCount(vo.getDeviceTypeAlarmCount());
|
|
|
+ break;
|
|
|
+ case "41885"://燃气
|
|
|
+ sensorAlarmCountVo.setGasCount(vo.getDeviceTypeCount());
|
|
|
+ sensorAlarmCountVo.setGasAlarmCount(vo.getDeviceTypeAlarmCount());
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
return sensorAlarmCountVo;
|
|
|
@@ -171,6 +192,25 @@ public class IotAlarmDataServiceImpl extends ServiceImpl<IotAlarmDataMapper, Iot
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ public Integer getEnvMonitorBadge(Long orgId) {
|
|
|
+ AppAlarmPageDto pageDto = new AppAlarmPageDto();
|
|
|
+ pageDto.setCheckSub(false);
|
|
|
+ pageDto.setOrgId(orgId);
|
|
|
+ SensorAlarmCountVo alarmCountVo = this.selectDeviceTypeCount(pageDto);
|
|
|
+ if (alarmCountVo != null){
|
|
|
+ Integer thiefAlarmCount = alarmCountVo.getThiefAlarmCount() == null ? 0 : alarmCountVo.getThiefAlarmCount();
|
|
|
+ Integer infraredAlarmCount = alarmCountVo.getInfraredAlarmCount() == null ? 0 : alarmCountVo.getInfraredAlarmCount();
|
|
|
+ Integer doorAlarmCount = alarmCountVo.getDoorAlarmCount() == null ? 0 : alarmCountVo.getDoorAlarmCount();
|
|
|
+ Integer waterAlarmCount = alarmCountVo.getWaterAlarmCount() == null ? 0 : alarmCountVo.getWaterAlarmCount();
|
|
|
+ Integer upsAlarmCount = alarmCountVo.getUpsAlarmCount() == null ? 0 : alarmCountVo.getUpsAlarmCount();
|
|
|
+ Integer airAlarmCount = alarmCountVo.getAirAlarmCount() == null ? 0 : alarmCountVo.getAirAlarmCount();
|
|
|
+ Integer count = thiefAlarmCount + infraredAlarmCount + doorAlarmCount + waterAlarmCount + upsAlarmCount + airAlarmCount;
|
|
|
+ return count;
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
public TableDataInfo<IotAlarmDataVo> selectSensorAlarmPageList(AppAlarmPageDto requestDto) {
|
|
|
Page<IotAlarmDataVo> page;
|
|
|
//分页
|