From 7b8bdc0410756e6fb448df8203b5f945b97eec12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Wed, 6 Dec 2023 23:25:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=A0=B9=E6=8D=AE=E5=8E=9F?= =?UTF-8?q?=E5=8D=95=E5=8F=B7=E6=9F=A5=E8=AF=A2=E5=85=B3=E8=81=94=E7=9A=84?= =?UTF-8?q?=E5=8D=95=E6=8D=AE=E5=88=97=E8=A1=A8=E7=9A=84=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/depotHead/DepotHeadService.java | 48 +------------------ 1 file changed, 2 insertions(+), 46 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 b2b959e1..7e0fa5bd 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 @@ -877,7 +877,7 @@ public class DepotHeadService { public List getBillListByLinkNumberList(List linkNumberList)throws Exception { if(linkNumberList!=null && linkNumberList.size()>0) { DepotHeadExample example = new DepotHeadExample(); - example.createCriteria().andLinkNumberIn(linkNumberList).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + example.createCriteria().andLinkNumberIn(linkNumberList).andSubTypeLike("退货").andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); return depotHeadMapper.selectByExample(example); } else { return new ArrayList<>(); @@ -892,19 +892,7 @@ public class DepotHeadService { */ public List getBillListByLinkNumber(String linkNumber)throws Exception { DepotHeadExample example = new DepotHeadExample(); - example.createCriteria().andLinkNumberEqualTo(linkNumber).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); - return depotHeadMapper.selectByExample(example); - } - - /** - * 根据原单号查询关联的单据列表(排除当前的单据编号) - * @param linkNumber - * @return - * @throws Exception - */ - public List getBillListByLinkNumberExceptNumber(String linkNumber, String number)throws Exception { - DepotHeadExample example = new DepotHeadExample(); - example.createCriteria().andLinkNumberEqualTo(linkNumber).andNumberNotEqualTo(number).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); + example.createCriteria().andLinkNumberEqualTo(linkNumber).andSubTypeLike("退货").andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED); return depotHeadMapper.selectByExample(example); } @@ -1102,38 +1090,6 @@ public class DepotHeadService { ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest()); } - /** - * 退货单对应的原单实际欠款(这里面要除去收付款的金额) - * @param linkNumber 原单单号 - * @param number 当前单号 - * @return - */ - public BigDecimal getOriginalRealDebt(String linkNumber, String number) throws Exception { - DepotHead depotHead = getDepotHead(linkNumber); - BigDecimal discountLastMoney = depotHead.getDiscountLastMoney()!=null?depotHead.getDiscountLastMoney():BigDecimal.ZERO; - BigDecimal otherMoney = depotHead.getOtherMoney()!=null?depotHead.getOtherMoney():BigDecimal.ZERO; - BigDecimal deposit = depotHead.getDeposit()!=null?depotHead.getDeposit():BigDecimal.ZERO; - BigDecimal changeAmount = depotHead.getChangeAmount()!=null?depotHead.getChangeAmount().abs():BigDecimal.ZERO; - //原单欠款 - BigDecimal debt = discountLastMoney.add(otherMoney).subtract((deposit.add(changeAmount))); - //完成欠款 - BigDecimal finishDebt = accountItemService.getEachAmountByBillId(depotHead.getId()); - finishDebt = finishDebt!=null?finishDebt:BigDecimal.ZERO; - //原单对应的退货单欠款(总数) - List billList = getBillListByLinkNumberExceptNumber(linkNumber, number); - BigDecimal allBillDebt = BigDecimal.ZERO; - for(DepotHead dh: billList) { - BigDecimal billDiscountLastMoney = dh.getDiscountLastMoney()!=null?dh.getDiscountLastMoney():BigDecimal.ZERO; - BigDecimal billOtherMoney = dh.getOtherMoney()!=null?dh.getOtherMoney():BigDecimal.ZERO; - BigDecimal billDeposit = dh.getDeposit()!=null?dh.getDeposit():BigDecimal.ZERO; - BigDecimal billChangeAmount = dh.getChangeAmount()!=null?dh.getChangeAmount().abs():BigDecimal.ZERO; - BigDecimal billDebt = billDiscountLastMoney.add(billOtherMoney).subtract((billDeposit.add(billChangeAmount))); - allBillDebt = allBillDebt.add(billDebt); - } - //原单实际欠款 - return debt.subtract(finishDebt).subtract(allBillDebt); - } - public Map getBuyAndSaleStatistics(String today, String monthFirstDay, String yesterdayBegin, String yesterdayEnd, String yearBegin, String yearEnd, HttpServletRequest request) throws Exception { Long userId = userService.getUserId(request);