weclouds 1 рік тому
батько
коміт
e9ae11f129
44 змінених файлів з 847 додано та 174 видалено
  1. 9 0
      src/main/java/com/welampiot/configuration/WifiMqttConfig.java
  2. 393 112
      src/main/java/com/welampiot/controller/BasePlatformController.java
  3. 0 14
      src/main/java/com/welampiot/controller/LampController.java
  4. 9 0
      src/main/java/com/welampiot/dao/GbPlayDao.java
  5. 1 0
      src/main/java/com/welampiot/dao/LampDao.java
  6. 2 0
      src/main/java/com/welampiot/dao/LampPoleDao.java
  7. 1 0
      src/main/java/com/welampiot/dao/ProgramDao.java
  8. 1 0
      src/main/java/com/welampiot/dao/ScreenDao.java
  9. 1 0
      src/main/java/com/welampiot/dao/VideoMonitorDao.java
  10. 1 0
      src/main/java/com/welampiot/dao/WifiDao.java
  11. 2 0
      src/main/java/com/welampiot/dao/WifiInfoLogDao.java
  12. 10 0
      src/main/java/com/welampiot/dto/GbPlayDTO.java
  13. 3 0
      src/main/java/com/welampiot/dto/LampPoleDTO.java
  14. 5 4
      src/main/java/com/welampiot/dto/OperationLogDTO.java
  15. 10 0
      src/main/java/com/welampiot/service/GbPlayService.java
  16. 2 0
      src/main/java/com/welampiot/service/LampPoleService.java
  17. 1 0
      src/main/java/com/welampiot/service/LampService.java
  18. 1 0
      src/main/java/com/welampiot/service/ProgramService.java
  19. 1 0
      src/main/java/com/welampiot/service/ScreenService.java
  20. 1 0
      src/main/java/com/welampiot/service/VideoMonitorService.java
  21. 2 0
      src/main/java/com/welampiot/service/WifiInfoLogService.java
  22. 1 0
      src/main/java/com/welampiot/service/WifiService.java
  23. 29 0
      src/main/java/com/welampiot/service/impl/GbPlayServiceImpl.java
  24. 8 0
      src/main/java/com/welampiot/service/impl/LampPoleServiceImpl.java
  25. 4 0
      src/main/java/com/welampiot/service/impl/LampServiceImpl.java
  26. 4 0
      src/main/java/com/welampiot/service/impl/ProgramServiceImpl.java
  27. 5 0
      src/main/java/com/welampiot/service/impl/ScreenServiceImpl.java
  28. 4 1
      src/main/java/com/welampiot/service/impl/VideoMonitorServiceImpl.java
  29. 5 1
      src/main/java/com/welampiot/service/impl/WifiInfoLogServiceImpl.java
  30. 4 0
      src/main/java/com/welampiot/service/impl/WifiServiceImpl.java
  31. 160 8
      src/main/java/com/welampiot/utils/ToolUtils.java
  32. 2 1
      src/main/java/com/welampiot/vo/LampPoleDetailVO.java
  33. 1 0
      src/main/java/com/welampiot/vo/OperationLogVO.java
  34. 17 0
      src/main/resources/mapper/GbPlayMapper.xml
  35. 4 0
      src/main/resources/mapper/LampMapper.xml
  36. 82 28
      src/main/resources/mapper/LampPoleMapper.xml
  37. 18 4
      src/main/resources/mapper/OperationLogMapper.xml
  38. 3 0
      src/main/resources/mapper/ProgramMapper.xml
  39. 5 0
      src/main/resources/mapper/ScreenMapper.xml
  40. 4 0
      src/main/resources/mapper/VideoMonitorMapper.xml
  41. 6 0
      src/main/resources/mapper/WifiInfoLogMapper.xml
  42. 4 1
      src/main/resources/mapper/WifiMapper.xml
  43. 10 0
      src/main/resources/prod/application.yml
  44. 11 0
      src/main/resources/test/application.yml

+ 9 - 0
src/main/java/com/welampiot/configuration/WifiMqttConfig.java

@@ -0,0 +1,9 @@
+package com.welampiot.configuration;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+@Component
+@ConfigurationProperties(prefix = "wifi.mqtt")
+public class WifiMqttConfig extends BaseMqttConfig{
+}

+ 393 - 112
src/main/java/com/welampiot/controller/BasePlatformController.java

@@ -5,7 +5,6 @@ import com.welampiot.common.InterfaceResultEnum;
 import com.welampiot.dto.*;
 import com.welampiot.service.*;
 import com.welampiot.utils.ToolUtils;
-import com.welampiot.utils.WeatherUtil;
 import com.welampiot.vo.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.CrossOrigin;
@@ -14,12 +13,13 @@ import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.servlet.http.HttpServletRequest;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.text.DecimalFormat;
+import java.text.ParseException;
 import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
