|
|
@@ -41,6 +41,7 @@ public class IotAlarmDataServiceImpl extends ServiceImpl<IotAlarmDataMapper, Iot
|
|
|
|
|
|
@Resource
|
|
|
private RemoteOrgService orgService;
|
|
|
+
|
|
|
@Override
|
|
|
public TableDataInfo<IotAlarmDataVo> selectListPage(IotAlarmDataVo request) {
|
|
|
//未删除
|
|
|
@@ -52,31 +53,30 @@ public class IotAlarmDataServiceImpl extends ServiceImpl<IotAlarmDataMapper, Iot
|
|
|
page = new Page<>();
|
|
|
}
|
|
|
|
|
|
- if(ObjectUtil.isNotEmpty(request.getAlarmTime())){
|
|
|
+ if (ObjectUtil.isNotEmpty(request.getAlarmTime())) {
|
|
|
DateTime startTime = DateUtil.parse(request.getAlarmTime().get(0), "yyyy-MM-dd HH:mm:ss");
|
|
|
DateTime endTime = DateUtil.parse(request.getAlarmTime().get(1), "yyyy-MM-dd HH:mm:ss");
|
|
|
- request.getParams().put("alarmStartTime",DateUtil.beginOfDay(startTime));
|
|
|
- request.getParams().put("alarmEndTime",DateUtil.endOfDay(endTime));
|
|
|
+ request.getParams().put("alarmStartTime", DateUtil.beginOfDay(startTime));
|
|
|
+ request.getParams().put("alarmEndTime", DateUtil.endOfDay(endTime));
|
|
|
}
|
|
|
|
|
|
- if(ObjectUtil.isNotEmpty(request.getAlarmEndTime())){
|
|
|
+ if (ObjectUtil.isNotEmpty(request.getAlarmEndTime())) {
|
|
|
DateTime startTime = DateUtil.parse(request.getAlarmEndTime().get(0), "yyyy-MM-dd HH:mm:ss");
|
|
|
DateTime endTime = DateUtil.parse(request.getAlarmEndTime().get(1), "yyyy-MM-dd HH:mm:ss");
|
|
|
- request.getParams().put("endAlarmStartTime",DateUtil.beginOfDay(startTime));
|
|
|
- request.getParams().put("endAlarmEndTime",DateUtil.endOfDay(endTime));
|
|
|
+ request.getParams().put("endAlarmStartTime", DateUtil.beginOfDay(startTime));
|
|
|
+ request.getParams().put("endAlarmEndTime", DateUtil.endOfDay(endTime));
|
|
|
|
|
|
}
|
|
|
|
|
|
- if(ObjectUtil.isNotEmpty(request.getAlarmDealTime())){
|
|
|
+ if (ObjectUtil.isNotEmpty(request.getAlarmDealTime())) {
|
|
|
DateTime startTime = DateUtil.parse(request.getAlarmDealTime().get(0), "yyyy-MM-dd HH:mm:ss");
|
|
|
DateTime endTime = DateUtil.parse(request.getAlarmDealTime().get(1), "yyyy-MM-dd HH:mm:ss");
|
|
|
- request.getParams().put("dealAlarmStartTime",DateUtil.beginOfDay(startTime));
|
|
|
- request.getParams().put("dealAlarmEndTime",DateUtil.endOfDay(endTime));
|
|
|
+ request.getParams().put("dealAlarmStartTime", DateUtil.beginOfDay(startTime));
|
|
|
+ request.getParams().put("dealAlarmEndTime", DateUtil.endOfDay(endTime));
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
- if(request.getCheckSub() && ObjectUtil.isNotEmpty(request.getOrgId())){
|
|
|
+ if (request.getCheckSub() && ObjectUtil.isNotEmpty(request.getOrgId())) {
|
|
|
SysOrg org = orgService.selectSysOrgById(request.getOrgId(), SecurityConstants.INNER);
|
|
|
request.setOrgPath(org.getPath());
|
|
|
request.setOrgId(null);
|
|
|
@@ -85,54 +85,54 @@ public class IotAlarmDataServiceImpl extends ServiceImpl<IotAlarmDataMapper, Iot
|
|
|
List<String> deviceTypes = Lists.newArrayList();
|
|
|
Integer dataType = request.getDataType();
|
|
|
String deviceType = request.getDeviceType();
|
|
|
- if(dataType == null){
|
|
|
- if(StringUtils.isNotEmpty(deviceType)){
|
|
|
+ if (dataType == null) {
|
|
|
+ if (StringUtils.isNotEmpty(deviceType)) {
|
|
|
//两种告警分类都包含的告警类型合并
|
|
|
- if(String.valueOf(SensorType.INFRARED_SENSOR.getProductName()).equals(deviceType)){
|
|
|
+ if (String.valueOf(SensorType.INFRARED_SENSOR.getProductName()).equals(deviceType)) {
|
|
|
deviceTypes.add("AlarmHostInput_Infrared");
|
|
|
deviceTypes.add(deviceType);
|
|
|
- }else if(String.valueOf(SensorType.SMOKE_SENSOR.getProductName()).equals(deviceType)){
|
|
|
+ } else if (String.valueOf(SensorType.SMOKE_SENSOR.getProductName()).equals(deviceType)) {
|
|
|
deviceTypes.add("AlarmHostInput_Smoke");
|
|
|
deviceTypes.add(deviceType);
|
|
|
- }else if(String.valueOf(SensorType.HUMIDITY_TEMPERATURE_SENSOR.getProductName()).equals(deviceType)){
|
|
|
+ } else if (String.valueOf(SensorType.HUMIDITY_TEMPERATURE_SENSOR.getProductName()).equals(deviceType)) {
|
|
|
deviceTypes.add("AlarmHostInput_Humidity");
|
|
|
deviceTypes.add("AlarmHostInput_Temperature");
|
|
|
deviceTypes.add(deviceType);
|
|
|
- }else if(String.valueOf(SensorType.WATER_INTRUSION.getProductName()).equals(deviceType)){
|
|
|
+ } else if (String.valueOf(SensorType.WATER_INTRUSION.getProductName()).equals(deviceType)) {
|
|
|
deviceTypes.add("AlarmHostInput_Soaking");
|
|
|
deviceTypes.add(deviceType);
|
|
|
- }else if(String.valueOf(SensorType.DOOR_MAGNETIC_SENSOR.getProductName()).equals(deviceType)){
|
|
|
+ } else if (String.valueOf(SensorType.DOOR_MAGNETIC_SENSOR.getProductName()).equals(deviceType)) {
|
|
|
deviceTypes.add("AlarmHostInput_DoorSensor");
|
|
|
deviceTypes.add(deviceType);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
deviceTypes.add(deviceType);
|
|
|
}
|
|
|
}
|
|
|
- }else if(dataType == 2){
|
|
|
+ } else if (dataType == 2) {
|
|
|
//报警主机类:下拉框告警类型转换
|
|
|
- if(StringUtils.isNotEmpty(deviceType)){
|
|
|
- if(String.valueOf(SensorType.INFRARED_SENSOR.getProductName()).equals(deviceType)){
|
|
|
+ if (StringUtils.isNotEmpty(deviceType)) {
|
|
|
+ if (String.valueOf(SensorType.INFRARED_SENSOR.getProductName()).equals(deviceType)) {
|
|
|
deviceTypes.add("AlarmHostInput_Infrared");
|
|
|
- }else if(String.valueOf(SensorType.SMOKE_SENSOR.getProductName()).equals(deviceType)){
|
|
|
+ } else if (String.valueOf(SensorType.SMOKE_SENSOR.getProductName()).equals(deviceType)) {
|
|
|
deviceTypes.add("AlarmHostInput_Smoke");
|
|
|
- }else if(String.valueOf(SensorType.HUMIDITY_TEMPERATURE_SENSOR.getProductName()).equals(deviceType)){
|
|
|
+ } else if (String.valueOf(SensorType.HUMIDITY_TEMPERATURE_SENSOR.getProductName()).equals(deviceType)) {
|
|
|
deviceTypes.add("AlarmHostInput_Humidity");
|
|
|
deviceTypes.add("AlarmHostInput_Temperature");
|
|
|
- }else if(String.valueOf(SensorType.WATER_INTRUSION.getProductName()).equals(deviceType)){
|
|
|
+ } else if (String.valueOf(SensorType.WATER_INTRUSION.getProductName()).equals(deviceType)) {
|
|
|
deviceTypes.add("AlarmHostInput_Soaking");
|
|
|
- }else if(String.valueOf(SensorType.DOOR_MAGNETIC_SENSOR.getProductName()).equals(deviceType)){
|
|
|
+ } else if (String.valueOf(SensorType.DOOR_MAGNETIC_SENSOR.getProductName()).equals(deviceType)) {
|
|
|
deviceTypes.add("AlarmHostInput_DoorSensor");
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
deviceTypes.add(deviceType);
|
|
|
}
|
|
|
}
|
|
|
- }else{
|
|
|
- if(StringUtils.isNotEmpty(deviceType)) {
|
|
|
+ } else {
|
|
|
+ if (StringUtils.isNotEmpty(deviceType)) {
|
|
|
deviceTypes.add(deviceType);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- Page<IotAlarmDataVo> iotAlarmDataVoPage = baseMapper.selectPageList(page, request,deviceTypes);
|
|
|
+ Page<IotAlarmDataVo> iotAlarmDataVoPage = baseMapper.selectPageList(page, request, deviceTypes);
|
|
|
|
|
|
//抓换为TableDataInfo适配前端
|
|
|
return TableDataInfo.build(iotAlarmDataVoPage);
|
|
|
@@ -140,29 +140,29 @@ public class IotAlarmDataServiceImpl extends ServiceImpl<IotAlarmDataMapper, Iot
|
|
|
|
|
|
@Override
|
|
|
public TableDataInfo<AppAlarmDataPageVo> selectListAppPage(AppAlarmPageDto request) {
|
|
|
- Page<AppAlarmDataPageVo> page=request.toPage();
|
|
|
- if(request.getCheckSub() && ObjectUtil.isNotEmpty(request.getOrgId())){
|
|
|
+ Page<AppAlarmDataPageVo> page = request.toPage();
|
|
|
+ if (request.getCheckSub() && ObjectUtil.isNotEmpty(request.getOrgId())) {
|
|
|
SysOrg org = orgService.selectSysOrgById(request.getOrgId(), SecurityConstants.INNER);
|
|
|
request.setOrgPath(org.getPath());
|
|
|
request.setOrgId(null);
|
|
|
}
|
|
|
- if(ObjectUtil.isNotEmpty(request.getAlarmTime()) && request.getAlarmTime().size() > 0){
|
|
|
- LocalDateTime alarmStartTime =LocalDateTime.parse(request.getAlarmTime().get(0), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
|
|
- LocalDateTime alarmEndTime =LocalDateTime.parse(request.getAlarmTime().get(1), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
|
|
- request.getParams().put("alarmStartTime",alarmStartTime);
|
|
|
- request.getParams().put("alarmEndTime",alarmEndTime);
|
|
|
+ if (ObjectUtil.isNotEmpty(request.getAlarmTime()) && request.getAlarmTime().size() > 0) {
|
|
|
+ LocalDateTime alarmStartTime = LocalDateTime.parse(request.getAlarmTime().get(0), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
|
|
+ LocalDateTime alarmEndTime = LocalDateTime.parse(request.getAlarmTime().get(1), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
|
|
+ request.getParams().put("alarmStartTime", alarmStartTime);
|
|
|
+ request.getParams().put("alarmEndTime", alarmEndTime);
|
|
|
}
|
|
|
|
|
|
- page=baseMapper.selectAppPageList(page,request);
|
|
|
+ page = baseMapper.selectAppPageList(page, request);
|
|
|
|
|
|
return TableDataInfo.build(page);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public IotAlarmDataVo getDetail(Long id) {
|
|
|
- IotAlarmDataVo vo=baseMapper.detail(id);
|
|
|
+ IotAlarmDataVo vo = baseMapper.detail(id);
|
|
|
|
|
|
- return vo;
|
|
|
+ return vo;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -179,57 +179,71 @@ public class IotAlarmDataServiceImpl extends ServiceImpl<IotAlarmDataMapper, Iot
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Integer appBadge(Long orgId){
|
|
|
- Integer count=baseMapper.appBadge(orgId);
|
|
|
+ public Integer appBadge(Long orgId) {
|
|
|
+ Integer count = baseMapper.appBadge(orgId);
|
|
|
|
|
|
- return count;
|
|
|
+ return count;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<IotAlarmData> selectAlarmDataListByOrgPath(String orgPath,Integer dataType) {
|
|
|
+ public List<IotAlarmData> selectAlarmDataListByOrgPath(String orgPath, Integer dataType) {
|
|
|
|
|
|
|
|
|
- return baseMapper.selectAlarmDataListByOrgPath(orgPath,dataType);
|
|
|
+ return baseMapper.selectAlarmDataListByOrgPath(orgPath, dataType);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public SensorAlarmCountVo selectDeviceTypeCount(AppAlarmPageDto requestDto) {
|
|
|
SensorAlarmCountVo sensorAlarmCountVo = new SensorAlarmCountVo();
|
|
|
- if(requestDto.getCheckSub() && ObjectUtil.isNotEmpty(requestDto.getOrgId())){
|
|
|
+ if (requestDto.getCheckSub() && ObjectUtil.isNotEmpty(requestDto.getOrgId())) {
|
|
|
SysOrg org = orgService.selectSysOrgById(requestDto.getOrgId(), SecurityConstants.INNER);
|
|
|
requestDto.setOrgPath(org.getPath());
|
|
|
}
|
|
|
List<DeviceTypeCountVo> list = baseMapper.selectDeviceTypeCount(requestDto);
|
|
|
for (DeviceTypeCountVo vo : list) {
|
|
|
final BaseDeviceTypeEnum typeEnum = BaseDeviceTypeEnum.getEnumByCode(vo.getDeviceType());
|
|
|
- switch (typeEnum){
|
|
|
+ switch (typeEnum) {
|
|
|
case FSU_Infrared://红外
|
|
|
- sensorAlarmCountVo.setInfraredCount(vo.getDeviceTypeCount());
|
|
|
- sensorAlarmCountVo.setInfraredAlarmCount(vo.getDeviceTypeAlarmCount());
|
|
|
+ case AlarmHostInput_Infrared://红外
|
|
|
+ sensorAlarmCountVo.setInfraredCount(vo.getDeviceTypeCount() + sensorAlarmCountVo.getInfraredCount());
|
|
|
+ sensorAlarmCountVo.setInfraredAlarmCount(vo.getDeviceTypeAlarmCount() + sensorAlarmCountVo.getInfraredAlarmCount());
|
|
|
break;
|
|
|
case FSU_Smoke://烟感
|
|
|
- sensorAlarmCountVo.setSmokeCount(vo.getDeviceTypeCount());
|
|
|
- sensorAlarmCountVo.setSmokeAlarmCount(vo.getDeviceTypeAlarmCount());
|
|
|
+ case AlarmHostInput_Smoke://烟感
|
|
|
+ sensorAlarmCountVo.setSmokeCount(vo.getDeviceTypeCount() + sensorAlarmCountVo.getSmokeCount());
|
|
|
+ sensorAlarmCountVo.setSmokeAlarmCount(vo.getDeviceTypeAlarmCount() + sensorAlarmCountVo.getSmokeAlarmCount());
|
|
|
break;
|
|
|
case FSU_TemperatureAndHumidity://温湿度
|
|
|
- sensorAlarmCountVo.setTemperatureAndHumidityCount(vo.getDeviceTypeCount());
|
|
|
- sensorAlarmCountVo.setTemperatureAndHumidityAlarmCount(vo.getDeviceTypeAlarmCount());
|
|
|
+ case AlarmHostInput_Humidity://湿度
|
|
|
+ case AlarmHostInput_Temperature://温度
|
|
|
+ sensorAlarmCountVo.setTemperatureAndHumidityCount(vo.getDeviceTypeCount() + sensorAlarmCountVo.getTemperatureAndHumidityCount());
|
|
|
+ sensorAlarmCountVo.setTemperatureAndHumidityAlarmCount(vo.getDeviceTypeAlarmCount() + sensorAlarmCountVo.getTemperatureAndHumidityAlarmCount());
|
|
|
break;
|
|
|
case FSU_Water://水浸
|
|
|
- sensorAlarmCountVo.setWaterCount(vo.getDeviceTypeCount());
|
|
|
- sensorAlarmCountVo.setWaterAlarmCount(vo.getDeviceTypeAlarmCount());
|
|
|
+ case AlarmHostInput_Soaking://水浸
|
|
|
+ sensorAlarmCountVo.setWaterCount(vo.getDeviceTypeCount() + sensorAlarmCountVo.getWaterCount());
|
|
|
+ sensorAlarmCountVo.setWaterAlarmCount(vo.getDeviceTypeAlarmCount() + sensorAlarmCountVo.getWaterAlarmCount());
|
|
|
break;
|
|
|
case FSU_DoorMagnetic://门磁
|
|
|
- sensorAlarmCountVo.setDoorCount(vo.getDeviceTypeCount());
|
|
|
- sensorAlarmCountVo.setDoorAlarmCount(vo.getDeviceTypeAlarmCount());
|
|
|
+ case AlarmHostInput_DoorSensor://门磁
|
|
|
+ sensorAlarmCountVo.setDoorCount(vo.getDeviceTypeCount() + sensorAlarmCountVo.getDoorCount());
|
|
|
+ sensorAlarmCountVo.setDoorAlarmCount(vo.getDeviceTypeAlarmCount() + sensorAlarmCountVo.getDoorAlarmCount());
|
|
|
break;
|
|
|
case FSU_Theft://防盗
|
|
|
- sensorAlarmCountVo.setThiefCount(vo.getDeviceTypeCount());
|
|
|
- sensorAlarmCountVo.setThiefAlarmCount(vo.getDeviceTypeAlarmCount());
|
|
|
+ sensorAlarmCountVo.setThiefCount(vo.getDeviceTypeCount() + sensorAlarmCountVo.getThiefCount());
|
|
|
+ sensorAlarmCountVo.setThiefAlarmCount(vo.getDeviceTypeAlarmCount() + sensorAlarmCountVo.getThiefAlarmCount());
|
|
|
break;
|
|
|
case FSU_Gas://燃气
|
|
|
- sensorAlarmCountVo.setGasCount(vo.getDeviceTypeCount());
|
|
|
- sensorAlarmCountVo.setGasAlarmCount(vo.getDeviceTypeAlarmCount());
|
|
|
+ sensorAlarmCountVo.setGasCount(vo.getDeviceTypeCount() + sensorAlarmCountVo.getGasCount());
|
|
|
+ sensorAlarmCountVo.setGasAlarmCount(vo.getDeviceTypeAlarmCount() + sensorAlarmCountVo.getGasAlarmCount());
|
|
|
+ break;
|
|
|
+ case FSU_Ups://ups
|
|
|
+ sensorAlarmCountVo.setUpsCount(vo.getDeviceTypeCount() + sensorAlarmCountVo.getUpsCount());
|
|
|
+ sensorAlarmCountVo.setUpsAlarmCount(vo.getDeviceTypeAlarmCount() + sensorAlarmCountVo.getUpsAlarmCount());
|
|
|
+ break;
|
|
|
+ case FSU_AirConditioner://空调
|
|
|
+ sensorAlarmCountVo.setAirCount(vo.getDeviceTypeCount() + sensorAlarmCountVo.getAirCount());
|
|
|
+ sensorAlarmCountVo.setAirAlarmCount(vo.getDeviceTypeAlarmCount() + sensorAlarmCountVo.getAirAlarmCount());
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
@@ -242,10 +256,10 @@ public class IotAlarmDataServiceImpl extends ServiceImpl<IotAlarmDataMapper, Iot
|
|
|
pageDto.setOrgId(orgId);
|
|
|
pageDto.setCheckSub(true);
|
|
|
SensorAlarmCountVo alarmCountVo = this.selectDeviceTypeCount(pageDto);
|
|
|
- if (alarmCountVo != null){
|
|
|
- Integer smokeAlarmCount = alarmCountVo.getSmokeAlarmCount() == null ? 0 : alarmCountVo.getSmokeAlarmCount();
|
|
|
- Integer gasAlarmCount = alarmCountVo.getGasAlarmCount() == null ? 0 : alarmCountVo.getGasAlarmCount();
|
|
|
- Integer htAlarmCount = alarmCountVo.getTemperatureAndHumidityAlarmCount() == null ? 0 : alarmCountVo.getTemperatureAndHumidityAlarmCount();
|
|
|
+ if (alarmCountVo != null) {
|
|
|
+ Integer smokeAlarmCount = alarmCountVo.getSmokeAlarmCount();
|
|
|
+ Integer gasAlarmCount = alarmCountVo.getGasAlarmCount();
|
|
|
+ Integer htAlarmCount = alarmCountVo.getTemperatureAndHumidityAlarmCount();
|
|
|
Integer count = smokeAlarmCount + gasAlarmCount + htAlarmCount;
|
|
|
return count;
|
|
|
}
|
|
|
@@ -258,13 +272,13 @@ public class IotAlarmDataServiceImpl extends ServiceImpl<IotAlarmDataMapper, Iot
|
|
|
pageDto.setCheckSub(true);
|
|
|
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();
|
|
|
+ if (alarmCountVo != null) {
|
|
|
+ Integer thiefAlarmCount = alarmCountVo.getThiefAlarmCount();
|
|
|
+ Integer infraredAlarmCount = alarmCountVo.getInfraredAlarmCount();
|
|
|
+ Integer doorAlarmCount = alarmCountVo.getDoorAlarmCount();
|
|
|
+ Integer waterAlarmCount = alarmCountVo.getWaterAlarmCount();
|
|
|
+ Integer upsAlarmCount = alarmCountVo.getUpsAlarmCount();
|
|
|
+ Integer airAlarmCount = alarmCountVo.getAirAlarmCount();
|
|
|
Integer count = thiefAlarmCount + infraredAlarmCount + doorAlarmCount + waterAlarmCount + upsAlarmCount + airAlarmCount;
|
|
|
return count;
|
|
|
}
|
|
|
@@ -286,10 +300,10 @@ public class IotAlarmDataServiceImpl extends ServiceImpl<IotAlarmDataMapper, Iot
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<Map<String,String>> selectAlarmCount(String orgPath) {
|
|
|
+ public List<Map<String, String>> selectAlarmCount(String orgPath) {
|
|
|
Date date = new Date();
|
|
|
Date beginTime = DateUtil.offsetDay(DateUtil.beginOfDay(date), -90);
|
|
|
- return baseMapper.selectAlarmCount(orgPath,beginTime);
|
|
|
+ return baseMapper.selectAlarmCount(orgPath, beginTime);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -303,8 +317,8 @@ public class IotAlarmDataServiceImpl extends ServiceImpl<IotAlarmDataMapper, Iot
|
|
|
List<AlarmTypeSelectedVO> list = Lists.newArrayList();
|
|
|
AlarmTypeSelectedVO bean;
|
|
|
String suffix = "告警";
|
|
|
- List<String> excludeTypes = Lists.newArrayList("FSU_AirConditioner","FSU_DoPowerCollection","FSU_DoPowerControlBoxButton",
|
|
|
- "AlarmHostInput_Humidity","AlarmHostInput_Temperature","AlarmHostInput_Smoke","AlarmHostInput_Infrared","AlarmHostInput_Soaking","AlarmHostInput_DoorSensor");
|
|
|
+ List<String> excludeTypes = Lists.newArrayList("FSU_AirConditioner", "FSU_DoPowerCollection", "FSU_DoPowerControlBoxButton",
|
|
|
+ "AlarmHostInput_Humidity", "AlarmHostInput_Temperature", "AlarmHostInput_Smoke", "AlarmHostInput_Infrared", "AlarmHostInput_Soaking", "AlarmHostInput_DoorSensor");
|
|
|
List<String> mixTypes = Lists.newArrayList(
|
|
|
String.valueOf(SensorType.INFRARED_SENSOR.getProductName()),
|
|
|
String.valueOf(SensorType.SMOKE_SENSOR.getProductName()),
|
|
|
@@ -312,52 +326,52 @@ public class IotAlarmDataServiceImpl extends ServiceImpl<IotAlarmDataMapper, Iot
|
|
|
String.valueOf(SensorType.WATER_INTRUSION.getProductName()),
|
|
|
String.valueOf(SensorType.DOOR_MAGNETIC_SENSOR.getProductName())
|
|
|
);
|
|
|
- if(StringUtils.isEmpty(type)){
|
|
|
- List<AlarmTypeSelectedVO> types0=baseMapper.selectAlarmTypeList(excludeTypes,null,type);
|
|
|
- for(AlarmTypeSelectedVO vo:types0){
|
|
|
- vo.setLabel(vo.getLabel()+suffix);
|
|
|
+ if (StringUtils.isEmpty(type)) {
|
|
|
+ List<AlarmTypeSelectedVO> types0 = baseMapper.selectAlarmTypeList(excludeTypes, null, type);
|
|
|
+ for (AlarmTypeSelectedVO vo : types0) {
|
|
|
+ vo.setLabel(vo.getLabel() + suffix);
|
|
|
|
|
|
//两种告警分类都包含的告警类型合并
|
|
|
- boolean isMix =false;
|
|
|
- for(String mix :mixTypes){
|
|
|
- if(mix.equals(vo.getValue())){
|
|
|
- isMix =true;
|
|
|
+ boolean isMix = false;
|
|
|
+ for (String mix : mixTypes) {
|
|
|
+ if (mix.equals(vo.getValue())) {
|
|
|
+ isMix = true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- if(isMix){
|
|
|
+ if (isMix) {
|
|
|
vo.setType("0_2");
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
vo.setType(vo.getValue().startsWith("FSU_") ? "0" : "2");
|
|
|
}
|
|
|
}
|
|
|
list.addAll(types0);
|
|
|
|
|
|
List<AlarmTypeSelectedVO> types1 = Lists.newArrayList();
|
|
|
- for(AlarmVideoTypeEnum enums:AlarmVideoTypeEnum.values()){
|
|
|
+ for (AlarmVideoTypeEnum enums : AlarmVideoTypeEnum.values()) {
|
|
|
bean = new AlarmTypeSelectedVO();
|
|
|
String value = String.valueOf(enums.getValue());
|
|
|
bean.setValue(value);
|
|
|
- bean.setLabel(enums.getText()+suffix);
|
|
|
+ bean.setLabel(enums.getText() + suffix);
|
|
|
bean.setType("1");
|
|
|
types1.add(bean);
|
|
|
}
|
|
|
list.addAll(types1);
|
|
|
- }else if(type.equals("1")){
|
|
|
+ } else if (type.equals("1")) {
|
|
|
List<AlarmTypeSelectedVO> types1 = Lists.newArrayList();
|
|
|
- for(AlarmVideoTypeEnum enums:AlarmVideoTypeEnum.values()){
|
|
|
+ for (AlarmVideoTypeEnum enums : AlarmVideoTypeEnum.values()) {
|
|
|
bean = new AlarmTypeSelectedVO();
|
|
|
String value = String.valueOf(enums.getValue());
|
|
|
bean.setValue(value);
|
|
|
- bean.setLabel(enums.getText()+suffix);
|
|
|
+ bean.setLabel(enums.getText() + suffix);
|
|
|
bean.setType(type);
|
|
|
types1.add(bean);
|
|
|
}
|
|
|
list.addAll(types1);
|
|
|
- }else{
|
|
|
- List<AlarmTypeSelectedVO> types0=baseMapper.selectAlarmTypeList(excludeTypes,mixTypes,type);
|
|
|
- for(AlarmTypeSelectedVO vo:types0){
|
|
|
- vo.setLabel(vo.getLabel()+suffix);
|
|
|
+ } else {
|
|
|
+ List<AlarmTypeSelectedVO> types0 = baseMapper.selectAlarmTypeList(excludeTypes, mixTypes, type);
|
|
|
+ for (AlarmTypeSelectedVO vo : types0) {
|
|
|
+ vo.setLabel(vo.getLabel() + suffix);
|
|
|
vo.setType(type);
|
|
|
}
|
|
|
list.addAll(types0);
|