cloudroam
2024-12-27 8bfe96b6f370f1d2e79b739c7db50b95dab9a965
src/main/java/com/mzl/flower/service/payment/OrderService.java
@@ -1818,4 +1818,34 @@
            orderMapper.updatePaymentCreateDate(order);
        });
    }
    public List<OrderStatusCountDTO> getAbnormalOrderStatusCount(OrderQueryDTO dto) {
         dto.setStartDate(parseLocalDateTime(dto.getStartDateStr(), true));
        dto.setEndDate(parseLocalDateTime(dto.getEndDateStr(), false));
        dto.setCreateStartDate(parseLocalDateTime(dto.getCreateStartDateStr(), 17, 0, 0, -1));
        dto.setCreateEndDate(parseLocalDateTime(dto.getCreateEndDateStr(), 17, 0, 0, 0));
        List<CodeValueDTO> ls = codeService.searchValue("ABNORMAL_ORDER_STATUS");
        List<OrderStatusCountDTO> ll = orderMapper.getAbnormalOrderStatusCount(dto);
        Map<String, Integer> llMap = new HashMap<>();
        if (ll != null && ll.size() > 0) {
            for (OrderStatusCountDTO c : ll) {
                llMap.put(c.getValue(), c.getOrderCount());
            }
        }
        List<OrderStatusCountDTO> rr = new ArrayList<>();
        for (CodeValueDTO c : ls) {
            OrderStatusCountDTO r = new OrderStatusCountDTO();
            r.setValue(c.getValue());
            r.setLabel(c.getLabel());
            Integer count = llMap.get(r.getValue());
            r.setOrderCount(count == null ? 0 : count);
            rr.add(r);
        }
        return rr;
    }
}