|
|
@ -82,7 +82,9 @@ public class TbsActivityServiceImpl extends ServiceImpl<TbsActivityMapper,TbsAct |
|
|
|
List<Long> spuIds = activityBo.getActivityGoodsList().stream().map(TbsActivityGoodsBo::getGoodsId).collect(Collectors.toList()); |
|
|
|
List<GoodsSpu> spuList = goodsSpuService.listByIds(spuIds); |
|
|
|
for (GoodsSpu goodsSpu : spuList) { |
|
|
|
GoodsCategory category = goodsCategoryService.getById(goodsSpu.getCategoryLast()); |
|
|
|
GoodsCategory category1 = goodsCategoryService.getById(goodsSpu.getCategoryFirst()); |
|
|
|
GoodsCategory category2 = goodsCategoryService.getById(goodsSpu.getCategorySecond()); |
|
|
|
GoodsCategory category3 = goodsCategoryService.getById(goodsSpu.getCategoryThird()); |
|
|
|
TbsActivityGoods activityGoods = new TbsActivityGoods(); |
|
|
|
activityGoods.setCostApplyId(costApply.getId()); |
|
|
|
activityGoods.setActivityId(activity.getId()); |
|
|
@ -90,17 +92,45 @@ public class TbsActivityServiceImpl extends ServiceImpl<TbsActivityMapper,TbsAct |
|
|
|
activityGoods.setTargetId(goodsSpu.getId()); |
|
|
|
activityGoods.setTargetCode(goodsSpu.getSpuCode()); |
|
|
|
activityGoods.setTargetName(goodsSpu.getName()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
activityGoods.setTargetLevelPathIds(category1.getId()+"_"+category2.getId()+"_"+category3.getId()+"_"+goodsSpu.getId()); |
|
|
|
activityGoods.setTargetLevelPathNames(category1.getName()+"_"+category2.getName()+"_"+category3.getName()+"_"+goodsSpu.getName()); |
|
|
|
activityGoodsList.add(activityGoods); |
|
|
|
} |
|
|
|
}else if (goodsType.equals(TbsGoodsType.sku.name())){ |
|
|
|
List<Long> skuIds = activityBo.getActivityGoodsList().stream().map(TbsActivityGoodsBo::getGoodsId).collect(Collectors.toList()); |
|
|
|
List<GoodsSku> skuList = goodsSkuService.listByIds(skuIds); |
|
|
|
for (GoodsSku sku : skuList) { |
|
|
|
GoodsSpu goodsSpu = goodsSpuService.getById(sku.getSpuId()); |
|
|
|
GoodsCategory category1 = goodsCategoryService.getById(goodsSpu.getCategoryFirst()); |
|
|
|
GoodsCategory category2 = goodsCategoryService.getById(goodsSpu.getCategorySecond()); |
|
|
|
GoodsCategory category3 = goodsCategoryService.getById(goodsSpu.getCategoryThird()); |
|
|
|
TbsActivityGoods activityGoods = new TbsActivityGoods(); |
|
|
|
activityGoods.setCostApplyId(costApply.getId()); |
|
|
|
activityGoods.setActivityId(activity.getId()); |
|
|
|
activityGoods.setTargetType(goodsType); |
|
|
|
activityGoods.setTargetId(sku.getId()); |
|
|
|
activityGoods.setTargetCode(sku.getSkuCode()); |
|
|
|
activityGoods.setTargetName(sku.getSpecInfos()); |
|
|
|
activityGoods.setTargetLevelPathIds(category1.getId()+"_"+category2.getId()+"_"+category3.getId()+"_"+goodsSpu.getId()+"_"+sku.getId()); |
|
|
|
activityGoods.setTargetLevelPathNames(category1.getName()+"_"+category2.getName()+"_"+category3.getName()+"_"+goodsSpu.getName()+"_"+sku.getSpecInfos()); |
|
|
|
activityGoodsList.add(activityGoods); |
|
|
|
} |
|
|
|
}else { |
|
|
|
//品牌、品类、系列
|
|
|
|
List<Long> categoryIds = activityBo.getActivityGoodsList().stream().map(TbsActivityGoodsBo::getGoodsId).collect(Collectors.toList()); |
|
|
|
List<GoodsCategory> categoryList = goodsCategoryService.listByIds(categoryIds); |
|
|
|
for (GoodsCategory category : categoryList) { |
|
|
|
TbsActivityGoods activityGoods = new TbsActivityGoods(); |
|
|
|
activityGoods.setCostApplyId(costApply.getId()); |
|
|
|
activityGoods.setActivityId(activity.getId()); |
|
|
|
activityGoods.setTargetType(goodsType); |
|
|
|
activityGoods.setTargetId(category.getId()); |
|
|
|
activityGoods.setTargetCode(category.getCode()); |
|
|
|
activityGoods.setTargetName(category.getName()); |
|
|
|
activityGoods.setTargetLevelPathIds(category.getLevelPath()); |
|
|
|
activityGoods.setTargetLevelPathNames(category.getLevelPathNames()); |
|
|
|
activityGoodsList.add(activityGoods); |
|
|
|
} |
|
|
|
} |
|
|
|
//费用详情
|
|
|
|
Map<Long,BmsSubject> subjectMap = new HashMap<>(); |
|
|
|