| | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.time.temporal.ChronoUnit; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | } |
| | | |
| | | public Page<DeliveryOrderStatisticsDTO> selectSupplierDoStatistics(Page page){ |
| | | |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd"); |
| | | LocalDate theDay = parseLocalDate("2024-08-03"); |
| | | |
| | | long current = page.getCurrent(); |
| | |
| | | current = current == 0 ? 1 : current; |
| | | |
| | | long endDays = (current - 1) * size; |
| | | long beginDays = endDays + size; |
| | | long beginDays = endDays + size-1; |
| | | LocalDate beginDate = now.plusDays(-beginDays); |
| | | LocalDate endDate = now.plusDays(-endDays); |
| | | |
| | |
| | | , fivePm.plusDays(-1), fivePm); |
| | | |
| | | DeliveryOrderStatisticsDTO dto = new DeliveryOrderStatisticsDTO(); |
| | | dto.setId(endDate.format(formatter)); |
| | | dto.setDate(endDate); |
| | | dto.setNum(0); |
| | | dto.setPrice(new BigDecimal(0)); |
| | |
| | | } |
| | | |
| | | page.setRecords(ls); |
| | | |
| | | |
| | | // 获取当前日期 |
| | | LocalDate today = LocalDate.now(); |
| | | // 计算当前日期与给定日期的天数差 |
| | | long daysBetween = ChronoUnit.DAYS.between(theDay, today); |
| | | page.setTotal(daysBetween); |
| | | |
| | | return page; |
| | | } |
| | | |