+import java.util.*;
 
 /**
  * ClassName: BasePlatformController
@@ -46,6 +46,19 @@ public class BasePlatformController {
     private UserService userService;
     @Autowired
     private WifiInfoLogService wifiInfoLogService;
+    @Autowired
+    private LampService lampService;
+    @Autowired
+    private PolicyService policyService;
+    @Autowired
+    private VideoMonitorService videoMonitorService;
+    @Autowired
+    private ScreenService screenService;
+    @Autowired
+    private ProgramService programService;
+    @Autowired
+    private WifiService wifiService;
+
 
     /**
      * 基础平台全局概览
@@ -56,6 +69,20 @@ public class BasePlatformController {
     public BaseResult<?> data(HttpServletRequest request) {
         Integer version = (Integer) toolUtils.getRequestContent(request, "version", 1);
         List<?> sectionList = toolUtils.getSectionList(request);
+        LampPoleInfoVO lampPoleDevCount = null;
+        if (sectionList == null || sectionList.size() == 0){
+            lampPoleDevCount = new LampPoleInfoVO();
+            lampPoleDevCount.setLampPoleCount(0);
+            lampPoleDevCount.setCloudCount(0);
+            lampPoleDevCount.setBroadcastCount(0);
+            lampPoleDevCount.setVideoCount(0);
+            lampPoleDevCount.setWeatherCount(0);
+            lampPoleDevCount.setEmCount(0);
+            lampPoleDevCount.setChargeCount(0);
+            lampPoleDevCount.setScreenCount(0);
+            lampPoleDevCount.setLampPoleAlarmCount(0);
+            return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,lampPoleDevCount);
+        }
         LampInfoDTO lampInfoDTO = new LampInfoDTO();
         lampInfoDTO.setSectionList(sectionList);
         LampInfoLogNewDTO sumEleByDTO = lampInfoLogNewService.getSumEleByDTO(lampInfoDTO);
@@ -65,7 +92,7 @@ public class BasePlatformController {
         Integer lampPoleCount = lampPoleService.getLampPoleInstallTotal(lampPoleVO); // 灯杆总数
         LampPoleDTO lampPoleDTO = new LampPoleDTO();
         lampPoleDTO.setSectionList(sectionList);
-        LampPoleInfoVO lampPoleDevCount = lampPoleService.getLampPoleDevCount(lampPoleDTO);
+        lampPoleDevCount = lampPoleService.getLampPoleDevCount(lampPoleDTO);
         lampPoleDevCount.setCarRoadCount(0); // 车路协同数量
         lampPoleDevCount.setTrafficLightCount(0); // 交通灯数量
         lampPoleDevCount.setFiveGCount(0); // 5G基站数量
@@ -99,6 +126,27 @@ public class BasePlatformController {
         Integer version = (Integer) toolUtils.getRequestContent(request, "version", 1);
         String username = (String) toolUtils.getRequestContent(request, "username", 2);
         List<?> sectionList = toolUtils.getSectionList(request);
+        LampPoleInfoVO lampPoleDevCount = null;
+        if (sectionList == null || sectionList.size() == 0){
+            lampPoleDevCount = new LampPoleInfoVO();
+            lampPoleDevCount.setLampPoleCount(0);
+            lampPoleDevCount.setCloudCount(0);
+            lampPoleDevCount.setBroadcastCount(0);
+            lampPoleDevCount.setVideoCount(0);
+            lampPoleDevCount.setWeatherCount(0);
+            lampPoleDevCount.setEmCount(0);
+            lampPoleDevCount.setChargeCount(0);
+            lampPoleDevCount.setScreenCount(0);
+            lampPoleDevCount.setTrafficLightCount(0);
+            lampPoleDevCount.setLampPoleAlarmCount(0);
+            lampPoleDevCount.setTotalCom(0F);
+            lampPoleDevCount.setTotalSave(0F);
+            lampPoleDevCount.setActionList(new ArrayList<>());
+            lampPoleDevCount.setAlarmList(new ArrayList<>());
+            lampPoleDevCount.setLampPoleList(new ArrayList<>());
+            return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,lampPoleDevCount);
+        }
+
         LampInfoDTO lampInfoDTO = new LampInfoDTO();
         lampInfoDTO.setSectionList(sectionList);
         LampInfoLogNewDTO sumEleByDTO = lampInfoLogNewService.getSumEleByDTO(lampInfoDTO);
@@ -108,7 +156,7 @@ public class BasePlatformController {
         Integer lampPoleCount = lampPoleService.getLampPoleInstallTotal(lampPoleVO); // 灯杆总数
         LampPoleDTO lampPoleDTO = new LampPoleDTO();
         lampPoleDTO.setSectionList(sectionList);
-        LampPoleInfoVO lampPoleDevCount = lampPoleService.getLampPoleDevCount(lampPoleDTO);
+        lampPoleDevCount = lampPoleService.getLampPoleDevCount(lampPoleDTO);
         lampPoleDevCount.setCarRoadCount(0); // 车路协同数量
         lampPoleDevCount.setTrafficLightCount(0); // 交通灯数量
         lampPoleDevCount.setFiveGCount(0); // 5G基站数量
@@ -134,30 +182,56 @@ public class BasePlatformController {
         UserDTO userDTO = userService.queryUserIdByUsername(username);
         if (userDTO == null) return toolUtils.response(InterfaceResultEnum.PARAM_FAIL,version);
         OperationLogVO operationLogVO = new OperationLogVO();
-        operationLogVO.setUserId(userDTO.getId());
-        operationLogVO.setRole(userDTO.getRole());
+        operationLogVO.setSectionList(sectionList);
         List<OperationLogDTO> logList = operationLogService.getLessOperationLogList(operationLogVO);
         lampPoleDevCount.setActionList(logList);
 
         // 故障列表
+        String[] alamDevArr = {"路灯","摄像头","云盒","RFID","LED屏","一键报警","充电桩","气象站","微基站","广播音柱"};
         List<LampPoleDTO> lampPoleAlarmInfoList = lampPoleService.getLampPoleAlarmInfoList(lampPoleVO);
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        for (LampPoleDTO dto:lampPoleAlarmInfoList) {
+            if (dto.getDType() != null){
+                dto.setContent(alamDevArr[dto.getDType()]+dto.getContent());
+            }
+            Date cmdTime = null;
+            try {
+                cmdTime = simpleDateFormat.parse(dto.getUpdateTime());
+            } catch (ParseException e) {
+                throw new RuntimeException(e);
+            }
+            long timeStamp = cmdTime.getTime() + dto.getTimezone() * 3600 * 1000;
+           String newUpdateTime = simpleDateFormat.format(new Date(timeStamp));
+            dto.setUpdateTime(newUpdateTime);
+            dto.setTimezone(null);
+            dto.setDType(null);
+        }
         lampPoleDevCount.setAlarmList(lampPoleAlarmInfoList);
 
         // 灯杆列表
         List<LampPoleDTO> list = lampPoleService.getNewLampPoleList3(lampPoleVO);
+        List<Integer> lampPoleIds = new ArrayList<>();
         for (LampPoleDTO dto : list) {
-            if (dto.getDevType() != null && !dto.getDevType().isEmpty()) {
-                String devType = dto.getDevType();
-                int length = devType.split(",").length;
-                dto.setDevCount(length);
-            } else {
-                dto.setDevCount(0);
+            lampPoleIds.add(dto.getId());
+        }
+        List<LampPoleDTO> tempList = new ArrayList<>();
+        if (lampPoleIds != null || lampPoleIds.size() != 0){
+            List<LampPoleDTO> alarmList = lampPoleService.getPoleAlarmLogList(lampPoleIds);
+            for (LampPoleDTO dto:alarmList) {
+                tempList.add(dto.getLampPoleId(),dto);
             }
-            if (dto.getAlarmStatus() != null && dto.getAlarmStatus() == 2) {
-                dto.setStatus(0);
-            } else if (dto.getAlarmStatus() != null && dto.getAlarmStatus() != 2) {
-                dto.setStatus(1);
+        }
+        for (LampPoleDTO dto : list) {
+            lampPoleIds.add(dto.getId());
+            if (tempList != null && tempList.size() != 0 && tempList.get(dto.getId()) != null){
+                dto.setLampPoleId(tempList.get(dto.getId()).getId());
+                dto.setDevType2(tempList.get(dto.getId()).getDevType());
+            }else {
+                dto.setLampPoleId(0);
+                dto.setDevType2("0");
             }
+            String[] devTypeList = dto.getDevType().split(",");
+            dto.setDevCount(devTypeList.length);
         }
         lampPoleDevCount.setLampPoleList(list);
         return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,lampPoleDevCount);
@@ -173,109 +247,316 @@ public class BasePlatformController {
         Integer version = (Integer) toolUtils.getRequestContent(request, "version", 1);
         Integer id = (Integer) toolUtils.getRequestContent(request, "id", 1);
         if (id == null) return toolUtils.response(InterfaceResultEnum.LACK_PARAM_ERROR,version);
-
-        // 故障列表
-        List<LampPoleDTO> alarmList = lampPoleService.getLampPoleAlarmListByLampPoleId(id);
-        // 灯控列表
-        List<LampPoleDTO> lampList = lampPoleService.getLampListByLampPoleId(id);
-        // 灯杆详情
-        LampPoleDTO dto = lampPoleService.getNewLampPoleDetailsById(id);
-        if (dto == null) return toolUtils.response(InterfaceResultEnum.PARAM_FAIL,version);
+        List<LampInfoDTO> lampJoinLogList = lampService.getLampJoinLogList(id);
 
         LampPoleDetailVO lampPoleDetailVO = new LampPoleDetailVO();
-        // 气象信息
-        String longitude = dto.getLongitude();
-        String latitude = dto.getLatitude();
-        WeatherDTO weatherInfo = WeatherUtil.getNowWeatherInfo(longitude, latitude);
-        lampPoleDetailVO.setWeatherInfo(weatherInfo);
-        // 音柱当前播放的节目
-        lampPoleDetailVO.setBroadcastPro(dto.getBroadcastPro());
-        // 音柱当前播放节目的id
-        lampPoleDetailVO.setProgramId(dto.getProgramId());
-        // 音柱id
-        lampPoleDetailVO.setBroadcastId(dto.getBroadcastId());
-        // 当天流量
-        lampPoleDetailVO.setDayFlow(dto.getDayFlow());
-        // 故障列表
-        lampPoleDetailVO.setAlarmList(alarmList);
-        // 灯控列表
-        lampPoleDetailVO.setLampList(lampList);
-        // 摄像头
-        VideoMonitorDTO videoMonitorDTO = new VideoMonitorDTO();
-        videoMonitorDTO.setId(dto.getVideoId());
-        videoMonitorDTO.setVideoAddress(dto.getVideoAddress());
-        lampPoleDetailVO.setVideo(videoMonitorDTO);
-        // 屏幕
-        ScreenDTO screenDTO = new ScreenDTO();
-        screenDTO.setId(dto.getScreenId());
-        screenDTO.setName(dto.getProgramName());
-        screenDTO.setStatus(dto.getScreenStatus());
-        screenDTO.setLight(dto.getLight());
-        screenDTO.setVolume(dto.getVolume());
-        screenDTO.setMaxLight(dto.getMaxLight());
-        screenDTO.setPlayingId(dto.getPlayingId());
-        screenDTO.setScreenImage(dto.getImage());
-        lampPoleDetailVO.setScreen(screenDTO);
-        // 充电桩
-        ChargeDTO chargeDTO = new ChargeDTO();
-        chargeDTO.setOnline(dto.getChargeOnline());
-        chargeDTO.setStatus(dto.getChargeStatus());
-        chargeDTO.setEquipmentElectricity(dto.getEquipmentElectricity());
-        if (dto.getBillAmt() != null) {
-            chargeDTO.setBillAmt(Float.parseFloat(dto.getBillAmt()));
+        if (lampJoinLogList == null || lampJoinLogList.size() == 0){
+            lampPoleDetailVO.setLampList(new ArrayList<>());
+            lampPoleDetailVO.setVideo(new VideoMonitorDTO());
+            lampPoleDetailVO.setScreen(new ScreenDTO());
+            lampPoleDetailVO.setWeatherInfo(new WeatherDTO());
+            lampPoleDetailVO.setDayFlow("0");
+            lampPoleDetailVO.setCharge(new ChargeDTO());
+            lampPoleDetailVO.setBroadcastId(0);
+            lampPoleDetailVO.setProgramId(0);
+            lampPoleDetailVO.setAlarmList(new ArrayList<>());
+            WifiInfoLogVO wifiInfoLogVO = new WifiInfoLogVO();
+            wifiInfoLogVO.setDate(new ArrayList<>());
+            wifiInfoLogVO.setFlow(new ArrayList<>());
+            lampPoleDetailVO.setFlowList(wifiInfoLogVO);
+            if (version == 0){
+                lampPoleDetailVO.setBroadcastPro("暂无节目");
+            } else if (version == 1) {
+                lampPoleDetailVO.setBroadcastPro("There are currently no programs available");
+            }else {
+                lampPoleDetailVO.setBroadcastPro("Нет программы");
+            }
+
+            return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,lampPoleDetailVO);
         }
-        lampPoleDetailVO.setCharge(chargeDTO);
-        // 流量列表
-        List<Object> dateList = new ArrayList<>();
-        List<Object> flowList = new ArrayList<>();
-        long l = System.currentTimeMillis();
-        long startTime = l - 24 * 3600 * 1000 * 6;
-        HashMap<String, Integer> objectObjectHashMap = new HashMap<>();
-        long timeT = startTime;
-        int i = 0;
+        for (LampInfoDTO dto:lampJoinLogList) {
+            //floor($lamp_info['workTimeTotal']/60).':'.substr('00'.$lamp_info['workTimeTotal']%60, -2);
+            Integer i = Integer.valueOf(dto.getWorkTimeTotal()) / 60;
+            String str = "00" + String.valueOf(Integer.valueOf(dto.getWorkTimeTotal()) % 60);
+            String substring = str.substring(str.length() - 2);
+            dto.setWorkTimeTotal(substring);
+            if (dto.getPolicyType() == 1){
+                PolicyDTO policy = policyService.getPolicyDTOById(dto.getPolicyId());
+                if (policy != null){
+                    dto.setPolicyName(policy.getName());
+                }else {
+                    if (version == 0){
+                        dto.setPolicyName("暂无策略");
+                    } else if (version == 1) {
+                        dto.setPolicyName("No strategy at the moment");
+                    }else {
+                        dto.setPolicyName("Нет стратегии");
+                    }
+                }
+            }else {
+                if (version == 0){
+                    dto.setPolicyName("暂无策略");
+                } else if (version == 1) {
+                    dto.setPolicyName("No strategy at the moment");
+                }else {
+                    dto.setPolicyName("Нет стратегии");
+                }
+            }
+        }
+        lampPoleDetailVO.setLampList(lampJoinLogList);
+        //摄像头
+        VideoMonitorDTO monitorDTO = videoMonitorService.geteMonitorData(id);
+        if (monitorDTO != null){
+            String gbPlayAddress = toolUtils.getGbPlayAddress(monitorDTO.getGbAddress(), null, null, null);
+            monitorDTO.setVideoAddress(gbPlayAddress);
+            lampPoleDetailVO.setVideo(monitorDTO);
+        }else {
+            lampPoleDetailVO.setVideo(new VideoMonitorDTO());
+        }
+        //屏幕
+        ScreenDTO oneScreen = screenService.getOneScreenByLampPoleId(id);
+        if (oneScreen != null){
+            oneScreen.setName("");
+            oneScreen.setScreenImage("");
+            if (oneScreen.getType() == 1) oneScreen.setName("气象站");
+            if (oneScreen.getType() == 0){
+                ProgramDTO oneProgram = programService.getOneProgram(oneScreen.getPlayingId());
+                if (oneProgram != null) oneScreen.setName(oneProgram.getName());
+            }
+            String path = "/upload/image/"+oneScreen.getNum()+".png";
 
-        DecimalFormat decimalFormat = new DecimalFormat("0.00");
-        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:00:00");
-        SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        while (timeT <= l) {
-            objectObjectHashMap.put(simpleDateFormat.format(new Date(timeT)), i);
-            dateList.add(simpleDateFormat.format(new Date(timeT)));
-            flowList.add(0);
-            timeT += 3600 * 1000;
-            i++;
+            String rootPath = System.getProperty("user.dir");
+            int lastedIndex = rootPath.lastIndexOf("/");
+            rootPath = rootPath.substring(0,lastedIndex); //工程根目录
+
+            String filePath = rootPath+path;
+            Path p = Paths.get(filePath);
+            if (Files.exists(p)) oneScreen.setScreenImage(path);
+            lampPoleDetailVO.setScreen(oneScreen);
+        }else {
+            lampPoleDetailVO.setScreen(new ScreenDTO());
         }
 
-        int dayNumber = 1;
-        WifiInfoLogDTO wifiInfoLogDTO = new WifiInfoLogDTO();
-        wifiInfoLogDTO.setDayNum(7);
-        wifiInfoLogDTO.setDayNumber(dayNumber);
-        wifiInfoLogDTO.setLampPoleId(id);
-        List<WifiInfoLogDTO> wifiInfoLogList = wifiInfoLogService.getWifiStatisticsListByDTO(wifiInfoLogDTO);
-        for (WifiInfoLogDTO dto1 : wifiInfoLogList) {
-            Date date = new Date(simpleDateFormat2.parse(dto1.getUpdateTime()).getTime());
-            String s = simpleDateFormat.format(date);
-            long time = simpleDateFormat.parse(s).getTime();
-            String formatStart = simpleDateFormat.format(startTime);
-            startTime = simpleDateFormat.parse(formatStart).getTime();
-            long timespan = (time - startTime) / (3600 * 1000 * dayNumber);
-            long newTime = startTime + timespan * (3600 * 1000 * dayNumber);
-            date = new Date(newTime);
-            s = simpleDateFormat.format(date);
-            Integer integer = null;
-            if (objectObjectHashMap.containsKey(s)) {
-                integer = objectObjectHashMap.get(s);
+        //wifi
+        WifiDTO wifi = wifiService.getWifiByLampPoleId(id);
+        if (wifi != null){
+            // 获取当前时间
+            SimpleDateFormat fitDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            // 获取当前时间
+            Date now = new Date();
+            // 计算当前时间戳
+            long currentTimeMillis = now.getTime();
+            // 计算昨天和今天的开始和结束时间
+            long seconds = currentTimeMillis ;
+            Date startDate = new Date(seconds - 8 * 3600 * 1000 - 7 * 24 * 3600 * 1000);
+            Date endDate = new Date(seconds - 8 * 3600 * 1000);
+
+            // 打印结果
+            String startDateStr = fitDateFormat.format(startDate);
+            String endDateStr = fitDateFormat.format(endDate);
+
+
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+            HashMap<String, HashMap<String, Integer>> shaMap = new HashMap<>();
+            for (int i = 0; i < 7; i++){
+                String in = sdf.format(new Date(seconds - i * 24 * 3600 * 1000));
+                HashMap<String, Integer> ObjectHashMap = new HashMap<>();
+                ObjectHashMap.put("max",0);
+                ObjectHashMap.put("min",0);
+                shaMap.put(in,ObjectHashMap);
+            }
+            HashMap<String, Object> flowMap = new HashMap<>();
+            flowMap.put("id",wifi.getId());
+            flowMap.put("startdate",startDateStr);
+            flowMap.put("enddate",endDateStr);
+
+            List<WifiInfoLogDTO> wifiLogList = wifiInfoLogService.getWifiLog(flowMap);
+            for (WifiInfoLogDTO dto:wifiLogList) {
+                Date updateParse = fitDateFormat.parse(dto.getUpdateTime());
+                long updateSta = updateParse.getTime() + 8 * 3600 * 1000;
+                String in = sdf.format(new Date(updateSta));
+                if (shaMap.get(in) != null){
+                    shaMap.get(in).put("min",Integer.valueOf(dto.getTotalCom()));
+                    if (shaMap.get(in).get("max") == 0){
+                        shaMap.get(in).put("max",Integer.valueOf(dto.getTotalCom()));
+                    }
+                }
             }
+            HashMap<String,Object> flowHashMap = new HashMap<String,Object>();
+            ArrayList<Object> dateList = new ArrayList<>();
+            ArrayList<Object> flowList = new ArrayList<>();
+            SimpleDateFormat dateFormat1 = new SimpleDateFormat("MM-dd");
 
-            if (dto1.getMinFlow() != null && !dto1.getMinFlow().equals("0") && integer != null &&
-                    dto1.getMaxFlow() != null && !dto1.getMaxFlow().equals("0")) {
-                Float flow = Float.parseFloat(dto1.getMaxFlow()) - Float.parseFloat(dto1.getMinFlow());
-                flowList.set(integer,Float.parseFloat(decimalFormat.format(flow)));
+            // 创建一个List来存储HashMap的key
+            ArrayList<String> keys = new ArrayList<>();
+            // 遍历HashMap,将key添加到List中
+            for (Map.Entry<String, HashMap<String,Integer>> entry : shaMap.entrySet()) {
+                keys.add(entry.getKey());
             }
+            // 使用Collections.sort()方法对List进行排序
+            SimpleDateFormat sdformat = new SimpleDateFormat("yyyy-MM-dd");
+            Collections.sort(keys);
+            // 按照排序后的顺序获取List中的key
+            for (String key : keys) {
+                //System.out.println(key);
+                String time = dateFormat1.format(sdformat.parse(key));
+                dateList.add(time);
+                HashMap<String, Integer> stringIntegerHashMap = shaMap.get(key);
+                Integer max = stringIntegerHashMap.get("max");
+                Integer min = stringIntegerHashMap.get("min");
+                flowList.add(max > min ? max-min : 0);
+            }
+            WifiInfoLogVO wifiInfoLogVO = new WifiInfoLogVO();
+            wifiInfoLogVO.setDate(dateList);
+            wifiInfoLogVO.setFlow(flowList);
+            lampPoleDetailVO.setFlowList(wifiInfoLogVO);
+        }else {
+            WifiInfoLogVO wifiInfoLogVO = new WifiInfoLogVO();
+            wifiInfoLogVO.setDate(new ArrayList<>());
+            wifiInfoLogVO.setFlow(new ArrayList<>());
+            lampPoleDetailVO.setFlowList(wifiInfoLogVO);
         }
-        WifiInfoLogVO wifiInfoLogVO = new WifiInfoLogVO();
-        wifiInfoLogVO.setDate(dateList);
-        wifiInfoLogVO.setFlow(flowList);
-        lampPoleDetailVO.setFlowList(wifiInfoLogVO);
+
+        //weather
+        LampPoleDTO localDataById = lampPoleService.getLocalDataById(id);
+        String urlStr = "https://devapi.heweather.net/v7/weather/3d?location="+localDataById.getLongitude()+","+localDataById.getLatitude()+"&key="+ToolUtils.WEATHER_KEY;
+
+        String info = toolUtils.sendHttp("get", urlStr, null, 5, ToolUtils.ContentTypeEnum.CONTENT_TYPE_FORM, null);
+
+
+
+        //        $weather_info = file_get_contents("compress.zlib://".$url);
+//        $weather_info = json_decode($weather_info,true);
+
+
+//        if (!empty($res)) {
+//            $enddate = date('Y-m-d H:00:00',time()-8*3600);
+//            $startdate = date('Y-m-d H:00:00',time()-8*3600-7*24*3600);
+//            $data['day_flow'] = $res['day_flow'];
+//            $temp_list = [];
+//            for ($i=0; $i < 7; $i++) {
+//                $in = date('Y-m-d',time()-$i*24*3600);
+//                $temp_list[$in] = ['max'=>0,'min'=>0];
+//            }
+//            $flow_list = $this->db->query('select total_com,updatetime from wifi_info_log where id = '.$res['id'].' and updatetime >= "'.$startdate.'" and updatetime <= "'.$enddate.'" order by updatetime desc')->result_array();
+//            foreach ($flow_list as $key => $value) {
+//                $in = date('Y-m-d',strtotime($value['updatetime'])+8*3600);
+//                if (isset($temp_list[$in])) {
+//                    $temp_list[$in]['min'] = $value['total_com'];
+//                    if ($temp_list[$in]['max'] == 0) {
+//                        $temp_list[$in]['max'] = $value['total_com'];
+//                    }
+//                }
+//            }
+//            $temp_list = array_reverse($temp_list);
+//            foreach ($temp_list as $key => $value) {
+//                $data['flow_list']['date'][] = date('m-d',strtotime($key));
+//                $data['flow_list']['flow'][] = $value['max'] > $value['min'] ? $value['max'] - $value['min'] : 0;
+//            }
+//        }
+
+        // 故障列表
+//        List<LampPoleDTO> alarmList = lampPoleService.getLampPoleAlarmListByLampPoleId(id);
+//        // 灯控列表
+//        List<LampPoleDTO> lampList = lampPoleService.getLampListByLampPoleId(id);
+//        // 灯杆详情
+//        LampPoleDTO dto = lampPoleService.getNewLampPoleDetailsById(id);
+//        if (dto == null) return toolUtils.response(InterfaceResultEnum.PARAM_FAIL,version);
+//
+////        LampPoleDetailVO lampPoleDetailVO = new LampPoleDetailVO();
+//        // 气象信息
+//        String longitude = dto.getLongitude();
+//        String latitude = dto.getLatitude();
+//        WeatherDTO weatherInfo = WeatherUtil.getNowWeatherInfo(longitude, latitude);
+//        lampPoleDetailVO.setWeatherInfo(weatherInfo);
+//        // 音柱当前播放的节目
+//        lampPoleDetailVO.setBroadcastPro(dto.getBroadcastPro());
+//        // 音柱当前播放节目的id
+//        lampPoleDetailVO.setProgramId(dto.getProgramId());
+//        // 音柱id
+//        lampPoleDetailVO.setBroadcastId(dto.getBroadcastId());
+//        // 当天流量
+//        lampPoleDetailVO.setDayFlow(dto.getDayFlow());
+//        // 故障列表
+//        lampPoleDetailVO.setAlarmList(alarmList);
+//        // 灯控列表
+//        lampPoleDetailVO.setLampList(lampList);
+//        // 摄像头
+//        VideoMonitorDTO videoMonitorDTO = new VideoMonitorDTO();
+//        videoMonitorDTO.setId(dto.getVideoId());
+//        videoMonitorDTO.setVideoAddress(dto.getVideoAddress());
+//        lampPoleDetailVO.setVideo(videoMonitorDTO);
+//        // 屏幕
+//        ScreenDTO screenDTO = new ScreenDTO();
+//        screenDTO.setId(dto.getScreenId());
+//        screenDTO.setName(dto.getProgramName());
+//        screenDTO.setStatus(dto.getScreenStatus());
+//        screenDTO.setLight(dto.getLight());
+//        screenDTO.setVolume(dto.getVolume());
+//        screenDTO.setMaxLight(dto.getMaxLight());
+//        screenDTO.setPlayingId(dto.getPlayingId());
+//        screenDTO.setScreenImage(dto.getImage());
+//        lampPoleDetailVO.setScreen(screenDTO);
+//        // 充电桩
+//        ChargeDTO chargeDTO = new ChargeDTO();
+//        chargeDTO.setOnline(dto.getChargeOnline());
+//        chargeDTO.setStatus(dto.getChargeStatus());
+//        chargeDTO.setEquipmentElectricity(dto.getEquipmentElectricity());
+//        if (dto.getBillAmt() != null) {
+//            chargeDTO.setBillAmt(Float.parseFloat(dto.getBillAmt()));
+//        }
+//        lampPoleDetailVO.setCharge(chargeDTO);
+//        // 流量列表
+//        List<Object> dateList = new ArrayList<>();
+//        List<Object> flowList = new ArrayList<>();
+//        long l = System.currentTimeMillis();
+//        long startTime = l - 24 * 3600 * 1000 * 6;
+//        HashMap<String, Integer> objectObjectHashMap = new HashMap<>();
+//        long timeT = startTime;
+//        int i = 0;
+//
+//        DecimalFormat decimalFormat = new DecimalFormat("0.00");
+//        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:00:00");
+//        SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+//        while (timeT <= l) {
+//            objectObjectHashMap.put(simpleDateFormat.format(new Date(timeT)), i);
+//            dateList.add(simpleDateFormat.format(new Date(timeT)));
+//            flowList.add(0);
+//            timeT += 3600 * 1000;
+//            i++;
+//        }
+//
+//        int dayNumber = 1;
+//        WifiInfoLogDTO wifiInfoLogDTO = new WifiInfoLogDTO();
+//        wifiInfoLogDTO.setDayNum(7);
+//        wifiInfoLogDTO.setDayNumber(dayNumber);
+//        wifiInfoLogDTO.setLampPoleId(id);
+//        List<WifiInfoLogDTO> wifiInfoLogList = wifiInfoLogService.getWifiStatisticsListByDTO(wifiInfoLogDTO);
+//        for (WifiInfoLogDTO dto1 : wifiInfoLogList) {
+//            Date date = new Date(simpleDateFormat2.parse(dto1.getUpdateTime()).getTime());
+//            String s = simpleDateFormat.format(date);
+//            long time = simpleDateFormat.parse(s).getTime();
+//            String formatStart = simpleDateFormat.format(startTime);
+//            startTime = simpleDateFormat.parse(formatStart).getTime();
+//            long timespan = (time - startTime) / (3600 * 1000 * dayNumber);
+//            long newTime = startTime + timespan * (3600 * 1000 * dayNumber);
+//            date = new Date(newTime);
+//            s = simpleDateFormat.format(date);
+//            Integer integer = null;
+//            if (objectObjectHashMap.containsKey(s)) {
+//                integer = objectObjectHashMap.get(s);
+//            }
+//
+//            if (dto1.getMinFlow() != null && !dto1.getMinFlow().equals("0") && integer != null &&
+//                    dto1.getMaxFlow() != null && !dto1.getMaxFlow().equals("0")) {
+//                Float flow = Float.parseFloat(dto1.getMaxFlow()) - Float.parseFloat(dto1.getMinFlow());
+//                flowList.set(integer,Float.parseFloat(decimalFormat.format(flow)));
+//            }
+//        }
+//        WifiInfoLogVO wifiInfoLogVO = new WifiInfoLogVO();
+//        wifiInfoLogVO.setDate(dateList);
+//        wifiInfoLogVO.setFlow(flowList);
+//        lampPoleDetailVO.setFlowList(wifiInfoLogVO);
         return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,lampPoleDetailVO);
     }
 }

+ 0 - 14
src/main/java/com/welampiot/controller/LampController.java

@@ -14,12 +14,7 @@ import com.welampiot.utils.AESUtils;
 import com.welampiot.utils.JwtUtil;
 import com.welampiot.utils.ToolUtils;
 import com.welampiot.vo.*;
-import org.apache.commons.codec.DecoderException;
-import org.apache.commons.codec.binary.Hex;
 import org.apache.commons.lang3.ArrayUtils;
-import org.eclipse.paho.client.mqttv3.MqttMessage;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.DigestUtils;
@@ -28,18 +23,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
-import javax.crypto.Cipher;
-import javax.crypto.SecretKey;
-import javax.crypto.spec.IvParameterSpec;
-import javax.crypto.spec.SecretKeySpec;
 import javax.servlet.http.HttpServletRequest;
 import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.math.BigInteger;
 import java.nio.charset.StandardCharsets;
-import java.security.GeneralSecurityException;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
 import java.text.DecimalFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;

+ 9 - 0
src/main/java/com/welampiot/dao/GbPlayDao.java

@@ -0,0 +1,9 @@
+package com.welampiot.dao;
+
+import com.welampiot.dto.GbPlayDTO;
+
+public interface GbPlayDao {
+    GbPlayDTO getOneData(String address);
+    void addData(GbPlayDTO dto);
+    void updataData(GbPlayDTO dto);
+}

+ 1 - 0
src/main/java/com/welampiot/dao/LampDao.java

@@ -68,4 +68,5 @@ public interface LampDao {
     void addByDto(LampInfoDTO dto);
     void updateById(LampInfoDTO dto);
     LampInfoDTO getOneData(HashMap<String,Object> map);
+    List<LampInfoDTO>getLampJoinLogList(Integer id);
 }

+ 2 - 0
src/main/java/com/welampiot/dao/LampPoleDao.java

@@ -62,4 +62,6 @@ public interface LampPoleDao {
     LampPoleDTO getNewLampPoleDetailsById(@Param("id") Integer id);
     List<LampPoleDTO> getLampListByLampPoleId(@Param("lampPoleId") Integer lampPoleId);
     void updateById(LampPoleDTO lampPoleDTO);
+    List<LampPoleDTO>getPoleAlarmLogList(List<Integer> lampPoleIds);
+    LampPoleDTO getLocalDataById(Integer id);
 }

+ 1 - 0
src/main/java/com/welampiot/dao/ProgramDao.java

@@ -20,4 +20,5 @@ public interface ProgramDao {
     void deleteProgramDataById(@Param("programId") Integer programId);
 
     ProgramDTO getProgramDTOById(@Param("programId") Integer programId);
+    ProgramDTO getOneProgram(Integer id);
 }

+ 1 - 0
src/main/java/com/welampiot/dao/ScreenDao.java

@@ -42,4 +42,5 @@ public interface ScreenDao {
     ScreenDTO getScreenById(@Param("id")int id);
     void updateByDto(ScreenDTO dto);
     ScreenDTO getOneScreen(HashMap<String,Object> map);
+    ScreenDTO getOneScreenByLampPoleId(Integer lampPoleId);
 }

+ 1 - 0
src/main/java/com/welampiot/dao/VideoMonitorDao.java

@@ -53,4 +53,5 @@ public interface VideoMonitorDao {
     List<VideoMonitorDTO> getDataList(EmergencyDTO dto);
 
     VideoMonitorDTO getOneMonitor(HashMap<String,Object> map);
+    VideoMonitorDTO geteMonitorData(Integer lampPoleId);
 }

+ 1 - 0
src/main/java/com/welampiot/dao/WifiDao.java

@@ -36,4 +36,5 @@ public interface WifiDao {
     WifiDTO getTotalWifiCountAndFlow(WifiDTO dto);
     WifiDTO getWifiByLampPoleId(@Param("lampPoleId") Integer lampPoleId);
     WifiDTO getOneWifi(HashMap<String,Object> map);
+    WifiDTO getOneWifiByLampPoleId(Integer id);
 }

+ 2 - 0
src/main/java/com/welampiot/dao/WifiInfoLogDao.java

@@ -3,6 +3,7 @@ package com.welampiot.dao;
 import com.welampiot.dto.WifiInfoLogDTO;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.HashMap;
 import java.util.List;
 
 /**
@@ -24,4 +25,5 @@ public interface WifiInfoLogDao {
 
     List<WifiInfoLogDTO> getWifiInfoLogListByDTO(WifiInfoLogDTO dto);
     WifiInfoLogDTO getWifiDayTotalCom(@Param("id") Integer id, @Param("startDate") String startDate);
+    List<WifiInfoLogDTO> getWifiLog(HashMap<String,Object> hashMap);
 }

+ 10 - 0
src/main/java/com/welampiot/dto/GbPlayDTO.java

@@ -0,0 +1,10 @@
+package com.welampiot.dto;
+
+import lombok.Data;
+
+@Data
+public class GbPlayDTO {
+    private Integer id;
+    private String gbAddress;
+    private long time;
+}

+ 3 - 0
src/main/java/com/welampiot/dto/LampPoleDTO.java

@@ -132,4 +132,7 @@ public class LampPoleDTO {
     private Integer volume;
     private String broadcastPro;
     private Float equipmentElectricity; // 累计充电量
+    private Integer dType;
+    private String content;
+    private String modelType;
 }

+ 5 - 4
src/main/java/com/welampiot/dto/OperationLogDTO.java

@@ -8,17 +8,17 @@ public class OperationLogDTO {
     private String time;
     private String acount;
     private String remark;
-    private int operaType;
+    private Integer operaType;
     private String operation;
-    private int sectionId;
-    private int areaId;
+    private Integer sectionId;
+    private Integer areaId;
     private Integer os;
     private Integer type;
     private Integer userId;
     private Integer devType;
     private String deviceName;
     private String sn;
-    private int devId;
+    private Integer devId;
     private String sqlLog;
     private String ipAddr;
     private String location;
@@ -29,4 +29,5 @@ public class OperationLogDTO {
     private Integer timezone;
     private String company;
     private String logInfo;
+    private String content;
 }

+ 10 - 0
src/main/java/com/welampiot/service/GbPlayService.java

@@ -0,0 +1,10 @@
+package com.welampiot.service;
+
+import com.welampiot.dto.GbPlayDTO;
+
+public interface GbPlayService {
+    GbPlayDTO getOneData(String address);
+
+    void addData(GbPlayDTO dto);
+    void updataData(GbPlayDTO dto);
+}

+ 2 - 0
src/main/java/com/welampiot/service/LampPoleService.java

@@ -54,4 +54,6 @@ public interface LampPoleService {
     List<LampPoleDTO> getLampListByLampPoleId(Integer lampPoleId);
     LampPoleInfoVO getLampPoleBigScreenCount(LampPoleDTO lampPoleDTO, LampInfoDTO lampInfoDTO);
     void updateById(LampPoleDTO lampPoleDTO);
+    List<LampPoleDTO>getPoleAlarmLogList(List<Integer> lampPoleIds);
+    LampPoleDTO getLocalDataById(Integer id);
 }

+ 1 - 0
src/main/java/com/welampiot/service/LampService.java

@@ -68,4 +68,5 @@ public interface LampService {
     void addByDto(LampInfoDTO dto);
     void updateById(LampInfoDTO dto);
     LampInfoDTO getOneData(HashMap<String,Object> map);
+    List<LampInfoDTO>getLampJoinLogList(Integer id);
 }

+ 1 - 0
src/main/java/com/welampiot/service/ProgramService.java

@@ -19,4 +19,5 @@ public interface ProgramService {
     void deleteProgramDataById(Integer programId);
 
     ProgramDTO getProgramDTOById(Integer programId);
+    ProgramDTO getOneProgram(Integer id);
 }

+ 1 - 0
src/main/java/com/welampiot/service/ScreenService.java

@@ -39,4 +39,5 @@ public interface ScreenService {
     ScreenDTO getScreenById(int id);
     void updateByDto(ScreenDTO dto);
     ScreenDTO getOneScreen(HashMap<String,Object> map);
+    ScreenDTO getOneScreenByLampPoleId(Integer lampPoleId);
 }

+ 1 - 0
src/main/java/com/welampiot/service/VideoMonitorService.java

@@ -37,4 +37,5 @@ public interface VideoMonitorService {
     void updateIsAutoStatus(VideoMonitorDTO dto);
     List<VideoMonitorDTO> getDataList(EmergencyDTO dto);
     VideoMonitorDTO getOneMonitor(HashMap<String,Object> map);
+    VideoMonitorDTO geteMonitorData(Integer lampPoleId);
 }

+ 2 - 0
src/main/java/com/welampiot/service/WifiInfoLogService.java

@@ -3,6 +3,7 @@ package com.welampiot.service;
 import com.welampiot.dto.WifiInfoLogDTO;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.HashMap;
 import java.util.List;
 
 /**
@@ -25,4 +26,5 @@ public interface WifiInfoLogService {
     List<WifiInfoLogDTO> getWifiInfoLogListByDTO(WifiInfoLogDTO dto);
 
     WifiInfoLogDTO getWifiDayTotalCom(Integer id, String startDate);
+    List<WifiInfoLogDTO> getWifiLog(HashMap<String,Object> hashMap);
 }

+ 1 - 0
src/main/java/com/welampiot/service/WifiService.java

@@ -38,4 +38,5 @@ public interface WifiService {
     WifiDTO getTotalWifiCountAndFlow(WifiDTO dto);
     WifiDTO getWifiByLampPoleId(Integer lampPoleId);
     WifiDTO getOneWifi(HashMap<String,Object> map);
+    WifiDTO getOneWifiByLampPoleId(Integer id);
 }

+ 29 - 0
src/main/java/com/welampiot/service/impl/GbPlayServiceImpl.java

@@ -0,0 +1,29 @@
+package com.welampiot.service.impl;
+
+import com.welampiot.dao.GbPlayDao;
+import com.welampiot.dto.GbPlayDTO;
+import com.welampiot.service.GbPlayService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class GbPlayServiceImpl implements GbPlayService {
+    @Autowired
+    private GbPlayDao gbPlayDao;
+
+    @Override
+    public GbPlayDTO getOneData(String address) {
+        return gbPlayDao.getOneData(address);
+    }
+
+    @Override
+    public void addData(GbPlayDTO dto) {
+        gbPlayDao.addData(dto);
+    }
+
+    @Override
+    public void updataData(GbPlayDTO dto) {
+        gbPlayDao.updataData(dto);
+    }
+
+}

+ 8 - 0
src/main/java/com/welampiot/service/impl/LampPoleServiceImpl.java

@@ -623,4 +623,12 @@ public class LampPoleServiceImpl implements LampPoleService {
     public void updateById(LampPoleDTO lampPoleDTO){
         lampPoleDao.updateById( lampPoleDTO);
     }
+    @Override
+    public List<LampPoleDTO>getPoleAlarmLogList(List<Integer> lampPoleIds){
+        return lampPoleDao.getPoleAlarmLogList(lampPoleIds);
+    }
+    @Override
+    public LampPoleDTO getLocalDataById(Integer id){
+        return lampPoleDao.getLocalDataById(id);
+    }
 }

+ 4 - 0
src/main/java/com/welampiot/service/impl/LampServiceImpl.java

@@ -786,4 +786,8 @@ public class LampServiceImpl implements LampService {
     public LampInfoDTO getOneData(HashMap<String,Object> map){
         return lampDao.getOneData(map);
     }
+    @Override
+    public List<LampInfoDTO>getLampJoinLogList(Integer id){
+        return lampDao.getLampJoinLogList(id);
+    }
 }

+ 4 - 0
src/main/java/com/welampiot/service/impl/ProgramServiceImpl.java

@@ -36,4 +36,8 @@ public class ProgramServiceImpl implements ProgramService {
     public ProgramDTO getProgramDTOById(Integer programId) {
         return programDao.getProgramDTOById(programId);
     }
+    @Override
+    public ProgramDTO getOneProgram(Integer id){
+        return programDao.getOneProgram(id);
+    }
 }

+ 5 - 0
src/main/java/com/welampiot/service/impl/ScreenServiceImpl.java

@@ -268,7 +268,12 @@ public class ScreenServiceImpl implements ScreenService {
     public Integer getTotalBySectionList(ScreenDTO dto) {
         return screenDao.getTotalBySectionList(dto);
     }
+    @Override
     public ScreenDTO getOneScreen(HashMap<String,Object> map){
         return screenDao.getOneScreen(map);
     }
+    @Override
+    public ScreenDTO getOneScreenByLampPoleId(Integer lampPoleId){
+        return screenDao.getOneScreenByLampPoleId(lampPoleId);
+    }
 }

+ 4 - 1
src/main/java/com/welampiot/service/impl/VideoMonitorServiceImpl.java

@@ -155,5 +155,8 @@ public class VideoMonitorServiceImpl implements VideoMonitorService {
     public VideoMonitorDTO getOneMonitor(HashMap<String,Object> map){
         return videoMonitorDao.getOneMonitor(map);
     }
-
+    @Override
+    public VideoMonitorDTO geteMonitorData(Integer lampPoleId){
+        return videoMonitorDao.geteMonitorData(lampPoleId);
+    }
 }

+ 5 - 1
src/main/java/com/welampiot/service/impl/WifiInfoLogServiceImpl.java

@@ -6,6 +6,7 @@ import com.welampiot.service.WifiInfoLogService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.HashMap;
 import java.util.List;
 
 /**
@@ -52,5 +53,8 @@ public class WifiInfoLogServiceImpl implements WifiInfoLogService {
     public WifiInfoLogDTO getWifiDayTotalCom(Integer id, String startDate) {
         return wifiInfoLogDao.getWifiDayTotalCom(id, startDate);
     }
-
+    @Override
+    public List<WifiInfoLogDTO> getWifiLog(HashMap<String,Object> hashMap){
+        return wifiInfoLogDao.getWifiLog(hashMap);
+    }
 }

+ 4 - 0
src/main/java/com/welampiot/service/impl/WifiServiceImpl.java

@@ -268,4 +268,8 @@ public class WifiServiceImpl implements WifiService {
     public WifiDTO getOneWifi(HashMap<String,Object> map){
         return wifiDao.getOneWifi(map);
     }
+    @Override
+    public WifiDTO getOneWifiByLampPoleId(Integer id){
+        return wifiDao.getOneWifiByLampPoleId(id);
+    }
 }

+ 160 - 8
src/main/java/com/welampiot/utils/ToolUtils.java

@@ -60,6 +60,10 @@ public class ToolUtils {
     final static public Integer SYSTEM_ADMIN = 1;
     final static public Integer COMPANY_ADMIN = 2;
     final static public Integer COMPANY_CUSTOMER = 3;
+    //国标摄像头播放地址
+    final static private String gbHost = "47.112.108.98";
+    // 和风天气的key
+    final static public String WEATHER_KEY = "2dca03c7d95c442ba8fbce9d7a96db78";
 
     private UserDTO user;
     @Autowired
@@ -83,6 +87,8 @@ public class ToolUtils {
     private IpInfoService ipInfoService;
     @Autowired
     private OperationLogService operationLogService;
+    @Autowired
+    private GbPlayService gbPlayService;
 
     /**
      * 获取用户所有路段 id
@@ -353,7 +359,7 @@ public class ToolUtils {
     }
 
     /**
-     * 发送mqtt指令
+     * 发送plc的mqtt指令
      * @param sendTopic  发送的topic
      * @param cmdInfo   发送的指令内容
      * @param resTopic  接收指令返回的topic
@@ -413,7 +419,7 @@ public class ToolUtils {
     }
 
     /**
-     * 发送mqtt指令
+     * 发送plc的mqtt指令
      * @param sendTopic  发送的topic
      * @param cmdInfo   发送的指令内容
      * @param resTopic  接收指令返回的topic
@@ -1009,7 +1015,7 @@ System.out.println(res);
             Integer startBright = p.getStartBright();
             Integer startColor = p.getStartColor();
             String tips1,tips2;
-            int startTime = Integer.parseInt(startDelayTime);
+            int startTime = java.lang.Integer.parseInt(startDelayTime);
             if (startTime >= 0) {
                 tips1 = "日出推迟" + startTime + "分钟 亮度" + startBright + "% 色温" + startColor + "k";
             } else {
@@ -1019,7 +1025,7 @@ System.out.println(res);
             String endDelayTime = p.getEndDelayTime();
             Integer endBright = p.getEndBright();
             Integer endColor = p.getEndColor();
-            int endTime = Integer.parseInt(endDelayTime);
+            int endTime = java.lang.Integer.parseInt(endDelayTime);
             if (endTime >= 0) {
                 tips2 = "日落推迟" + endTime + "分钟 亮度" + endBright + "% 色温" + endColor + "k";
             } else {
@@ -1222,7 +1228,11 @@ System.out.println(res);
         return result;
     }
 
-    // 添加设备onenet
+    /**
+     * 添加设备onenet
+     * @param deviceId
+     * @return
+     */
     public String addDeviceOnenet(String deviceId){
         JSONObject device = new JSONObject();
         device.put("title",deviceId);
@@ -1264,7 +1274,24 @@ System.out.println(res);
             }
         }
     }
