| | |
| | | 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; |
| | | } |
| | | |
| | | public List<DeliveryOrderItemListDTO> getDeliveryOrderItems(String id) { |
| | | return deliveryOrderItemMapper.selectDoItemList(id); |
| | | } |
| | | |
| | | public List<DeliveryOrderItemDTO> getSupplierDeliveryOrderItems(String ids){ |
| | | List<String> idList = splitParam(ids); |
| | | List<DeliveryOrderItemDTO> ls = new ArrayList<>(); |
| | | if(idList != null && idList.size() > 0){ |
| | | for(String id : idList){ |
| | | ls.add(getSupplierDeliveryOrderItem(id)); |
| | | } |
| | | } |
| | | |
| | | return ls; |
| | | } |
| | | |
| | | public DeliveryOrderItemDTO getSupplierDeliveryOrderItem(String id) { |
| | |
| | | ); |
| | | if (count == 0) { |
| | | Order o = orderMapper.selectById(orderId); |
| | | if(!Constants.ORDER_STATUS_BACKEND.COLLECTION.name().equals(o.getStatus())){ |
| | | log.warn("非待集货状态,不可设置待发货"); |
| | | return; |
| | | } |
| | | o.setStatusBackend(Constants.ORDER_STATUS_BACKEND.SEND.name()); |
| | | o.update(SecurityUtils.getUserId()); |
| | | orderMapper.updateById(o); |