lyq 1 rok pred
rodič
commit
c09a675dd8

+ 24 - 3
src/main/java/com/sooka/sponest/mobile/event/service/impl/AppEventServiceImpl.java

@@ -95,7 +95,22 @@ public class AppEventServiceImpl implements AppEventService {
     @Override
     public AjaxResult queryEventDetail(String eventCode) {
         try {
-            return AjaxResult.success(remoteEventBaseService.getCentereventTEventcatalogueByCode(eventCode).getData());
+            AppEventSalBO appEventSalBO = remoteEventBaseService.getCentereventTEventcatalogueByCode(eventCode).getData();
+            String token = "";// 大华token
+            if (dahuaFile) {
+                token = remoteMonitorService.getToken();
+            }
+            String finalToken = token;
+            appEventSalBO.getAttachs().forEach(item -> {
+                if ("DH_1".equals(item.getBusSource())) {
+                    item.setAttachPath(DH1 + item.getAttachPath() + "?token=" + finalToken);
+                } else {
+                    item.setAttachPath(DH2 + item.getAttachPath());
+                }
+            });
+            String prefix = remoteSystemBaseService.selectConfigKey("appUrl").getData();
+            appEventSalBO.getAttachsMpf().forEach(item -> item.setAttachPath(prefix + item.getAttachPath()));
+            return AjaxResult.success(appEventSalBO);
         } catch (Exception e) {
             log.error(e.getMessage());
             return AjaxResult.error("查询失败");
@@ -105,6 +120,12 @@ public class AppEventServiceImpl implements AppEventService {
     @Value("${sooka.dahuafile:}")
     private Boolean dahuaFile;
 
+    @Value("${sooka.DH1:}")
+    private String DH1;
+
+    @Value("${sooka.DH2:}")
+    private String DH2;
+
     @Autowired
     private RemoteMonitorBaseService remoteMonitorService;
 
@@ -129,9 +150,9 @@ public class AppEventServiceImpl implements AppEventService {
         for (AppDataTAttach appDataTAttach : appDataTAttachList) {
             String urlPrefix = FilePrefixUtils.getAPPUrlPrefix(appDataTAttach.getBusSource(), keyMap);
             if ("DH_1".equals(appDataTAttach.getBusSource())) {
-                appDataTAttach.setAttachPath(urlPrefix.replace("10.53.0.37", "202.98.7.134") + appDataTAttach.getAttachPath() + "?token=" + token);
+                appDataTAttach.setAttachPath(DH1 + appDataTAttach.getAttachPath() + "?token=" + token);
             } else if ("DH_2".equals(appDataTAttach.getBusSource())) {
-                appDataTAttach.setAttachPath(urlPrefix.replace("10.53.0.35:38499", "202.98.7.130:38494") + appDataTAttach.getAttachPath());
+                appDataTAttach.setAttachPath(DH2 + appDataTAttach.getAttachPath());
             } else if (appDataTAttach.getAttachPath().endsWith(".jpg") || appDataTAttach.getAttachPath().endsWith(".gif") || appDataTAttach.getAttachPath().endsWith(".png")
                     || appDataTAttach.getAttachPath().endsWith(".jpeg") || appDataTAttach.getAttachPath().endsWith(".bmp") || appDataTAttach.getAttachPath().endsWith(".webp")
                     || appDataTAttach.getAttachPath().endsWith(".psd") || appDataTAttach.getAttachPath().endsWith(".svg") || appDataTAttach.getAttachPath().endsWith(".tiff")