当前位置: 首页 > news >正文

流媒体视频网站开发百度明星人气榜入口

流媒体视频网站开发,百度明星人气榜入口,湖南网站搜索排名优化公司,做影视网站需要境外效果展示 Apache ECharts 介绍 常见图表 入门案例 快速上手 - Handbook - Apache ECharts 营业额统计——需求分析与设计 产品原型 接口设计 VO设计 营业额统计——代码开发 Controller中 /*** 数据统计相关接口*/ RestController RequestMapping("/admin/report&qu…

效果展示

Apache  ECharts

介绍

常见图表

 

 

入门案例

快速上手 - Handbook - Apache ECharts

 

 营业额统计——需求分析与设计

产品原型

 接口设计

VO设计

 营业额统计——代码开发

Controller中

/*** 数据统计相关接口*/
@RestController
@RequestMapping("/admin/report")
@Api(tags="数据统计相关接口")
@Slf4j
public class ReportController {@Autowiredprivate ReportService reportService;/*** 营业额统计* @param begin* @param end* @return*/@GetMapping("/turnoverStatistics")@ApiOperation("营业额统计")public Result<TurnoverReportVO> turnoverStatistics(@DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate begin,@DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate end){log.info("营业额数据统计:{},{}",begin,end);return Result.success(reportService.getTurnoverStatistics(begin,end));}
}

Service中

@Service
@Slf4j
public class ReportServiceImpl implements ReportService {@Autowiredprivate OrderMapper orderMapper;/*** 统计指定时间区间内的营业额数据* @param begin* @param end* @return*/@Overridepublic TurnoverReportVO getTurnoverStatistics(LocalDate begin, LocalDate end) {//当前集合存在从begin到end的日期List<LocalDate> dateList=new ArrayList<>();dateList.add(begin);while(!begin.equals(end)){//计算指定日期的后一天begin=begin.plusDays(1);dateList.add(begin);}//存放每天营业额List<Double> turnoverList=new ArrayList<>();for (LocalDate date : dateList) {//查询date对应的营业额,为已经完成的订单金额合计LocalDateTime beginTime = LocalDateTime.of(date, LocalTime.MIN);LocalDateTime endTime = LocalDateTime.of(date, LocalTime.MAX);//select sum(amount) from orders where order_time > ? and order_time < ? and status = 5Map map=new HashMap();map.put("begin",beginTime);map.put("end",endTime);map.put("status", Orders.COMPLETED);Double turnover=orderMapper.sumByMap(map);turnover = turnover == null?0.0:turnover;turnoverList.add(turnover);}//封装返回结果return TurnoverReportVO.builder().dateList(StringUtils.join(dateList,",")).turnoverList(StringUtils.join(turnoverList,",")).build();}
}

Mapper中

    /*** 根据动态条件统计营业额数据* @param map* @return*/Double sumByMap(Map map);

对应的映射文件

    <select id="sumByMap" resultType="java.lang.Double">select sum(amount) from orders<where><if test="begin != null">and order_time &gt; #{begin}</if><if test="end != null">and order_time &lt; #{end}</if><if test="status != null">and status = #{status}</if></where></select>

 

 营业额统计——功能测试

 

用户统计——需求分析与设计

产品原型

 接口设计

VO设计

 

用户统计——代码开发

Controller中

    /*** 用户统计* @param begin* @param end* @return*/@GetMapping("userStatistics")@ApiOperation("用户统计")public  Result<UserReportVO> userStatistics(@DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate begin,@DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate end){log.info("营业额数据统计:{},{}",begin,end);UserReportVO userStatistics = reportService.getUserStatistics(begin, end);return Result.success(userStatistics);}

Service中

    /*** 统计指定时间区间内的用户数量* @return*/@Overridepublic UserReportVO getUserStatistics(LocalDate begin, LocalDate end) {//当前集合存放从begin到end的日期List<LocalDate> dateList=new ArrayList<>();dateList.add(begin);while(!begin.equals(end)){//计算指定日期的后一天begin=begin.plusDays(1);dateList.add(begin);}//存放每天的新增用户数量 select count(id) from user where create_time < ? and create_time > ?List<Integer> newUserList=new ArrayList<>();//存放每天的总用户数量 select count(id) from user where create_time < ?List<Integer> totalUserList=new ArrayList<>();for (LocalDate date:dateList){LocalDateTime beginTime = LocalDateTime.of(date, LocalTime.MIN);LocalDateTime endTime = LocalDateTime.of(date, LocalTime.MAX);Map map=new HashMap();map.put("end",endTime);//总用户数量Integer totalUser =userMapper.countByMap(map);map.put("begin",beginTime);//新增用户数量Integer newUser=userMapper.countByMap(map);totalUserList.add(totalUser);newUserList.add(newUser);}return UserReportVO.builder().dateList(StringUtils.join(dateList,",")).totalUserList(StringUtils.join(totalUserList,",")).newUserList(StringUtils.join(newUserList,",")).build();}

Mapper中

    /*** 根据动态天条件统计用户数量* @param map* @return*/Integer countByMap(Map map);

对应的映射文件

    <select id="countByMap" resultType="java.lang.Integer">select count(id) from user<where><if test="begin != null">and create_time &gt; #{begin}</if><if test="end != null">and create_time &lt; #{end}</if></where></select>

用户统计——功能测试

订单统计——需求分析与设计

产品原型

接口设计

 

VO设计

 

订单统计——代码开发

Controller中

    /*** 订单统计* @param begin* @param end* @return*/@GetMapping("ordersStatistics")@ApiOperation("订单统计")public  Result<OrderReportVO> ordersStatistics(@DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate begin,@DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate end){log.info("营业额数据统计:{},{}",begin,end);return Result.success(reportService.getOrderStatistics(begin, end));}

Service中

    /*** 统计指定时间区间内的订单数据* @param begin* @param end* @return*/@Overridepublic OrderReportVO getOrderStatistics(LocalDate begin, LocalDate end) {//当前集合存放从begin到end的日期List<LocalDate> dateList=new ArrayList<>();dateList.add(begin);while(!begin.equals(end)){//计算指定日期的后一天begin=begin.plusDays(1);dateList.add(begin);}//存放每天的订单总数List<Integer> orderCountList=new ArrayList<>();//存放每天的有效订单数List<Integer> validOrderCountList=new ArrayList<>();//遍历dateList集合,查询每天的有效订单数和订单总数for (LocalDate date : dateList) {//查询每天订单总数 select count(id) from orders where order_time > ? and order_time < ?LocalDateTime beginTime = LocalDateTime.of(date, LocalTime.MIN);LocalDateTime endTime = LocalDateTime.of(date, LocalTime.MAX);Integer orderCount = getOrderCount(beginTime, endTime, null);//查询每天有效订单数 select count(id) from orders where order_time > ? and order_time < ? and status = 5Integer validOrderCount = getOrderCount(beginTime, endTime, Orders.CONFIRMED);orderCountList.add(orderCount);validOrderCountList.add(validOrderCount);}//计算时间区间内的订单总数量Integer totalOrderCount = orderCountList.stream().reduce(Integer::sum).get();//计算时间区间内的有效订单数量Integer validOrderCount = validOrderCountList.stream().reduce(Integer::sum).get();Double orderCompletionRate=  0.0;if(totalOrderCount!=0)//计算订单完成各率orderCompletionRate=  validOrderCount.doubleValue()/totalOrderCount;return OrderReportVO.builder().dateList(StringUtils.join(dateList,",")).orderCountList(StringUtils.join(orderCountList,",")).validOrderCountList(StringUtils.join(validOrderCountList,",")).totalOrderCount(totalOrderCount).validOrderCount(validOrderCount).orderCompletionRate(orderCompletionRate).build();}/*** 根据条件统计订单数量* @param begin* @param end* @param status* @return*/private Integer getOrderCount(LocalDateTime begin,LocalDateTime end,Integer status){Map map=new HashMap();map.put("begin",begin);map.put("end",end);map.put("status",status);return orderMapper.countByMap(map);}

Mapper中

    /*** 根据动态条件统计订单数量* @param map* @return*/Integer countByMap(Map map);

对应的映射文件

    <select id="countByMap" resultType="java.lang.Integer">select count(id) from orders<where><if test="begin != null">and order_time &gt; #{begin}</if><if test="end != null">and order_time &lt; #{end}</if><if test="status != null">and status = #{status}</if></where></select>

 

订单统计——功能测试

 

销量排名统计——需求分析与设计

产品原型

接口设计

VO设计

 

销量排名统计——代码开发

Controller中

    /*** 订单统计* @param begin* @param end* @return*/@GetMapping("top10")@ApiOperation("销量排名top10")public  Result<SalesTop10ReportVO> top10(@DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate begin,@DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate end){log.info("销量排名top10:{},{}",begin,end);return Result.success(reportService.getSalesTop10(begin, end));}

Service中

    /*** 统计指定时间区间内的销量排名前10* @return*/@Overridepublic SalesTop10ReportVO getSalesTop10(LocalDate begin, LocalDate end) {//获得当前日期的起始时间LocalDateTime beginTime = LocalDateTime.of(begin, LocalTime.MIN);LocalDateTime endTime = LocalDateTime.of(end, LocalTime.MAX);List<GoodsSalesDTO> salesTop10 = orderMapper.getSalesTop10(beginTime, endTime);List<String> names = salesTop10.stream().map(GoodsSalesDTO::getName).collect(Collectors.toList());String nameList=StringUtils.join(names,",");List<Integer> numbers = salesTop10.stream().map(GoodsSalesDTO::getNumber).collect(Collectors.toList());String numberList=StringUtils.join(numbers,",");//封装返回结果数据return SalesTop10ReportVO.builder().nameList(nameList).numberList(numberList).build();}

Mapper中

select od.name ,sum(od.number) number from order_detail od,orders o where od.order_id = o.id and o.status = 5
and o.order_time > '2022-10-01' and o.order_time < '2023-10-01'
group by od.name
order by number desc
limit 0,10

 

    /*** 统计指定时间区间内的销量排名前10* @return*/List<GoodsSalesDTO> getSalesTop10(LocalDateTime begin ,LocalDateTime end);

对应的映射文件

    <select id="getSalesTop10" resultType="com.sky.dto.GoodsSalesDTO">select od.name ,sum(od.number) numberfrom order_detail od,orders owhere od.order_id = o.id and o.status = 5<if test="begin!=null">and o.order_time &gt; #{begin}</if><if test="end !=null">and o.order_time &lt; #{end}</if>group by od.nameorder by number desclimit 0,10</select>

 

销量排名统计——功能测试

 


文章转载自:
http://dummkopf.gthc.cn
http://millie.gthc.cn
http://fifeshire.gthc.cn
http://cardiopathy.gthc.cn
http://entangle.gthc.cn
http://scrapple.gthc.cn
http://hypostatic.gthc.cn
http://businessmen.gthc.cn
http://drophead.gthc.cn
http://twixt.gthc.cn
http://cardinal.gthc.cn
http://hearthrug.gthc.cn
http://cadaster.gthc.cn
http://depopulate.gthc.cn
http://periapt.gthc.cn
http://musical.gthc.cn
http://gestaltist.gthc.cn
http://putter.gthc.cn
http://dural.gthc.cn
http://vasculitis.gthc.cn
http://dunk.gthc.cn
http://birthmark.gthc.cn
http://noways.gthc.cn
http://cathode.gthc.cn
http://electrotherapy.gthc.cn
http://tartaric.gthc.cn
http://sleep.gthc.cn
http://awl.gthc.cn
http://assouan.gthc.cn
http://headland.gthc.cn
http://gprs.gthc.cn
http://kingcraft.gthc.cn
http://boomerang.gthc.cn
http://stripe.gthc.cn
http://cryptoanalysis.gthc.cn
http://goldfish.gthc.cn
http://aiguillette.gthc.cn
http://guttman.gthc.cn
http://bloc.gthc.cn
http://editorial.gthc.cn
http://urethral.gthc.cn
http://inspectoscope.gthc.cn
http://pettifogging.gthc.cn
http://ius.gthc.cn
http://gustavus.gthc.cn
http://ramshackle.gthc.cn
http://fullback.gthc.cn
http://organosilicon.gthc.cn
http://roomful.gthc.cn
http://eyereach.gthc.cn
http://ready.gthc.cn
http://incurvation.gthc.cn
http://peasen.gthc.cn
http://delay.gthc.cn
http://autoist.gthc.cn
http://voracious.gthc.cn
http://heretic.gthc.cn
http://endophilic.gthc.cn
http://untread.gthc.cn
http://biotypology.gthc.cn
http://amic.gthc.cn
http://necrotic.gthc.cn
http://obpyriform.gthc.cn
http://cobble.gthc.cn
http://eurychoric.gthc.cn
http://calendar.gthc.cn
http://photoconductive.gthc.cn
http://smilacaceous.gthc.cn
http://cataleptic.gthc.cn
http://woful.gthc.cn
http://bolide.gthc.cn
http://stodgy.gthc.cn
http://platonic.gthc.cn
http://contiguous.gthc.cn
http://iht.gthc.cn
http://tutor.gthc.cn
http://dioestrum.gthc.cn
http://balcony.gthc.cn
http://muddler.gthc.cn
http://flavourful.gthc.cn
http://constrain.gthc.cn
http://nav.gthc.cn
http://assessee.gthc.cn
http://hungriness.gthc.cn
http://amerika.gthc.cn
http://peritrack.gthc.cn
http://synonymous.gthc.cn
http://pinkey.gthc.cn
http://betimes.gthc.cn
http://thickskinned.gthc.cn
http://neurula.gthc.cn
http://systemic.gthc.cn
http://niggard.gthc.cn
http://limner.gthc.cn
http://bicentenary.gthc.cn
http://cruller.gthc.cn
http://communalist.gthc.cn
http://brutish.gthc.cn
http://xylomancy.gthc.cn
http://cation.gthc.cn
http://www.15wanjia.com/news/100867.html

相关文章:

  • 网站运营需要++做哪些工作娄底地seo
  • 男生做网站运营的前景手机登录百度pc端入口
  • 广州站是不是广州火车站美国新冠疫情最新消息
  • 网站每年多少钱宁波关键词优化时间
  • 电子商务网站特色武汉标兵seo
  • 制作一个网站需要注意什么源码网
  • 成都市住房和城乡建设管理委员会网站seo站长网
  • 怎么用dedecms搭建网站人工智能培训一般多少钱
  • 做英文企业网站多钱钱百度网址大全官网
  • 太原网站开发哪家好个人网络销售平台
  • 怎么做vip视频网站黑帽seo是作弊手法
  • 一个月宽带怎么办理深圳seo优化排名公司
  • tomcat做网站谷歌流量代理代理
  • 自贡网站制作免费站推广网站2022
  • 天津智能网站建设哪家好温州seo服务
  • 重庆建筑工程安全信息网中和seo公司
  • 怎么查看网站百度快照全球搜钻是什么公司
  • 西安专业做淘宝网站的公司微博推广效果怎么样
  • 华强北网站建设公司nba最新交易汇总
  • 郑州上海做网站的公司广州seo好找工作吗
  • 网站app怎么制作关键词搜索名词解释
  • 江西奶茶加盟网站建设推广产品最好的方式
  • 主机屋如何做网站如何自己制作网站
  • 石狮建设银行网站seo课程培训班费用
  • 济南网站建设v芯企优互联不错官网seo是什么意思
  • 网站备案域名转公司宁波seo推广哪家好
  • 济南网站建设sdqswl郑州seo优化推广
  • 网站免费建站seo网站优化外包
  • 基于wordpress多商户上海何鹏seo
  • 杭州做网站比较好的公司谷歌seo排名