码迷,mamicode.com
首页 > 其他好文 > 详细

lambda

时间:2020-03-21 17:57:59      阅读:62      评论:0      收藏:0      [点我收藏+]

标签:new   查询   lis   style   list()   service   bsp   Collector   constant   

 // 封装返回对象
        String bizDataStr = bizMessage.getBizDataStr();
        ConSellerGoods conSellerGoods = JsonUtil.fromJson(bizDataStr, ConSellerGoods.class);
        // 获取商家编码和商品编码,查询所有设备商品信息
        GoodsBoxDto goodsBoxDto = new GoodsBoxDto();
        goodsBoxDto.setSellerNo(conSellerGoods.getSellerNo());
        ArrayList<String> listSkus = new ArrayList<>();
        listSkus.add(conSellerGoods.getGoodsNo());
        goodsBoxDto.setSkuList(listSkus);
        Result result = conBoxGoodsService.getBoxGoodsList(goodsBoxDto);
        if (result.isSuccess()) {
            List<ConBoxGoods> conBoxGoodsList =
                    (List<ConBoxGoods>) result.get(BaseConstants.SERVICE_RESULT_SUCCESS_CODE);
            // 设备列表-根据商家和设备查询设备商品列表
//            List<GoodsBoxDto> listSellerBox = conBoxGoodsList.stream()
//                    .map(e -> new GoodsBoxDto(e.getSellerNo(), e.getBoxNo()))
//                    .collect(Collectors.toList());
            List<String> listBoxNos=conBoxGoodsList.stream().map(p->p.getBoxNo()).collect(Collectors.toList());
            UIGoodsBoxDto uiGoodsBoxDto = new UIGoodsBoxDto();
            uiGoodsBoxDto.setSellerNo(conSellerGoods.getSellerNo());
            uiGoodsBoxDto.setListBoxNos(listBoxNos);
            Result boxGoodsListByListResult = conBoxGoodsService.getBoxGoodsListByListDto(uiGoodsBoxDto);
            // 根据商家和设备分组
            List<ConBoxGoods> conBoxGoodsList2 =
                    (List<ConBoxGoods>) boxGoodsListByListResult.get(BaseConstants.SERVICE_RESULT_SUCCESS_CODE);
            Map<String, List<ConBoxGoods>> listSellerBox2 =
                    conBoxGoodsList2.stream().collect(Collectors.groupingBy(e -> fetchGroupKey(e)));
            ICRBoxListRequestDto icrBoxListRequestDto = new ICRBoxListRequestDto();
            ArrayList<ICRSkuRequestDto> icrSkuRequestDtoArrayList = new ArrayList<>();

 

lambda

标签:new   查询   lis   style   list()   service   bsp   Collector   constant   

原文地址:https://www.cnblogs.com/honghong75042/p/12540186.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!