update 财务中心 电费 服务费

This commit is contained in:
Guoqs
2025-07-14 16:09:59 +08:00
parent 54bd952894
commit 5b8bbac7d1
3 changed files with 37 additions and 14 deletions

View File

@@ -204,6 +204,8 @@ public class OrderSplitRecordServiceImpl implements OrderSplitRecordService {
summaryData.setOrderCount(orderCodeSet.size()); summaryData.setOrderCount(orderCodeSet.size());
BigDecimal totalSettleAmount = BigDecimal.ZERO; // 当天结算金额汇总 BigDecimal totalSettleAmount = BigDecimal.ZERO; // 当天结算金额汇总
BigDecimal totalMerchantSplitAmount = BigDecimal.ZERO; // 当天运营商分账金额汇总 BigDecimal totalMerchantSplitAmount = BigDecimal.ZERO; // 当天运营商分账金额汇总
BigDecimal totalMerchantElecAmount = BigDecimal.ZERO; // 当天运营商分账金额汇总
BigDecimal totalMerchantServiceAmount = BigDecimal.ZERO; // 当天运营商分账金额汇总
BigDecimal totalOtherSplitAmount = BigDecimal.ZERO; // 当天其他人分账金额汇总 BigDecimal totalOtherSplitAmount = BigDecimal.ZERO; // 当天其他人分账金额汇总
BigDecimal totalFeeAmount = BigDecimal.ZERO; // 当天手续费金额 BigDecimal totalFeeAmount = BigDecimal.ZERO; // 当天手续费金额
Map<String, List<OrderSplitRecord>> otherSplitDetailMap = Maps.newHashMap(); // 当天其他人分账的记录 Map<String, List<OrderSplitRecord>> otherSplitDetailMap = Maps.newHashMap(); // 当天其他人分账的记录
@@ -220,6 +222,8 @@ public class OrderSplitRecordServiceImpl implements OrderSplitRecordService {
// if (adapayMemberAccount != null && adapayMemberAccount.getAdapayMemberId().equals(record.getAdapayMemberId())) { // if (adapayMemberAccount != null && adapayMemberAccount.getAdapayMemberId().equals(record.getAdapayMemberId())) {
// record.getAdapayMemberId() 存在usedAdapayMemberIdList // record.getAdapayMemberId() 存在usedAdapayMemberIdList
if (CollectionUtils.isNotEmpty(usedAdapayMemberIdList) && usedAdapayMemberIdList.contains(record.getAdapayMemberId())) { if (CollectionUtils.isNotEmpty(usedAdapayMemberIdList) && usedAdapayMemberIdList.contains(record.getAdapayMemberId())) {
totalMerchantElecAmount = totalMerchantElecAmount.add(record.getElectricitySplitAmount());
totalMerchantServiceAmount = totalMerchantServiceAmount.add(record.getServiceSplitAmount());
totalMerchantSplitAmount = totalMerchantSplitAmount.add(record.getElectricitySplitAmount()).add(record.getServiceSplitAmount()); totalMerchantSplitAmount = totalMerchantSplitAmount.add(record.getElectricitySplitAmount()).add(record.getServiceSplitAmount());
} else { } else {
totalOtherSplitAmount = totalOtherSplitAmount.add(record.getElectricitySplitAmount()).add(record.getServiceSplitAmount()); totalOtherSplitAmount = totalOtherSplitAmount.add(record.getElectricitySplitAmount()).add(record.getServiceSplitAmount());
@@ -259,6 +263,8 @@ public class OrderSplitRecordServiceImpl implements OrderSplitRecordService {
summaryData.setTotalSettleAmount(totalSettleAmount); summaryData.setTotalSettleAmount(totalSettleAmount);
summaryData.setMerchantSplitAmount(totalMerchantSplitAmount); summaryData.setMerchantSplitAmount(totalMerchantSplitAmount);
summaryData.setMerchantFeeAmount(totalFeeAmount); summaryData.setMerchantFeeAmount(totalFeeAmount);
summaryData.setMerchantElecAmount(totalMerchantElecAmount);
summaryData.setMerchantServiceAmount(totalMerchantServiceAmount);
summaryData.setOtherSplitAmount(totalOtherSplitAmount); summaryData.setOtherSplitAmount(totalOtherSplitAmount);
resultList.add(summaryData); resultList.add(summaryData);
} }

View File

@@ -434,20 +434,7 @@ public class SettleOrderReportServiceImpl implements SettleOrderReportService {
totalAmount = totalAmount.add(amount); totalAmount = totalAmount.add(amount);
virtualAmount = virtualAmount.add(settleOrderReportVO.getVirtualAmount()); virtualAmount = virtualAmount.add(settleOrderReportVO.getVirtualAmount());
} }
// 用电度数
report.setUseElectricity(useElectricity);
// 充电次数
report.setChargeNum(chargeNum);
// 充电时长
report.setChargeTime(chargeTime);
// 电费金额
report.setElectricityAmount(electricityAmount);
// 服务费金额
report.setServiceAmount(serviceAmount);
// 收入金额
report.setTotalAmount(totalAmount);
// 虚拟金额
report.setVirtualAmount(virtualAmount);
// 从清分账单中计算交易金额,交易手续费 // 从清分账单中计算交易金额,交易手续费
GetClearingBillDTO clearingBillDTO = GetClearingBillDTO.builder() GetClearingBillDTO clearingBillDTO = GetClearingBillDTO.builder()
@@ -476,8 +463,28 @@ public class SettleOrderReportServiceImpl implements SettleOrderReportService {
.reduce(BigDecimal.ZERO, BigDecimal::add); .reduce(BigDecimal.ZERO, BigDecimal::add);
tradeFee = orderSplitDailySummaryData.stream().map(OrderSplitDailySummaryData::getMerchantFeeAmount) tradeFee = orderSplitDailySummaryData.stream().map(OrderSplitDailySummaryData::getMerchantFeeAmount)
.reduce(BigDecimal.ZERO, BigDecimal::add); .reduce(BigDecimal.ZERO, BigDecimal::add);
electricityAmount = orderSplitDailySummaryData.stream().map(OrderSplitDailySummaryData::getMerchantElecAmount)
.reduce(BigDecimal.ZERO, BigDecimal::add);
serviceAmount = orderSplitDailySummaryData.stream().map(OrderSplitDailySummaryData::getMerchantServiceAmount)
.reduce(BigDecimal.ZERO, BigDecimal::add);
} }
// 用电度数
report.setUseElectricity(useElectricity);
// 充电次数
report.setChargeNum(chargeNum);
// 充电时长
report.setChargeTime(chargeTime);
// 电费金额
report.setElectricityAmount(electricityAmount);
// 服务费金额
report.setServiceAmount(serviceAmount);
// 收入金额
report.setTotalAmount(totalAmount);
// 虚拟金额
report.setVirtualAmount(virtualAmount);
// 交易金额 // 交易金额
report.setTradeAmount(tradeAmount.subtract(tradeFee)); report.setTradeAmount(tradeAmount.subtract(tradeFee));
// 交易手续费 // 交易手续费

View File

@@ -47,6 +47,16 @@ public class OrderSplitDailySummaryData {
*/ */
private BigDecimal merchantFeeAmount; private BigDecimal merchantFeeAmount;
/**
* 本运营商总电费金额
*/
private BigDecimal merchantElecAmount;
/**
* 本运营商总服务费金额
*/
private BigDecimal merchantServiceAmount;
/** /**
* 他人分账金额(被分走的金额) * 他人分账金额(被分走的金额)
*/ */