From a8a707e602d644f3207b077d55bfad1a7c3642b7 Mon Sep 17 00:00:00 2001
From: LHN <31457034@qq.com>
Date: 星期三, 19 十月 2022 17:47:48 +0800
Subject: [PATCH] changes

---
 ximon-admin/src/main/java/com/sandu/ximon/admin/controller/VnnoxController.java     |    6 
 dao/src/main/resources/mapper/LedPlayerEntityMapper.xml                             |    2 
 ximon-admin/src/main/java/com/sandu/ximon/admin/service/PlayPlanNvService.java      |  173 ++++++++++++++++++++++---------------------
 ximon-admin/src/main/java/com/sandu/ximon/admin/service/IpVolumeMissionService.java |    4 
 4 files changed, 94 insertions(+), 91 deletions(-)

diff --git a/dao/src/main/resources/mapper/LedPlayerEntityMapper.xml b/dao/src/main/resources/mapper/LedPlayerEntityMapper.xml
index 02be14e..6294706 100644
--- a/dao/src/main/resources/mapper/LedPlayerEntityMapper.xml
+++ b/dao/src/main/resources/mapper/LedPlayerEntityMapper.xml
@@ -78,7 +78,7 @@
         WHERE
         t3.group_id=#{groupId}
         <if test="clientId != null">
