From e55c8b0a92eb9715edd90c31dfd4de51a47b588b Mon Sep 17 00:00:00 2001
From: liuhaonan <31457034@qq.com>
Date: 星期五, 04 十一月 2022 17:40:08 +0800
Subject: [PATCH] changes
---
ximon-admin/src/main/java/com/sandu/ximon/admin/controller/GetListOnBindingController.java | 253 ++++++++++++++++++++++++++++++++++++--------------
1 files changed, 180 insertions(+), 73 deletions(-)
diff --git a/ximon-admin/src/main/java/com/sandu/ximon/admin/controller/GetListOnBindingController.java b/ximon-admin/src/main/java/com/sandu/ximon/admin/controller/GetListOnBindingController.java
index 50b4fa7..dfe475c 100644
--- a/ximon-admin/src/main/java/com/sandu/ximon/admin/controller/GetListOnBindingController.java
+++ b/ximon-admin/src/main/java/com/sandu/ximon/admin/controller/GetListOnBindingController.java
@@ -2,22 +2,23 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.github.pagehelper.util.StringUtil;
import com.sandu.common.domain.ResponseVO;
import com.sandu.common.util.ResponseUtil;
import com.sandu.common.util.SpringContextHolder;
-import com.sandu.ximon.admin.param.BroadcastTerminalV2Param;
import com.sandu.ximon.admin.security.SecurityUtils;
import com.sandu.ximon.admin.service.*;
import com.sandu.ximon.dao.bo.BroadcastTerminalV2EntityBo;
+import com.sandu.ximon.dao.bo.LightBo;
import com.sandu.ximon.dao.bo.MonitorBo;
-import com.sandu.ximon.dao.domain.Client;
-import com.sandu.ximon.dao.domain.IpVolumeFile;
-import com.sandu.ximon.dao.domain.LEDProgram;
-import com.sandu.ximon.dao.domain.PoleLightemitEntity;
+import com.sandu.ximon.dao.domain.*;
+import com.sandu.ximon.dao.mapper.LightMapper;
import com.sandu.ximon.dao.mapper.MonitorMapper;
+import com.sandu.ximon.dao.mapper.PoleMapper;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
@@ -40,11 +41,16 @@
* 瀹㈡埛鍒楄〃
*/
@GetMapping("/getClientList")
- public ResponseVO<Object> getClientList() {
+ public ResponseVO<Object> getClientList(@RequestParam(required = false, value = "keyword") String keyword) {
LambdaQueryWrapper<Client> wrapper = Wrappers.lambdaQuery(Client.class);
//闈炶秴绠″彧鑳界湅鍒拌嚜宸变笅灞炵殑瀹㈡埛淇℃伅
if (SecurityUtils.getClientId() != null) {
wrapper.eq(Client::getSuperiorId, SecurityUtils.getUserId());
+ }
+ if (!StringUtil.isEmpty(keyword)) {
+ wrapper.like(Client::getId, keyword).or(w -> {
+ w.like(Client::getClientName, keyword);
+ });
}
List<Client> list = SpringContextHolder.getBean(ClientService.class).list(wrapper);
@@ -60,6 +66,158 @@
return ResponseUtil.success(mapList);
}
+ /**
+ * 鐏潌鍒楄〃
+ */
+ private final PoleMapper poleMapper;
+
+ @GetMapping("/getPoleList")
+ public ResponseVO<Object> getPoleList(@RequestParam(required = false, value = "keyword") String keyword) {
+ List<Pole> poleList;
+ if (SecurityUtils.getClientId() == null) {
+ poleList = poleMapper.getPoleListOnBinding(null, keyword);
+ } else {
+ poleList = poleMapper.getPoleListOnBinding(SecurityUtils.getUserId(), keyword);
+ }
+
+ List<Map> mapList = new ArrayList<>();
+ Map map;
+ for (Pole bean : poleList) {
+ map = new LinkedHashMap();
+ map.put("id", bean.getId());
+ map.put("poleName", bean.getPoleName());
+ mapList.add(map);
+ }
+ return ResponseUtil.success(mapList);
+ }
+
+ /**
+ * 璺伅鍒楄〃
+ */
+ private final LightMapper lightMapper;
+
+ @GetMapping("/getLightList")
+ public ResponseVO<Object> getLightList(@RequestParam(required = false, value = "keyword") String keyword) {
+ List<LightBo> listLight = lightMapper.listLightOnBinding(SecurityUtils.getClientId(), keyword);
+
+
+ List<Map> mapList = new ArrayList<>();
+ Map map;
+ for (LightBo bean : listLight) {
+ map = new LinkedHashMap();
+ map.put("id", bean.getLightId());
+ map.put("deviceCode", bean.getDeviceCode());
+ map.put("poleId", bean.getPoleId());
+ map.put("poleName", bean.getPoleName());
+ mapList.add(map);
+ }
+ return ResponseUtil.success(mapList);
+ }
+
+ /**
+ * NLED鍒楄〃(璇虹摝璁惧)
+ */
+ @GetMapping("/getLedPlayerEntityList")
+ public ResponseVO<Object> getLedPlayerEntityList(@RequestParam(required = false, value = "keyword") String keyword) {
+ List<LedPlayerEntity> list = SpringContextHolder.getBean(LedPlayerEntityService.class).
+ ledPlayerEntityListOnBinding(keyword);
+
+ List<Map> mapList = new ArrayList<>();
+ Map map;
+ for (LedPlayerEntity bean : list) {
+ map = new LinkedHashMap();
+ map.put("id", bean.getId());
+ map.put("name", bean.getName());
+ map.put("playerName", bean.getPlayerName());
+ map.put("playerId", bean.getPlayerId());
+ map.put("sn", bean.getSn());
+ map.put("poleId", bean.getPoleId());
+ map.put("poleName", bean.getPoleName());
+ map.put("onlineStatus", bean.getOnlineStatus());
+ map.put("resolution", bean.getWidth() + " * " + bean.getHeight());
+ mapList.add(map);
+ }
+ return ResponseUtil.success(mapList);
+ }
+
+ /**
+ * NLED鏂囦欢鍒楄〃
+ */
+ @GetMapping("/getLedFilesList")
+ public ResponseVO<Object> getLedFilesList() {
+ LambdaQueryWrapper<LEDProgramFile> wrapper = Wrappers.lambdaQuery(LEDProgramFile.class);
+ if (SecurityUtils.getClientId() != null) {
+ wrapper.eq(LEDProgramFile::getClientId, SecurityUtils.getUserId()).or(w -> {
+ w.eq(LEDProgramFile::getUserId, SecurityUtils.getUserId());
+ });
+ }
+ List<LEDProgramFile> list = SpringContextHolder.getBean(LEDProgramFileService.class).list(wrapper);
+
+ List<Map> mapList = new ArrayList<>();
+ Map map;
+ for (LEDProgramFile bean : list) {
+ map = new LinkedHashMap();
+ map.put("fileId", bean.getId());
+ map.put("fileType", bean.getFileType());
+ map.put("fileUrl", bean.getFileUrl());
+ map.put("fileSize", bean.getSize());
+ if ("mp4".equals(bean.getFileType())) {
+ map.put("screenShot", bean.getScreenShot());
+ } else {
+ map.put("screenShot", bean.getFileUrl());
+ }
+ mapList.add(map);
+ }
+ return ResponseUtil.success(mapList);
+ }
+
+ /**
+ * NLED鑺傜洰鍒楄〃
+ *
+ * @return
+ */
+ private final LEDProgramService ledProgramService;
+
+ @GetMapping("/getNledProgeamList")
+ public ResponseVO<Object> getNledProgeamList(@RequestParam(required = false, value = "keyword") String keyword) {
+ List<LEDProgram> ledPrograms = ledProgramService.listProgramOnBinding(keyword);
+ List<Map> mapList = new ArrayList<>();
+ Map map;
+ for (LEDProgram bean : ledPrograms) {
+ map = new LinkedHashMap();
+ map.put("id", bean.getId());
+ map.put("name", bean.getName());
+ mapList.add(map);
+ }
+ return ResponseUtil.success(mapList);
+ }
+
+
+ /**
+ * SLED鍒楄〃
+ *
+ * @return
+ */
+ private final PoleLightemitService sLedService;
+
+ @GetMapping("/getSledList")
+ public ResponseVO<Object> getSledList(@RequestParam(required = false, value = "keyword") String keyword) {
+ List<PoleLightemitEntity> poleLightemitEntities = sLedService.listLedOnBinding(keyword);
+ List<Map> mapList = new ArrayList<>();
+ Map map;
+ for (PoleLightemitEntity bean : poleLightemitEntities) {
+ map = new LinkedHashMap();
+ map.put("lightemitId", bean.getLightemitId());
+ map.put("lightemitName", bean.getLightemitName());
+ map.put("lightemitControlCode", bean.getLightemitControlCode());
+ map.put("isOnLine", bean.isOnLine());
+ map.put("streetlightId", bean.getStreetlightId());
+ map.put("streetlightName", bean.getStreetlightName());
+ mapList.add(map);
+ }
+ return ResponseUtil.success(mapList);
+ }
+
/**
* 鎽勫儚澶村垪琛�
@@ -69,13 +227,13 @@
private final MonitorMapper monitorMapper;
@GetMapping("/getMonitorList")
- public ResponseVO<Object> getMonitorList() {
+ public ResponseVO<Object> getMonitorList(@RequestParam(required = false, value = "keyword") String keyword) {
List<MonitorBo> monitorBos;
//瓒呯
if (SecurityUtils.getClientId() == null) {
- monitorBos = monitorMapper.listMonitorDeviceSerial1(null, null, 2);
+ monitorBos = monitorMapper.newListMonitorOnBind(null, keyword);
} else {
- monitorBos = monitorMapper.listMonitorDeviceSerial1(SecurityUtils.getUserId(), null, 2);
+ monitorBos = monitorMapper.newListMonitorOnBind(SecurityUtils.getUserId(), keyword);
}
List<Map> mapList = new ArrayList<>();
Map map;
@@ -92,41 +250,14 @@
}
- private final IpVolumeFileService ipVolumeFileService;
-
- /**
- * 闊虫煴骞挎挱绱犳潗鍒楄〃
- *
- * @return
- */
- @GetMapping("/getIpFileList")
- public ResponseVO<Object> getIpFileList() {
- List<IpVolumeFile> ipVolumeFiles = ipVolumeFileService.listFiles();
- List<Map> mapList = new ArrayList<>();
- Map map;
- for (IpVolumeFile bean : ipVolumeFiles) {
- map = new LinkedHashMap();
- map.put("id", bean.getId());
- map.put("fileName", bean.getFileName());
- mapList.add(map);
- }
- return ResponseUtil.success(mapList);
- }
-
- private final IpVolumeService ipVolumeService;
-
/**
* 闊虫煴鍒楄〃
- *
- * @return
*/
+ private final IpVolumeService ipVolumeService;
+
@GetMapping("/getIpVolumeList")
- public ResponseVO<Object> getIpVolumeList() {
- BroadcastTerminalV2Param param = new BroadcastTerminalV2Param();
- param.setBindingState(2);
- param.setKeyword(null);
- param.setWorkState(2);
- List<BroadcastTerminalV2EntityBo> broadcastTerminalList = ipVolumeService.getBroadcastTerminalList(null, param);
+ public ResponseVO<Object> getIpVolumeList(@RequestParam(required = false, value = "keyword") String keyword) {
+ List<BroadcastTerminalV2EntityBo> broadcastTerminalList = ipVolumeService.newIpTerminalList(keyword);
List<Map> mapList = new ArrayList<>();
Map map;
for (BroadcastTerminalV2EntityBo bean : broadcastTerminalList) {
@@ -142,48 +273,24 @@
}
- private final PoleLightemitService sLedService;
-
/**
- * SLED鍒楄〃
- *
- * @return
+ * 闊虫煴骞挎挱绱犳潗鍒楄〃
*/
- @GetMapping("/getSledList")
- public ResponseVO<Object> getSledList() {
- List<PoleLightemitEntity> poleLightemitEntities = sLedService.listLed(null, false);
+ private final IpVolumeFileService ipVolumeFileService;
+
+ @GetMapping("/getIpFileList")
+ public ResponseVO<Object> getIpFileList(@RequestParam(required = false, value = "keyword") String keyword) {
+ List<IpVolumeFile> ipVolumeFiles = ipVolumeFileService.listFiles(keyword);
List<Map> mapList = new ArrayList<>();
Map map;
- for (PoleLightemitEntity bean : poleLightemitEntities) {
- map = new LinkedHashMap();
- map.put("lightemitName", bean.getLightemitName());
- map.put("lightemitControlCode", bean.getLightemitControlCode());
- map.put("isOnLine", bean.isOnLine());
- map.put("streetlightId", bean.getPoleId());
- map.put("streetlightName", bean.getPoleName());
- mapList.add(map);
- }
- return ResponseUtil.success(mapList);
- }
-
- private final LEDProgramService ledProgramService;
-
- /**
- * NLED鑺傜洰鍒楄〃
- * @return
- */
- @GetMapping("/getNledProgeamList")
- public ResponseVO<Object> getNledProgeamList() {
- List<LEDProgram> ledPrograms = ledProgramService.listProgram(null, null);
- List<Map> mapList = new ArrayList<>();
- Map map;
- for (LEDProgram bean : ledPrograms) {
+ for (IpVolumeFile bean : ipVolumeFiles) {
map = new LinkedHashMap();
map.put("id", bean.getId());
- map.put("name", bean.getName());
+ map.put("fileName", bean.getFileName());
mapList.add(map);
}
return ResponseUtil.success(mapList);
}
+
}
--
Gitblit v1.9.3