|
@@ -15,10 +15,12 @@ import com.usky.fire.mapper.AlarmVideoMapper;
|
|
|
import com.usky.fire.service.AlarmVideoService;
|
|
|
import com.usky.fire.service.BaseUserCompanyService;
|
|
|
import com.usky.fire.service.util.OnlineMethod;
|
|
|
+import com.usky.fire.service.vo.DataVo;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
@@ -66,7 +68,7 @@ public class AlarmVideoServiceImpl extends AbstractCrudService<AlarmVideoMapper,
|
|
|
if (CollectionUtils.isNotEmpty(list)) {
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
list.get(i).setAlarmTypeName(OnlineMethod.alarmName(list.get(i).getAlarmType()));
|
|
|
- list.get(i).setReportContent(list.get(i).getDeviceName() + ",端口号:" + OnlineMethod.alarmName(list.get(i).getPortNum()));
|
|
|
+ list.get(i).setReportContent(list.get(i).getDeviceName() + ",端口号:" + list.get(i).getPortNum());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -140,7 +142,7 @@ public class AlarmVideoServiceImpl extends AbstractCrudService<AlarmVideoMapper,
|
|
|
if (CollectionUtils.isNotEmpty(list)) {
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
list.get(i).setAlarmTypeName(OnlineMethod.alarmName(list.get(i).getAlarmType()));
|
|
|
- list.get(i).setReportContent(list.get(i).getDeviceName() + ",端口号:" + OnlineMethod.alarmName(list.get(i).getPortNum()));
|
|
|
+ list.get(i).setReportContent(list.get(i).getDeviceName() + ",端口号:" + list.get(i).getPortNum());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -155,4 +157,31 @@ public class AlarmVideoServiceImpl extends AbstractCrudService<AlarmVideoMapper,
|
|
|
int count = this.count(queryWrapper);
|
|
|
return count;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<DataVo> Alarmlist() {
|
|
|
+ List<DataVo> list = new ArrayList<>();
|
|
|
+ String companyId = baseUserCompanyService.companyId();
|
|
|
+ LambdaQueryWrapper<AlarmVideo> queryWrapperOne = Wrappers.lambdaQuery();
|
|
|
+ queryWrapperOne.select(AlarmVideo::getAlarmTime, AlarmVideo::getDeviceCode,
|
|
|
+ AlarmVideo::getAlarmType, AlarmVideo::getAddress,
|
|
|
+ AlarmVideo::getHandlingStatus, AlarmVideo::getDeviceName,
|
|
|
+ AlarmVideo::getAttributeValue4, AlarmVideo::getPortNum)
|
|
|
+ .eq(AlarmVideo::getCompanyId, companyId)
|
|
|
+ .orderByDesc(AlarmVideo::getId)
|
|
|
+ .last(" limit 1");
|
|
|
+ List<AlarmVideo> list1 = this.list(queryWrapperOne);
|
|
|
+ for (int i = 0; i < list1.size(); i++) {
|
|
|
+ DataVo dataVo = new DataVo();
|
|
|
+ dataVo.setType1(list1.get(i).getAlarmTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
|
|
+ dataVo.setType2(list1.get(i).getDeviceCode());
|
|
|
+ dataVo.setType3(list1.get(i).getAlarmType());
|
|
|
+ dataVo.setType4(list1.get(i).getAddress());
|
|
|
+ dataVo.setType5(list1.get(i).getPortNum());
|
|
|
+ dataVo.setType6(list1.get(i).getDeviceName() + ",端口号:" + list1.get(i).getPortNum());
|
|
|
+ dataVo.setType7(list1.get(i).getHandlingStatus() == 1 ? "已处理" : "未处理");
|
|
|
+ list.add(dataVo);
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
}
|