mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-11 13:30:15 +08:00
update
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user