소스 검색

灯杆大屏:统计数据、灯杆数据

zhj 2 년 전
부모
커밋
e595270ad0
34개의 변경된 파일689개의 추가작업 그리고 14개의 파일을 삭제
  1. 3 3
      src/main/java/com/welampiot/controller/BasePlatformController.java
  2. 158 4
      src/main/java/com/welampiot/controller/BigScreenController.java
  3. 21 0
      src/main/java/com/welampiot/dao/TrailInfoDao.java
  4. 21 0
      src/main/java/com/welampiot/dao/VideoCarDao.java
  5. 19 0
      src/main/java/com/welampiot/dao/VideoFaceDao.java
  6. 1 1
      src/main/java/com/welampiot/dto/ChargeDTO.java
  7. 1 0
      src/main/java/com/welampiot/dto/EnvmonitorDTO.java
  8. 33 0
      src/main/java/com/welampiot/dto/TrailInfoDTO.java
  9. 33 0
      src/main/java/com/welampiot/dto/VideoCarDTO.java
  10. 37 0
      src/main/java/com/welampiot/dto/VideoFaceDTO.java
  11. 11 0
      src/main/java/com/welampiot/dto/VideoMonitorDTO.java
  12. 7 0
      src/main/java/com/welampiot/dto/WeatherDTO.java
  13. 3 0
      src/main/java/com/welampiot/dto/WifiDTO.java
  14. 1 0
      src/main/java/com/welampiot/service/LampPoleService.java
  15. 20 0
      src/main/java/com/welampiot/service/TrailInfoService.java
  16. 20 0
      src/main/java/com/welampiot/service/VideoCarService.java
  17. 18 0
      src/main/java/com/welampiot/service/VideoFaceService.java
  18. 1 1
      src/main/java/com/welampiot/service/WifiService.java
  19. 21 1
      src/main/java/com/welampiot/service/impl/ChargeServiceImpl.java
  20. 13 0
      src/main/java/com/welampiot/service/impl/LampPoleServiceImpl.java
  21. 19 1
      src/main/java/com/welampiot/service/impl/LampServiceImpl.java
  22. 34 0
      src/main/java/com/welampiot/service/impl/TrailInfoServiceImpl.java
  23. 34 0
      src/main/java/com/welampiot/service/impl/VideoCarServiceImpl.java
  24. 29 0
      src/main/java/com/welampiot/service/impl/VideoFaceServiceImpl.java
  25. 1 0
      src/main/java/com/welampiot/service/impl/WifiServiceImpl.java
  26. 58 0
      src/main/java/com/welampiot/utils/WeatherUtil.java
  27. 1 0
      src/main/java/com/welampiot/vo/LampPoleInfoVO.java
  28. 1 1
      src/main/resources/mapper/ChargeMapper.xml
  29. 5 0
      src/main/resources/mapper/EnvmonitorMapper.xml
  30. 1 1
      src/main/resources/mapper/LampMapper.xml
  31. 24 0
      src/main/resources/mapper/TrailInfoMapper.xml
  32. 21 0
      src/main/resources/mapper/VideoCarMapper.xml
  33. 15 0
      src/main/resources/mapper/VideoFaceMapper.xml
  34. 4 1
      src/main/resources/mapper/VideoMonitorMapper.xml

+ 3 - 3
src/main/java/com/welampiot/controller/BasePlatformController.java

