当前位置: 首页> 房产> 建材 > 美篇app怎么制作_今日重庆杂志社_长沙县网络营销咨询_最新热点新闻事件素材

美篇app怎么制作_今日重庆杂志社_长沙县网络营销咨询_最新热点新闻事件素材

时间:2025/9/5 14:48:03来源:https://blog.csdn.net/dongjing991/article/details/144904886 浏览次数:0次
美篇app怎么制作_今日重庆杂志社_长沙县网络营销咨询_最新热点新闻事件素材

一、使用场景

1、当需要对一个list中的元素属性进行重新赋值,比如一个list中存储了订单数据,我们需要改变list中每个订单的id,然后再重新输出订单list

      if(CollectionUtils.isNotEmpty(orderList)){
            orderList.forEach(p->{
                PointsExchangeOrderItem item = new PointsExchangeOrderItem();
                item.setOrderId(p.getId());
                List<PointsExchangeOrderItem> itemList = item.select();
                if (CollectionUtils.isNotEmpty(itemList)){
                    List<String> collects = itemList.stream().map(PointsExchangeOrderItem::getExchangeId).collect(Collectors.toList());
                    String exchangeIdStr = String.join(",", collects);
                    p.setExchangeInPointsId(exchangeIdStr);
                    p.setExchangeOutPointsId(exchangeIdStr);

                }


            });
        }

        return orderList;

      if(CollectionUtils.isNotEmpty(orderList)){orderList.forEach(p->{PointsExchangeOrderItem item = new PointsExchangeOrderItem();item.setOrderId(p.getId());List<PointsExchangeOrderItem> itemList = item.select();if (CollectionUtils.isNotEmpty(itemList)){List<String> collects = itemList.stream().map(PointsExchangeOrderItem::getExchangeId).collect(Collectors.toList());String exchangeIdStr = String.join(",", collects);p.setExchangeInPointsId(exchangeIdStr);p.setExchangeOutPointsId(exchangeIdStr);}});}return orderList;

关键字:美篇app怎么制作_今日重庆杂志社_长沙县网络营销咨询_最新热点新闻事件素材

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: