首页统计修改

This commit is contained in:
梁琦涛
2023-12-29 14:42:23 +08:00
parent 1e4206ecb7
commit 90418697e9
3 changed files with 30 additions and 6 deletions
@@ -112,6 +112,18 @@ public class IndexService {
List<String> billMoneyMap = cumulativeProcesZero(list.stream().map(AllProjectStatistics::getBillMoney).collect(Collectors.toList()));
List<String> confirmAmountMap = cumulativeProcesZero(list.stream().map(AllProjectStatistics::getConfirmAmount).collect(Collectors.toList()));
List<String> allMoneyMap = cumulativeProcesZero(list.stream().map(AllProjectStatistics::getAllMoney).collect(Collectors.toList()));
// 预计到账金额
List<AllProjectStatistics> listEstimatedArrivalMoney = payWorkingGroupMapper.cumulativeListEstimatedArrivalMoney(allProjectStatisticsSearch.getPaymentYear());
// 累加金额
for (int i = 1; i < listEstimatedArrivalMoney.size(); i++) {
AllProjectStatistics obj = listEstimatedArrivalMoney.get(i);
AllProjectStatistics objLast = listEstimatedArrivalMoney.get(i-1);
BigDecimal n = new BigDecimal(obj.getEstimatedArrivalMoney());
BigDecimal l = new BigDecimal(objLast.getEstimatedArrivalMoney());
obj.setEstimatedArrivalMoney(n.add(l).toPlainString());
listEstimatedArrivalMoney.set(i,obj);
}
List<String> date = list.stream().map(AllProjectStatistics::getPaymentDate).collect(Collectors.toList());
List<String> dateList = new ArrayList<>(12);
for (String d : date) {
@@ -170,6 +182,9 @@ public class IndexService {
if (lineChartListVO.getComeAllMoney().equals("0.00")) {
lineChartListVO.setComeAllMoney(old.getComeAllMoney());
}
if (lineChartListVO.getEstimatedArrivalMoney().equals("0.00")) {
lineChartListVO.setEstimatedArrivalMoney(old.getEstimatedArrivalMoney());
}
}
return list;
}
@@ -2525,14 +2525,14 @@
<!-- 统计预计到账金额(应收金额) 预计到账日期 -->
<select id="cumulativeListEstimatedArrivalMoney"
resultType="com.jero.statistics.entity.AllProjectStatistics">
select DATE_FORMAT(paymentDate, '%Y-%m') as paymentDate,sum(comeAllMoney) as comeAllMoney from (
select receivable_amount as comeAllMoney,estimated_arrival_date as paymentDate from pay_common_project where DATE_FORMAT(estimated_arrival_date, '%Y') = '2023'
select DATE_FORMAT(paymentDate, '%Y-%m') as paymentDate,sum(estimatedArrivalMoney) as estimatedArrivalMoney from (
select receivable_amount as estimatedArrivalMoney,estimated_arrival_date as paymentDate from pay_common_project where DATE_FORMAT(estimated_arrival_date, '%Y') = #{paymentYear}
union all
select receivable_amount as comeAllMoney,estimated_arrival_date as paymentDate from pay_working_group_subitem where DATE_FORMAT(estimated_arrival_date, '%Y') = '2023'
select receivable_amount as estimatedArrivalMoney,estimated_arrival_date as paymentDate from pay_working_group_subitem where DATE_FORMAT(estimated_arrival_date, '%Y') = #{paymentYear}
union all
select amount_receivable as comeAllMoney,estimated_arrival_date as paymentDate from pay_meeting_situation where DATE_FORMAT(estimated_arrival_date, '%Y') = '2023'
select amount_receivable as estimatedArrivalMoney,estimated_arrival_date as paymentDate from pay_meeting_situation where DATE_FORMAT(estimated_arrival_date, '%Y') = #{paymentYear}
union all
select amount_receivable as comeAllMoney,estimated_arrival_date as paymentDate from pay_member_project_subitem where DATE_FORMAT(estimated_arrival_date, '%Y') = '2023'
select amount_receivable as estimatedArrivalMoney,estimated_arrival_date as paymentDate from pay_member_project_subitem where DATE_FORMAT(estimated_arrival_date, '%Y') = #{paymentYear}
) dataAll group by DATE_FORMAT(paymentDate, '%Y-%m') order by paymentDate
</select>
</mapper>
@@ -619,6 +619,15 @@ public class PayWorkingGroupServiceImpl extends ServiceImpl<PayWorkingGroupMappe
List<AllProjectStatistics> listComeAllMoney = payWorkingGroupMapper.cumulativeListComeAllMoney(allProjectStatisticsSearch.getPaymentYear());
// 预计到账金额
List<AllProjectStatistics> listEstimatedArrivalMoney = payWorkingGroupMapper.cumulativeListEstimatedArrivalMoney(allProjectStatisticsSearch.getPaymentYear());
// 累加金额
for (int i = 1; i < listEstimatedArrivalMoney.size(); i++) {
AllProjectStatistics obj = listEstimatedArrivalMoney.get(i);
AllProjectStatistics objLast = listEstimatedArrivalMoney.get(i-1);
BigDecimal n = new BigDecimal(obj.getEstimatedArrivalMoney());
BigDecimal l = new BigDecimal(objLast.getEstimatedArrivalMoney());
obj.setEstimatedArrivalMoney(n.add(l).toPlainString());
listEstimatedArrivalMoney.set(i,obj);
}
return getAllProjectMoneyStatistics(allProjectStatisticsSearch,allMoneyList,listConfirmAmount, listBillMoney,listComeAllMoney,listEstimatedArrivalMoney);
}
@@ -689,7 +698,7 @@ public class PayWorkingGroupServiceImpl extends ServiceImpl<PayWorkingGroupMappe
Map<String, String> confirmAmountMap = listConfirmAmount.stream().collect(Collectors.toMap(AllProjectStatistics::getPaymentDate, AllProjectStatistics::getConfirmAmount));
Map<String, String> billMoneyMap = listBillMoney.stream().collect(Collectors.toMap(AllProjectStatistics::getPaymentDate, AllProjectStatistics::getBillMoney));
Map<String, String> comeAllMoneyMap = listComeAllMoney.stream().collect(Collectors.toMap(AllProjectStatistics::getPaymentDate, AllProjectStatistics::getComeAllMoney));
Map<String, String> estimatedArrivalMoneyMap = listEstimatedArrivalMoney.stream().collect(Collectors.toMap(AllProjectStatistics::getPaymentDate, AllProjectStatistics::getComeAllMoney));
Map<String, String> estimatedArrivalMoneyMap = listEstimatedArrivalMoney.stream().collect(Collectors.toMap(AllProjectStatistics::getPaymentDate, AllProjectStatistics::getEstimatedArrivalMoney));
String paymentYear=allProjectStatisticsSearch.getPaymentYear();
List<String> yearMonth = getYearMonth(paymentYear);