zhanghua
2023-05-30 f186f661e0ef88ad43c20c272621e8c7506e7b82
bug修改
7个文件已修改
1个文件已添加
94 ■■■■ 已修改文件
ycl-platform/src/main/java/com/ycl/controller/trend/TrendAnalysisController.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/entity/cockpitManage/TeamConstruction.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/mapper/trend/TrendAnalysisMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/trend/TrendAnalysisService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/trend/impl/TrendAnalysisServiceImpl.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/unlawful/impl/UnlawfulServiceImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/vo/TrendAnalysisVo.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/resources/mapper/trend/TrendAnalysisMapper.xml 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/controller/trend/TrendAnalysisController.java
@@ -5,6 +5,7 @@
import com.ycl.api.CommonResult;
import com.ycl.dto.trend.TrendAnalysisParam;
import com.ycl.service.trend.TrendAnalysisService;
import com.ycl.vo.TrendAnalysisVo;
import com.ycl.vo.TrendVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -23,19 +24,27 @@
    @ApiOperation("数据查询")
    @PostMapping("/info")
    public CommonResult<List<TrendVo>> list(@RequestBody TrendAnalysisParam trendAnalysisParam, Integer pageSize, Integer pageNum) {
        return CommonResult.success(trendAnalysisService.list(trendAnalysisParam,pageSize,pageNum));
        return CommonResult.success(trendAnalysisService.list(trendAnalysisParam, pageSize, pageNum));
    }
    @ApiOperation("点位数据查询")
    @GetMapping("/pointInfo")
    public CommonResult<List<TrendVo>> queryPointInfo(@RequestParam(required = false) String longitude,
                                                      @RequestParam(required = false) String latitude) {
        return CommonResult.success(trendAnalysisService.queryPointInfo(longitude,latitude));
        return CommonResult.success(trendAnalysisService.queryPointInfo(longitude, latitude));
    }
    @ApiOperation("点位数据查询")
    @GetMapping("/queryPointInfoByTime")
    public CommonResult<TrendAnalysisVo> queryPointInfoByTime(@RequestParam Long pointId,
                                                              @RequestParam(required = false) String startTime,
                                                              @RequestParam(required = false) String endTime) {
        return CommonResult.success(trendAnalysisService.queryPointInfoByTime(pointId, startTime, endTime));
    }
    @ApiOperation("首次报警点位数据查询")
    @PostMapping("/firstInfo")
    public CommonResult<List<TrendVo>> queryListByCount(@RequestBody TrendAnalysisParam trendAnalysisParam, Integer pageSize, Integer pageNum) {
        return CommonResult.success(trendAnalysisService.queryListByCount(trendAnalysisParam,pageSize,pageNum));
        return CommonResult.success(trendAnalysisService.queryListByCount(trendAnalysisParam, pageSize, pageNum));
    }
}
ycl-platform/src/main/java/com/ycl/entity/cockpitManage/TeamConstruction.java
@@ -31,8 +31,8 @@
    @ExcelIgnore
    private Long id;
    @ExcelIgnore
    private String regionIds;
