From 923cc423de52da8d2059b820f75f54ee4e73f204 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Thu, 4 May 2023 21:50:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=8E=A5=E5=8F=A3=EF=BC=9A?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E7=BC=96=E5=8F=B7=E6=9F=A5=E8=AF=A2=E5=8D=95?= =?UTF-8?q?=E6=8D=AE=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/depotHead/DepotHeadService.java | 90 ++++++++++--------- 1 file changed, 48 insertions(+), 42 deletions(-) diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java b/jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java index 91a0cbb0..eaf11272 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java @@ -162,8 +162,9 @@ public class DepotHeadService { //欠款计算 BigDecimal discountLastMoney = dh.getDiscountLastMoney()!=null?dh.getDiscountLastMoney():BigDecimal.ZERO; BigDecimal otherMoney = dh.getOtherMoney()!=null?dh.getOtherMoney():BigDecimal.ZERO; + BigDecimal deposit = dh.getDeposit()!=null?dh.getDeposit():BigDecimal.ZERO; BigDecimal changeAmount = dh.getChangeAmount()!=null?dh.getChangeAmount():BigDecimal.ZERO; - dh.setDebt(discountLastMoney.add(otherMoney).subtract((dh.getDeposit().add(changeAmount)))); + dh.setDebt(discountLastMoney.add(otherMoney).subtract((deposit.add(changeAmount)))); //是否有付款单或收款单 if(financialBillNoMap!=null) { Integer financialBillNoSize = financialBillNoMap.get(dh.getId()); @@ -729,48 +730,53 @@ public class DepotHeadService { Map financialBillNoMap = getFinancialBillNoMapByBillIdList(idList); Map billSizeMap = getBillSizeMapByLinkNumberList(numberList); Map materialsListMap = findMaterialsListMapByHeaderIdList(idList); - for (DepotHeadVo4List dh : list) { - if(accountMap!=null && StringUtil.isNotEmpty(dh.getAccountIdList()) && StringUtil.isNotEmpty(dh.getAccountMoneyList())) { - String accountStr = accountService.getAccountStrByIdAndMoney(accountMap, dh.getAccountIdList(), dh.getAccountMoneyList()); - dh.setAccountName(accountStr); - } - if(dh.getAccountIdList() != null) { - String accountidlistStr = dh.getAccountIdList().replace("[", "").replace("]", "").replaceAll("\"", ""); - dh.setAccountIdList(accountidlistStr); - } - if(dh.getAccountMoneyList() != null) { - String accountmoneylistStr = dh.getAccountMoneyList().replace("[", "").replace("]", "").replaceAll("\"", ""); - dh.setAccountMoneyList(accountmoneylistStr); - } - if(dh.getChangeAmount() != null) { - dh.setChangeAmount(dh.getChangeAmount().abs()); - } - if(dh.getTotalPrice() != null) { - dh.setTotalPrice(dh.getTotalPrice().abs()); - } - //是否有付款单或收款单 - if(financialBillNoMap!=null) { - Integer financialBillNoSize = financialBillNoMap.get(dh.getId()); - dh.setHasFinancialFlag(financialBillNoSize!=null && financialBillNoSize>0); - } - //是否有退款单 - if(billSizeMap!=null) { - Integer billListSize = billSizeMap.get(dh.getNumber()); - dh.setHasBackFlag(billListSize!=null && billListSize>0); - } - if(StringUtil.isNotEmpty(dh.getSalesMan())) { - dh.setSalesManStr(personService.getPersonByMapAndIds(personMap,dh.getSalesMan())); - } - if(dh.getOperTime() != null) { - dh.setOperTimeStr(getCenternTime(dh.getOperTime())); - } - //商品信息简述 - if(materialsListMap!=null) { - dh.setMaterialsList(materialsListMap.get(dh.getId())); - } - dh.setCreatorName(userService.getUser(dh.getCreator()).getUsername()); - resList.add(dh); + DepotHeadVo4List dh = list.get(0); + if(accountMap!=null && StringUtil.isNotEmpty(dh.getAccountIdList()) && StringUtil.isNotEmpty(dh.getAccountMoneyList())) { + String accountStr = accountService.getAccountStrByIdAndMoney(accountMap, dh.getAccountIdList(), dh.getAccountMoneyList()); + dh.setAccountName(accountStr); } + if(dh.getAccountIdList() != null) { + String accountidlistStr = dh.getAccountIdList().replace("[", "").replace("]", "").replaceAll("\"", ""); + dh.setAccountIdList(accountidlistStr); + } + if(dh.getAccountMoneyList() != null) { + String accountmoneylistStr = dh.getAccountMoneyList().replace("[", "").replace("]", "").replaceAll("\"", ""); + dh.setAccountMoneyList(accountmoneylistStr); + } + if(dh.getChangeAmount() != null) { + dh.setChangeAmount(dh.getChangeAmount().abs()); + } + if(dh.getTotalPrice() != null) { + dh.setTotalPrice(dh.getTotalPrice().abs()); + } + //欠款计算 + BigDecimal discountLastMoney = dh.getDiscountLastMoney()!=null?dh.getDiscountLastMoney():BigDecimal.ZERO; + BigDecimal otherMoney = dh.getOtherMoney()!=null?dh.getOtherMoney():BigDecimal.ZERO; + BigDecimal deposit = dh.getDeposit()!=null?dh.getDeposit():BigDecimal.ZERO; + BigDecimal changeAmount = dh.getChangeAmount()!=null?dh.getChangeAmount():BigDecimal.ZERO; + dh.setDebt(discountLastMoney.add(otherMoney).subtract((deposit.add(changeAmount)))); + //是否有付款单或收款单 + if(financialBillNoMap!=null) { + Integer financialBillNoSize = financialBillNoMap.get(dh.getId()); + dh.setHasFinancialFlag(financialBillNoSize!=null && financialBillNoSize>0); + } + //是否有退款单 + if(billSizeMap!=null) { + Integer billListSize = billSizeMap.get(dh.getNumber()); + dh.setHasBackFlag(billListSize!=null && billListSize>0); + } + if(StringUtil.isNotEmpty(dh.getSalesMan())) { + dh.setSalesManStr(personService.getPersonByMapAndIds(personMap,dh.getSalesMan())); + } + if(dh.getOperTime() != null) { + dh.setOperTimeStr(getCenternTime(dh.getOperTime())); + } + //商品信息简述 + if(materialsListMap!=null) { + dh.setMaterialsList(materialsListMap.get(dh.getId())); + } + dh.setCreatorName(userService.getUser(dh.getCreator()).getUsername()); + resList.add(dh); } }catch(Exception e){ JshException.readFail(logger, e);