Commit 199dcfb3 by 吕明尚

修改数据统计

parent e916c699
......@@ -16,6 +16,15 @@ public class OrderVo {
private Long consumerId;
/**
* 用户手机号
*/
private String consumerPhone;
private String nickName;
private String avatar;
private Long storeId;
private Long roomId;
......
......@@ -2940,12 +2940,19 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
);
//优惠券id集合,去掉为null的
List<Long> ids = orderList.stream().map(SOrder::getCouponId).filter(Objects::nonNull).collect(Collectors.toList());
List<Long> consumerIds = orderList.stream().map(SOrder::getConsumerId).filter(Objects::nonNull).collect(Collectors.toList());
Map<Long, SConsumer> consumerMap = sConsumerService.listByIds(consumerIds).stream().collect(Collectors.toMap(SConsumer::getId, Function.identity()));
if (CollectionUtil.isNotEmpty(ids)) {
map.putAll(consumerCouponService.selectByIds(ids).stream().collect(Collectors.toMap(SConsumerCoupon::getId, Function.identity())));
}
List<OrderVo> finalOrderVoList = orderVoList;
orderList.stream().forEach(order -> {
OrderVo orderVo = new OrderVo();
SConsumer sConsumer = consumerMap.get(order.getConsumerId());
if (ObjectUtil.isNotEmpty(sConsumer)) {
orderVo.setNickName(sConsumer.getNickName());
orderVo.setAvatar(sConsumer.getAvatar());
}
BeanUtils.copyProperties(order, orderVo);
orderVo.setOrderNo(order.getOrderNo());
orderVo.setPayType(order.getPayType());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment