| | |
| | | private void saveGoodsVipList(List<GoodsVip> goodsVipList, Integer id) { |
| | | goodsVipService.remove(new LambdaQueryWrapper<GoodsVip>() |
| | | .eq(GoodsVip::getGoodsId, id)); |
| | | goodsVipList.forEach(item -> { |
| | | item.setId(null); |
| | | item.setGoodsId(id); |
| | | }); |
| | | goodsVipService.saveBatch(goodsVipList); |
| | | } |
| | | |
| | |
| | | |
| | | private List<VipSetting> getVipSettings(Stream<Integer> goodsVipList) { |
| | | List<Integer> vipIds = goodsVipList.collect(Collectors.toList()); |
| | | if (CollectionUtils.isEmpty(vipIds)){ |
| | | return new ArrayList<>(); |
| | | } |
| | | return vipSettingService.listByIds(vipIds); |
| | | } |
| | | |