-    //操作日志
+
+    /**
+     * 操作日志
+     * @param request HttpServletRequest类型
+     * @param operation 操作(添加/删除/编辑)
+     * @param remark 标记(中/英/俄,拼接设备的各种需要的信息)
+     * @param type 类型(0-中文,1-英语,2-俄文)
+     * @param operaType 操作类型(0 未定义操作,1 添加,2 删除,3 编辑,4 指令,5 退出登录
+     * @param devtype '设备类型(0 非设备,1 路灯,2 灯杆,3 回路,4 井盖,5 垃圾桶)
+     * @param deviceName 设备名称/或编号
+     * @param area  区域名
+     * @param section 路段名
+     * @param sn  设备sn码
+     * @param sectionId 路段id
+     * @param areaId 区域id
+     * @param id 设备id
+     * @param sql_log 最后一条sql语句
+     */
     public void addOpertaionLog(HttpServletRequest request,String operation, String remark,Integer type,Integer operaType,Integer devtype,String deviceName,String area,String section,String sn ,Integer sectionId ,Integer areaId ,Integer id,String sql_log){
         String ip = "";
         if (request.getParameter("ip") != null){
@@ -1309,7 +1336,7 @@ System.out.println(res);
         }
 
     }
-    public String getLocationByIp(String ip) throws IOException {
+    private String getLocationByIp(String ip) throws IOException {
         //把域名都转换成ip地址
         ip = InetAddress.getByName(ip).getHostAddress();
 
@@ -1353,7 +1380,11 @@ System.out.println(res);
         return location;
     }
 
-    // 翻译故障信息
+    /**
+     *  翻译故障信息 - 中英
+     * @param alarmStr
+     * @return
+     */
     public String changeAlarm(String alarmStr){
         if (alarmStr == null || alarmStr.length() == 0) return  "Unknown error";
         HashMap<String, String> hashMap = new HashMap<>();
@@ -1380,6 +1411,12 @@ System.out.println(res);
         //字符串拼接
         return String.join(".", stringList);
     }
+
+    /**
+     * 翻译故障信息 - 中俄
+     * @param alarmStr
+     * @return
+     */
     public String changeAlarmRu(String alarmStr){
         if (alarmStr == null || alarmStr.length() == 0) return  "ошибка";
         HashMap<String, String> hashMap = new HashMap<>();
@@ -1505,4 +1542,119 @@ System.out.println(res);
         }
         return true;
     }
