fix: use daily franchise order trend through 31 days
| | |
| | | Map<String, Object> countSeries = new LinkedHashMap<>(); countSeries.put("name", "充电订单"); countSeries.put("data", countData); countSeries.put("type", "line"); countSeries.put("style", "curve"); countSeries.put("index", 1); ((List<Map<String, Object>>) chart.get("series")).add(countSeries); return chart; |
| | | } |
| | | |
| | | /** Long date ranges use monthly buckets so the mobile chart stays readable. */ |
| | | /** Ranges longer than 31 days use monthly buckets so the mobile chart stays readable. */ |
| | | private boolean franchiseeUseMonthlyTrend(LocalDateTime[] range) { |
| | | if (range == null || range.length < 2 || range[0] == null || range[1] == null) { |
| | | return false; |
| | | } |
| | | return range[0].toLocalDate().plusDays(90).isBefore(range[1].toLocalDate()); |
| | | return range[0].toLocalDate().plusDays(31).isBefore(range[1].toLocalDate()); |
| | | } |
| | | |
| | | private Map<String, Object> franchiseeMonthlyOrderTrend(List<FranchiseeDayStat> stats, LocalDateTime[] range) { |