|
|
@ -596,6 +596,9 @@ public class PortalOfCostApplication { |
|
|
|
.map(ProcessGoodsItem::getInventoryCode).distinct().collect(Collectors.toList()); |
|
|
|
} |
|
|
|
List<GoodsSku> skuList = this.initSkuListOfProcess(invCodeList); |
|
|
|
if(skuList.size()!=invCodeList.size()){ |
|
|
|
Assert.throwEx("品类缺失"); |
|
|
|
} |
|
|
|
//常用参数
|
|
|
|
final String GOODS_TYPE = "sku"; |
|
|
|
final BigDecimal OneHundred = new BigDecimal("100"); |
|
|
@ -678,6 +681,7 @@ public class PortalOfCostApplication { |
|
|
|
|
|
|
|
//活动-商品
|
|
|
|
List<TbsActivityGoods> activityGoodsList = new ArrayList<>(); |
|
|
|
|
|
|
|
for (GoodsSku sku : skuList) { |
|
|
|
GoodsSpu goodsSpu = goodsSpuService.getById(sku.getSpuId()); |
|
|
|
GoodsCategory category1 = goodsCategoryService.getById(goodsSpu.getCategoryFirst()); |
|
|
@ -727,15 +731,16 @@ public class PortalOfCostApplication { |
|
|
|
centerGoods.setTargetLevelPathIds(activityGoods.getTargetLevelPathIds()); |
|
|
|
centerGoods.setTargetLevelPathNames(activityGoods.getTargetLevelPathNames()); |
|
|
|
// 分配金额
|
|
|
|
BigDecimal totalSkuAmt = BigDecimal.ZERO; |
|
|
|
for (ProcessGoodsItem goodsItem : processGoodsItems) { |
|
|
|
if(goodsItem.getInventoryCode().equals(activityGoods.getTargetCode())){ |
|
|
|
BigDecimal rate = goodsItem.getAmount().divide(totalAmount, RoundingMode.UP); |
|
|
|
centerGoods.setCenterGoodsAmount(goodsItem.getAmount()); |
|
|
|
centerGoods.setCenterGoodsRate(rate); |
|
|
|
centerGoods.setUsedAmount(goodsItem.getAmount()); |
|
|
|
break; |
|
|
|
totalSkuAmt = totalSkuAmt.add(goodsItem.getAmount()); |
|
|
|
} |
|
|
|
} |
|
|
|
BigDecimal rate = totalSkuAmt.divide(totalAmount, RoundingMode.UP); |
|
|
|
centerGoods.setCenterGoodsAmount(totalSkuAmt); |
|
|
|
centerGoods.setCenterGoodsRate(rate); |
|
|
|
centerGoods.setUsedAmount(totalSkuAmt); |
|
|
|
activityCenterGoodsList.add(centerGoods); |
|
|
|
} |
|
|
|
|
|
|
|