This commit is contained in:
雷欧(林平凡)
2024-11-13 17:35:42 +08:00
parent f33ceb9198
commit 1057a11bac

View File

@@ -425,7 +425,7 @@ public class JDUtils {
// 计算出skuId 违规的前7个排行
Map<Long, Long> skuIdViolationCountMap = oneYearOrders.stream().filter(orderRow -> orderRow.getValidCode() == 27
|| orderRow.getValidCode() == 28
|| orderRow.getValidCode() == 2).collect(Collectors.groupingBy(OrderRow::getSkuId, Collectors.counting()));
|| orderRow.getValidCode() == 2).filter(orderRow -> orderRow.getSkuId() != null).collect(Collectors.groupingBy(OrderRow::getSkuId, Collectors.counting()));
List<Map.Entry<Long, Long>> sortedViolationCounts = skuIdViolationCountMap.entrySet().stream()
.sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())).limit(7).collect(Collectors.toList());
for (Map.Entry<Long, Long> entry : sortedViolationCounts) {