2021与蓝度共同重构项目,服务端
zhanzhiqin
2022-10-20 4e76b9737e036c18e8a9e840dc443615ffcec348
ximon-admin/src/main/java/com/sandu/ximon/admin/controller/GetListOnBindingController.java
@@ -1,13 +1,11 @@
package com.sandu.ximon.admin.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
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;
@@ -50,8 +48,8 @@
            wrapper.eq(Client::getSuperiorId, SecurityUtils.getUserId());
        }
        if (!StringUtil.isEmpty(keyword)) {
            wrapper.eq(Client::getId, keyword).or(w -> {
                w.eq(Client::getClientName, keyword);
            wrapper.like(Client::getId, keyword).or(w -> {
                w.like(Client::getClientName, keyword);
            });
        }
        List<Client> list = SpringContextHolder.getBean(ClientService.class).list(wrapper);
@@ -74,12 +72,12 @@
    private final PoleMapper poleMapper;
    @GetMapping("/getPoleList")
    public ResponseVO<Object> getPoleList() {
    public ResponseVO<Object> getPoleList(@RequestParam(required = false, value = "keyword") String keyword) {
        List<Pole> poleList;
        if (SecurityUtils.getClientId() == null) {
            poleList = poleMapper.queryPoleOnLineStatesList(null, null, null, null, null, null);
            poleList = poleMapper.getPoleListOnBinding(null, keyword);
        } else {
            poleList = poleMapper.queryPoleOnLineStatesList(SecurityUtils.getUserId(), null, null, null, null, null);
            poleList = poleMapper.getPoleListOnBinding(SecurityUtils.getUserId(), keyword);
        }
        List<Map> mapList = new ArrayList<>();
@@ -99,8 +97,8 @@
    private final LightMapper lightMapper;
    @GetMapping("/getLightList")
    public ResponseVO<Object> getLightList() {
        List<LightBo> listLight = lightMapper.listLight(SecurityUtils.getClientId(), null);
    public ResponseVO<Object> getLightList(@RequestParam(required = false, value = "keyword") String keyword) {
        List<LightBo> listLight = lightMapper.listLightOnBinding(SecurityUtils.getClientId(), keyword);
        List<Map> mapList = new ArrayList<>();
@@ -120,9 +118,9 @@
     * NLED列表(诺瓦设备)
     */
    @GetMapping("/getLedPlayerEntityList")
    public ResponseVO<Object> getLedPlayerEntityList() {
    public ResponseVO<Object> getLedPlayerEntityList(@RequestParam(required = false, value = "keyword") String keyword) {
        List<LedPlayerEntity> list = SpringContextHolder.getBean(LedPlayerEntityService.class).
                ledPlayerEntityList(null, null, null, null);
                ledPlayerEntityListOnBinding(keyword);
        List<Map> mapList = new ArrayList<>();
        Map map;
@@ -131,10 +129,12 @@
            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);
@@ -145,16 +145,27 @@
     */
    @GetMapping("/getLedFilesList")
    public ResponseVO<Object> getLedFilesList() {
        List<LedSFile> list = SpringContextHolder.getBean(LedSFileService.class).list();
        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 (LedSFile bean : list) {
        for (LEDProgramFile bean : list) {
            map = new LinkedHashMap();
            map.put("fileId", bean.getFileId());
            map.put("fileId", bean.getId());
            map.put("fileType", bean.getFileType());
            map.put("fileUrl", bean.getFileUrl());
            map.put("fileSize", bean.getFileSize());
            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);
@@ -168,8 +179,8 @@
    private final LEDProgramService ledProgramService;
    @GetMapping("/getNledProgeamList")
    public ResponseVO<Object> getNledProgeamList() {
        List<LEDProgram> ledPrograms = ledProgramService.listProgram(null, null, null, null);
    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) {
@@ -190,12 +201,13 @@
    private final PoleLightemitService sLedService;
    @GetMapping("/getSledList")
    public ResponseVO<Object> getSledList() {
        List<PoleLightemitEntity> poleLightemitEntities = sLedService.listLed(null, null, null, false);
    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());
@@ -245,10 +257,6 @@
    @GetMapping("/getIpVolumeList")
    public ResponseVO<Object> getIpVolumeList(@RequestParam(required = false, value = "keyword") String keyword) {
        BroadcastTerminalV2Param param = new BroadcastTerminalV2Param();
        param.setBindingState(2);
        param.setKeyword(null);
        param.setWorkState(2);
        List<BroadcastTerminalV2EntityBo> broadcastTerminalList = ipVolumeService.newIpTerminalList(keyword);
        List<Map> mapList = new ArrayList<>();
        Map map;