From 939614c2e2c616b418696cc6cc11a449abf9df92 Mon Sep 17 00:00:00 2001 From: "zhangxinah@yonyou.com" Date: Thu, 17 Apr 2025 15:46:07 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E7=A0=81=E6=A0=BC=E5=BC=8F=E8=BD=AC?= =?UTF-8?q?=E4=B8=BAGBK?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GatheringbillEditSaveBatchBSAction.java | 156 +++++++++--------- .../GatheringbillSaveBatchBSAction.java | 18 +- 2 files changed, 89 insertions(+), 85 deletions(-) diff --git a/arap/src/private/nc/bs/arap/actions/GatheringbillEditSaveBatchBSAction.java b/arap/src/private/nc/bs/arap/actions/GatheringbillEditSaveBatchBSAction.java index 5bf8ae8..92e08e1 100644 --- a/arap/src/private/nc/bs/arap/actions/GatheringbillEditSaveBatchBSAction.java +++ b/arap/src/private/nc/bs/arap/actions/GatheringbillEditSaveBatchBSAction.java @@ -22,89 +22,93 @@ import nc.vo.pub.lang.UFDouble; import java.util.Map; public class GatheringbillEditSaveBatchBSAction extends BillUpdateBatchBSAction { - public GatheringbillEditSaveBatchBSAction() { - this.validatorCode.add(5); - this.validatorCode.add(34); - this.validatorCode.add(57); - this.validatorCode.add(59); - this.validatorCode.add(62); - this.validatorCode.add(93); - this.validatorCode.add(94); - this.validatorCode.add(100); - this.validatorCode.remove(44); - } + public GatheringbillEditSaveBatchBSAction() { + this.validatorCode.add(5); + this.validatorCode.add(34); + this.validatorCode.add(57); + this.validatorCode.add(59); + this.validatorCode.add(62); + this.validatorCode.add(93); + this.validatorCode.add(94); + this.validatorCode.add(100); + this.validatorCode.remove(44); + } - protected void doBeforeUpdate(AggregatedValueObject[] bills, AggregatedValueObject[] orginBills) throws BusinessException { - ArapBillPubUtil.fillTradeTypeInfo(bills); + protected void doBeforeUpdate(AggregatedValueObject[] bills, AggregatedValueObject[] orginBills) + throws BusinessException { + ArapBillPubUtil.fillTradeTypeInfo(bills); - for(AggregatedValueObject bill : bills) { - ArapBillPubUtil.processMoneyOnlySum(bill); - } + for (AggregatedValueObject bill : bills) { + ArapBillPubUtil.processMoneyOnlySum(bill); + } - /** - * 收款单保存校验关联的销售订单实际收款金额是否超过价税合计 - */ - int i = 0; + /** + * տУ۶ʵտǷ񳬹˰ϼ + */ + int i = 0; - for(AggregatedValueObject bill : bills) { - AggregatedValueObject oriBill = orginBills[i++]; - BaseBillVO billVO = (BaseBillVO) bill.getParentVO(); //修改的收款单 - BaseBillVO billOriVO = (BaseBillVO) oriBill.getParentVO(); //之前的收款单 - UFDouble money = billVO.getMoney(); //修改后的金额 - UFDouble oriMoney = billOriVO.getMoney(); //修改前的金额 - String pk_tradetype = billVO.getPk_tradetype(); - if(!"F2-Cxx-02".equals(pk_tradetype)){ - continue; - } - String def3 = billVO.getDef3(); //收款单对应的销售订单id - if(StringUtil.isEmpty(def3) || "N".equals(def3) || "~".equals(def3)){ - //无绑定的销售订单则下一次循环 - continue; - } - //计算收款单金额差值 - UFDouble changeMoney = money.sub(oriMoney); - //根据销售订单id去查询销售订单 - BaseDAO dao = new BaseDAO(); - String sql = "select nreceivedmny,ntotalorigmny from so_saleorder where dr = 0 and csaleorderid = '" +def3+"'"; - Map saleMap = (Map)dao.executeQuery(sql, new MapProcessor()); - //销售订单价税合计 - UFDouble ntotalorigmny = UFDouble.ZERO_DBL; - //销售订单实际收款金额 - UFDouble nreceivedmny = UFDouble.ZERO_DBL; - if(saleMap != null) { - nreceivedmny = new UFDouble(saleMap.get("nreceivedmny") == null ? "0" : saleMap.get("nreceivedmny").toString()); - ntotalorigmny = new UFDouble(saleMap.get("ntotalorigmny") == null ? "0" : saleMap.get("ntotalorigmny").toString()); - } - UFDouble moreMoney = nreceivedmny.add(changeMoney).sub(ntotalorigmny); - if(nreceivedmny.add(changeMoney).compareTo(ntotalorigmny) > 0){ - throw new BusinessException("【该笔收款已超销售订单"+ moreMoney +"元,无法传输!请检查订单累计收款金额!】"); - } - } + for (AggregatedValueObject bill : bills) { + AggregatedValueObject oriBill = orginBills[i++]; + BaseBillVO billVO = (BaseBillVO) bill.getParentVO(); // ޸ĵտ + BaseBillVO billOriVO = (BaseBillVO) oriBill.getParentVO(); // ֮ǰտ + UFDouble money = billVO.getMoney(); // ޸ĺĽ + UFDouble oriMoney = billOriVO.getMoney(); // ޸ǰĽ + String pk_tradetype = billVO.getPk_tradetype(); + if (!"F2-Cxx-02".equals(pk_tradetype)) { + continue; + } + String def3 = billVO.getDef3(); // տӦ۶id + if (StringUtil.isEmpty(def3) || "N".equals(def3) || "~".equals(def3)) { + // ް󶨵۶һѭ + continue; + } + // տֵ + UFDouble changeMoney = money.sub(oriMoney); + // ۶idȥѯ۶ + BaseDAO dao = new BaseDAO(); + String sql = "select nreceivedmny,ntotalorigmny from so_saleorder where dr = 0 and csaleorderid = '" + def3 + + "'"; + Map saleMap = (Map) dao.executeQuery(sql, new MapProcessor()); + // ۶˰ϼ + UFDouble ntotalorigmny = UFDouble.ZERO_DBL; + // ۶ʵտ + UFDouble nreceivedmny = UFDouble.ZERO_DBL; + if (saleMap != null) { + nreceivedmny = new UFDouble( + saleMap.get("nreceivedmny") == null ? "0" : saleMap.get("nreceivedmny").toString()); + ntotalorigmny = new UFDouble( + saleMap.get("ntotalorigmny") == null ? "0" : saleMap.get("ntotalorigmny").toString()); + } + UFDouble moreMoney = nreceivedmny.add(changeMoney).sub(ntotalorigmny); + if (nreceivedmny.add(changeMoney).compareTo(ntotalorigmny) > 0) { + throw new BusinessException("ñտѳ۶" + moreMoney + "Ԫ޷䣡鶩ۼտ"); + } + } - ArapBillVOUtils.prepareDefaultInfo(bills, true); - BillDateUtils.setBillDateByNow(bills); - int updateType = this.getUpdateType(bills, orginBills); + ArapBillVOUtils.prepareDefaultInfo(bills, true); + BillDateUtils.setBillDateByNow(bills); + int updateType = this.getUpdateType(bills, orginBills); - for(AggregatedValueObject bill : bills) { - bill.getParentVO().setStatus(1); - } + for (AggregatedValueObject bill : bills) { + bill.getParentVO().setStatus(1); + } - if (updateType == TEMP_2_SAVE || updateType == SAVE_2_SAVE) { - for(AggregatedValueObject bill : bills) { - for(CircularlyAccessibleValueObject item : bill.getChildrenVO()) { - if (item.getStatus() != 2 && item.getStatus() != 3) { - item.setStatus(1); - } - } - } - } + if (updateType == TEMP_2_SAVE || updateType == SAVE_2_SAVE) { + for (AggregatedValueObject bill : bills) { + for (CircularlyAccessibleValueObject item : bill.getChildrenVO()) { + if (item.getStatus() != 2 && item.getStatus() != 3) { + item.setStatus(1); + } + } + } + } - if (updateType == TEMP_2_SAVE || updateType == SAVE_2_SAVE) { - BillAccountCalendarUtils.setAccperiodYearMonth(bills); - } + if (updateType == TEMP_2_SAVE || updateType == SAVE_2_SAVE) { + BillAccountCalendarUtils.setAccperiodYearMonth(bills); + } - this.checkIsCorrdBillMoneyControl(bills, orginBills); - this.checkOtherSystemBill(bills, orginBills); - (new CrossRuleCheckValidator()).validate(bills); - } + this.checkIsCorrdBillMoneyControl(bills, orginBills); + this.checkOtherSystemBill(bills, orginBills); + (new CrossRuleCheckValidator()).validate(bills); + } } diff --git a/arap/src/private/nc/bs/arap/actions/GatheringbillSaveBatchBSAction.java b/arap/src/private/nc/bs/arap/actions/GatheringbillSaveBatchBSAction.java index 70c8334..fd55a8b 100644 --- a/arap/src/private/nc/bs/arap/actions/GatheringbillSaveBatchBSAction.java +++ b/arap/src/private/nc/bs/arap/actions/GatheringbillSaveBatchBSAction.java @@ -59,29 +59,29 @@ public class GatheringbillSaveBatchBSAction extends BillInsertBatchBSAction { ArapBillVOUtils.setDefaultSettleFlag(bills); /** - * 收款单保存校验关联的销售订单实际收款金额是否超过价税合计 + * տУ۶ʵտǷ񳬹˰ϼ */ for(AggregatedValueObject bill : bills) { - BaseBillVO billVO = (BaseBillVO) bill.getParentVO(); //修改的收款单 - UFDouble money = billVO.getMoney(); //金额 + BaseBillVO billVO = (BaseBillVO) bill.getParentVO(); //޸ĵտ + UFDouble money = billVO.getMoney(); // String pk_tradetype = billVO.getPk_tradetype(); if(!"F2-Cxx-02".equals(pk_tradetype)){ continue; } - String def3 = billVO.getDef3(); //收款单对应的销售订单id + String def3 = billVO.getDef3(); //տӦ۶id if(StringUtil.isEmpty(def3) || "N".equals(def3) || "~".equals(def3)){ - //无绑定的销售订单则下一次循环 + //ް󶨵۶һѭ continue; } - //根据销售订单id去查询销售订单 + //۶idȥѯ۶ BaseDAO dao = new BaseDAO(); String sql = "select nreceivedmny,ntotalorigmny from so_saleorder where dr = 0 and csaleorderid = '" +def3+"'"; Map saleMap = (Map)dao.executeQuery(sql, new MapProcessor()); - //销售订单价税合计 + //۶˰ϼ UFDouble ntotalorigmny = UFDouble.ZERO_DBL; - //销售订单实际收款金额 + //۶ʵտ UFDouble nreceivedmny = UFDouble.ZERO_DBL; if(saleMap != null) { nreceivedmny = new UFDouble(saleMap.get("nreceivedmny") == null ? "0" : saleMap.get("nreceivedmny").toString()); @@ -89,7 +89,7 @@ public class GatheringbillSaveBatchBSAction extends BillInsertBatchBSAction { } UFDouble moreMoney = nreceivedmny.add(money).sub(ntotalorigmny); if(nreceivedmny.add(money).compareTo(ntotalorigmny) > 0){ - throw new BusinessException("【该笔收款已超销售订单"+ moreMoney +"元,无法传输!请检查订单累计收款金额!】"); + throw new BusinessException("ñտѳ۶"+ moreMoney +"Ԫ޷䣡鶩ۼտ"); } } }