@@ -229,7 +229,7 @@ public class BasePlatformController {
         List<Object> dateList = new ArrayList<>();
         List<Object> flowList = new ArrayList<>();
         long l = System.currentTimeMillis();
-        long startTime = l - 24 * 3600 * 1000 * 14;
+        long startTime = l - 24 * 3600 * 1000 * 6;
         HashMap<String, Integer> objectObjectHashMap = new HashMap<>();
         long timeT = startTime;
         int i = 0;
@@ -237,7 +237,7 @@ public class BasePlatformController {
         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) {
+        while (timeT <= l) {
             objectObjectHashMap.put(simpleDateFormat.format(new Date(timeT)), i);
             dateList.add(simpleDateFormat.format(new Date(timeT)));
             flowList.add(0);
@@ -252,7 +252,7 @@ public class BasePlatformController {
         wifiInfoLogDTO.setLampPoleId(id);
         List<WifiInfoLogDTO> wifiInfoLogList = wifiInfoLogService.getWifiStatisticsListByDTO(wifiInfoLogDTO);
         for (WifiInfoLogDTO dto1 : wifiInfoLogList) {
-            Date date = new Date(simpleDateFormat2.parse(dto.getUpdateTime()).getTime());
+            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);

+ 158 - 4
src/main/java/com/welampiot/controller/BigScreenController.java

@@ -2,13 +2,14 @@ package com.welampiot.controller;
 
 import com.welampiot.common.BaseResult;
 import com.welampiot.common.InterfaceResultEnum;
-import com.welampiot.dto.LampInfoCacheByDayDTO;
-import com.welampiot.dto.LampInfoDTO;
-import com.welampiot.service.LampInfoCacheByDayService;
-import com.welampiot.service.LampService;
+import com.welampiot.dto.*;
+import com.welampiot.service.*;
 import com.welampiot.utils.ToolUtils;
+import com.welampiot.utils.WeatherUtil;
 import com.welampiot.vo.LampInfoCacheByDayVO;
 import com.welampiot.vo.LampInfoVO;
+import com.welampiot.vo.LampPoleDataVO;
+import com.welampiot.vo.LampPoleInfoVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.CrossOrigin;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -43,6 +44,26 @@ public class BigScreenController {
     private LampInfoCacheByDayService lampInfoCacheByDayService;
     @Autowired
     private LampService lampService;
+    @Autowired
+    private LampPoleService lampPoleService;
+    @Autowired
+    private EnvmonitorService envmonitorService;
+    @Autowired
+    private ScreenService screenService;
+    @Autowired
+    private VideoMonitorService videoMonitorService;
+    @Autowired
+    private VideoCarService videoCarService;
+    @Autowired
+    private VideoFaceService videoFaceService;
+    @Autowired
+    private TrailInfoService trailInfoService;
+    @Autowired
+    private ChargeService chargeService;
+    @Autowired
+    private WifiService wifiService;
+    @Autowired
+    private WifiInfoLogService wifiInfoLogService;
 
     /**
      * 用电量统计
@@ -216,4 +237,137 @@ public class BigScreenController {
         lampInfoVO.setValue(valueList);
         return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,lampInfoVO);
     }
+
+    /**
+     * 灯杆大屏统计数据
+     * @param request sectionList
+     * @return 灯杆数量统计
+     */
+    @RequestMapping(value = "/lampPoleTotalData", method = RequestMethod.POST)
+    public BaseResult<?> lampPoleTotalData(HttpServletRequest request) {
+        Integer version = (Integer) toolUtils.getRequestContent(request,"version",1);
+        LampPoleDTO lampPoleDTO = new LampPoleDTO();
+        lampPoleDTO.setSectionList(toolUtils.getSectionList(request));
+        LampInfoDTO lampInfoDTO = new LampInfoDTO();
+        lampInfoDTO.setSectionList(toolUtils.getSectionList(request));
+        LampPoleInfoVO lampPoleData = lampPoleService.getLampPoleBigScreenCount(lampPoleDTO, lampInfoDTO);
+        return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,lampPoleData);
+    }
+
+    /**
+     * 灯杆大屏灯杆数据
+     * @param request 灯杆id
+     * @return 灯杆数据
+     */
+    @RequestMapping(value = "/lampPoleData", method = RequestMethod.POST)
+    public BaseResult<?> lampPoleData(HttpServletRequest request) throws Exception {
+        Integer version = (Integer) toolUtils.getRequestContent(request,"version",1);
+        Integer lampPoleId = (Integer) toolUtils.getRequestContent(request,"lampPoleId",1);
+        if (lampPoleId == 0) return toolUtils.response(InterfaceResultEnum.LACK_PARAM_ERROR,version);
+        // 照明数据
+        LampInfoDTO lampInfoDTO = lampService.getLampOfLampPoleById(lampPoleId, 0);
+        LampPoleDataVO lampPoleDataVO = new LampPoleDataVO();
+        lampPoleDataVO.setLampData(lampInfoDTO);
+        // 气象数据
+        EnvmonitorDTO envmonitor = envmonitorService.getEnvmonitorByLampPoleId(lampPoleId);
+        Double longitude = null,latitude = null;
+        if (envmonitor != null) {
+            longitude = envmonitor.getLongitude();
+            latitude = envmonitor.getLatitude();
+        }
+        if (longitude != null && latitude != null) {
+            List<WeatherDTO> weatherList = WeatherUtil.getNearWeatherInfo(longitude.toString(), latitude.toString());
+            envmonitor.setWeatherList(weatherList);
+        }
+        lampPoleDataVO.setWeatherData(envmonitor);
+        // 屏幕数据
+        ScreenDTO screen = screenService.getScreenByLampPoleId(lampPoleId);
+        if (screen != null) screen.setName(screen.getPlay());
+        lampPoleDataVO.setScreenData(screen);
+        // 监控数据
+        VideoMonitorDTO video = videoMonitorService.getVideoMonitorByLampPoleId(lampPoleId);
+        video.setVideoPath("");
+        video.setVideoPathHd("");
+        VideoCarDTO videoCar = videoCarService.getVideoCarByVideoId(video.getId());
+        if (videoCar != null) video.setCarImage(videoCar.getImage());
+        List<VideoCarDTO> carList = videoCarService.getVideoCarListByVideoId(video.getId());
+        video.setCarList(carList); // 车牌识别列表
+        List<VideoFaceDTO> videoFace = videoFaceService.getVideoFaceListByVideoId(lampPoleId);
+        video.setFaceList(videoFace); // 人脸识别列表
+        List<TrailInfoDTO> trailList = trailInfoService.getTrailInfoListByVideoId(video.getId());
+        video.setTrailList(trailList); // 轨迹列表
+        List<TrailInfoDTO> smailList = trailInfoService.getSmailListByVideoId(video.getId());
+        video.setSmailList(smailList); // 相似度列表
+        lampPoleDataVO.setVideoData(video);
+        // 充电桩数据
+        ChargeDTO chargeDTO = chargeService.getChargeInfoByLampPoleId(lampPoleId);
+        lampPoleDataVO.setChargeData(chargeDTO);
+        // wifi数据
+        WifiDTO wifi = wifiService.getWifiByLampPoleId(lampPoleId);
+        if (wifi.getFlow() != null) {
+            Float flow = wifi.getFlow();
+            if (flow < 1024) {
+                wifi.setType(0);
+            } else if (1024 <= flow && flow < 1024 * 1024) {
+                wifi.setType(1);
+                flow = flow / 1024;
+                wifi.setFlow(flow);
+            } else if (1024 * 1024 <= flow) {
+                wifi.setType(2);
+                flow = flow / (1024 * 1024);
+                wifi.setFlow(flow);
+            }
+        }
+        // 流量列表
+        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(lampPoleId);
+        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)));
+            }
+        }
+        wifi.setDateList(dateList);
+        wifi.setFlowList(flowList);
+        lampPoleDataVO.setWifiData(wifi);
+        return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS,version,lampPoleDataVO);
+    }
 }

