Bladeren bron

截图优化

wyyay 10 maanden geleden
bovenliggende
commit
164bc00af8

+ 4 - 4
hazard-admin/src/main/java/com/ozs/web/controller/shotschedule/ShotPictureExecutors.java

@@ -42,6 +42,7 @@ public class ShotPictureExecutors {
     @Async
     @Scheduled(fixedRate = 60000)
     public synchronized void handleNormalPicture() {
+        String address = storeAddress;
         List<SysDictData> dataList = DictUtils.getDictCache("shot_switch");
         if(CollectionUtils.isEmpty(dataList) || Objects.isNull(dataList.get(0))){
             dataList = iSysDictTypeService.selectDictDataByType("shot_switch");
@@ -52,12 +53,11 @@ public class ShotPictureExecutors {
             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())) {
                     if(CollectionUtils.isEmpty(addressDataList) || Objects.isNull(addressDataList.get(0))){
-                        address = storeAddress;
+                        address = addressDataList.get(0).getDictLabel();
                     }
                     taskService.getNormalPicture(address);
                 }
@@ -74,6 +74,7 @@ public class ShotPictureExecutors {
     @Async
     @Scheduled(fixedRate = 500)
     public synchronized void handleAlarmPicture() {
+        String address = storeAddress;
         List<SysDictData> dataList = DictUtils.getDictCache("shot_switch");
         if(CollectionUtils.isEmpty(dataList) || Objects.isNull(dataList.get(0))){
             dataList = iSysDictTypeService.selectDictDataByType("shot_switch");
@@ -84,12 +85,11 @@ public class ShotPictureExecutors {
             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())) {
                     if(CollectionUtils.isEmpty(addressDataList) || Objects.isNull(addressDataList.get(0))){
-                        address = storeAddress;
+                        address = addressDataList.get(0).getDictLabel();
                     }
                     taskService.getAlarmPicture(address);
                 }