|
@@ -48,22 +48,13 @@ public class TaskService {
|
|
|
|
|
|
public void getNormalPicture() {
|
|
|
String address = storeAddress;
|
|
|
- List<SysDictData> dataList = DictUtils.getDictCache("shot_switch");
|
|
|
- if(CollectionUtils.isEmpty(dataList) || Objects.isNull(dataList.get(0))){
|
|
|
- dataList = iSysDictTypeService.selectDictDataByType("shot_switch");
|
|
|
- DictUtils.setDictCache("shot_switch",dataList);
|
|
|
- }
|
|
|
List<SysDictData> addressDataList = DictUtils.getDictCache("shot_address");
|
|
|
if(CollectionUtils.isEmpty(addressDataList) || Objects.isNull(addressDataList.get(0))){
|
|
|
addressDataList = iSysDictTypeService.selectDictDataByType("shot_address");
|
|
|
DictUtils.setDictCache("shot_address",addressDataList);
|
|
|
}
|
|
|
- if(!CollectionUtils.isEmpty(dataList) && Objects.nonNull(dataList.get(0))){
|
|
|
- if (Boolean.parseBoolean(dataList.get(0).getDictLabel())) {
|
|
|
- if(!CollectionUtils.isEmpty(addressDataList) && Objects.nonNull(addressDataList.get(0))){
|
|
|
- address = addressDataList.get(0).getDictLabel();
|
|
|
- }
|
|
|
- }
|
|
|
+ if(!CollectionUtils.isEmpty(addressDataList) && Objects.nonNull(addressDataList.get(0))){
|
|
|
+ address = addressDataList.get(0).getDictLabel();
|
|
|
}
|
|
|
boolean isHasKeyNormal = redisService.hasKey(Constants.NORMAL_SET);
|
|
|
if(!isHasKeyNormal){
|
|
@@ -71,6 +62,9 @@ public class TaskService {
|
|
|
}
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
Set<BaseCameraVO> normalSet = redisService.getSetMembers(Constants.NORMAL_SET);
|
|
|
+ if (log.isDebugEnabled()) {
|
|
|
+ log.debug("正常摄像机数量:"+normalSet.size());
|
|
|
+ }
|
|
|
if (!CollectionUtils.isEmpty(normalSet)) {
|
|
|
String finalAddress = address;
|
|
|
normalSet.forEach(item -> {
|
|
@@ -101,22 +95,13 @@ public class TaskService {
|
|
|
|
|
|
public void getAlarmPicture() {
|
|
|
String address = storeAddress;
|
|
|
- List<SysDictData> dataList = DictUtils.getDictCache("shot_switch");
|
|
|
- if(CollectionUtils.isEmpty(dataList) || Objects.isNull(dataList.get(0))){
|
|
|
- dataList = iSysDictTypeService.selectDictDataByType("shot_switch");
|
|
|
- DictUtils.setDictCache("shot_switch",dataList);
|
|
|
- }
|
|
|
List<SysDictData> addressDataList = DictUtils.getDictCache("shot_address");
|
|
|
if(CollectionUtils.isEmpty(addressDataList) || Objects.isNull(addressDataList.get(0))){
|
|
|
addressDataList = iSysDictTypeService.selectDictDataByType("shot_address");
|
|
|
DictUtils.setDictCache("shot_address",addressDataList);
|
|
|
}
|
|
|
- if(!CollectionUtils.isEmpty(dataList) && Objects.nonNull(dataList.get(0))){
|
|
|
- if (Boolean.parseBoolean(dataList.get(0).getDictLabel())) {
|
|
|
- if(!CollectionUtils.isEmpty(addressDataList) && Objects.nonNull(addressDataList.get(0))){
|
|
|
- address = addressDataList.get(0).getDictLabel();
|
|
|
- }
|
|
|
- }
|
|
|
+ if(!CollectionUtils.isEmpty(addressDataList) && Objects.nonNull(addressDataList.get(0))){
|
|
|
+ address = addressDataList.get(0).getDictLabel();
|
|
|
}
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
boolean isHasKeyAlarm = redisService.hasKey(Constants.ALARM_SET);
|
|
@@ -124,6 +109,9 @@ public class TaskService {
|
|
|
msgAlarmService.initializationCameraCache();
|
|
|
}
|
|
|
Set<BaseCameraVO> alarmSet = redisService.getSetMembers(Constants.ALARM_SET);
|
|
|
+ if (log.isDebugEnabled()) {
|
|
|
+ log.debug("报警摄像机数量:"+alarmSet.size());
|
|
|
+ }
|
|
|
if(!CollectionUtils.isEmpty(alarmSet)){
|
|
|
String finalAddress = address;
|
|
|
alarmSet.forEach(item -> {
|
|
@@ -152,5 +140,4 @@ public class TaskService {
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|