|
@@ -1253,6 +1253,7 @@ public class CostDepartmentProfitServiceImpl extends ServiceImpl<CostDepartmentP
|
|
|
for (CommonTitleReportVo reportVo : titleReportVoList) {
|
|
|
List<CommonTitleReportVo> childList = collect.get(reportVo.getReportId());
|
|
|
if (!CollectionUtils.isEmpty(childList)) {
|
|
|
+ childList.sort(Comparator.comparing(CommonTitleReportVo::getSort, Comparator.nullsLast(Integer::compareTo)));
|
|
|
reportVo.setChildTitle(setReportChildren(childList, collect));
|
|
|
}
|
|
|
}
|
|
@@ -1278,7 +1279,10 @@ public class CostDepartmentProfitServiceImpl extends ServiceImpl<CostDepartmentP
|
|
|
for (ReportForm reportForm : reportFormList) {
|
|
|
Integer hide = reportForm.getHide();
|
|
|
if(hide.equals(NumberConstant.ONE)){
|
|
|
- filterProfit.addAll(collectGroup.get(reportForm.getId()));
|
|
|
+ List<CostDepartmentProfit> costDepartmentProfits = collectGroup.get(reportForm.getId());
|
|
|
+ if(!CollectionUtils.isEmpty(costDepartmentProfits)) {
|
|
|
+ filterProfit.addAll(costDepartmentProfits);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1340,6 +1344,7 @@ public class CostDepartmentProfitServiceImpl extends ServiceImpl<CostDepartmentP
|
|
|
for (CostProfitVo costProfitVo : profitVos) {
|
|
|
costProfitVo.setResponsibilityCode(responsibility.getResponsibilityCode());
|
|
|
costProfitVo.setResponsibilityName(responsibility.getResponsibilityName());
|
|
|
+ costProfitVo.setSort(responsibility.getSort());
|
|
|
costProfitVo.setAmount(BigDecimal.ZERO);
|
|
|
costProfitVo.setPercent(BigDecimal.ZERO);
|
|
|
parentReportVos.add(costProfitVo);
|
|
@@ -1354,6 +1359,7 @@ public class CostDepartmentProfitServiceImpl extends ServiceImpl<CostDepartmentP
|
|
|
for (CostProfitVo costProfitVo : profitVos) {
|
|
|
costProfitVo.setResponsibilityCode(responsibility.getResponsibilityCode());
|
|
|
costProfitVo.setResponsibilityName(responsibility.getResponsibilityName());
|
|
|
+ costProfitVo.setSort(responsibility.getSort());
|
|
|
costProfitVo.setAmount(BigDecimal.ZERO);
|
|
|
costProfitVo.setPercent(BigDecimal.ZERO);
|
|
|
if (aLong.equals(NumberConstant.ZERO_L)) {
|
|
@@ -1481,6 +1487,7 @@ public class CostDepartmentProfitServiceImpl extends ServiceImpl<CostDepartmentP
|
|
|
vo.setResponsibilityCode(k);
|
|
|
vo.setResponsibilityName(responseNameMap.get(k));
|
|
|
if (!CollectionUtils.isEmpty(v)) {
|
|
|
+ vo.setSort(v.get(0).getSort());
|
|
|
List<CommonDataReportVo> dataReportVos = new ArrayList<>();
|
|
|
for (CostProfitVo costProfitVo : v) {
|
|
|
CommonDataReportVo vo1 = new CommonDataReportVo();
|
|
@@ -1490,6 +1497,7 @@ public class CostDepartmentProfitServiceImpl extends ServiceImpl<CostDepartmentP
|
|
|
}
|
|
|
vo.setProfitList(dataReportVos);
|
|
|
} else {
|
|
|
+ vo.setSort(NumberConstant.ZERO);
|
|
|
vo.setProfitList(new ArrayList<>());
|
|
|
}
|
|
|
list.add(vo);
|
|
@@ -1503,6 +1511,7 @@ public class CostDepartmentProfitServiceImpl extends ServiceImpl<CostDepartmentP
|
|
|
vo.setResponsibilityName(responseNameMap.get(k));
|
|
|
if (!CollectionUtils.isEmpty(v)) {
|
|
|
vo.setParentResponsibilityCode(v.get(0).getParentResponsibilityCode());
|
|
|
+ vo.setSort(v.get(0).getSort());
|
|
|
List<CommonDataReportVo> dataReportVos = new ArrayList<>();
|
|
|
for (CostProfitVo costProfitVo : v) {
|
|
|
CommonDataReportVo vo1 = new CommonDataReportVo();
|
|
@@ -1512,6 +1521,7 @@ public class CostDepartmentProfitServiceImpl extends ServiceImpl<CostDepartmentP
|
|
|
}
|
|
|
vo.setProfitList(dataReportVos);
|
|
|
} else {
|
|
|
+ vo.setSort(NumberConstant.ZERO);
|
|
|
vo.setProfitList(new ArrayList<>());
|
|
|
}
|
|
|
list1.add(vo);
|
|
@@ -1525,6 +1535,8 @@ public class CostDepartmentProfitServiceImpl extends ServiceImpl<CostDepartmentP
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ //按责任中心序号排序
|
|
|
+ costResponsibilityProfitVoSort(list);
|
|
|
response.setData(list);
|
|
|
|
|
|
//提取出最上层
|
|
@@ -1692,7 +1704,11 @@ public class CostDepartmentProfitServiceImpl extends ServiceImpl<CostDepartmentP
|
|
|
for (ReportForm reportForm : reportFormList) {
|
|
|
Integer hide = reportForm.getHide();
|
|
|
if(hide.equals(NumberConstant.ONE)){
|
|
|
- filterProfit.addAll(collect1.get(reportForm.getId()));
|
|
|
+// filterProfit.addAll(collect1.get(reportForm.getId()));
|
|
|
+ List<CostDepartmentProfit> costDepartmentProfits = collect1.get(reportForm.getId());
|
|
|
+ if(!CollectionUtils.isEmpty(costDepartmentProfits)) {
|
|
|
+ filterProfit.addAll(costDepartmentProfits);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1763,7 +1779,11 @@ public class CostDepartmentProfitServiceImpl extends ServiceImpl<CostDepartmentP
|
|
|
for (ReportForm reportForm : reportFormList) {
|
|
|
Integer hide = reportForm.getHide();
|
|
|
if(hide.equals(NumberConstant.ONE)){
|
|
|
- filterProfit.addAll(collect1.get(reportForm.getId()));
|
|
|
+// filterProfit.addAll(collect1.get(reportForm.getId()));
|
|
|
+ List<CostDepartmentProfit> costDepartmentProfits = collect1.get(reportForm.getId());
|
|
|
+ if(!CollectionUtils.isEmpty(costDepartmentProfits)) {
|
|
|
+ filterProfit.addAll(costDepartmentProfits);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1821,7 +1841,11 @@ public class CostDepartmentProfitServiceImpl extends ServiceImpl<CostDepartmentP
|
|
|
for (ReportForm reportForm : reportFormList) {
|
|
|
Integer hide = reportForm.getHide();
|
|
|
if(hide.equals(NumberConstant.ONE)){
|
|
|
- filterProfit.addAll(collect1.get(reportForm.getId()));
|
|
|
+// filterProfit.addAll(collect1.get(reportForm.getId()));
|
|
|
+ List<CostDepartmentProfit> costDepartmentProfits = collect1.get(reportForm.getId());
|
|
|
+ if(!CollectionUtils.isEmpty(costDepartmentProfits)) {
|
|
|
+ filterProfit.addAll(costDepartmentProfits);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
Map<Long, Integer> sortMap = reportFormList.stream().collect(Collectors.toMap(ReportForm::getId, ReportForm::getSort, (a, b) -> b));
|
|
@@ -2238,10 +2262,15 @@ public class CostDepartmentProfitServiceImpl extends ServiceImpl<CostDepartmentP
|
|
|
|
|
|
List<ReportFormCustomVo> costProfitVos1 = collect.get(0L);
|
|
|
collect.remove(NumberConstant.ZERO_L);
|
|
|
-
|
|
|
+ //最外层排序
|
|
|
+ if (!CollectionUtils.isEmpty(costProfitVos1)) {
|
|
|
+ costProfitVos1.sort(Comparator.comparing(ReportFormCustomVo::getSort, Comparator.nullsLast(Integer::compareTo)));
|
|
|
+ }
|
|
|
for (ReportFormCustomVo costProfitVo : costProfitVos1) {
|
|
|
List<ReportFormCustomVo> costProfitVo1 = collect.get(costProfitVo.getId());
|
|
|
if (!CollectionUtils.isEmpty(costProfitVo1)) {
|
|
|
+ //子项排序
|
|
|
+ costProfitVo1.sort(Comparator.comparing(ReportFormCustomVo::getSort, Comparator.nullsLast(Integer::compareTo)));
|
|
|
costProfitVo.setChildren(setCustomChildren(costProfitVo1, collect));
|
|
|
}
|
|
|
}
|
|
@@ -3098,4 +3127,13 @@ public class CostDepartmentProfitServiceImpl extends ServiceImpl<CostDepartmentP
|
|
|
}
|
|
|
T.sort(Comparator.comparing(CommonResponsibilityReportVo::getSort, Comparator.nullsLast(Integer::compareTo)));
|
|
|
}
|
|
|
+
|
|
|
+ private void costResponsibilityProfitVoSort(List<CostResponsibilityProfitVo> T) {
|
|
|
+ for (CostResponsibilityProfitVo responsibility : T) {
|
|
|
+ if (!CollectionUtils.isEmpty(responsibility.getChild())) {
|
|
|
+ costResponsibilityProfitVoSort(responsibility.getChild());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ T.sort(Comparator.comparing(CostResponsibilityProfitVo::getSort, Comparator.nullsLast(Integer::compareTo)));
|
|
|
+ }
|
|
|
}
|