-            AND (t2.user_id = #{clientId} OR t2.client_id = #{clientId})
+            AND (t3.user_id = #{clientId} OR t3.client_id = #{clientId})
         </if>
     </select>
     <select id="ledListByGroupId" resultType="com.sandu.ximon.dao.domain.LedPlayerEntity">
diff --git a/ximon-admin/src/main/java/com/sandu/ximon/admin/controller/VnnoxController.java b/ximon-admin/src/main/java/com/sandu/ximon/admin/controller/VnnoxController.java
index 3ca7075..f985e3f 100644
--- a/ximon-admin/src/main/java/com/sandu/ximon/admin/controller/VnnoxController.java
+++ b/ximon-admin/src/main/java/com/sandu/ximon/admin/controller/VnnoxController.java
@@ -274,9 +274,9 @@
      */
     @GetMapping("/getByGroupId")
     public ResponseVO<Object> getByGroupId(@RequestParam(value = "groupId", required = true) Long groupId) {
-        if (!permissionConfig.check(MenuEnum.LED_N_GROUP_INFO.getCode())) {
-            return ResponseUtil.fail("缂哄皯瀵瑰簲鐢ㄦ埛鏉冮檺");
-        }
+//        if (!permissionConfig.check(MenuEnum.LED_N_GROUP_INFO.getCode())) {
+//            return ResponseUtil.fail("缂哄皯瀵瑰簲鐢ㄦ埛鏉冮檺");
+//        }
         if (groupId == null) {
             throw new BusinessException("groupId涓嶈兘涓虹┖");
         }
diff --git a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/IpVolumeMissionService.java b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/IpVolumeMissionService.java
index 4837ce6..b8da591 100644
--- a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/IpVolumeMissionService.java
+++ b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/IpVolumeMissionService.java
@@ -437,12 +437,12 @@
         }
         if (SecurityUtils.getClientId() != null) {
             if (clientService.findClientId()) {
-                if (byId.getUserId().equals(SecurityUtils.getUserId())) {
+                if (!byId.getUserId().equals(SecurityUtils.getUserId())) {
                     throw new BusinessException("浠诲姟褰掑睘閿欒");
                 }
 
             } else {
-                if (byId.getClientId().equals(SecurityUtils.getUserId())) {
+                if (!byId.getClientId().equals(SecurityUtils.getUserId())&&!byId.getUserId().equals(SecurityUtils.getUserId())) {
                     throw new BusinessException("浠诲姟褰掑睘閿欒");
                 }
             }
diff --git a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/PlayPlanNvService.java b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/PlayPlanNvService.java
index 1b4e15c..8e258bb 100644
--- a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/PlayPlanNvService.java
+++ b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/PlayPlanNvService.java
@@ -430,93 +430,96 @@
         if (ledProgram.getPages() == null) {
             throw new BusinessException("鑺傜洰鍐呭涓㈠け");
         }
-        if (SecurityUtils.getClientId() != null && !Objects.equals(ledProgram.getClientId(), SecurityUtils.getUserId()) && !Objects.equals(ledProgram.getClientId(), SecurityUtils.getClientId())) {
+        if (SecurityUtils.getClientId() != null
+                && !Objects.equals(ledProgram.getClientId(), SecurityUtils.getUserId())
+                && !Objects.equals(ledProgram.getUserId(), SecurityUtils.getUserId())) {
             throw new BusinessException("璇蜂笉瑕佹搷浣滃叾浠栦汉鐨勮妭鐩�");
         }
-        String pages = ledProgram.getPages();
-
-
-        List<String> success = new ArrayList<>();
-        List<String> fail = new ArrayList<>();
-        //鎷兼帴鎴愬姛澶辫触鐨勭粨鏋�
-        Map<String, Object> result = new HashMap<>();
-        List<NovaPushResultVO> successList = new ArrayList<>();
-        List<NovaPushResultVO> faileList = new ArrayList<>();
-
-
-        List<List<String>> split = CollectionUtil.split(nova.stream().map(NovaPushResultVO::getPlayerId).collect(Collectors.toList()), 100);
-
-        for (List<String> playerIds : split) {
-            PlayerProgram program = new PlayerProgram();
-            List<PlayerPage> programDtos = JSON.parseArray(pages, PlayerPage.class);
-            programDtos.forEach(
-                    programDto -> {
-                        programDto.getWidgets().forEach(
-                                widget -> {
-                                    if (PlayerWidgetType.PICTURE.equals(widget.getType()) || PlayerWidgetType.VIDEO.equals(widget.getType())) {
-                                        String url = widget.getUrl();
-                                        LEDProgramFile one = fileService.getOne(Wrappers.lambdaQuery(LEDProgramFile.class).eq(LEDProgramFile::getFileUrl, url));
-                                        if (one == null) {
-                                            throw new BusinessException("鑺傜洰鏂囦欢宸插け鏁�");
-                                        }
-                                        widget.setMd5(one.getMd5());
-                                        widget.setSize(Long.parseLong(one.getSize()));
-                                    }
-                                }
-                        );
-                    }
-            );
-            program.setPlayerIds(playerIds);
-            //鑾峰彇鑺傜洰瀹炰綋
-            program.setPages(programDtos);
-
-            program.setNoticeUrl(VnnoxConstant.NOTIFY_URL);
-            VnnoxResultResponse vnnoxResultResponse = vnnoxProgramAPIUtil.pushProgram(program);
-
-            if (vnnoxResultResponse == null || vnnoxResultResponse.getData() == null) {
-                throw new BusinessException("鎺ㄩ�佸け璐�");
-            }
-
-
-            if (vnnoxResultResponse.getData() != null) {
-                success = vnnoxResultResponse.getData().getSuccess();
-                fail = vnnoxResultResponse.getData().getFail();
-            }
-
-            List<String> finalSuccess = success;
-            List<String> finalFail = fail;
-            nova.forEach(n -> {
-                if (finalSuccess.contains(n.getPlayerId())) {
-                    successList.add(n);
-                } else if (finalFail.contains(n.getPlayerId())) {
-                    faileList.add(n);
-                }
-            });
-        }
-
-        result.put("success", successList);
-        result.put("fail", faileList);
-
-        /**
-         * 璇虹摝鎺ㄩ�佽妭鐩棩蹇楄褰曞紑濮�
-         */
-        List<LedPlayerEntity> list = SpringContextHolder.getBean(LedPlayerEntityService.class)
-                .list(Wrappers.lambdaQuery(LedPlayerEntity.class).in(LedPlayerEntity::getId, nova.stream().map(NovaPushResultVO::getPlayerId).toArray()));
-        List<String> listCode = new ArrayList<>();
-        for (LedPlayerEntity temp : list) {
-            listCode.add(temp.getSn());
-        }
-
-        String content = "{鑺傜洰ID锛�" + pid
-                + "锛� 鑺傜洰鍚嶇О锛�" + ledProgram.getName()
-                + "}," + " 鎺ㄩ�佺粨鏋滐細" + result
-                + " }";
-        StoreOperationRecordsUtils.storeOperationData(listCode, null, "璇虹摝鎺ㄩ�佽妭鐩�", content);
-        /**
-         * 璇虹摝鎺ㄩ�佽妭鐩棩蹇楄褰曠粨鏉�
-         */
-
-        return result;
+        return null;
+//        String pages = ledProgram.getPages();
+//
+//
+//        List<String> success = new ArrayList<>();
+//        List<String> fail = new ArrayList<>();
+//        //鎷兼帴鎴愬姛澶辫触鐨勭粨鏋�
+//        Map<String, Object> result = new HashMap<>();
+//        List<NovaPushResultVO> successList = new ArrayList<>();
+//        List<NovaPushResultVO> faileList = new ArrayList<>();
+//
+//
+//        List<List<String>> split = CollectionUtil.split(nova.stream().map(NovaPushResultVO::getPlayerId).collect(Collectors.toList()), 100);
+//
+//        for (List<String> playerIds : split) {
+//            PlayerProgram program = new PlayerProgram();
+//            List<PlayerPage> programDtos = JSON.parseArray(pages, PlayerPage.class);
+//            programDtos.forEach(
+//                    programDto -> {
+//                        programDto.getWidgets().forEach(
+//                                widget -> {
+//                                    if (PlayerWidgetType.PICTURE.equals(widget.getType()) || PlayerWidgetType.VIDEO.equals(widget.getType())) {
+//                                        String url = widget.getUrl();
+//                                        LEDProgramFile one = fileService.getOne(Wrappers.lambdaQuery(LEDProgramFile.class).eq(LEDProgramFile::getFileUrl, url));
+//                                        if (one == null) {
+//                                            throw new BusinessException("鑺傜洰鏂囦欢宸插け鏁�");
+//                                        }
+//                                        widget.setMd5(one.getMd5());
+//                                        widget.setSize(Long.parseLong(one.getSize()));
+//                                    }
+//                                }
+//                        );
+//                    }
+//            );
+//            program.setPlayerIds(playerIds);
+//            //鑾峰彇鑺傜洰瀹炰綋
+//            program.setPages(programDtos);
+//
+//            program.setNoticeUrl(VnnoxConstant.NOTIFY_URL);
+//            VnnoxResultResponse vnnoxResultResponse = vnnoxProgramAPIUtil.pushProgram(program);
+//
+//            if (vnnoxResultResponse == null || vnnoxResultResponse.getData() == null) {
+//                throw new BusinessException("鎺ㄩ�佸け璐�");
+//            }
+//
+//
+//            if (vnnoxResultResponse.getData() != null) {
+//                success = vnnoxResultResponse.getData().getSuccess();
+//                fail = vnnoxResultResponse.getData().getFail();
+//            }
+//
+//            List<String> finalSuccess = success;
+//            List<String> finalFail = fail;
+//            nova.forEach(n -> {
+//                if (finalSuccess.contains(n.getPlayerId())) {
+//                    successList.add(n);
+//                } else if (finalFail.contains(n.getPlayerId())) {
+//                    faileList.add(n);
+//                }
+//            });
+//        }
+//
+//        result.put("success", successList);
+//        result.put("fail", faileList);
+//
+//        /**
+//         * 璇虹摝鎺ㄩ�佽妭鐩棩蹇楄褰曞紑濮�
+//         */
+//        List<LedPlayerEntity> list = SpringContextHolder.getBean(LedPlayerEntityService.class)
+//                .list(Wrappers.lambdaQuery(LedPlayerEntity.class).in(LedPlayerEntity::getId, nova.stream().map(NovaPushResultVO::getPlayerId).toArray()));
+//        List<String> listCode = new ArrayList<>();
+//        for (LedPlayerEntity temp : list) {
+//            listCode.add(temp.getSn());
+//        }
+//
+//        String content = "{鑺傜洰ID锛�" + pid
+//                + "锛� 鑺傜洰鍚嶇О锛�" + ledProgram.getName()
+//                + "}," + " 鎺ㄩ�佺粨鏋滐細" + result
+//                + " }";
+//        StoreOperationRecordsUtils.storeOperationData(listCode, null, "璇虹摝鎺ㄩ�佽妭鐩�", content);
+//        /**
+//         * 璇虹摝鎺ㄩ�佽妭鐩棩蹇楄褰曠粨鏉�
+//         */
+//
+//        return result;
     }
 
 

--
Gitblit v1.9.3