解决多账户的明细合计的空bug

This commit is contained in:
jishenghua
2024-01-14 15:38:22 +08:00
parent 644abc7a14
commit 9f2dee507e

View File

@@ -331,15 +331,17 @@ public class AccountService {
List<DepotHead> dataList = accountMapperEx.getManyAccountSum(accountId, beginTime, endTime, forceFlag); List<DepotHead> dataList = accountMapperEx.getManyAccountSum(accountId, beginTime, endTime, forceFlag);
if (dataList != null) { if (dataList != null) {
for (DepotHead depotHead : dataList) { for (DepotHead depotHead : dataList) {
String accountIdList = depotHead.getAccountIdList(); if(depotHead != null) {
String accountMoneyList = depotHead.getAccountMoneyList(); String accountIdList = depotHead.getAccountIdList();
if(StringUtil.isNotEmpty(accountIdList) && StringUtil.isNotEmpty(accountMoneyList)) { String accountMoneyList = depotHead.getAccountMoneyList();
String[] aList = accountIdList.split(","); if(StringUtil.isNotEmpty(accountIdList) && StringUtil.isNotEmpty(accountMoneyList)) {
String[] amList = accountMoneyList.split(","); String[] aList = accountIdList.split(",");
for (int i = 0; i < aList.length; i++) { String[] amList = accountMoneyList.split(",");
if (aList[i].equals(accountId.toString())) { for (int i = 0; i < aList.length; i++) {
if(amList.length>0) { if (aList[i].equals(accountId.toString())) {
accountSum = accountSum.add(new BigDecimal(amList[i])); if(amList.length>0) {
accountSum = accountSum.add(new BigDecimal(amList[i]));
}
} }
} }
} }