|
@@ -6,6 +6,7 @@ import com.ozs.system.service.ISysDictDataService;
|
|
|
import com.ozs.system.service.ISysDictTypeService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.scheduling.annotation.EnableAsync;
|
|
@@ -32,6 +33,8 @@ public class ShotPictureExecutors {
|
|
|
private ISysDictTypeService iSysDictTypeService;
|
|
|
@Autowired
|
|
|
private TaskService taskService; //任务
|
|
|
+ @Value("${shot.storeAddress}")
|
|
|
+ private String storeAddress;
|
|
|
|
|
|
/**
|
|
|
* 处理非预警摄像头截图
|
|
@@ -44,11 +47,19 @@ public class ShotPictureExecutors {
|
|
|
dataList = iSysDictTypeService.selectDictDataByType("shot_switch");
|
|
|
DictUtils.setDictCache("shot_switch",dataList);
|
|
|
}
|
|
|
- //boolean shotSwitch = Boolean.parseBoolean(dictDataService.selectDictLabel("shot_switch", String.valueOf(0)));
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ String address = addressDataList.get(0).getDictLabel();
|
|
|
try {
|
|
|
if(!CollectionUtils.isEmpty(dataList) && Objects.nonNull(dataList.get(0))){
|
|
|
if (Boolean.parseBoolean(dataList.get(0).getDictLabel())) {
|
|
|
- taskService.getNormalPicture();
|
|
|
+ if(CollectionUtils.isEmpty(addressDataList) || Objects.isNull(addressDataList.get(0))){
|
|
|
+ address = storeAddress;
|
|
|
+ }
|
|
|
+ taskService.getNormalPicture(address);
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
@@ -68,10 +79,19 @@ public class ShotPictureExecutors {
|
|
|
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);
|
|
|
+ }
|
|
|
+ String address = addressDataList.get(0).getDictLabel();
|
|
|
try {
|
|
|
if(!CollectionUtils.isEmpty(dataList) && Objects.nonNull(dataList.get(0))){
|
|
|
if (Boolean.parseBoolean(dataList.get(0).getDictLabel())) {
|
|
|
- taskService.getAlarmPicture();
|
|
|
+ if(CollectionUtils.isEmpty(addressDataList) || Objects.isNull(addressDataList.get(0))){
|
|
|
+ address = storeAddress;
|
|
|
+ }
|
|
|
+ taskService.getAlarmPicture(address);
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|