+ 21 - 0
src/main/java/com/welampiot/dao/TrailInfoDao.java

@@ -0,0 +1,21 @@
+package com.welampiot.dao;
+
+import com.welampiot.dto.TrailInfoDTO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * ClassName: TrailInfoDao
+ * Package: com.welampiot.dao
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/9/11 - 18:23
+ * @Version: v1.0
+ */
+public interface TrailInfoDao {
+    List<TrailInfoDTO> getTrailInfoListByVideoId(@Param("videoId") Integer videoId);
+
+    List<TrailInfoDTO> getSmailListByVideoId(@Param("videoId") Integer videoId);
+}

+ 21 - 0
src/main/java/com/welampiot/dao/VideoCarDao.java

@@ -0,0 +1,21 @@
+package com.welampiot.dao;
+
+import com.welampiot.dto.VideoCarDTO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * ClassName: VideoCarDao
+ * Package: com.welampiot.dao
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/9/11 - 17:09
+ * @Version: v1.0
+ */
+public interface VideoCarDao {
+    VideoCarDTO getVideoCarByVideoId(@Param("videoId") Integer videoId);
+
+    List<VideoCarDTO> getVideoCarListByVideoId(@Param("videoId") Integer videoId);
+}

+ 19 - 0
src/main/java/com/welampiot/dao/VideoFaceDao.java

@@ -0,0 +1,19 @@
+package com.welampiot.dao;
+
+import com.welampiot.dto.VideoFaceDTO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * ClassName: VideoFaceDao
+ * Package: com.welampiot.dao
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/9/11 - 17:29
+ * @Version: v1.0
+ */
+public interface VideoFaceDao {
+    List<VideoFaceDTO> getVideoFaceListByVideoId(@Param("videoId") Integer videoId);
+}

+ 1 - 1
src/main/java/com/welampiot/dto/ChargeDTO.java

