|
|
@ -342,7 +342,11 @@ public class PortalOfCost2Application { |
|
|
|
} |
|
|
|
|
|
|
|
@NotNull |
|
|
|
private List<TbsActivityCenterGoods> getTbsActivityCenterGoods(BmsSupplier supplier, BmsSubject subject, BigDecimal OneHundred, List<ProcessGoodsItem> processGoodsItems, String costCode, LocalDate nowDate, LocalDate startDate, LocalDate endDate, Long supplierId, BigDecimal totalAmount, TbsActivity activity, List<TbsActivityCenter> activityCenterList, List<TbsActivityGoods> activityGoodsList) { |
|
|
|
private List<TbsActivityCenterGoods> getTbsActivityCenterGoods(BmsSupplier supplier, BmsSubject subject, BigDecimal OneHundred, |
|
|
|
List<ProcessGoodsItem> processGoodsItems, String costCode, LocalDate nowDate, |
|
|
|
LocalDate startDate, LocalDate endDate, Long supplierId, BigDecimal totalAmount, |
|
|
|
TbsActivity activity, List<TbsActivityCenter> activityCenterList, |
|
|
|
List<TbsActivityGoods> activityGoodsList) { |
|
|
|
List<TbsActivityCenterGoods> activityCenterGoodsList = new ArrayList<>(); |
|
|
|
|
|
|
|
for (TbsActivityCenter activityCenter : activityCenterList) { |
|
|
@ -384,29 +388,16 @@ public class PortalOfCost2Application { |
|
|
|
centerGoods.setTargetLevelPathIds(activityGoods.getTargetLevelPathIds()); |
|
|
|
centerGoods.setTargetLevelPathNames(activityGoods.getTargetLevelPathNames()); |
|
|
|
// 分配金额
|
|
|
|
if (costCode.contains("YX06")){ |
|
|
|
if(i+1== activityGoodsList.size()){ |
|
|
|
centerGoods.setCenterGoodsAmount(yx06Surplus); |
|
|
|
centerGoods.setCenterGoodsRate(yx06SurplusRate); |
|
|
|
centerGoods.setUsedAmount(yx06Surplus); |
|
|
|
}else { |
|
|
|
yx06SurplusRate = yx06SurplusRate.subtract(yx06Rate); |
|
|
|
yx06Surplus = yx06Surplus.subtract(yx06ItemAmt); |
|
|
|
centerGoods.setCenterGoodsAmount(yx06ItemAmt); |
|
|
|
centerGoods.setCenterGoodsRate(yx06Rate); |
|
|
|
centerGoods.setUsedAmount(yx06ItemAmt); |
|
|
|
} |
|
|
|
if(i+1== activityGoodsList.size()){ |
|
|
|
centerGoods.setCenterGoodsAmount(yx06Surplus); |
|
|
|
centerGoods.setCenterGoodsRate(yx06SurplusRate); |
|
|
|
centerGoods.setUsedAmount(yx06Surplus); |
|
|
|
}else { |
|
|
|
BigDecimal totalSkuAmt = BigDecimal.ZERO; |
|
|
|
for (ProcessGoodsItem goodsItem : processGoodsItems) { |
|
|
|
if(goodsItem.getInventoryCode().equals(activityGoods.getTargetCode())){ |
|
|
|
totalSkuAmt = totalSkuAmt.add(goodsItem.getAmount()); |
|
|
|
} |
|
|
|
} |
|
|
|
BigDecimal rate = totalSkuAmt.divide(totalAmount, RoundingMode.UP); |
|
|
|
centerGoods.setCenterGoodsAmount(totalSkuAmt); |
|
|
|
centerGoods.setCenterGoodsRate(rate); |
|
|
|
centerGoods.setUsedAmount(totalSkuAmt); |
|
|
|
yx06SurplusRate = yx06SurplusRate.subtract(yx06Rate); |
|
|
|
yx06Surplus = yx06Surplus.subtract(yx06ItemAmt); |
|
|
|
centerGoods.setCenterGoodsAmount(yx06ItemAmt); |
|
|
|
centerGoods.setCenterGoodsRate(yx06Rate); |
|
|
|
centerGoods.setUsedAmount(yx06ItemAmt); |
|
|
|
} |
|
|
|
activityCenterGoodsList.add(centerGoods); |
|
|
|
} |
|
|
|