|
@@ -337,6 +337,7 @@ public class CostDepartmentProfitServiceImpl extends ServiceImpl<CostDepartmentP
|
|
|
String reportTopName = sheet.getRow(row).getCell(1).getStringCellValue();
|
|
|
BigDecimal amount = profitMap.get(reportTopName + "cost" + responsibilityTopName).getAmount();
|
|
|
writer.writeCellValue(j+2,row,amount);
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
row++;
|
|
@@ -402,9 +403,8 @@ public class CostDepartmentProfitServiceImpl extends ServiceImpl<CostDepartmentP
|
|
|
// 查找在归集数据里面当前责任中心对应的这些会计科目的金额
|
|
|
List<IncomeCollection> incomeCollectionList = list.stream().filter(income -> income.getResponsibilityCode().equals(i.getResponsibilityCode()) && accountList.contains(income.getAccountingCode())).collect(Collectors.toList());
|
|
|
// 需要查询分摊后的表
|
|
|
-// List<AllocationQueryReportVO> collect = allocationQueryReportVOList.stream().filter(m -> m.getResponsibilityCode().equals(i.getResponsibilityCode())).collect(Collectors.toList());
|
|
|
-// List<AllocationQueryReportVO> collect1 = collect.stream().filter(m -> !Collections.disjoint(accountList, m.getAccountingCodes())).collect(Collectors.toList());
|
|
|
- List<AllocationQueryReportVO> reportVOList = allocationQueryReportVOList.stream().filter(m -> m.getResponsibilityCode().equals(i.getResponsibilityCode()) && !Collections.disjoint(accountList, m.getAccountingCodes())).collect(Collectors.toList());
|
|
|
+ List<AllocationQueryReportVO> reportVOList = allocationQueryReportVOList.stream().filter(m -> m.getTargetResponsibilityCode().equals(i.getResponsibilityCode()) && accountList.contains(m.getAccountingCode())).collect(Collectors.toList());
|
|
|
+
|
|
|
if (CollUtil.isNotEmpty(incomeCollectionList)) {
|
|
|
incomeCollectionList.forEach(m -> {
|
|
|
sum.updateAndGet(v -> v.add(m.getAmount()));
|
|
@@ -432,10 +432,12 @@ public class CostDepartmentProfitServiceImpl extends ServiceImpl<CostDepartmentP
|
|
|
if (CollUtil.isNotEmpty(reportRelationList)) {
|
|
|
// 找到对应的分摊层级的Id 但是分摊报表里面存的是分摊层级的序号
|
|
|
List<Long> shareLevelIds = reportRelationList.stream().map(ReportRelation::getRelationCode).map(Long::valueOf).collect(Collectors.toList());
|
|
|
- List<Integer> levelShortList = costShareLevelList.stream().filter(m -> shareLevelIds.contains(m.getId())).map(CostShareLevel::getLeverSort).collect(Collectors.toList());
|
|
|
- if (CollUtil.isNotEmpty(levelShortList)) {
|
|
|
+// List<Integer> levelShortList = costShareLevelList.stream()
|
|
|
+// .filter(m -> shareLevelIds.contains(m.getId()))
|
|
|
+// .map(CostShareLevel::getLeverSort).collect(Collectors.toList());
|
|
|
+ if (CollUtil.isNotEmpty(shareLevelIds)) {
|
|
|
// 查询报表里面是当前分摊层级的数据
|
|
|
- List<Allocation> allocations = allocationList.stream().filter(m -> levelShortList.contains(m.getLevelSort()) && m.getTargetResponsibilityCode().equals(i.getResponsibilityCode())).collect(Collectors.toList());
|
|
|
+ List<Allocation> allocations = allocationList.stream().filter(m -> shareLevelIds.contains(m.getShareLevelId()) && m.getTargetResponsibilityCode().equals(i.getResponsibilityCode())).collect(Collectors.toList());
|
|
|
if (CollUtil.isNotEmpty(allocations)) {
|
|
|
// allocations.forEach(m -> {
|
|
|
// sum.updateAndGet(v -> v.add(m.getAmount()));
|