//    @ExcelIgnore
//    private String regionIds;
    /**
     * 部门名称
ycl-platform/src/main/java/com/ycl/mapper/trend/TrendAnalysisMapper.java
@@ -11,4 +11,8 @@
    List<TrendVo> selectTrendPointInfo(String longitude, String latitude);
    List<TrendVo> queryPointInfoByTime(@Param("pointId") Long pointId, @Param("startTime") String startTime, @Param("endTime") String endTime);
    List<TrendVo> queryPointInfoTypeByTime(@Param("pointId") Long pointId, @Param("startTime") String startTime, @Param("endTime") String endTime);
}
ycl-platform/src/main/java/com/ycl/service/trend/TrendAnalysisService.java
@@ -1,6 +1,7 @@
package com.ycl.service.trend;
import com.ycl.dto.trend.TrendAnalysisParam;
import com.ycl.vo.TrendAnalysisVo;
import com.ycl.vo.TrendVo;
import java.util.List;
@@ -11,4 +12,6 @@
    List<TrendVo> queryListByCount(TrendAnalysisParam trendAnalysisParam, Integer pageSize, Integer pageNum);
    List<TrendVo> queryPointInfo(String longitude, String latitude);
    TrendAnalysisVo queryPointInfoByTime(Long pointId, String startTime, String endTime);
}
ycl-platform/src/main/java/com/ycl/service/trend/impl/TrendAnalysisServiceImpl.java
@@ -4,6 +4,7 @@
import com.ycl.dto.trend.TrendAnalysisParam;
import com.ycl.mapper.trend.TrendAnalysisMapper;
import com.ycl.service.trend.TrendAnalysisService;
import com.ycl.vo.TrendAnalysisVo;
import com.ycl.vo.TrendVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.amqp.RabbitProperties;
@@ -26,12 +27,20 @@
    }
    @Override
    public List<TrendVo> queryPointInfo(String longitude,String latitude) {
        return trendAnalysisMapper.selectTrendPointInfo(longitude,latitude);
    public List<TrendVo> queryPointInfo(String longitude, String latitude) {
        return trendAnalysisMapper.selectTrendPointInfo(longitude, latitude);
    }
    @Override
    public TrendAnalysisVo queryPointInfoByTime(Long pointId, String startTime, String endTime) {
        TrendAnalysisVo vo = new TrendAnalysisVo();
        vo.setTimeList(trendAnalysisMapper.queryPointInfoByTime(pointId, startTime, endTime));
        vo.setTypeList(trendAnalysisMapper.queryPointInfoTypeByTime(pointId, startTime, endTime));
        return vo;
    }
    @Override
    public List<TrendVo> queryListByCount(TrendAnalysisParam trendAnalysisParam, Integer pageSize, Integer pageNum) {
        return trendAnalysisMapper.selectTrendInfo(trendAnalysisParam).stream().filter(item->1==item.getCount()).collect(Collectors.toList());
        return trendAnalysisMapper.selectTrendInfo(trendAnalysisParam).stream().filter(item -> 1 == item.getCount()).collect(Collectors.toList());
    }
}
ycl-platform/src/main/java/com/ycl/service/unlawful/impl/UnlawfulServiceImpl.java
@@ -39,10 +39,10 @@
    private IPage<UnlawfulDto> getUnlawfulDtoIPage(Double total, IPage<UnlawfulDto> page1) {
        page1.getRecords().forEach(dto -> {
            dto.setRatio(StringUtils.doubleTwo((double) dto.getCount() / total));
            dto.setRegisterRatio(StringUtils.doubleTwo((double) dto.getRegister() / (double) dto.getCount()));
            dto.setCheckedRatio(StringUtils.doubleTwo((double) dto.getChecked() / (double) dto.getCount()));
            dto.setAccuracyRatio(StringUtils.doubleTwo(1.0 - (double) dto.getRelearn() / (double) dto.getCount()));
            dto.setRatio(StringUtils.doubleTwo((double) dto.getCount() * 100 / total) + "%");
            dto.setRegisterRatio(StringUtils.doubleTwo((double) dto.getRegister() * 100 / (double) dto.getCount()) + "%");
            dto.setCheckedRatio(StringUtils.doubleTwo((double) dto.getChecked() * 100 / (double) dto.getCount()) + "%");
            dto.setAccuracyRatio(StringUtils.doubleTwo(1.0 - (double) dto.getRelearn() * 100 / (double) dto.getCount()) + "%");
        });
        return page1;
ycl-platform/src/main/java/com/ycl/vo/TrendAnalysisVo.java
New file
@@ -0,0 +1,14 @@
package com.ycl.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
@ApiModel(value = "趋势分析")
public class TrendAnalysisVo {
    List<TrendVo> timeList;
    List<TrendVo> typeList;
}
ycl-platform/src/main/resources/mapper/trend/TrendAnalysisMapper.xml
@@ -34,10 +34,39 @@
            <if test="longitude='' and longitude =null and latitude='' and latitude=null">
                t2.longitude=#{longitude} and t2.latitude=#{latitude}
            </if>
         and   t1.video_point_id IS NOT NULL
            and t1.video_point_id IS NOT NULL
        </where>
        GROUP BY
        t1.video_point_id,DATE_FORMAT(t3.alarm_time,"%Y-%m-%d")
    </select>
    <select id="queryPointInfoByTime" resultType="com.ycl.vo.TrendVo">
        SELECT t2.address, DATE_FORMAT(t3.alarm_time,"%Y-%m-%d") as dateTime,count(0) as count
        FROM
        ums_violations t1
        LEFT JOIN ums_video_point t2 ON t2.id = t1.video_point_id
        LEFT JOIN ums_video_alarm_report t3 ON t3.id = t1.video_alarm_report_id
        where t1.video_point_id = #{pointId}
        <if test="startTime!=null and startTime != ''">
            and t3.alarm_time BETWEEN #{startTime} and #{endTime}
        </if>
        GROUP BY
        t1.video_point_id,DATE_FORMAT(t3.alarm_time,"%Y-%m-%d")
        order by DATE_FORMAT(t3.alarm_time,"%Y-%m-%d")
    </select>
    <select id="queryPointInfoTypeByTime" resultType="com.ycl.vo.TrendVo">
        SELECT t3.algo_name as name,count(0) as count
        FROM
        ums_violations t1
        LEFT JOIN ums_video_point t2 ON t2.id = t1.video_point_id
        LEFT JOIN ums_video_alarm_report t3 ON t3.id = t1.video_alarm_report_id
        where t3.algo_name is not null
        and t1.video_point_id = #{pointId}
        <if test="startTime!=null and startTime != ''">
            and t3.alarm_time BETWEEN #{startTime} and #{endTime}
        </if>
        GROUP BY t3.algo_name
        order by t3.algo_name
    </select>
</mapper>