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/service/PlayPlanNvService.java | 173 +++++++++++++++++++++++++++++----------------------------
1 files changed, 88 insertions(+), 85 deletions(-)
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