@@ -74,7 +74,7 @@ public class ChargeDTO implements Serializable {
     private Float free;
 
     /** 累计充电时间 **/
-    private Integer duration;
+    private String duration;
 
     /** 在线状态(0 待机,1 在线) **/
     private Integer online;

+ 1 - 0
src/main/java/com/welampiot/dto/EnvmonitorDTO.java

@@ -210,6 +210,7 @@ public class EnvmonitorDTO implements Serializable {
 
     private String area;
 
+    private List<WeatherDTO> weatherList;
     List<WeatherRS485DevInfoDTO> devList;
 
     private String temp;

+ 33 - 0
src/main/java/com/welampiot/dto/TrailInfoDTO.java

@@ -0,0 +1,33 @@
+package com.welampiot.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * ClassName: TrailInfoDTO
+ * Package: com.welampiot.dto
+ * Description: 轨迹查找信息表
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/9/11 - 16:51
+ * @Version: v1.0
+ */
+@Data
+public class TrailInfoDTO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private Integer id;
+
+    private Integer videoId;
+
+    private String smail; // 相似度
+
+    private String image; // 相似人脸图片地址
+
+    private String updateTime; // 更新时间
+
+    private String location; // 路段名
+
+    private String faceImage;
+}

+ 33 - 0
src/main/java/com/welampiot/dto/VideoCarDTO.java

@@ -0,0 +1,33 @@
+package com.welampiot.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * ClassName: VideoCarDTO
+ * Package: com.welampiot.dto
+ * Description: 摄像头车牌识别信息表
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/9/11 - 16:35
+ * @Version: v1.0
+ */
+@Data
+public class VideoCarDTO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private Integer id;
+
+    private Integer videoId; // 视屏监控id
+
+    private String updateTime; // 更新时间
+
+    private String image; // 车牌图片
+
+    private String carNumber; // 车牌号
+
+    private String faceImage;
+
+    private String bigImage; // 大图地址
+}

+ 37 - 0
src/main/java/com/welampiot/dto/VideoFaceDTO.java

@@ -0,0 +1,37 @@
+package com.welampiot.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * ClassName: VideoFaceDTO
+ * Package: com.welampiot.dto
+ * Description: 摄像头人脸识别信息表
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/9/11 - 16:41
+ * @Version: v1.0
+ */
+@Data
+public class VideoFaceDTO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private Integer id;
+
+    private Integer videoId; // 视屏监控id
+
+    private String image; // 识别图片地址
+
+    private Integer age; // 年龄
+
+    private String bigImage; // 大图地址
+
+    private Integer gender; // 性别(0 女,1 男)
+
+    private Integer expression; // 表情(0 愤怒,1 厌恶,2 恐惧,3 高兴,4 平静,5 伤心,6 惊讶)
+
+    private String updateTime; // 更新时间
+
+    private String faceToken; // 人脸标识
+}

+ 11 - 0
src/main/java/com/welampiot/dto/VideoMonitorDTO.java

@@ -2,6 +2,8 @@ package com.welampiot.dto;
 
 import lombok.Data;
 
