首页-全所收入统计(累计);

首页-全所收入统计(单月);
This commit is contained in:
梁琦涛
2023-12-27 17:24:28 +08:00
parent 7c6e35558f
commit ed1d64c49a
6 changed files with 42 additions and 8 deletions
@@ -1,10 +1,9 @@
package com.jero.index.service;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.jero.common.system.api.ISysBaseAPI;
import com.jero.common.system.vo.DictModel;
import com.jero.index.dto.YearMoneyDTO;
@@ -19,7 +18,6 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.*;
import java.util.stream.Collectors;
@@ -78,6 +76,8 @@ public class IndexService {
lineChartListVO.setBillMoney(reduce2.toString());
BigDecimal reduce3 = lineChartListVOList.stream().map(i -> new BigDecimal(i.getComeAllMoney())).reduce(BigDecimal.ZERO, BigDecimal::add);
lineChartListVO.setComeAllMoney(reduce3.toString());
BigDecimal reduce4 = lineChartListVOList.stream().map(i -> new BigDecimal(i.getEstimatedArrivalMoney())).reduce(BigDecimal.ZERO, BigDecimal::add);
lineChartListVO.setEstimatedArrivalMoney(reduce4.toString());
lineChartListVO.setPaymentDate("总数");
lineChartListVOList.add(lineChartListVO);
return lineChartListVOList;
@@ -99,6 +99,7 @@ public class IndexService {
lineChartListVO.setBillMoney(allProjectStatistics.getBillMoney());
lineChartListVO.setComeAllMoney(allProjectStatistics.getComeAllMoney());
lineChartListVO.setPaymentDate(allProjectStatistics.getPaymentDate());
lineChartListVO.setEstimatedArrivalMoney(allProjectStatistics.getEstimatedArrivalMoney());
return lineChartListVO;
}
@@ -24,4 +24,6 @@ public class LineChartListVO {
@ApiModelProperty(value = "到账时间")
private String paymentDate;
@ApiModelProperty(value = "预计到账金额")
private String estimatedArrivalMoney;
}
@@ -242,6 +242,8 @@ public interface PayWorkingGroupMapper extends BaseMapper<PayWorkingGroup> {
List<AllProjectStatistics> cumulativeListComeAllMoney(@Param("paymentYear") String paymentYear);
List<AllProjectStatistics> cumulativeListEstimatedArrivalMoney(@Param("paymentYear") String paymentYear);
BigDecimal invoiceAmount(@Param("start") Integer start, @Param("end") Integer end, @Param("departCode") String departCode);
IPage<AllProjectStatisticsOther> invoiceAmountList(Page<AllProjectStatistics> page, @Param("start") Integer start, @Param("end") Integer end, @Param("departCode") String departCode, @Param("column") String column, @Param("order") String order);
@@ -2522,4 +2522,17 @@
</where>
) a
</select>
<!-- 统计预计到账金额(应收金额) 预计到账日期 -->
<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'
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'
union all
select amount_receivable as comeAllMoney,estimated_arrival_date as paymentDate from pay_meeting_situation where DATE_FORMAT(estimated_arrival_date, '%Y') = '2023'
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'
) dataAll group by DATE_FORMAT(paymentDate, '%Y-%m') order by paymentDate
</select>
</mapper>
@@ -606,7 +606,9 @@ public class PayWorkingGroupServiceImpl extends ServiceImpl<PayWorkingGroupMappe
List<AllProjectStatistics> listConfirmAmount = payWorkingGroupMapper.queryListConfirmAmount(allProjectStatisticsSearch);
List<AllProjectStatistics> listBillMoney = payWorkingGroupMapper.queryListBillMoney(allProjectStatisticsSearch);
List<AllProjectStatistics> listComeAllMoney = payWorkingGroupMapper.queryListComeAllMoney(allProjectStatisticsSearch);
return getAllProjectMoneyStatistics(allProjectStatisticsSearch,allMoneyList,listConfirmAmount, listBillMoney,listComeAllMoney);
// 预计到账金额
List<AllProjectStatistics> listEstimatedArrivalMoney = payWorkingGroupMapper.cumulativeListEstimatedArrivalMoney(allProjectStatisticsSearch.getPaymentYear());
return getAllProjectMoneyStatistics(allProjectStatisticsSearch,allMoneyList,listConfirmAmount, listBillMoney,listComeAllMoney,listEstimatedArrivalMoney);
}
@Override
@@ -615,7 +617,9 @@ public class PayWorkingGroupServiceImpl extends ServiceImpl<PayWorkingGroupMappe
List<AllProjectStatistics> listConfirmAmount = payWorkingGroupMapper.cumulativeListConfirmAmount(allProjectStatisticsSearch.getPaymentYear());
List<AllProjectStatistics> listBillMoney = payWorkingGroupMapper.cumulativeListBillMoney(allProjectStatisticsSearch.getPaymentYear());
List<AllProjectStatistics> listComeAllMoney = payWorkingGroupMapper.cumulativeListComeAllMoney(allProjectStatisticsSearch.getPaymentYear());
return getAllProjectMoneyStatistics(allProjectStatisticsSearch,allMoneyList,listConfirmAmount, listBillMoney,listComeAllMoney);
// 预计到账金额
List<AllProjectStatistics> listEstimatedArrivalMoney = payWorkingGroupMapper.cumulativeListEstimatedArrivalMoney(allProjectStatisticsSearch.getPaymentYear());
return getAllProjectMoneyStatistics(allProjectStatisticsSearch,allMoneyList,listConfirmAmount, listBillMoney,listComeAllMoney,listEstimatedArrivalMoney);
}
@Override
@@ -625,7 +629,9 @@ public class PayWorkingGroupServiceImpl extends ServiceImpl<PayWorkingGroupMappe
List<AllProjectStatistics> listBillMoney = payWorkingGroupMapper.queryListBillMoney(allProjectStatisticsSearch);
List<AllProjectStatistics> listComeAllMoney = payWorkingGroupMapper.queryListComeAllMoney(allProjectStatisticsSearch);
List<AllProjectStatistics> list2=getAllProjectMoneyStatistics(allProjectStatisticsSearch,allMoneyList,listConfirmAmount, listBillMoney,listComeAllMoney);
// 预计到账金额
List<AllProjectStatistics> listEstimatedArrivalMoney = payWorkingGroupMapper.cumulativeListEstimatedArrivalMoney(allProjectStatisticsSearch.getPaymentYear());
List<AllProjectStatistics> list2=getAllProjectMoneyStatistics(allProjectStatisticsSearch,allMoneyList,listConfirmAmount, listBillMoney,listComeAllMoney,listEstimatedArrivalMoney);
AllMoney allMoney=payWorkingGroupMapper.queryPageList33(allProjectStatisticsSearch, idList);
List<String> comeAllMoneyList=list2.stream().map(AllProjectStatistics::getComeAllMoney).collect(Collectors.toList());
@@ -677,11 +683,13 @@ public class PayWorkingGroupServiceImpl extends ServiceImpl<PayWorkingGroupMappe
List<AllProjectStatistics> allMoneyList,
List<AllProjectStatistics> listConfirmAmount,
List<AllProjectStatistics> listBillMoney,
List<AllProjectStatistics> listComeAllMoney) {
List<AllProjectStatistics> listComeAllMoney,
List<AllProjectStatistics> listEstimatedArrivalMoney) {
Map<String, String> allMoneyMap = allMoneyList.stream().collect(Collectors.toMap(AllProjectStatistics::getPaymentDate, AllProjectStatistics::getAllMoney));
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));
String paymentYear=allProjectStatisticsSearch.getPaymentYear();
List<String> yearMonth = getYearMonth(paymentYear);
@@ -692,6 +700,7 @@ public class PayWorkingGroupServiceImpl extends ServiceImpl<PayWorkingGroupMappe
allProjectStatistics.setConfirmAmount("0.00");
allProjectStatistics.setBillMoney("0.00");
allProjectStatistics.setComeAllMoney("0.00");
allProjectStatistics.setEstimatedArrivalMoney("0.00");
allProjectStatistics.setPaymentDate(date);
returnList.add(allProjectStatistics);
}
@@ -709,6 +718,9 @@ public class PayWorkingGroupServiceImpl extends ServiceImpl<PayWorkingGroupMappe
if (allMoneyMap.containsKey(paymentDate)) {
allProjectStatistics.setAllMoney(allMoneyMap.get(paymentDate));
}
if (estimatedArrivalMoneyMap.containsKey(paymentDate)) {
allProjectStatistics.setEstimatedArrivalMoney(estimatedArrivalMoneyMap.get(paymentDate));
}
}
return returnList;
}
@@ -80,6 +80,10 @@ public class AllProjectStatistics {
@ApiModelProperty(value = "项目年份")
private String year;
@ApiModelProperty(value = "预计到账金额")
private String estimatedArrivalMoney;
public AllProjectStatistics(String allMoney, String confirmAmount, String billMoney, String comeAllMoney, String paymentDate) {
this.allMoney=allMoney;