+
+    /**
+     * 生成日志,保存在本地
+     * @param fileName 文件名
+     * @param content  日志内容
+     * @throws IOException
+     */
+    public void setLog(String fileName,String content) throws IOException {
+        String rootPath = System.getProperty("user.dir");
+        int lastedIndex = rootPath.lastIndexOf("/");
+        rootPath = rootPath.substring(0,lastedIndex); //工程根目录
+
+        String logFilePath = rootPath+"/upload/log";
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        // 创建日志文件
+        File logFile = new File(logFilePath);
+        if (!logFile.exists()) {
+            logFile.mkdirs(); //创建文件夹
+        }
+        String record = String.format("%s", content+"===="+dateFormat.format(new Date()));
+        File file = new File(logFilePath +"/"+ fileName);
+        try (FileWriter writer = new FileWriter(file, true)) {
+            writer.write(record);
+            writer.flush();
+            writer.write("\n"); // 添加一个空行,以便下次写入时定位到下一行
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 获取国标摄像头播放地址
+     * @param gbAddress  国标摄像头地址
+     * @param res
+     * @param vType
+     * @param sectionId
+     * @return
+     * @throws IOException
+     */
+    public String getGbPlayAddress(String gbAddress,String res,String vType,Integer sectionId ) throws IOException {
+        //Integer gb_id = Integer.valueOf(gbAddress.substring(gbAddress.length() - 7));
+        String gbId =  gbAddress.substring(gbAddress.length() - 7);
+        String url = "http://"+ToolUtils.gbHost+":8060/index/api/getMediaList?secret=weclouds123";
+        if (res == null) res = this.sendHttp("get",url,null,5,null,null);
+        JSONObject parseObject = JSON.parseObject(res);
+
+        gbId = String.format("%08x", gbId);
+        String address = "";
+        if (gbAddress.equals("34020000001320000120")) gbId = "55667788";
+        if (parseObject != null && parseObject.getInteger("code") != null && parseObject.getInteger("code") == 0){
+            List<Object> list = parseObject.getJSONArray("data") == null ? new ArrayList<>() : parseObject.getJSONArray("data");
+            int flag = 0;
+            for (Object obj:list) {
+                JSONObject item = (JSONObject) obj;
+                String stream = (String) item.get("stream");
+                Integer bytesSpeed = item.getInteger("bytesSpeed");
+                if (stream.toLowerCase().equals(gbId.toLowerCase()) && bytesSpeed != 0){
+                    flag = 1;
+                    break;
+                }
+            }
+            if (flag == 1){
+                this.setLog("get_gb_play_address.txt",gbAddress+" old address "+this.getUser().getUsername());
+                if (vType == null || vType.isEmpty()){
+                    address = "https://gb.lampmind.com:8087/gb3/rtp/"+gbId.toUpperCase()+".live.flv";
+                }else {
+                    address = "https://gb.lampmind.com:8087/gb3/rtp/"+gbId.toUpperCase()+"/hls.m3u8";
+                }
+            }else {
+                this.setLog("get_gb_play_address.txt",gbAddress+" new address--- "+this.getUser().getUsername());
+                GbPlayDTO oneData = gbPlayService.getOneData(gbAddress);
+                long currentTimeMillis = System.currentTimeMillis();
+                long seconds = currentTimeMillis / 1000;
+                if (oneData == null || seconds - oneData.getTime() > 5){
+                    Integer id =  Integer.valueOf(gbAddress.substring(gbAddress.length() - 7));
+                    String resUrl = "http://"+ToolUtils.gbHost+":8089/api/play/"+gbAddress+"/"+gbAddress+"/"+id;
+                    String res2 = this.sendHttp("get", resUrl, null, 5, null, null);
+                    JSONObject jsonObject = JSON.parseObject(res2);
+
+                    if (oneData == null){
+                        oneData.setGbAddress(gbAddress);
+                        oneData.setTime(seconds);
+                        gbPlayService.addData(oneData);
+                    }else {
+                        oneData.setTime(seconds);
+                        gbPlayService.updataData(oneData);
+                    }
+                }
+                if (vType == null || vType.isEmpty()){
+                    address = "https://gb.lampmind.com:8087/gb3/rtp/"+gbId.toUpperCase()+".live.flv";
+                }else {
+                    address = "https://gb.lampmind.com:8087/gb3/rtp/"+gbId.toUpperCase()+"/hls.m3u8";
+                }
+            }
+            if (gbAddress.equals("34020000001320001079") || gbAddress.equals("34020000001320000762") || gbAddress.equals("3402000000132000128")){
+                address = "https://gb.lampmind.com:8087/gb3/rtp/"+gbId.toUpperCase()+".live.mp4";
+            }else {
+                address = "https://gb.lampmind.com:8087/gb3/rtp/"+gbId.toUpperCase()+"/hls.m3u8";
+            }
+            if (sectionId.equals(739) || sectionId.equals(593)){
+                address = "https://gb.lampmind.com:8087/gb3/rtp/"+gbId.toUpperCase()+".live.flv";
+            }
+            if (gbAddress.equals("34020000001320000967")){
+
+            }
+
+            String sendTopic = "/welampiot/gb28181/getImage";
+            String backTopic = "/welampiot/gb28181/getImage";
+            JSONObject jsonObject = new JSONObject();
+            jsonObject.put("gb_address",gbAddress);
+
+            this.sendMqttCmd(sendTopic,jsonObject.toString(),backTopic,0);
+        }
+        return address;
+    }
 }

+ 2 - 1
src/main/java/com/welampiot/vo/LampPoleDetailVO.java

@@ -22,7 +22,8 @@ public class LampPoleDetailVO {
 
     private String dayFlow; // 当天流量
 
-    private List<LampPoleDTO> lampList; // 灯控列表
+    //private List<LampPoleDTO> lampList; // 灯控列表
+    private List<LampInfoDTO> lampList; // 灯控列表
 
     private VideoMonitorDTO video; // 摄像头
 

+ 1 - 0
src/main/java/com/welampiot/vo/OperationLogVO.java

@@ -22,4 +22,5 @@ public class OperationLogVO {
     private Integer total;
     private String path;
     private List<OperationLogDTO> list;
+    private List sectionList; // 路段筛选
 }

+ 17 - 0
src/main/resources/mapper/GbPlayMapper.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.welampiot.dao.GbPlayDao">
+    <select id="getOneData" parameterType="string" resultType="GbPlayDTO">
+        select id,time from gb_play where gb_address = #{address} limit 1;
+    </select>
+
+    <insert id="addData" parameterType="GbPlayDTO" useGeneratedKeys="true" keyProperty="id">
+        insert into gb_play (gb_address, time) VALUES (#{gbAddress},#{time});
+    </insert>
+
+    <update id="updataData" parameterType="GbPlayDTO">
+        update gb_play set time = #{time} where id = #{id}
+    </update>
+</mapper>

+ 4 - 0
src/main/resources/mapper/LampMapper.xml

@@ -1343,4 +1343,8 @@
         </if>
 
     </select>
+    
+    <select id="getLampJoinLogList" parameterType="Integer" resultType="LampInfoDTO">
+        select a.lighteness,a.usedEnergyTotal,a.power_save as powerSave,b.work_time_total as workTimeTotal,a.policy_type as policyType,a.policyid as policyId,a.number,a.id from lampinfo a left join lamp_info_log_new b on a.id = b.lampid where a.lamp_pole_id = #{id} order by a.id desc
+    </select>
 </mapper>

+ 82 - 28
src/main/resources/mapper/LampPoleMapper.xml

@@ -786,13 +786,39 @@
             lp.id = t3.lampId
     </select>
 
+<!--    <select id="getLampPoleAlarmInfoList" resultType="LampPoleDTO">-->
+<!--        select-->
+<!--            a.updatetime as updateTime,-->
+<!--            a.stralarmtype as alarmInfo,-->
+<!--            lp.name-->
+<!--        from lamp_pole lp-->
+<!--        left join all_alarm_info_log a on a.lampid = lp.id-->
+<!--        where a.devType = 1 and a.status != 2-->
+<!--        <if test="sectionList != null and !sectionList.isEmpty()">-->
+<!--            and lp.sectionid in-->
+<!--            <foreach collection="sectionList" item="item" open="(" separator="," close=")">-->
+<!--                #{item}-->
+<!--            </foreach>-->
+<!--        </if>-->
+<!--        <if test="areaId != null and areaId != 0">-->
+<!--            and lp.areaid = #{areaId}-->
+<!--        </if>-->
+<!--        <if test="sectionId != null and sectionId != 0">-->
+<!--            and lp.sectionid = #{sectionId}-->
+<!--        </if>-->
+<!--        order by updateTime desc-->
+<!--        limit 100-->
+<!--    </select>-->
+
     <select id="getLampPoleAlarmInfoList" resultType="LampPoleDTO">
         select
-            a.updatetime as updateTime,
-            a.stralarmtype as alarmInfo,
-            lp.name
+        a.updatetime as updateTime,
+        a.stralarmtype as content,
+        lp.name,a.dType,s.timezone,lp.longitude,lp.latitude
         from lamp_pole lp
         left join all_alarm_info_log a on a.lampid = lp.id
+        left join lampinfo l on l.lamp_pole_id = a.lampid and a.devType = 1
+        left join section s on l.sectionid = s.id
         where a.devType = 1 and a.status != 2
         <if test="sectionList != null and !sectionList.isEmpty()">
             and lp.sectionid in
@@ -800,14 +826,8 @@
                 #{item}
             </foreach>
         </if>
-        <if test="areaId != null and areaId != 0">
-            and lp.areaid = #{areaId}
-        </if>
-        <if test="sectionId != null and sectionId != 0">
-            and lp.sectionid = #{sectionId}
-        </if>
-        order by updateTime desc
-        limit 100
+        order by a.updatetime desc,a.id DESC
+        limit 20
     </select>
 
     <!-- 路灯亮灯数 -->
@@ -1214,31 +1234,59 @@
         </if>
     </select>
 
+<!--    <select id="getNewLampPoleList3" resultType="LampPoleDTO">-->
+<!--        select lp.id,lp.name,s.name as section,lp.devtype as devType,a.status as alarmStatus-->
+<!--        from lamp_pole lp-->
+<!--        left join section s on s.id = lp.sectionid,-->
+<!--        (SELECT t1.*-->
+<!--        FROM all_alarm_info_log t1,-->
+<!--        (SELECT lampid,-->
+<!--        max(updatetime) AS maxtime-->
+<!--        FROM all_alarm_info_log-->
+<!--        GROUP BY lampid) t2-->
+<!--        WHERE t1.lampid = t2.lampid-->
+<!--        AND t1.updatetime = t2.maxtime) as  a-->
+<!--        where a.devType = 1 and a.lampid = lp.id-->
+<!--        <if test="sectionList != null and !sectionList.isEmpty()">-->
+<!--            and lp.sectionid in-->
+<!--            <foreach collection="sectionList" item="item" open="(" separator="," close=")">-->
+<!--                #{item}-->
+<!--            </foreach>-->
+<!--        </if>-->
+<!--        <if test="areaId != null and areaId != 0">-->
+<!--            and lp.areaid = #{areaId}-->
+<!--        </if>-->
+<!--        <if test="sectionId != null and sectionId != 0">-->
+<!--            and lp.sectionid = #{sectionId}-->
+<!--        </if>-->
+<!--    </select>-->
+
     <select id="getNewLampPoleList3" resultType="LampPoleDTO">
-        select lp.id,lp.name,s.name as section,lp.devtype as devType,a.status as alarmStatus
+        select lp.id,lp.name,s.name as section,lp.devtype as devType,s.timezone,lp.modelType,lp.longitude,lp.latitude
         from lamp_pole lp
-        left join section s on s.id = lp.sectionid,
-        (SELECT t1.*
-        FROM all_alarm_info_log t1,
-        (SELECT lampid,
-        max(updatetime) AS maxtime
-        FROM all_alarm_info_log
-        GROUP BY lampid) t2
-        WHERE t1.lampid = t2.lampid
-        AND t1.updatetime = t2.maxtime) as  a
-        where a.devType = 1 and a.lampid = lp.id
+        left join section s on s.id = lp.sectionid
+        left join global_location g on s.pid = g.id
+        where
         <if test="sectionList != null and !sectionList.isEmpty()">
-            and lp.sectionid in
+             lp.sectionid in
             <foreach collection="sectionList" item="item" open="(" separator="," close=")">
                 #{item}
             </foreach>
         </if>
-        <if test="areaId != null and areaId != 0">
-            and lp.areaid = #{areaId}
-        </if>
-        <if test="sectionId != null and sectionId != 0">
-            and lp.sectionid = #{sectionId}
+        order by lp.number ASC,lp.name ASC,lp.id DESC
+    </select>
+
+    <select id="getPoleAlarmLogList" parameterType="List" resultType="LampPoleDTO">
+        select lamp_pole_id as lampPoleId,max(updatetime),status,id,devtype as devType
+        from lamp_pole_alarm_log
+        where (status = 0 or status = 1)
+        <if test="lampPoleIds != null and !lampPoleIds.isEmpty()">
+            and lamp_pole_id in
+            <foreach collection="lampPoleIds" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
         </if>
+        group by lamp_pole_id
     </select>
 
     <!-- 单个灯杆的故障列表 -->
@@ -1348,4 +1396,10 @@
         id=#{id}
         where id = #{id}
     </insert>
+
+    <select id="getLocalDataById" parameterType="Integer" resultType="LampPoleDTO">
+        select G.longitude,G.latitude
+        from lamp_pole LP left join global_location G on G.id = LP.areaid
+        where LP.id = #{id}
+    </select>
 </mapper>

+ 18 - 4
src/main/resources/mapper/OperationLogMapper.xml

@@ -159,12 +159,26 @@
         limit 100
     </select>
 
+<!--    <select id="getLessOperationLogList" resultType="com.welampiot.dto.OperationLogDTO" parameterType="com.welampiot.vo.OperationLogVO">-->
+<!--        select o.time as updateTime,o.remark as logInfo,o.acount as `name`,o.deviceName,o.operaType-->
+<!--        from operation_log o-->
+<!--        where 1=1-->
+<!--        <if test="role != 1">-->
+<!--            and o.userid = #{userId}-->
+<!--        </if>-->
+<!--        order by o.time desc-->
+<!--        limit 50-->
+<!--    </select>-->
+
     <select id="getLessOperationLogList" resultType="com.welampiot.dto.OperationLogDTO" parameterType="com.welampiot.vo.OperationLogVO">
-        select o.time as updateTime,o.remark as logInfo,o.acount as `name`,o.deviceName,o.operaType
+        select o.time as updateTime,o.remark as content,o.acount as `name`
         from operation_log o
-        where 1=1
-        <if test="role != 1">
-            and o.userid = #{userId}
+        where type = 0
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            and sectionid in
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
         </if>
         order by o.time desc
         limit 50

+ 3 - 0
src/main/resources/mapper/ProgramMapper.xml

@@ -20,4 +20,7 @@
         where id = #{programId};
     </delete>
 
+    <select id="getOneProgram" resultType="ProgramDTO" parameterType="integer">
+        select name from program where id = #{id}
+    </select>
 </mapper>

+ 5 - 0
src/main/resources/mapper/ScreenMapper.xml

@@ -243,4 +243,9 @@
             </otherwise>
         </choose>
     </select>
+    
+    <select id="getOneScreenByLampPoleId" parameterType="Integer" resultType="ScreenDTO">
+        select num,light,status,netStatus,volume,playingid as playingId,maxLight,type,id
+        from screen where lamp_pole_id = #{lampPoleId}
+    </select>
 </mapper>

+ 4 - 0
src/main/resources/mapper/VideoMonitorMapper.xml

@@ -446,4 +446,8 @@
             </otherwise>
         </choose>
     </select>
+
+    <select id="geteMonitorData" resultType="VideoMonitorDTO" parameterType="Integer">
+        select gb_address as gbAddress,id from video_monitor where lamp_pole_id = #{lampPoleId} and net_type = 1 order by id desc limit 1
+    </select>
 </mapper>

+ 6 - 0
src/main/resources/mapper/WifiInfoLogMapper.xml

@@ -86,4 +86,10 @@
         limit 1
     </select>
 
+    <select id="getWifiLog" resultType="WifiInfoLogDTO" parameterType="HashMap">
+        select total_com as totalCom,updatetime as updateTime
+        from wifi_info_log
+        where id = #{id} and updatetime >= #{startdate} and updatetime &lt;= #{enddate}
+        order by updatetime desc
+    </select>
 </mapper>

+ 4 - 1
src/main/resources/mapper/WifiMapper.xml

@@ -287,7 +287,7 @@
 
     <select id="getWifiByLampPoleId" resultType="WifiDTO">
         select
-            w.num,w.model,w.status,w.net_type as netType,w.device_count deviceCount,
+           w.id,w.num,w.model,w.status,w.net_type as netType,w.device_count deviceCount,
             w.flow,w.day_flow as dayFlow,w.day_device_count as dayDeviceCount,w.power,
             w.lanStatus,w.ledStatus,w.online,w.ACI,w.voltage,w.current,w.power_factor as powerFactor
         from wifi w
@@ -310,6 +310,9 @@
                 and (W.num = #{name} or W.num = #{number})
             </otherwise>
         </choose>
+    </select>
 
+    <select id="getOneWifiByLampPoleId" parameterType="integer" resultType="WifiDTO">
+        select day_flow,id from wifi where lamp_pole_id = #{id}
     </select>
 </mapper>

+ 10 - 0
src/main/resources/prod/application.yml

@@ -47,6 +47,16 @@ welampiot:
     timeout: 10
     keepalive: 20
 
+wifi: #云盒
+  mqtt:
+    url: streetserver.weclouds.xyz:1883
+    clientId: welampiot_mqtt_client
+    topics: /#
+    username: weclouds
+    password: weclouds@1234
+    timeout: 10
+    keepalive: 20
+
 plc:
   mqtt:
     url: tcp://120.24.144.183:1883

+ 11 - 0
src/main/resources/test/application.yml

@@ -46,6 +46,17 @@ welampiot:
     timeout: 10
     keepalive: 20
 
+
+wifi: #云盒
+  mqtt:
+    url: streetserver.weclouds.xyz:1883
+    clientId: welampiot_mqtt_client
+    topics: /#
+    username: weclouds
+    password: weclouds@1234
+    timeout: 10
+    keepalive: 20
+
 plc:  #力合微
   mqtt:
     url: tcp://120.24.144.183:1883