lambda
Posted honghong75042
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了lambda相关的知识,希望对你有一定的参考价值。
// 封装返回对象 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的主要内容,如果未能解决你的问题,请参考以下文章
使用 savedInstanceState 保存和恢复 Kotlin lambda
Android开发太难了:Java Lambda ≠ Android Lambda (上)
Android开发太难了:Java Lambda ≠ Android Lambda (上)
Android开发太难了:Java Lambda ≠ Android Lambda (上)