|
@@ -1246,8 +1246,14 @@ public class CostDepartmentProfitServiceImpl extends ServiceImpl<CostDepartmentP
|
|
|
if (CollUtil.isEmpty(reportFormList)) {
|
|
|
throw new CostException(500, "损益表未找到");
|
|
|
}
|
|
|
- List<CommonTitleReportVo> commonTitleReportVos = reportFormList.stream().map(reportForm -> new CommonTitleReportVo(reportForm.getId(), reportForm.getParentId(), reportForm.getReportName(), reportForm.getSort())).collect(Collectors.toList());
|
|
|
-
|
|
|
+ List<CommonTitleReportVo> commonTitleReportVos = reportFormList.stream().map(reportForm -> {
|
|
|
+ CommonTitleReportVo commonTitleReportVo = new CommonTitleReportVo(reportForm.getId(), reportForm.getParentId(), reportForm.getReportName(), reportForm.getSort());
|
|
|
+ commonTitleReportVo.setDataType(reportForm.getDataType());
|
|
|
+ commonTitleReportVo.setDecimalPlace(reportForm.getDecimalPlace());
|
|
|
+ commonTitleReportVo.setPermil(reportForm.getPermil());
|
|
|
+ return commonTitleReportVo;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+// List<CommonTitleReportVo> commonTitleReportVos = BeanUtil.convertList(reportFormList,CommonTitleReportVo.class);
|
|
|
Map<Long, List<CommonTitleReportVo>> collect = commonTitleReportVos.stream().collect(Collectors.groupingBy(CommonTitleReportVo::getParentReportId));
|
|
|
List<CommonTitleReportVo> titleReportVoList = collect.get(NumberConstant.ZERO_L);
|
|
|
for (CommonTitleReportVo reportVo : titleReportVoList) {
|
|
@@ -1715,11 +1721,22 @@ public class CostDepartmentProfitServiceImpl extends ServiceImpl<CostDepartmentP
|
|
|
|
|
|
Map<Long, Integer> sortMap = reportFormList.stream().collect(Collectors.toMap(ReportForm::getId, ReportForm::getSort, (a, b) -> b));
|
|
|
Map<Long, String> descriptionMap = reportFormList.stream().collect(Collectors.toMap(ReportForm::getId, reportForm -> !StringUtils.isEmpty(reportForm.getDescription()) ? reportForm.getDescription() : "", (a, b) -> b));
|
|
|
+ Map<Long, List<ReportForm>> reportIdMap = reportFormList.stream().collect(Collectors.groupingBy(ReportForm::getId));
|
|
|
|
|
|
List<CostProfitVo> costProfitVos = BeanUtil.convertList(filterProfit, CostProfitVo.class);
|
|
|
costProfitVos.forEach(profitVo -> {
|
|
|
profitVo.setDescription(descriptionMap.get(profitVo.getReportId()));
|
|
|
profitVo.setSort(sortMap.get(profitVo.getReportId()));
|
|
|
+ List<ReportForm> profitReportFormList = reportIdMap.get(profitVo.getReportId());
|
|
|
+ if(!CollectionUtils.isEmpty(profitReportFormList)) {
|
|
|
+ profitVo.setDataType(profitReportFormList.get(NumberConstant.ZERO).getDataType());
|
|
|
+ profitVo.setDecimalPlace(profitReportFormList.get(NumberConstant.ZERO).getDecimalPlace());
|
|
|
+ profitVo.setPermil(profitReportFormList.get(NumberConstant.ZERO).getPermil());
|
|
|
+ }else {
|
|
|
+ profitVo.setDataType(NumberConstant.ONE);
|
|
|
+ profitVo.setDecimalPlace(NumberConstant.TWO);
|
|
|
+ profitVo.setPermil(NumberConstant.ONE);
|
|
|
+ }
|
|
|
});
|
|
|
Map<Long, List<CostProfitVo>> collect = costProfitVos.stream().collect(Collectors.groupingBy(CostProfitVo::getReportParentId));
|
|
|
List<CostProfitVo> costProfitParentVos = collect.get(NumberConstant.ZERO_L);
|
|
@@ -1773,6 +1790,7 @@ public class CostDepartmentProfitServiceImpl extends ServiceImpl<CostDepartmentP
|
|
|
if (CollUtil.isEmpty(reportFormList)) {
|
|
|
throw new CostException(500, "损益表未找到");
|
|
|
}
|
|
|
+ Map<Long, List<ReportForm>> reportIdMap = reportFormList.stream().collect(Collectors.groupingBy(ReportForm::getId));
|
|
|
List<CostDepartmentProfit> filterProfit = new ArrayList<>();
|
|
|
|
|
|
Map<Long, List<CostDepartmentProfit>> collect1 = departmentProfits.stream().collect(Collectors.groupingBy(CostDepartmentProfit::getReportId));
|
|
@@ -1794,6 +1812,16 @@ public class CostDepartmentProfitServiceImpl extends ServiceImpl<CostDepartmentP
|
|
|
costProfitVos.forEach(profitVo -> {
|
|
|
profitVo.setDescription(descriptionMap.get(profitVo.getReportId()));
|
|
|
profitVo.setSort(sortMap.get(profitVo.getReportId()));
|
|
|
+ List<ReportForm> profitReportFormList = reportIdMap.get(profitVo.getReportId());
|
|
|
+ if(!CollectionUtils.isEmpty(profitReportFormList)) {
|
|
|
+ profitVo.setDataType(profitReportFormList.get(NumberConstant.ZERO).getDataType());
|
|
|
+ profitVo.setDecimalPlace(profitReportFormList.get(NumberConstant.ZERO).getDecimalPlace());
|
|
|
+ profitVo.setPermil(profitReportFormList.get(NumberConstant.ZERO).getPermil());
|
|
|
+ }else {
|
|
|
+ profitVo.setDataType(NumberConstant.ONE);
|
|
|
+ profitVo.setDecimalPlace(NumberConstant.TWO);
|
|
|
+ profitVo.setPermil(NumberConstant.ONE);
|
|
|
+ }
|
|
|
});
|
|
|
Map<Long, List<CostProfitVo>> collect = costProfitVos.stream().collect(Collectors.groupingBy(CostProfitVo::getReportParentId));
|
|
|
List<CostProfitVo> costProfitParentVos = collect.get(NumberConstant.ZERO_L);
|
|
@@ -1835,6 +1863,7 @@ public class CostDepartmentProfitServiceImpl extends ServiceImpl<CostDepartmentP
|
|
|
if (CollUtil.isEmpty(reportFormList)) {
|
|
|
throw new CostException(500, "损益表未找到");
|
|
|
}
|
|
|
+ Map<Long, List<ReportForm>> reportIdMap = reportFormList.stream().collect(Collectors.groupingBy(ReportForm::getId));
|
|
|
List<CostDepartmentProfit> filterProfit = new ArrayList<>();
|
|
|
|
|
|
Map<Long, List<CostDepartmentProfit>> collect1 = departmentProfits.stream().collect(Collectors.groupingBy(CostDepartmentProfit::getReportId));
|
|
@@ -1855,6 +1884,16 @@ public class CostDepartmentProfitServiceImpl extends ServiceImpl<CostDepartmentP
|
|
|
costProfitVos.forEach(profitVo -> {
|
|
|
profitVo.setDescription(descriptionMap.get(profitVo.getReportId()));
|
|
|
profitVo.setSort(sortMap.get(profitVo.getReportId()));
|
|
|
+ List<ReportForm> profitReportFormList = reportIdMap.get(profitVo.getReportId());
|
|
|
+ if(!CollectionUtils.isEmpty(profitReportFormList)) {
|
|
|
+ profitVo.setDataType(profitReportFormList.get(NumberConstant.ZERO).getDataType());
|
|
|
+ profitVo.setDecimalPlace(profitReportFormList.get(NumberConstant.ZERO).getDecimalPlace());
|
|
|
+ profitVo.setPermil(profitReportFormList.get(NumberConstant.ZERO).getPermil());
|
|
|
+ }else {
|
|
|
+ profitVo.setDataType(NumberConstant.ONE);
|
|
|
+ profitVo.setDecimalPlace(NumberConstant.TWO);
|
|
|
+ profitVo.setPermil(NumberConstant.ONE);
|
|
|
+ }
|
|
|
});
|
|
|
Map<Long, List<CostProfitVo>> collect = costProfitVos.stream().collect(Collectors.groupingBy(CostProfitVo::getReportParentId));
|
|
|
List<CostProfitVo> costProfitParentVos = collect.get(NumberConstant.ZERO_L);
|