您的位置:首页 > 文旅 > 美景 > 搭建平台激发活力_公司名字大全简单好听_英雄联盟世界排名_博客网站登录

搭建平台激发活力_公司名字大全简单好听_英雄联盟世界排名_博客网站登录

2024/10/9 5:15:26 来源:https://blog.csdn.net/anncyuyan/article/details/142256446  浏览:    关键词:搭建平台激发活力_公司名字大全简单好听_英雄联盟世界排名_博客网站登录
搭建平台激发活力_公司名字大全简单好听_英雄联盟世界排名_博客网站登录

Apache ECharts

前端技术。
在这里插入图片描述

营业额统计

还是比较简单的。

用户统计

订单统计

在这里插入图片描述
在这里插入图片描述
以上所有需求。难点在于对时间类的处理:

// 接收格式
@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));}
//日期扩展到时分秒
@Overridepublic TurnoverReportVO getTurnoverStatistics(LocalDate begin, LocalDate end) {// deteList: 开始日期,到结束日期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) {LocalDateTime dateBegin = LocalDateTime.of(date, LocalTime.MIN);LocalDateTime dateEnd = LocalDateTime.of(date, LocalTime.MAX);Map map = new HashMap();map.put("begin", dateBegin);map.put("end", dateEnd);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();}

销量排名Top10

难点在于查询数据库设计。

order_detail一张表不够,还需要确定对应的订单是否是完成状态。——》连接查询

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

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com