|
@@ -21,12 +21,9 @@ import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
-import com.fjhx.fundAccount.FundAccount;
|
|
|
|
-import com.fjhx.fundAccount.FundAccountDetail;
|
|
|
|
-import com.fjhx.fundAccount.FundAccountDetailDemerge;
|
|
|
|
-import com.fjhx.fundAccount.FundAccountDetailMark;
|
|
|
|
-import com.fjhx.fundAccount.FundResult;
|
|
|
|
-import com.fjhx.fundAccount.InternalTransfer;
|
|
|
|
|
|
+import com.fjhx.fundAccount.*;
|
|
|
|
+import com.fjhx.fundAccount.entity.GetNewBalanceV2RewriteDto;
|
|
|
|
+import com.fjhx.fundAccount.entity.GetNewBalanceV2RewriteVo;
|
|
import com.fjhx.fundAccount.enums.CurrencyTypeEnum;
|
|
import com.fjhx.fundAccount.enums.CurrencyTypeEnum;
|
|
import com.fjhx.fundAccount.enums.DataSourceEnum;
|
|
import com.fjhx.fundAccount.enums.DataSourceEnum;
|
|
import com.fjhx.fundAccount.enums.FundDetailTypeEnum;
|
|
import com.fjhx.fundAccount.enums.FundDetailTypeEnum;
|
|
@@ -38,6 +35,7 @@ import com.fjhx.fundAccount.service.IFundAccountService;
|
|
import com.fjhx.moneydetails.entity.RequestPaymentMoneyDetails;
|
|
import com.fjhx.moneydetails.entity.RequestPaymentMoneyDetails;
|
|
import com.fjhx.moneydetails.service.IRequestPaymentMoneyDetailsService;
|
|
import com.fjhx.moneydetails.service.IRequestPaymentMoneyDetailsService;
|
|
import com.fjhx.settlementofexchange.entity.SettlementOfExchange;
|
|
import com.fjhx.settlementofexchange.entity.SettlementOfExchange;
|
|
|
|
+import com.fjhx.utils.Assert;
|
|
import com.fjhx.utils.TimeUtil;
|
|
import com.fjhx.utils.TimeUtil;
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
import org.apache.commons.collections4.MapUtils;
|
|
import org.apache.commons.collections4.MapUtils;
|
|
@@ -45,6 +43,7 @@ import org.apache.commons.lang3.StringUtils;
|
|
import org.springblade.common.enums.YesOrNoEnum;
|
|
import org.springblade.common.enums.YesOrNoEnum;
|
|
import org.springblade.common.utils.DateUtils;
|
|
import org.springblade.common.utils.DateUtils;
|
|
import org.springblade.core.log.exception.ServiceException;
|
|
import org.springblade.core.log.exception.ServiceException;
|
|
|
|
+import org.springblade.core.mp.base.BasicsEntity;
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
import org.springblade.core.tenant.annotation.TenantIgnore;
|
|
import org.springblade.core.tenant.annotation.TenantIgnore;
|
|
import org.springblade.core.tool.utils.BeanUtils;
|
|
import org.springblade.core.tool.utils.BeanUtils;
|
|
@@ -58,13 +57,7 @@ import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
-import java.util.ArrayList;
|
|
|
|
-import java.util.Arrays;
|
|
|
|
-import java.util.Date;
|
|
|
|
-import java.util.HashMap;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Map;
|
|
|
|
-import java.util.Optional;
|
|
|
|
|
|
+import java.util.*;
|
|
import java.util.function.Function;
|
|
import java.util.function.Function;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@@ -1107,13 +1100,15 @@ public class FundAccountDetailServiceImpl extends ServiceImpl<FundAccountDetailM
|
|
public List<FundAccount> newBalanceV2(Map<String, Object> condition) {
|
|
public List<FundAccount> newBalanceV2(Map<String, Object> condition) {
|
|
condition.put("tenantId", AuthUtil.getTenantId());
|
|
condition.put("tenantId", AuthUtil.getTenantId());
|
|
//查出所有银行
|
|
//查出所有银行
|
|
- List<FundAccount> accounts = Arrays.asList(iFundAccountService.getById(Func.toStr(condition.get("fromFundAccountId"))));
|
|
|
|
|
|
+ List<FundAccount> accounts = Collections.singletonList(iFundAccountService.getById(Func.toStr(condition.get("fromFundAccountId"))));
|
|
if (CollectionUtils.isEmpty(accounts)) {
|
|
if (CollectionUtils.isEmpty(accounts)) {
|
|
return new ArrayList<>();
|
|
return new ArrayList<>();
|
|
}
|
|
}
|
|
List<FundAccountDetail> fundAccountDetails = baseMapper.getCaGroupByFCV2(condition);
|
|
List<FundAccountDetail> fundAccountDetails = baseMapper.getCaGroupByFCV2(condition);
|
|
for (FundAccount f : accounts) {
|
|
for (FundAccount f : accounts) {
|
|
|
|
+
|
|
for (FundAccountDetail d : fundAccountDetails) {
|
|
for (FundAccountDetail d : fundAccountDetails) {
|
|
|
|
+
|
|
if (StringUtils.equals(d.getFromFundAccountId(), f.getId())) {
|
|
if (StringUtils.equals(d.getFromFundAccountId(), f.getId())) {
|
|
if (d.getCurrencyType() == CurrencyTypeEnum.RMB.getKey()) {
|
|
if (d.getCurrencyType() == CurrencyTypeEnum.RMB.getKey()) {
|
|
f.setRmb(d.getBalance());
|
|
f.setRmb(d.getBalance());
|
|
@@ -1123,6 +1118,7 @@ public class FundAccountDetailServiceImpl extends ServiceImpl<FundAccountDetailM
|
|
f.setEuro(d.getBalance());
|
|
f.setEuro(d.getBalance());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return accounts;
|
|
return accounts;
|
|
@@ -1155,7 +1151,7 @@ public class FundAccountDetailServiceImpl extends ServiceImpl<FundAccountDetailM
|
|
//先删除部门费用分拆旧数据
|
|
//先删除部门费用分拆旧数据
|
|
iFundAccountDetailDemergeService.remove(Wrappers.<FundAccountDetailDemerge>lambdaQuery().eq(FundAccountDetailDemerge::getFundAccountDetailId, entity.getId()));
|
|
iFundAccountDetailDemergeService.remove(Wrappers.<FundAccountDetailDemerge>lambdaQuery().eq(FundAccountDetailDemerge::getFundAccountDetailId, entity.getId()));
|
|
|
|
|
|
- //保存部门费用分拆新数据
|
|
|
|
|
|
+ // 保存部门费用分拆新数据
|
|
if (CollectionUtils.isNotEmpty(entity.getDemerges())) {
|
|
if (CollectionUtils.isNotEmpty(entity.getDemerges())) {
|
|
for (FundAccountDetailDemerge demerge : entity.getDemerges()) {
|
|
for (FundAccountDetailDemerge demerge : entity.getDemerges()) {
|
|
demerge.setFundAccountDetailId(entity.getId());
|
|
demerge.setFundAccountDetailId(entity.getId());
|
|
@@ -1164,4 +1160,257 @@ public class FundAccountDetailServiceImpl extends ServiceImpl<FundAccountDetailM
|
|
}
|
|
}
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<GetNewBalanceV2RewriteVo> getNewBalanceV2Rewrite(GetNewBalanceV2RewriteDto dto) {
|
|
|
|
+
|
|
|
|
+ String yearAndYear = dto.getYearAndYear();
|
|
|
|
+ Assert.notEmpty(yearAndYear, "日期不能为空");
|
|
|
|
+
|
|
|
|
+ // 统计开始时间
|
|
|
|
+ Date beginDate;
|
|
|
|
+ // 统计结束时间
|
|
|
|
+ Date endDate;
|
|
|
|
+ try {
|
|
|
|
+ beginDate = DateUtil.parse(yearAndYear, "yyyy-MM");
|
|
|
|
+ endDate = DateUtil.endOfMonth(beginDate);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ throw new ServiceException("日期格式不正确");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 查询出租户交易 账号id、账号名、账号、人民币余额、美元余额、欧元余额
|
|
|
|
+ List<FundAccount> accountList = iFundAccountService.list(Wrappers.<FundAccount>lambdaQuery()
|
|
|
|
+ .eq(FundAccount::getTenantId, AuthUtil.getTenantId())
|
|
|
|
+ .eq(FundAccount::getDelFleg, 0)
|
|
|
|
+ .select(BasicsEntity::getId, FundAccount::getName, FundAccount::getAccountNumber,
|
|
|
|
+ FundAccount::getRmbAmount, FundAccount::getDollarAmount, FundAccount::getEuroAmount));
|
|
|
|
+
|
|
|
|
+ if (accountList.size() == 0) {
|
|
|
|
+ return new ArrayList<>();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 账号id列表
|
|
|
|
+ List<String> accountIdList = accountList.stream().map(BasicsEntity::getId).collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ // 算出传入日期月末余额
|
|
|
|
+ this.updateAmountByEndDate(accountList, accountIdList, endDate);
|
|
|
|
+
|
|
|
|
+ // 获取指定月份收支,并封装成 Map<账号id,Map<日期,Map<货币类型,Map<收支类型(1:支出 2:收入),改变数量>>>> 格式
|
|
|
|
+ Map<String, Map<String, Map<Integer, Map<Integer, BigDecimal>>>> incomingAndOutgoingsByMonth =
|
|
|
|
+ this.getIncomingAndOutgoingsByMonth(accountIdList, beginDate, endDate);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ List<GetNewBalanceV2RewriteVo> result = accountList.stream().map(item -> {
|
|
|
|
+ GetNewBalanceV2RewriteVo vo = new GetNewBalanceV2RewriteVo();
|
|
|
|
+ vo.setId(item.getId());
|
|
|
|
+ vo.setName(item.getName());
|
|
|
|
+ vo.setAccountNumber(item.getAccountNumber());
|
|
|
|
+
|
|
|
|
+ // Map<日期,Map<货币类型,Map<收支类型(1:支出 2:收入),改变数量>>>
|
|
|
|
+ Map<String, Map<Integer, Map<Integer, BigDecimal>>> stringMapMap = incomingAndOutgoingsByMonth.get(item.getId());
|
|
|
|
+
|
|
|
|
+ String yearMonthDay = DateUtil.format(endDate, "yyyy-MM-dd");
|
|
|
|
+ String startYearMonthDayStr = DateUtil.format(DateUtil.offsetDay(beginDate, -1), "yyyy-MM-dd");
|
|
|
|
+ List<GetNewBalanceV2RewriteVo.Detail> detailList = new ArrayList<>();
|
|
|
|
+ int flag = -1;
|
|
|
|
+
|
|
|
|
+ if (stringMapMap == null) {
|
|
|
|
+ while (!yearMonthDay.equals(startYearMonthDayStr)) {
|
|
|
|
+ GetNewBalanceV2RewriteVo.Detail detail = new GetNewBalanceV2RewriteVo.Detail();
|
|
|
|
+ detail.setYearMonthDay(yearMonthDay);
|
|
|
|
+ detail.setRmbAmount(cn.hutool.core.util.ObjectUtil.defaultIfNull(item.getRmbAmount(), BigDecimal.ZERO));
|
|
|
|
+ detail.setRmbIncome(BigDecimal.ZERO);
|
|
|
|
+ detail.setRmbExpenditure(BigDecimal.ZERO);
|
|
|
|
+
|
|
|
|
+ detail.setDollarAmount(cn.hutool.core.util.ObjectUtil.defaultIfNull(item.getDollarAmount(), BigDecimal.ZERO));
|
|
|
|
+ detail.setDollarIncome(BigDecimal.ZERO);
|
|
|
|
+ detail.setDollarExpenditure(BigDecimal.ZERO);
|
|
|
|
+
|
|
|
|
+ detail.setEuroAmount(cn.hutool.core.util.ObjectUtil.defaultIfNull(item.getEuroAmount(), BigDecimal.ZERO));
|
|
|
|
+ detail.setEuroIncome(BigDecimal.ZERO);
|
|
|
|
+ detail.setEuroExpenditure(BigDecimal.ZERO);
|
|
|
|
+ detailList.add(detail);
|
|
|
|
+
|
|
|
|
+ yearMonthDay = DateUtil.format(DateUtil.offsetDay(endDate, flag), "yyyy-MM-dd");
|
|
|
|
+ flag--;
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ while (!yearMonthDay.equals(startYearMonthDayStr)) {
|
|
|
|
+ // Map<货币类型,Map<收支类型(1:支出 2:收入),改变数量>>
|
|
|
|
+ Map<Integer, Map<Integer, BigDecimal>> integerMapMap = stringMapMap.get(yearMonthDay);
|
|
|
|
+
|
|
|
|
+ GetNewBalanceV2RewriteVo.Detail detail = new GetNewBalanceV2RewriteVo.Detail();
|
|
|
|
+ detail.setYearMonthDay(yearMonthDay);
|
|
|
|
+
|
|
|
|
+ detail.setRmbAmount(cn.hutool.core.util.ObjectUtil.defaultIfNull(item.getRmbAmount(), BigDecimal.ZERO));
|
|
|
|
+ detail.setDollarAmount(cn.hutool.core.util.ObjectUtil.defaultIfNull(item.getDollarAmount(), BigDecimal.ZERO));
|
|
|
|
+ detail.setEuroAmount(cn.hutool.core.util.ObjectUtil.defaultIfNull(item.getEuroAmount(), BigDecimal.ZERO));
|
|
|
|
+ if (integerMapMap == null) {
|
|
|
|
+ detail.setRmbIncome(BigDecimal.ZERO);
|
|
|
|
+ detail.setRmbExpenditure(BigDecimal.ZERO);
|
|
|
|
+ detail.setDollarIncome(BigDecimal.ZERO);
|
|
|
|
+ detail.setDollarExpenditure(BigDecimal.ZERO);
|
|
|
|
+ detail.setEuroIncome(BigDecimal.ZERO);
|
|
|
|
+ detail.setEuroExpenditure(BigDecimal.ZERO);
|
|
|
|
+ } else {
|
|
|
|
+ // Map<收支类型(1:收入 2:支出),改变数量>
|
|
|
|
+ Map<Integer, BigDecimal> rmbMap = integerMapMap.get(CurrencyTypeEnum.RMB.getKey());
|
|
|
|
+ if (rmbMap == null) {
|
|
|
|
+ detail.setRmbIncome(BigDecimal.ZERO);
|
|
|
|
+ detail.setRmbExpenditure(BigDecimal.ZERO);
|
|
|
|
+ } else {
|
|
|
|
+ BigDecimal expenditure = cn.hutool.core.util.ObjectUtil.defaultIfNull(rmbMap.get(2), BigDecimal.ZERO);
|
|
|
|
+ BigDecimal income = cn.hutool.core.util.ObjectUtil.defaultIfNull(rmbMap.get(1), BigDecimal.ZERO);
|
|
|
|
+
|
|
|
|
+ detail.setRmbIncome(income);
|
|
|
|
+ detail.setRmbExpenditure(expenditure);
|
|
|
|
+
|
|
|
|
+ item.setRmbAmount(item.getRmbAmount().subtract(income).add(expenditure));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // Map<收支类型(1:收入 2:支出),改变数量>
|
|
|
|
+ Map<Integer, BigDecimal> dollarMap = integerMapMap.get(CurrencyTypeEnum.USA.getKey());
|
|
|
|
+ if (dollarMap == null) {
|
|
|
|
+ detail.setDollarIncome(BigDecimal.ZERO);
|
|
|
|
+ detail.setRmbExpenditure(BigDecimal.ZERO);
|
|
|
|
+ } else {
|
|
|
|
+ BigDecimal expenditure = cn.hutool.core.util.ObjectUtil.defaultIfNull(dollarMap.get(2), BigDecimal.ZERO);
|
|
|
|
+ BigDecimal income = cn.hutool.core.util.ObjectUtil.defaultIfNull(dollarMap.get(1), BigDecimal.ZERO);
|
|
|
|
+
|
|
|
|
+ detail.setDollarIncome(income);
|
|
|
|
+ detail.setDollarExpenditure(expenditure);
|
|
|
|
+
|
|
|
|
+ item.setDollarAmount(item.getDollarAmount().subtract(income).add(expenditure));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // Map<收支类型(1:收入 2:支出),改变数量>
|
|
|
|
+ Map<Integer, BigDecimal> euroMap = integerMapMap.get(CurrencyTypeEnum.EURO.getKey());
|
|
|
|
+ if (euroMap == null) {
|
|
|
|
+ detail.setEuroIncome(BigDecimal.ZERO);
|
|
|
|
+ detail.setEuroExpenditure(BigDecimal.ZERO);
|
|
|
|
+ } else {
|
|
|
|
+ BigDecimal expenditure = cn.hutool.core.util.ObjectUtil.defaultIfNull(euroMap.get(2), BigDecimal.ZERO);
|
|
|
|
+ BigDecimal income = cn.hutool.core.util.ObjectUtil.defaultIfNull(euroMap.get(1), BigDecimal.ZERO);
|
|
|
|
+
|
|
|
|
+ detail.setEuroIncome(income);
|
|
|
|
+ detail.setEuroExpenditure(expenditure);
|
|
|
|
+
|
|
|
|
+ item.setEuroAmount(item.getEuroAmount().subtract(income).add(expenditure));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ detailList.add(detail);
|
|
|
|
+
|
|
|
|
+ yearMonthDay = DateUtil.format(DateUtil.offsetDay(endDate, flag), "yyyy-MM-dd");
|
|
|
|
+ flag--;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ vo.setDetailList(detailList);
|
|
|
|
+ return vo;
|
|
|
|
+ }).collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 算出传入日期月末余额
|
|
|
|
+ */
|
|
|
|
+ private void updateAmountByEndDate(List<FundAccount> accountList, List<String> accountIdList, Date date) {
|
|
|
|
+
|
|
|
|
+ // 统计月份之后收支金额
|
|
|
|
+ List<FundAccountDetail> list = list(Wrappers.<FundAccountDetail>lambdaQuery()
|
|
|
|
+ .in(FundAccountDetail::getFromFundAccountId, accountIdList)
|
|
|
|
+ .gt(BasicsEntity::getCreateTime, date)
|
|
|
|
+ .select(FundAccountDetail::getType, FundAccountDetail::getCurrencyType,
|
|
|
|
+ FundAccountDetail::getFromFundAccountId, FundAccountDetail::getMoney)
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ // 封装成 Map<账号id,Map<货币类型,改变数量>> 格式
|
|
|
|
+ Map<String, Map<Integer, BigDecimal>> collect = list.stream().collect(Collectors.groupingBy(
|
|
|
|
+ // 账号id
|
|
|
|
+ FundAccountDetail::getFromFundAccountId,
|
|
|
|
+ Collectors.toMap(
|
|
|
|
+ // 货币类型
|
|
|
|
+ FundAccountDetail::getCurrencyType,
|
|
|
|
+ item -> {
|
|
|
|
+ Integer type = item.getType();
|
|
|
|
+ BigDecimal money = item.getMoney();
|
|
|
|
+ // 支出加
|
|
|
|
+ if (type == 2) {
|
|
|
|
+ return money;
|
|
|
|
+ }
|
|
|
|
+ // 收入减
|
|
|
|
+ else {
|
|
|
|
+ return BigDecimal.ZERO.subtract(money);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 统计
|
|
|
|
+ BigDecimal::add
|
|
|
|
+ )
|
|
|
|
+ ));
|
|
|
|
+
|
|
|
|
+ // 计算出改变之前的数量
|
|
|
|
+ for (FundAccount fundAccount : accountList) {
|
|
|
|
+ // 获取 Map<货币类型,改变数量> map
|
|
|
|
+ Map<Integer, BigDecimal> itemMap = collect.get(fundAccount.getId());
|
|
|
|
+ if (itemMap == null) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ BigDecimal rmbAmountChange = itemMap.get(CurrencyTypeEnum.RMB.getKey());
|
|
|
|
+ if (rmbAmountChange != null) {
|
|
|
|
+ fundAccount.setRmbAmount(fundAccount.getRmbAmount().add(rmbAmountChange));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ BigDecimal usaAmountChange = itemMap.get(CurrencyTypeEnum.USA.getKey());
|
|
|
|
+ if (usaAmountChange != null) {
|
|
|
|
+ fundAccount.setDollarAmount(fundAccount.getDollarAmount().add(usaAmountChange));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ BigDecimal euroAmountChange = itemMap.get(CurrencyTypeEnum.EURO.getKey());
|
|
|
|
+ if (euroAmountChange != null) {
|
|
|
|
+ fundAccount.setEuroAmount(fundAccount.getEuroAmount().add(euroAmountChange));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取指定月份收支,并封装成 Map<账号id,Map<日期,Map<货币类型,Map<收支类型(1:支出 2:收入),改变数量>>>> 格式
|
|
|
|
+ */
|
|
|
|
+ private Map<String, Map<String, Map<Integer, Map<Integer, BigDecimal>>>> getIncomingAndOutgoingsByMonth(
|
|
|
|
+ List<String> accountIdList, Date beginDate, Date endDate) {
|
|
|
|
+
|
|
|
|
+ // 统计月份之后收支金额
|
|
|
|
+ List<FundAccountDetail> list = list(Wrappers.<FundAccountDetail>lambdaQuery()
|
|
|
|
+ .in(FundAccountDetail::getFromFundAccountId, accountIdList)
|
|
|
|
+ .between(BasicsEntity::getCreateTime, beginDate, endDate)
|
|
|
|
+ .select(FundAccountDetail::getType, FundAccountDetail::getCurrencyType,
|
|
|
|
+ FundAccountDetail::getFromFundAccountId, FundAccountDetail::getMoney)
|
|
|
|
+ .orderByDesc(BasicsEntity::getCreateTime)
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ return list.stream().collect(Collectors.groupingBy(
|
|
|
|
+ // 账号id分组
|
|
|
|
+ FundAccountDetail::getFromFundAccountId,
|
|
|
|
+ Collectors.groupingBy(
|
|
|
|
+ // 日期分组
|
|
|
|
+ item -> DateUtil.format(item.getCreateTime(), "yyyy-MM-dd"),
|
|
|
|
+ Collectors.groupingBy(
|
|
|
|
+ // 货币类型
|
|
|
|
+ FundAccountDetail::getCurrencyType,
|
|
|
|
+ Collectors.toMap(
|
|
|
|
+ // 收支类型
|
|
|
|
+ FundAccountDetail::getType,
|
|
|
|
+ // 收支金额
|
|
|
|
+ FundAccountDetail::getMoney,
|
|
|
|
+ // 相加统计
|
|
|
|
+ BigDecimal::add
|
|
|
|
+ )
|
|
|
|
+ )
|
|
|
|
+ )
|
|
|
|
+ ));
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|