Преглед изворни кода

手机端增加视联网,物联网,云广播详情接口
修改手机端资源详情接口,修改图片路径

Wang-Xiao-Ran пре 1 година
родитељ
комит
4b3b7ace01

+ 3 - 1
src/main/java/com/sooka/sponest/mobile/appbigdata/controller/AppBigDataCountController.java

@@ -20,6 +20,7 @@ import com.sooka.sponest.mobile.remoteapi.RemoteDataBaseService;
 import com.sooka.sponest.mobile.remoteapi.RemoteEventBaseService;
 import com.sooka.sponest.mobile.remoteapi.RemoteMiddlewareService;
 import com.sooka.sponest.mobile.remoteapi.domain.DataVO;
+import com.sooka.sponest.mobile.utils.PictureReplaceAll;
 import org.apache.poi.ss.formula.functions.T;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -76,7 +77,8 @@ public class AppBigDataCountController extends VisuBaseService {
     public AjaxResult getResourcePointById(@RequestBody VisualBO vb) {
         R resultData = middlewareService.getResourcePointById(vb.getId(), vb.getType());
         if (HttpStatus.SUCCESS == resultData.getCode()) {
-            return AjaxResult.success(resultData.getData());
+            LinkedHashMap<String, Object> data = (LinkedHashMap<String, Object>) resultData.getData();
+            return AjaxResult.success(PictureReplaceAll.replaceSchedulePictures(data,"pictures"));
         } else {
             return AjaxResult.error(resultData.getMsg());
         }

+ 9 - 0
src/main/java/com/sooka/sponest/mobile/remoteapi/RemoteMonitorBaseService.java

@@ -67,4 +67,13 @@ public interface RemoteMonitorBaseService {
 
     @GetMapping("/camera/selectIdTCameraByIds/{ids}")
     AjaxResult selectIdTCameraByIds(@PathVariable("ids") String[] ids);
+
+    @GetMapping("/camera/selectByCameraId/{id}")
+    AjaxResult selectByCameraId(@PathVariable("id") String cameraId);
+
+    @GetMapping("/device/selectByDeviceId/{id}")
+    AjaxResult selectByDeviceId(@PathVariable("id")String id);
+
+    @GetMapping("/broadcast/selectByBroadcastId/{id}")
+    AjaxResult selectByBroadcastId(@PathVariable("id")String id);
 }

+ 15 - 0
src/main/java/com/sooka/sponest/mobile/remoteapi/factory/RemoteMonitorBaseServiceFallbackFactory.java

@@ -100,6 +100,21 @@ public class RemoteMonitorBaseServiceFallbackFactory implements FallbackFactory<
             public AjaxResult selectIdTCameraByIds(String[] ids) {
                 return null;
             }
+
+            @Override
+            public AjaxResult selectByCameraId(String cameraId) {
+                return null;
+            }
+
+            @Override
+            public AjaxResult selectByDeviceId(String id) {
+                return null;
+            }
+
+            @Override
+            public AjaxResult selectByBroadcastId(String id) {
+                return null;
+            }
         };
     }
 }

+ 21 - 0
src/main/java/com/sooka/sponest/mobile/system/camera/controller/AppCameraController.java

@@ -253,4 +253,25 @@ public class AppCameraController extends AppBaseController {
                 .collect(Collectors.toList());
         return result;
     }
+
+    /**
+     * 查询视联网详情
+     * @param id 视联网设备ID
+     * @param type 请求的数据类型:1=视联网/2=物联网/3=云广播
+     * @return AjaxResult
+     */
+    @GetMapping("/getCameraById")
+    public AjaxResult getCameraByCameraId(@RequestParam("id") String id, @RequestParam("type") String type){
+        if("1".equals(type)){
+            return remoteMonitorBaseService.selectByCameraId(id);
+        }else if("2".equals(type)){
+            return remoteMonitorBaseService.selectByDeviceId(id);
+        }else if("3".equals(type)){
+            return remoteMonitorBaseService.selectByBroadcastId(id);
+        }else{
+            return AjaxResult.error("Request type is not found!");
+        }
+
+    }
+
 }

+ 1 - 1
src/main/java/com/sooka/sponest/mobile/utils/PictureReplaceAll.java

@@ -25,7 +25,7 @@ public class PictureReplaceAll {
         list.replaceAll(map -> replaceSchedulePictures(map, replaceKey));
     }
 
-    private static LinkedHashMap<String, Object> replaceSchedulePictures(LinkedHashMap<String, Object> map, String replaceKey) {
+    public static LinkedHashMap<String, Object> replaceSchedulePictures(LinkedHashMap<String, Object> map, String replaceKey) {
         String url = Optional.ofNullable(map.get(replaceKey)).map(Object::toString).map(s -> s.replaceAll(OLD_IP_FIRST, NEW_IP).replaceAll(OLD_IP_SECOND, NEW_IP)).orElse("");
 //        url = url.replaceAll(oldIp2, newIp1);
         map.put(replaceKey, url);