|
@ -80,6 +80,8 @@ public class TbsCostApplyServiceImpl extends ServiceImpl<TbsCostApplyMapper,TbsC |
|
|
private ProjectProperties projectProperties; |
|
|
private ProjectProperties projectProperties; |
|
|
private BirRoiRateService birRoiRateService; |
|
|
private BirRoiRateService birRoiRateService; |
|
|
private TbsCostPercentMapper tbsCostPercentMapper; |
|
|
private TbsCostPercentMapper tbsCostPercentMapper; |
|
|
|
|
|
private TbsScheduleItemBudgetMapper tbsScheduleItemBudgetMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public Long selectCountOverdueState(String userId) { |
|
|
public Long selectCountOverdueState(String userId) { |
|
@ -229,9 +231,7 @@ public class TbsCostApplyServiceImpl extends ServiceImpl<TbsCostApplyMapper,TbsC |
|
|
data.put("empExpenseRate",ytdQtdToOAVo.getQtdUserPercent()); |
|
|
data.put("empExpenseRate",ytdQtdToOAVo.getQtdUserPercent()); |
|
|
data.put("salesExpenseRate",ytdQtdToOAVo.getQtdRegionPercent()); |
|
|
data.put("salesExpenseRate",ytdQtdToOAVo.getQtdRegionPercent()); |
|
|
data.put("adminiExpenseRate",ytdQtdToOAVo.getQtdRegion2Percent()); |
|
|
data.put("adminiExpenseRate",ytdQtdToOAVo.getQtdRegion2Percent()); |
|
|
//TODO 预算费率
|
|
|
|
|
|
data.put("budgetExpenseRate","0.0"); |
|
|
|
|
|
data.put("ytdBudgetExpenseRate","0.0"); |
|
|
|
|
|
//插入记录表前移除历史记录
|
|
|
//插入记录表前移除历史记录
|
|
|
tbsCostPercentMapper.delByCostApplyId(tbsCostApply.getId()); |
|
|
tbsCostPercentMapper.delByCostApplyId(tbsCostApply.getId()); |
|
|
TbsCostPercent costPercent = new TbsCostPercent(); |
|
|
TbsCostPercent costPercent = new TbsCostPercent(); |
|
@ -244,9 +244,6 @@ public class TbsCostApplyServiceImpl extends ServiceImpl<TbsCostApplyMapper,TbsC |
|
|
costPercent.setQtdUserPercent(BigDecimal.valueOf(ytdQtdToOAVo.getYtdCustomerPercent())); |
|
|
costPercent.setQtdUserPercent(BigDecimal.valueOf(ytdQtdToOAVo.getYtdCustomerPercent())); |
|
|
costPercent.setQtdRegion2Percent(BigDecimal.valueOf(ytdQtdToOAVo.getYtdCustomerPercent())); |
|
|
costPercent.setQtdRegion2Percent(BigDecimal.valueOf(ytdQtdToOAVo.getYtdCustomerPercent())); |
|
|
costPercent.setQtdRegionPercent(BigDecimal.valueOf(ytdQtdToOAVo.getYtdCustomerPercent())); |
|
|
costPercent.setQtdRegionPercent(BigDecimal.valueOf(ytdQtdToOAVo.getYtdCustomerPercent())); |
|
|
//TODO 预算费率
|
|
|
|
|
|
costPercent.setYtdBudgetPercent(BigDecimal.ZERO); |
|
|
|
|
|
costPercent.setQtdBudgetPercent(BigDecimal.ZERO); |
|
|
|
|
|
tbsCostPercentMapper.insert(costPercent); |
|
|
tbsCostPercentMapper.insert(costPercent); |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -283,12 +280,26 @@ public class TbsCostApplyServiceImpl extends ServiceImpl<TbsCostApplyMapper,TbsC |
|
|
activityCenter.getCenterType()+"_"+ |
|
|
activityCenter.getCenterType()+"_"+ |
|
|
activityCenter.getCenterId())); |
|
|
activityCenter.getCenterId())); |
|
|
} |
|
|
} |
|
|
|
|
|
//TODO 目标费率
|
|
|
|
|
|
List<TbsBudgetCostItem> tbsBudgetCostItems = budgetCostItemService.listByCostApplyId(Long.parseLong(id)); |
|
|
|
|
|
List<Long> scheduleItemBudgetIds = tbsBudgetCostItems.stream().map(a->a.getScheduleItemBudgetId()).distinct().collect(Collectors.toList()); |
|
|
|
|
|
List<TbsScheduleItemBudget> tbsScheduleItemBudgets = tbsScheduleItemBudgetMapper.selectBatchIds(scheduleItemBudgetIds); |
|
|
|
|
|
for(TbsScheduleItemBudget tbsScheduleItemBudget : tbsScheduleItemBudgets){ |
|
|
|
|
|
subList.add( |
|
|
|
|
|
new TbsCostSubItem.Amount( |
|
|
|
|
|
tbsScheduleItemBudget.getBudgetAmount(),tbsScheduleItemBudget.getPreDispatchAmount() |
|
|
|
|
|
) |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
List<TbsActivityGoods> tbsActivityGoods = tbsActivityGoodsService.listByCostApplyId(Long.parseLong(id)); |
|
|
List<TbsActivityGoods> tbsActivityGoods = tbsActivityGoodsService.listByCostApplyId(Long.parseLong(id)); |
|
|
Set<String> bands = new HashSet<>(); |
|
|
Set<String> bands = new HashSet<>(); |
|
|
for (TbsActivityGoods tbsActivityGood : tbsActivityGoods) { |
|
|
for (TbsActivityGoods tbsActivityGood : tbsActivityGoods) { |
|
|
String band = tbsActivityGood.getTargetLevelPathNames().split("_")[0]; |
|
|
String band = tbsActivityGood.getTargetLevelPathNames().split("_")[0]; |
|
|
bands.add(band); |
|
|
bands.add(band); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String goods = bands.stream().collect(Collectors.joining(",")); |
|
|
String goods = bands.stream().collect(Collectors.joining(",")); |
|
|
data.put("chanPinPinLei",goods); |
|
|
data.put("chanPinPinLei",goods); |
|
|
data.put("sub",subList); |
|
|
data.put("sub",subList); |
|
|