诸几建设银行网站,标题优化怎么做,公司网站建设开发济南兴田德润简介图片,仿腾讯网站源码Apache ECharts
前端技术。
营业额统计
还是比较简单的。
用户统计
订单统计 以上所有需求。难点在于对时间类的处理#xff1a;
// 接收格式
GetMapping(/turnoverStatistics)ApiOperation(营业额统计)public ResultTurnoverReportVO…Apache ECharts
前端技术。
营业额统计
还是比较简单的。
用户统计
订单统计 以上所有需求。难点在于对时间类的处理
// 接收格式
GetMapping(/turnoverStatistics)ApiOperation(营业额统计)public ResultTurnoverReportVO 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: 开始日期到结束日期ListLocalDate dateList new ArrayList();dateList.add(begin);while (!begin.equals(end)){begin begin.plusDays(1);dateList.add(begin);}ListDouble 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 idgetSalesTop10 resultTypecom.sky.dto.GoodsSalesDTOselect od.name name, sum(od.number) numberfrom order_detail od, orders owhere od.order_id o.id and o.status5if testbegin ! nulland order_time gt; #{begin}/ifif testend ! nulland order_time lt; #{end}/ifgroup by od.nameorder by number desclimit 0,10/select