From 05dbdf89641be10c93856da0d967145b1ce22e57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Tue, 18 Feb 2020 00:21:20 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E7=BB=93=E7=AE=97=E8=B4=A6?= =?UTF-8?q?=E6=88=B7=E6=95=B0=E6=8D=AE=E6=98=BE=E7=A4=BA=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../erp/service/account/AccountService.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/jsh/erp/service/account/AccountService.java b/src/main/java/com/jsh/erp/service/account/AccountService.java index c05a6071..8adc091b 100644 --- a/src/main/java/com/jsh/erp/service/account/AccountService.java +++ b/src/main/java/com/jsh/erp/service/account/AccountService.java @@ -388,13 +388,17 @@ public class AccountService { for (DepotHead depotHead : dataList) { String accountIdList = depotHead.getAccountidlist(); String accountMoneyList = depotHead.getAccountmoneylist(); - accountIdList = accountIdList.replace("[", "").replace("]", "").replace("\"", ""); - accountMoneyList = accountMoneyList.replace("[", "").replace("]", "").replace("\"", ""); - String[] aList = accountIdList.split(","); - String[] amList = accountMoneyList.split(","); - for (int i = 0; i < aList.length; i++) { - if (aList[i].toString().equals(id.toString())) { - accountSum = accountSum .add(new BigDecimal(amList[i])); + if(StringUtil.isNotEmpty(accountIdList) && StringUtil.isNotEmpty(accountMoneyList)) { + accountIdList = accountIdList.replace("[", "").replace("]", "").replace("\"", ""); + accountMoneyList = accountMoneyList.replace("[", "").replace("]", "").replace("\"", ""); + String[] aList = accountIdList.split(","); + String[] amList = accountMoneyList.split(","); + for (int i = 0; i < aList.length; i++) { + if (aList[i].toString().equals(id.toString())) { + if(amList!=null && amList.length>0) { + accountSum = accountSum.add(new BigDecimal(amList[i])); + } + } } } }