+import java.util.List;
+
 @Data
 public class VideoMonitorDTO {
     private Integer id;
@@ -30,6 +32,7 @@ public class VideoMonitorDTO {
     private Integer isOpen;
     private Integer peopleCountTotal; // 总人流量
     private Integer dayPersonCountTotal; // 当日人数统计
+    private Integer personCountToday;
     private Integer manCount; // 男性数量
     private Integer womanCount; // 女性数量
     private Integer age1Count; // 年龄小于10岁的数量
@@ -41,6 +44,7 @@ public class VideoMonitorDTO {
     private Integer age7Count; // 60岁以上人数
     private Integer carCountTotal; // 总车流量
     private Integer dayCarCountTotal; // 当日车流量统计
+    private Integer carCountToday;
     private String faceSetId; // 人脸集合标识
     private String faceImage; // 人脸对比图
     private Integer isInspect; // 是否开启人脸识别(0 关闭,1 开启)
@@ -71,4 +75,11 @@ public class VideoMonitorDTO {
     private String rtmp2;
     private String rtmpHD2;
     private String videoAddress;
+    private String videoPath;
+    private String videoPathHd;
+    private String carImage;
+    private List<VideoFaceDTO> faceList; // 人脸识别列表
+    private List<VideoCarDTO> carList; // 车牌识别列表
+    private List<TrailInfoDTO> trailList; // 轨迹搜索图片
+    private List<TrailInfoDTO> smailList; // 相似度列表
 }

+ 7 - 0
src/main/java/com/welampiot/dto/WeatherDTO.java

@@ -21,5 +21,12 @@ public class WeatherDTO {
     private String category; // 空气质量等级
     private String tempMax; // 最高气温
     private String tempMin; // 最低气温
+    private String iconDay;
+    private String iconNight;
+    private String textDay;
+    private String textNight;
     private String updateTime;
+    private String date;
+    private String sunrise; // 日出时间
+    private String sunset; // 日落时间
 }

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

@@ -319,4 +319,7 @@ public class WifiDTO implements Serializable {
     private Integer LED6;
     private Integer LED7;
     private Integer LED8;
+
+    private List<Object> dateList;
+    private List<Object> flowList;
 }

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

@@ -48,4 +48,5 @@ public interface LampPoleService {
     List<LampPoleDTO> getLampPoleAlarmListByLampPoleId(Integer lampPoleId);
     LampPoleDTO getNewLampPoleDetailsById(Integer id);
     List<LampPoleDTO> getLampListByLampPoleId(Integer lampPoleId);
+    LampPoleInfoVO getLampPoleBigScreenCount(LampPoleDTO lampPoleDTO, LampInfoDTO lampInfoDTO);
 }

+ 20 - 0
src/main/java/com/welampiot/service/TrailInfoService.java

@@ -0,0 +1,20 @@
+package com.welampiot.service;
+
+import com.welampiot.dto.TrailInfoDTO;
+
+import java.util.List;
+
+/**
+ * ClassName: TrailInfoService
+ * Package: com.welampiot.service
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/9/11 - 18:24
+ * @Version: v1.0
+ */
+public interface TrailInfoService {
+    List<TrailInfoDTO> getTrailInfoListByVideoId(Integer videoId);
+
+    List<TrailInfoDTO> getSmailListByVideoId(Integer videoId);
+}

+ 20 - 0
src/main/java/com/welampiot/service/VideoCarService.java

@@ -0,0 +1,20 @@
+package com.welampiot.service;
+
+import com.welampiot.dto.VideoCarDTO;
+
+import java.util.List;
+
+/**
+ * ClassName: VideoCarService
+ * Package: com.welampiot.service
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/9/11 - 17:11
+ * @Version: v1.0
+ */
+public interface VideoCarService {
+    VideoCarDTO getVideoCarByVideoId(Integer videoId);
+
+    List<VideoCarDTO> getVideoCarListByVideoId(Integer videoId);
+}

+ 18 - 0
src/main/java/com/welampiot/service/VideoFaceService.java

@@ -0,0 +1,18 @@
+package com.welampiot.service;
+
+import com.welampiot.dto.VideoFaceDTO;
+
+import java.util.List;
+
+/**
+ * ClassName: VideoFaceService
+ * Package: com.welampiot.service
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/9/11 - 17:30
+ * @Version: v1.0
+ */
+public interface VideoFaceService {
+    List<VideoFaceDTO> getVideoFaceListByVideoId(Integer videoId);
+}

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

@@ -35,5 +35,5 @@ public interface WifiService {
     Integer checkWifiData(WifiDTO dto);
     WifiDTO getWifiInfoDetails(WifiDTO dto);
     WifiDTO getTotalWifiCountAndFlow(WifiDTO dto);
-    WifiDTO getWifiByLampPoleId(@Param("lampPoleId") Integer lampPoleId);
+    WifiDTO getWifiByLampPoleId(Integer lampPoleId);
 }

+ 21 - 1
src/main/java/com/welampiot/service/impl/ChargeServiceImpl.java

@@ -137,7 +137,27 @@ public class ChargeServiceImpl implements ChargeService {
 
     @Override
     public ChargeDTO getChargeInfoByLampPoleId(Integer lampPoleId) {
-        return chargeDao.getChargeInfoByLampPoleId(lampPoleId);
+        ChargeDTO chargeDTO = chargeDao.getChargeInfoByLampPoleId(lampPoleId);
+        if (chargeDTO != null && chargeDTO.getDuration() != null) {
+            String duration = chargeDTO.getDuration();
+            int workTime = Integer.parseInt(duration);
+            int hour = workTime / 60;
+            int min = workTime % 60;
+            String hourStr,minStr;
+            if (hour < 10) {
+                hourStr = "0" + hour;
+            } else {
+                hourStr = hour + "";
+            }
+            if (min < 10) {
+                minStr = "0" + min;
+            } else {
+                minStr = min + "";
+            }
+            duration = hourStr + ":" + minStr;
+            chargeDTO.setDuration(duration);
+        }
+        return chargeDTO;
     }
 
     @Override

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

@@ -587,6 +587,19 @@ public class LampPoleServiceImpl implements LampPoleService {
         return lampPoleDao.getLampListByLampPoleId(lampPoleId);
     }
 
+    @Override
+    public LampPoleInfoVO getLampPoleBigScreenCount(LampPoleDTO lampPoleDTO, LampInfoDTO lampInfoDTO) {
+        LampPoleInfoVO countVO = new LampPoleInfoVO();
+        Integer total = lampPoleDao.getLampPoleInstallTotalByDTO(lampPoleDTO);
+        countVO.setInstallCount(total);
+        countVO.setLampPoleCount(total);
+        countVO.setOnlineCount(lampService.getLampOnlineTotalByDTO(lampInfoDTO));
+        countVO.setFaultCount(lampService.getLampFaultTotalByDTO(lampInfoDTO));
+        countVO.setLightCount(lampService.getLampLightTotalByDTO(lampInfoDTO));
+        countVO.setScreenCount(lampPoleDao.getScreenCount(lampPoleDTO));
+        return countVO;
+    }
+
     @Override
     public Integer getAlarmCountByVO(LampPoleCountVO lampPoleCountVO) {
         return lampPoleDao.getAlarmCountByVO(lampPoleCountVO);

+ 19 - 1
src/main/java/com/welampiot/service/impl/LampServiceImpl.java

@@ -692,7 +692,25 @@ public class LampServiceImpl implements LampService {
 
     @Override
     public LampInfoDTO getLampOfLampPoleById(Integer lampPoleId, Integer lampId) {
-        return lampDao.getLampOfLampPoleById(lampPoleId, lampId);
+        LampInfoDTO lampInfoDTO = lampDao.getLampOfLampPoleById(lampPoleId, lampId);
+        String workTimeTotal = lampInfoDTO.getWorkTimeTotal();
+        int workTime = Integer.parseInt(workTimeTotal);
+        int hour = workTime / 60;
+        int min = workTime % 60;
+        String hourStr,minStr;
+        if (hour < 10) {
+            hourStr = "0" + hour;
+        } else {
+            hourStr = hour + "";
+        }
+        if (min < 10) {
+            minStr = "0" + min;
+        } else {
+            minStr = min + "";
+        }
+        workTimeTotal = hourStr + ":" + minStr;
+        lampInfoDTO.setWorkTimeTotal(workTimeTotal);
+        return lampInfoDTO;
     }
 
     @Override

+ 34 - 0
src/main/java/com/welampiot/service/impl/TrailInfoServiceImpl.java

@@ -0,0 +1,34 @@
+package com.welampiot.service.impl;
+
+import com.welampiot.dao.TrailInfoDao;
+import com.welampiot.dto.TrailInfoDTO;
+import com.welampiot.service.TrailInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * ClassName: TrailInfoServiceImpl
+ * Package: com.welampiot.service.impl
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/9/11 - 18:25
+ * @Version: v1.0
+ */
+@Service
+public class TrailInfoServiceImpl implements TrailInfoService {
+    @Autowired
+    private TrailInfoDao trailInfoDao;
+
+    @Override
+    public List<TrailInfoDTO> getTrailInfoListByVideoId(Integer videoId) {
+        return trailInfoDao.getTrailInfoListByVideoId(videoId);
+    }
+
+    @Override
+    public List<TrailInfoDTO> getSmailListByVideoId(Integer videoId) {
+        return trailInfoDao.getSmailListByVideoId(videoId);
+    }
+}

+ 34 - 0
src/main/java/com/welampiot/service/impl/VideoCarServiceImpl.java

@@ -0,0 +1,34 @@
+package com.welampiot.service.impl;
+
+import com.welampiot.dao.VideoCarDao;
+import com.welampiot.dto.VideoCarDTO;
+import com.welampiot.service.VideoCarService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * ClassName: VideoCarServiceImpl
+ * Package: com.welampiot.service.impl
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/9/11 - 17:11
+ * @Version: v1.0
+ */
+@Service
+public class VideoCarServiceImpl implements VideoCarService {
+    @Autowired
+    private VideoCarDao videoCarDao;
+
+    @Override
+    public VideoCarDTO getVideoCarByVideoId(Integer videoId) {
+        return videoCarDao.getVideoCarByVideoId(videoId);
+    }
+
+    @Override
+    public List<VideoCarDTO> getVideoCarListByVideoId(Integer videoId) {
+        return videoCarDao.getVideoCarListByVideoId(videoId);
+    }
+}

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

@@ -0,0 +1,29 @@
+package com.welampiot.service.impl;
+
+import com.welampiot.dao.VideoFaceDao;
+import com.welampiot.dto.VideoFaceDTO;
+import com.welampiot.service.VideoFaceService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * ClassName: VideoFaceServiceImpl
+ * Package: com.welampiot.service.impl
+ * Description:
+ *
+ * @Author: zhj_Start
+ * @Create: 2023/9/11 - 17:30
+ * @Version: v1.0
+ */
+@Service
+public class VideoFaceServiceImpl implements VideoFaceService {
+    @Autowired
+    private VideoFaceDao videoFaceDao;
+
+    @Override
+    public List<VideoFaceDTO> getVideoFaceListByVideoId(Integer videoId) {
+        return videoFaceDao.getVideoFaceListByVideoId(videoId);
+    }
+}

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

@@ -211,6 +211,7 @@ public class WifiServiceImpl implements WifiService {
     @Override
     public WifiDTO getWifiByLampPoleId(Integer lampPoleId) {
         WifiDTO dto = wifiDao.getWifiByLampPoleId(lampPoleId);
+        if (dto == null) return new WifiDTO();
         if (dto.getOnline() != null) {
             dto.setLED1(dto.getOnline());
         }

+ 58 - 0
src/main/java/com/welampiot/utils/WeatherUtil.java

@@ -12,6 +12,8 @@ import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.zip.GZIPInputStream;
 
 /**
@@ -90,6 +92,62 @@ public class WeatherUtil {
         return weatherDTO;
     }
 
+    /**
+     * 获取最近7天气信息
+     * @param longitude 经度
+     * @param latitude 纬度
+     * @return 返回天气信息
+     * @throws Exception 异常
+     */
+    public static List<WeatherDTO> getNearWeatherInfo(String longitude, String latitude) throws Exception {
+        // 实时天气
+        String url = "https://devapi.qweather.com/v7/weather/now?location=" + longitude + "," + latitude +
+                "&key=2dca03c7d95c442ba8fbce9d7a96db78";
+        RestTemplate restTemplate = new RestTemplate();
+        byte[] oResult = restTemplate.exchange(url, HttpMethod.GET, null, byte[].class).getBody();
+        String unGZipResult = unGZip(oResult);
+
+        JSONObject jsonObject = new JSONObject(unGZipResult);
+        JSONObject object = jsonObject.getJSONObject("now");
+        String temp = object.getString("temp"); // 实时天气温度
+
+        // 未来7天天气
+        url = "https://devapi.qweather.com/v7/weather/7d?location=" + longitude + "," + latitude +
+                "&key=2dca03c7d95c442ba8fbce9d7a96db78";
+        restTemplate = new RestTemplate();
+        byte[] oResult2 = restTemplate.exchange(url, HttpMethod.GET, null, byte[].class).getBody();
+        String unGZipResult2 = unGZip(oResult2);
+
+        List<WeatherDTO> weatherList = new ArrayList<>();
+        JSONObject jsonObject2 = new JSONObject(unGZipResult2);
+        JSONArray daily = jsonObject2.getJSONArray("daily");
+        for (int i = 0; i < daily.length(); i ++) {
+            JSONObject object2 = daily.getJSONObject(i);
+            String fxDate = object2.getString("fxDate"); // 更新日期
+            String tempMax = object2.getString("tempMax"); // 当天最高气温
+            String tempMin = object2.getString("tempMin"); // 当天最低气温
+            String sunrise = object2.getString("sunrise"); // 日出时间
+            String sunset = object2.getString("sunset"); // 日落时间
+            String iconDay = object2.getString("iconDay"); // 白天天气状况图标代码
+            String iconNight = object2.getString("iconNight"); // 白天天气状况文字描述
+            String textDay = object2.getString("textDay"); // 夜间天气状况图标代码
+            String textNight = object2.getString("textNight"); // 夜间天气状况文字描述
+            WeatherDTO weatherDTO = new WeatherDTO();
+            weatherDTO.setIconDay(iconDay);
+            weatherDTO.setIconNight(iconNight);
+            weatherDTO.setTextDay(textDay);
+            weatherDTO.setTextNight(textNight);
+            weatherDTO.setSunrise(sunrise);
+            weatherDTO.setSunset(sunset);
+            weatherDTO.setTempMax(tempMax);
+            weatherDTO.setTempMin(tempMin);
+            weatherDTO.setDate(fxDate);
+            weatherList.add(weatherDTO);
+        }
+        weatherList.get(0).setTemp(temp);
+        return weatherList;
+    }
+
     public static String unGZip(byte[] oResult) throws Exception {
         try (InputStream inputStream = new ByteArrayInputStream(oResult);
              ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();

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

@@ -14,6 +14,7 @@ public class LampPoleInfoVO {
     private Integer runCount;
     private Integer faultCount;
     private Integer onlineCount;
+    private Integer lightCount;
     private Integer lightingCount;
     private Integer installCount;
     private Integer rfidCount;

+ 1 - 1
src/main/resources/mapper/ChargeMapper.xml

@@ -138,7 +138,7 @@
         select c.type,c.macVoltage,c.power,c.macCurrent,c.voltage,c.current,c.model,c.num,c.chargeModel,
                c.electricityFee,c.serviceFee,c.connectorCode,c.stationCode,c.createtime as createTime,
                c.status,c.bill_amt as billAmt,c.energy,c.starttime as startTime,c.endtime as endTime,
-               c.duration,c.free,c.connectorNum,c.equipmentElectricity,c.macVoltage,c.serviceFee
+               c.duration,c.free,c.connectorNum,c.equipmentElectricity,c.macVoltage,c.serviceFee,c.connectorNum
         from charge c
         where c.lamp_pole_id = #{lampPoleId}
         limit 1

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

@@ -151,6 +151,7 @@
             e.id,
             e.longitude,
             e.latitude,
+            e.netType,
             e.model,
             e.num,
             e.address,
@@ -166,6 +167,10 @@
             e1.windSpeed,
             e1.windDire,
             e1.co2,
+            e1.co,
+            e1.tsp,
+            e1.rainfall,
+            e1.radiation,
             e1.updatetime as updateTime,
             n.protocoltype as protocolType
         from

+ 1 - 1
src/main/resources/mapper/LampMapper.xml

@@ -1108,7 +1108,7 @@
         select l.id as lampId,l2.gridvolt as gridVolt,l2.gridcurr as gridCurr,
                l2.grid_active_power as gridActivePower,l2.gridPF,l2.work_time_total as workTimeTotal,
                l2.total_gener_energy_cache as usedEnergyTotal,l2.total_ele_save_cache as powerSave,
-               p.name as policyName,l.lighteness
+               p.name as policyName,l.lighteness,l.colour_val as colourVal
         from lampinfo l
         left join lamp_info_log_new l2 on l2.lampid = l.id
         left join policy p on p.id = l.policyid

+ 24 - 0
src/main/resources/mapper/TrailInfoMapper.xml

@@ -0,0 +1,24 @@
+<?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.TrailInfoDao">
+
+    <select id="getTrailInfoListByVideoId" resultType="TrailInfoDTO">
+        select s.name as location,t.updatetime as updateTime
+        from trail_info t
+        left join video_monitor vm on t.videoid = vm.id
+        left join lamp_pole lp on lp.id = vm.lamp_pole_id
+        left join section s on lp.sectionid = s.id
+        where t.videoid = #{videoId}
+        order by t.updatetime desc
+    </select>
+
+    <select id="getSmailListByVideoId" resultType="TrailInfoDTO">
+        select t.image,vm.face_image as faceImage,t.smail
+        from trail_info t
+        left join video_monitor vm on vm.id = t.videoid
+        where t.videoid = #{videoId}
+        order by t.updatetime desc
+        limit 1
+    </select>
+
+</mapper>

+ 21 - 0
src/main/resources/mapper/VideoCarMapper.xml

@@ -0,0 +1,21 @@
+<?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.VideoCarDao">
+
+    <select id="getVideoCarByVideoId" resultType="VideoCarDTO">
+        select vc.image
+        from video_car vc
+        where vc.videoid = #{videoId}
+        order by vc.updatetime desc
+        limit 1
+    </select>
+
+    <select id="getVideoCarListByVideoId" resultType="VideoCarDTO">
+        select vc.carNumber,vm.face_image as faceImage
+        from video_car vc
+        left join video_monitor vm on vc.videoid = vm.id
+        where vc.videoid = #{videoId}
+        order by vc.updatetime desc
+    </select>
+
+</mapper>

+ 15 - 0
src/main/resources/mapper/VideoFaceMapper.xml

@@ -0,0 +1,15 @@
+<?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.VideoFaceDao">
+
+    <select id="getVideoFaceListByVideoId" resultType="VideoFaceDTO">
+        select
+            vf.image,
+            vf.age,
+            vf.gender,
+            vf.expression
+        from video_face vf
+        where vf.videoid = #{videoId}
+    </select>
+
+</mapper>

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

@@ -404,7 +404,10 @@
     <select id="getVideoMonitorByLampPoleId" resultType="VideoMonitorDTO">
         select
             v.id as videoId,v.is_auto as isAuto,v.rtmpHd,v.rtmp,v.hls,v.hlsHd,
-            v.deviceType,v.net_type as netType
+            v.deviceType,v.net_type as netType,v.devid as devId,v.channel,v.manCount,
+            v.womanCount,v.peopleCountTotal,v.day_personCountTotal as personCountToday,
+            v.age1Count,v.age2Count,v.age3Count,v.age4Count,v.age5Count,v.age6Count,
+            v.age7Count,v.carCountTotal,v.`day_ carCountTotal` as carCountToday,v.image
         from video_monitor v
         where v.lamp_pole_id = #{lampPoleId}
     </select>