This commit is contained in:
cc
2024-11-13 19:12:13 +08:00
parent c6a1650103
commit c1564261b1

View File

@@ -429,11 +429,13 @@ public class JDUtils {
|| orderRow.getValidCode() == 28
|| orderRow.getValidCode() == 2).filter(orderRow -> orderRow.getSkuName() != null).collect(Collectors.groupingBy(OrderRow::getSkuName, Collectors.counting()));
List<Map.Entry<String, Long>> sortedViolationCounts = skuIdViolationCountMap.entrySet().stream()
.sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())).limit(10).collect(Collectors.toList());
.sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())).collect(Collectors.toList());
Integer num = 0;
for (Map.Entry<String, Long> entry : sortedViolationCounts) {
num ++;
String skuName = entry.getKey();
Long count = entry.getValue();
content.append("商品:").append(skuName).append(" 违规次数:").append(count).append("\r");
content.append(num + ",商品:").append(skuName).append(" 违规次数:").append(count).append("\r");
}
}