fuliqi
2024-04-03 15f56cdd29e1f9a989ded5af2bae95f50998ad16
Merge remote-tracking branch 'origin/master'
9个文件已修改
100 ■■■■■ 已修改文件
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/Report.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-pojo/src/main/java/com/ycl/platform/domain/form/ReportForm.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-pojo/src/main/java/com/ycl/platform/domain/query/ReportQuery.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/controller/TMonitorController.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/mapper/TMonitorMapper.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/service/ITMonitorService.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/service/impl/ReportServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/service/impl/TMonitorServiceImpl.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/Report.java
@@ -56,5 +56,12 @@
    @TableField("error_type")
    private String errorType;
    @ApiModelProperty("生效时间")
    @TableField("begin_create_time")
    private Date beginCreateTime;
    @ApiModelProperty("失效时间")
    @TableField("end_create_time")
    private Date endCreateTime;
}
ycl-pojo/src/main/java/com/ycl/platform/domain/form/ReportForm.java
@@ -38,6 +38,12 @@
    @ApiModelProperty("审核时间")
    private Date auditingTime;
    @ApiModelProperty("生效时间")
    private Date beginCreateTime;
    @ApiModelProperty("失效时间")
    private Date endCreateTime;
    @ApiModelProperty("审核类型")
    private String reportType;
ycl-pojo/src/main/java/com/ycl/platform/domain/query/ReportQuery.java
@@ -1,6 +1,8 @@
package com.ycl.platform.domain.query;
import com.ycl.platform.base.AbsQuery;
import java.util.Date;
import java.util.List;
import org.springframework.lang.NonNull;
import jakarta.validation.constraints.NotBlank;
@@ -22,5 +24,9 @@
    private String reportType;
    private Date beginCreateTime;
    private Date endCreateTime;
}
ycl-server/src/main/java/com/ycl/platform/controller/TMonitorController.java
@@ -11,7 +11,6 @@
import enumeration.BusinessType;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@@ -96,4 +95,24 @@
    {
        return toAjax(tMonitorService.deleteTMonitorByIds(ids));
    }
    /**
     * 获取视频设备统计数
     */
    @GetMapping("/getVideoCount/{cameraFunType}")
    public AjaxResult getVideoCount(@PathVariable String cameraFunType)
    {
        return success(tMonitorService.getVideoCount(cameraFunType));
    }
    /**
     * 获取异常恢复视频设备统计数
     */
    @GetMapping("/recoveryException")
    public AjaxResult recoveryException()
    {
        return success(tMonitorService.recoveryException());
    }
}
ycl-server/src/main/java/com/ycl/platform/mapper/TMonitorMapper.java
@@ -4,6 +4,7 @@
import com.ycl.platform.domain.vo.TMonitorVO;
import java.util.List;
import java.util.Map;
/**
 * 设备资产Mapper接口
@@ -60,4 +61,13 @@
     * @return 结果
     */
    public int deleteTMonitorByIds(Long[] ids);
    /**
     * 获取视频统计
     * @param cameraFunType 类型
     * @return 统计数
     */
    Map<String, String> getVideoCount(String cameraFunType);
    Map<String, String> recoveryException();
}
ycl-server/src/main/java/com/ycl/platform/service/ITMonitorService.java
@@ -4,6 +4,7 @@
import com.ycl.platform.domain.vo.TMonitorVO;
import java.util.List;
import java.util.Map;
/**
 * 设备资产Service接口
@@ -60,4 +61,14 @@
     * @return 结果
     */
    public int deleteTMonitorById(Long id);
    /**
     * 获取指定摄像头功能类型下的视频数量。
     *
     * @param cameraFunType 摄像头功能类型,用于筛选视频。
     * @return 返回一个包含视频数量的Map对象,其中key为统计指标,value为对应功能类型下的统计数量。
     */
    Map<String, String> getVideoCount(String cameraFunType);
    Map<String, String> recoveryException();
}
ycl-server/src/main/java/com/ycl/platform/service/impl/ReportServiceImpl.java
@@ -52,6 +52,8 @@
     */
    @Override
    public Result add(ReportForm form) {
        form.setPeopleId(1);
        form.setUnitId(2);
        Report entity = ReportForm.getEntityByForm(form, null);
        if(baseMapper.insert(entity) > 0) {
            return Result.ok("添加成功");
@@ -114,6 +116,8 @@
        IPage<Report> page = new LambdaQueryChainWrapper<>(baseMapper)
                .eq(StringUtils.isNotBlank(query.getReportType()), Report::getReportType, query.getReportType())
                .le(Objects.nonNull(query.getBeginCreateTime()), Report::getBeginCreateTime, query.getBeginCreateTime())
                .ge(Objects.nonNull(query.getEndCreateTime()), Report::getEndCreateTime, query.getEndCreateTime())
                .orderByDesc(Report::getCreateTime)
                .page(PageUtil.getPage(query, Report.class));
ycl-server/src/main/java/com/ycl/platform/service/impl/TMonitorServiceImpl.java
@@ -8,6 +8,7 @@
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
 * 设备资产Service业务层处理
@@ -92,4 +93,14 @@
    {
        return tMonitorMapper.deleteTMonitorById(id);
    }
    @Override
    public Map<String, String> getVideoCount(String cameraFunType) {
        return tMonitorMapper.getVideoCount(cameraFunType);
    }
    @Override
    public Map<String, String> recoveryException() {
        return tMonitorMapper.recoveryException();
    }
}
ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml
@@ -225,4 +225,28 @@
            #{id}
        </foreach>
    </delete>
    <select id="getVideoCount" resultType="java.util.Map">
        SELECT count(*)                                                          AS totalPosts,
               IFNULL(SUM(IF(on_state = 1, 1, 0)), 0)                            AS totalMembers,
               IFNULL(SUM(IF(on_state = 2, 1, 0)), 0)                            AS postsPercentage,
               IFNULL(SUM(IF(default_order = 1, 1, 0)), 0)                       AS totalViews,
               -1                                                                as noStore,
               -1                                                                as partStore,
               IFNULL(ROUND(SUM(IF(on_state = 1, 1, 0)) / count(*) * 100, 2), 0) as viewsPercentage,
               -1                                                                as totalFace,
               -1                                                                as totalCar
        FROM t_monitor
        WHERE camera_fun_type like concat('%', #{cameraFunType}, '%')
    </select>
    <select id="recoveryException" resultType="java.util.Map">
        SELECT count(*)                                                          AS totalPosts,
               IFNULL(SUM(IF(on_state = 1, 1, 0)), 0)                            AS totalMembers,
               IFNULL(SUM(IF(on_state = 2, 1, 0)), 0)                            AS postsPercentage,
               IFNULL(SUM(IF(default_order = 1, 1, 0)), 0)                       AS totalViews,
               IFNULL(ROUND(SUM(IF(on_state = 1, 1, 0)) / count(*) * 100, 2), 0) as viewsPercentage
        FROM t_monitor
        WHERE recovery = 1
    </select>
</mapper>