This commit is contained in:
Guoqs
2026-04-20 16:14:50 +08:00
parent 50210ab5c0
commit 0eb026365e
2 changed files with 6 additions and 3 deletions

View File

@@ -6339,7 +6339,8 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
} }
List<String> orderCodeList = orderList.stream().map(OrderListVO::getOrderCode).collect(Collectors.toList()); List<String> orderCodeList = orderList.stream().map(OrderListVO::getOrderCode).collect(Collectors.toList());
UpdateOrderReviewDTO dto = new UpdateOrderReviewDTO(); UpdateOrderReviewDTO dto = new UpdateOrderReviewDTO();
dto.setOrderCodeList(MerchantUtils.getRandomNinetyPercent(orderCodeList)); // dto.setOrderCodeList(MerchantUtils.getRandomNinetyPercent(orderCodeList));
dto.setOrderCodeList(MerchantUtils.getRandomOrderCodes(orderList));
dto.setStationId(stationId); dto.setStationId(stationId);
return batchUpdateOrderReview(dto); return batchUpdateOrderReview(dto);
} }

View File

@@ -75,12 +75,14 @@ public class MerchantUtils {
return new ArrayList<>(shuffled.subList(0, keepCount)); return new ArrayList<>(shuffled.subList(0, keepCount));
} }
public static List<String> getRandomNinetyPercentV2(List<OrderListVO> list) { public static List<String> getRandomOrderCodes(List<OrderListVO> list) {
if (list == null || list.isEmpty()) { if (list == null || list.isEmpty()) {
return new ArrayList<>(); return new ArrayList<>();
} }
// 检查订单信息中的昵称,剔除不是以会员开头的订单
// list = list.stream().filter(order -> order.getNickName().startsWith("会员")).collect(Collectors.toList());
int total = list.size(); int total = list.size();
int removeCount = (int) Math.ceil(total * 0.1); int removeCount = (int) Math.ceil(total * 0.65);
int keepCount = Math.max(1, total - removeCount); int keepCount = Math.max(1, total - removeCount);
List<OrderListVO> shuffled = new ArrayList<>(list); List<OrderListVO> shuffled = new ArrayList<>(list);
Collections.shuffle(shuffled); Collections.shuffle(shuffled);