|
@ -23,7 +23,9 @@ import com.qs.serve.modules.bms.mapper.BmsSupplierMapper; |
|
|
import com.qs.serve.modules.tbs.entity.TbsActivity; |
|
|
import com.qs.serve.modules.tbs.entity.TbsActivity; |
|
|
import com.qs.serve.modules.tbs.entity.TbsActivityCenter; |
|
|
import com.qs.serve.modules.tbs.entity.TbsActivityCenter; |
|
|
import com.qs.serve.modules.tbs.entity.TbsActivityCenterGoods; |
|
|
import com.qs.serve.modules.tbs.entity.TbsActivityCenterGoods; |
|
|
|
|
|
import com.qs.serve.modules.tbs.entity.TbsCostApply; |
|
|
import com.qs.serve.modules.tbs.mapper.TbsActivityCenterGoodsMapper; |
|
|
import com.qs.serve.modules.tbs.mapper.TbsActivityCenterGoodsMapper; |
|
|
|
|
|
import com.qs.serve.modules.tbs.mapper.TbsCostApplyMapper; |
|
|
import com.qs.serve.modules.tbs.service.TbsActivityCenterGoodsService; |
|
|
import com.qs.serve.modules.tbs.service.TbsActivityCenterGoodsService; |
|
|
import com.qs.serve.modules.vtb.common.VtbFundFlowType; |
|
|
import com.qs.serve.modules.vtb.common.VtbFundFlowType; |
|
|
import com.qs.serve.modules.vtb.entity.VtbFundFlow; |
|
|
import com.qs.serve.modules.vtb.entity.VtbFundFlow; |
|
@ -73,6 +75,8 @@ public class BirActivityCenterGoodsServiceImpl extends ServiceImpl<BirActivityCe |
|
|
private final BmsSupplierMapper bmsSupplierMapper; |
|
|
private final BmsSupplierMapper bmsSupplierMapper; |
|
|
private final BirRemoveIdMapper birRemoveIdMapper; |
|
|
private final BirRemoveIdMapper birRemoveIdMapper; |
|
|
|
|
|
|
|
|
|
|
|
private final TbsCostApplyMapper tbsCostApplyMapper; |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void buildReport(int year, int month) { |
|
|
public void buildReport(int year, int month) { |
|
|
LocalDate startDate = LocalDate.of(year,month,1); |
|
|
LocalDate startDate = LocalDate.of(year,month,1); |
|
@ -133,6 +137,8 @@ public class BirActivityCenterGoodsServiceImpl extends ServiceImpl<BirActivityCe |
|
|
Map<Long,List<TbsActivityCenterGoods>> collectMap = activityCenterGoodsAllList.stream() |
|
|
Map<Long,List<TbsActivityCenterGoods>> collectMap = activityCenterGoodsAllList.stream() |
|
|
.collect(Collectors.groupingBy(TbsActivityCenterGoods::getActivityId)); |
|
|
.collect(Collectors.groupingBy(TbsActivityCenterGoods::getActivityId)); |
|
|
|
|
|
|
|
|
|
|
|
List<Long> costApplyIds = activityCenterGoodsAllList.stream().map(a->a.getCostApplyId()).distinct().collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
LambdaQueryWrapper<BmsSupplier> supplierLqw = new LambdaQueryWrapper<>(); |
|
|
LambdaQueryWrapper<BmsSupplier> supplierLqw = new LambdaQueryWrapper<>(); |
|
|
supplierLqw.in(BmsSupplier::getId,activityCenterGoodsAllList.stream().map(a->a.getSupplierId()).distinct().collect(Collectors.toList())); |
|
|
supplierLqw.in(BmsSupplier::getId,activityCenterGoodsAllList.stream().map(a->a.getSupplierId()).distinct().collect(Collectors.toList())); |
|
|
List<BmsSupplier> bmsSupplierList = bmsSupplierMapper.selectList(supplierLqw); |
|
|
List<BmsSupplier> bmsSupplierList = bmsSupplierMapper.selectList(supplierLqw); |
|
@ -157,11 +163,20 @@ public class BirActivityCenterGoodsServiceImpl extends ServiceImpl<BirActivityCe |
|
|
// final Map<Long,BigDecimal> actReleaseMap = new HashMap<>();
|
|
|
// final Map<Long,BigDecimal> actReleaseMap = new HashMap<>();
|
|
|
// actReleaseList.forEach(actRelease -> actReleaseMap.put(actRelease.getActivityId(),actRelease.getTotalAmt()));
|
|
|
// actReleaseList.forEach(actRelease -> actReleaseMap.put(actRelease.getActivityId(),actRelease.getTotalAmt()));
|
|
|
|
|
|
|
|
|
|
|
|
List<TbsCostApply> costApplyList = tbsCostApplyMapper.selectBatchIds(costApplyIds); |
|
|
|
|
|
|
|
|
|
|
|
Map<Long,List<TbsCostApply>> costApplyMap = costApplyList.stream().collect(Collectors.groupingBy(TbsCostApply::getId)); |
|
|
|
|
|
|
|
|
for (Long activityId : collectMap.keySet()) { |
|
|
for (Long activityId : collectMap.keySet()) { |
|
|
//用于保存的对象列表
|
|
|
//用于保存的对象列表
|
|
|
List<BirActivityCenterGoods> bacgList = new ArrayList<>(); |
|
|
List<BirActivityCenterGoods> bacgList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
//创建对象列表
|
|
|
//创建对象列表
|
|
|
List<TbsActivityCenterGoods> activityCenterGoodsList = collectMap.get(activityId); |
|
|
List<TbsActivityCenterGoods> activityCenterGoodsList = collectMap.get(activityId); |
|
|
|
|
|
|
|
|
|
|
|
TbsActivityCenterGoods tempGoods = activityCenterGoodsList.get(0); |
|
|
|
|
|
TbsCostApply costApply = costApplyMap.get(tempGoods.getCostApplyId()).get(0); |
|
|
|
|
|
|
|
|
for (TbsActivityCenterGoods activityCenterGoods : activityCenterGoodsList) { |
|
|
for (TbsActivityCenterGoods activityCenterGoods : activityCenterGoodsList) { |
|
|
LocalDate actStartDate = activityCenterGoods.getPreStartDate(); |
|
|
LocalDate actStartDate = activityCenterGoods.getPreStartDate(); |
|
|
LocalDate actEndDate = activityCenterGoods.getPreEndDate(); |
|
|
LocalDate actEndDate = activityCenterGoods.getPreEndDate(); |
|
@ -174,7 +189,7 @@ public class BirActivityCenterGoodsServiceImpl extends ServiceImpl<BirActivityCe |
|
|
dateSplitList, currDateSplit,currentActDays); |
|
|
dateSplitList, currDateSplit,currentActDays); |
|
|
//创建底表对象
|
|
|
//创建底表对象
|
|
|
BirActivityCenterGoods entity = createBirActivityCenterGoodsEntity(costCenterList, |
|
|
BirActivityCenterGoods entity = createBirActivityCenterGoodsEntity(costCenterList, |
|
|
activityCenterGoods, currentActDays, currDateSplit, goodSplitDTO,supplierMap,saleRegionMap,bizRegionMap); |
|
|
activityCenterGoods, currentActDays, currDateSplit, goodSplitDTO,supplierMap,saleRegionMap,bizRegionMap,costApply); |
|
|
bacgList.add(entity); |
|
|
bacgList.add(entity); |
|
|
} |
|
|
} |
|
|
}else if (dateSplitList.size()==1){ |
|
|
}else if (dateSplitList.size()==1){ |
|
@ -184,7 +199,7 @@ public class BirActivityCenterGoodsServiceImpl extends ServiceImpl<BirActivityCe |
|
|
dateSplitList, currDateSplit,currentActDays); |
|
|
dateSplitList, currDateSplit,currentActDays); |
|
|
//创建底表对象
|
|
|
//创建底表对象
|
|
|
BirActivityCenterGoods entity = createBirActivityCenterGoodsEntity(costCenterList, |
|
|
BirActivityCenterGoods entity = createBirActivityCenterGoodsEntity(costCenterList, |
|
|
activityCenterGoods, currentActDays, currDateSplit, goodSplitDTO,supplierMap,saleRegionMap,bizRegionMap); |
|
|
activityCenterGoods, currentActDays, currDateSplit, goodSplitDTO,supplierMap,saleRegionMap,bizRegionMap,costApply); |
|
|
bacgList.add(entity); |
|
|
bacgList.add(entity); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -211,7 +226,10 @@ public class BirActivityCenterGoodsServiceImpl extends ServiceImpl<BirActivityCe |
|
|
Integer currentActDays, |
|
|
Integer currentActDays, |
|
|
DateSplitDTO currDateSplit, |
|
|
DateSplitDTO currDateSplit, |
|
|
BirCenterGoodSplitDTO goodSplitDTO, |
|
|
BirCenterGoodSplitDTO goodSplitDTO, |
|
|
Map<String, BmsSupplier> supplierMap, Map<String, BmsRegion> saleRegionMap, Map<String, BmsRegion2> bizRegionMap) { |
|
|
Map<String, BmsSupplier> supplierMap, |
|
|
|
|
|
Map<String, BmsRegion> saleRegionMap, |
|
|
|
|
|
Map<String, BmsRegion2> bizRegionMap, |
|
|
|
|
|
TbsCostApply costApply) { |
|
|
BirActivityCenterGoods entity = new BirActivityCenterGoods(); |
|
|
BirActivityCenterGoods entity = new BirActivityCenterGoods(); |
|
|
entity.setActivityCenterGoodsId(activityCenterGoods.getId()); |
|
|
entity.setActivityCenterGoodsId(activityCenterGoods.getId()); |
|
|
entity.setKeyNum(currDateSplit.getYearMonth()); |
|
|
entity.setKeyNum(currDateSplit.getYearMonth()); |
|
@ -262,6 +280,8 @@ public class BirActivityCenterGoodsServiceImpl extends ServiceImpl<BirActivityCe |
|
|
entity.setSupplierId(activityCenterGoods.getSupplierId()); |
|
|
entity.setSupplierId(activityCenterGoods.getSupplierId()); |
|
|
entity.setSupplierCode(activityCenterGoods.getSupplierCode()); |
|
|
entity.setSupplierCode(activityCenterGoods.getSupplierCode()); |
|
|
entity.setSupplierName(activityCenterGoods.getSupplierName()); |
|
|
entity.setSupplierName(activityCenterGoods.getSupplierName()); |
|
|
|
|
|
entity.setTemplateId(costApply.getTemplateId()); |
|
|
|
|
|
entity.setTemplateTitle(costApply.getTemplateTitle()); |
|
|
|
|
|
|
|
|
BmsSupplier supplier = supplierMap.get(entity.getSupplierId().toString()); |
|
|
BmsSupplier supplier = supplierMap.get(entity.getSupplierId().toString()); |
|
|
if(supplier!=null){ |
|
|
if(supplier!=null){ |
|
|