From 5fe89369d620176daa8f5997dc594ca601ea2836 Mon Sep 17 00:00:00 2001 From: xiaoshi <2272816786@qq.com> Date: Tue, 17 Dec 2024 18:03:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=20=20?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E9=97=AE=E9=A2=98=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/ContractEeasurementBillPlugin.java | 75 +++++++++++++------ .../plugin/form/ResourceFilterExtPlugin.java | 3 +- 2 files changed, 53 insertions(+), 25 deletions(-) diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ContractEeasurementBillPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ContractEeasurementBillPlugin.java index 405798a..95a0397 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ContractEeasurementBillPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ContractEeasurementBillPlugin.java @@ -8,6 +8,7 @@ import kd.bos.form.CloseCallBack; import kd.bos.form.ShowFormHelper; import kd.bos.list.ListShowParameter; import kd.bos.orm.query.QFilter; +import kd.ec.contract.common.enums.PriceAdjustModeEnum; import kd.ec.contract.formplugin.ContractMeasureBillEditPlugin; import java.math.BigDecimal; @@ -22,25 +23,25 @@ public class ContractEeasurementBillPlugin extends ContractMeasureBillEditPlugin @Override protected void onThisQtyChanged(ChangeData changeData) { - BigDecimal qty = this.defaultZeroBigDecimal((BigDecimal)changeData.getNewValue()); + BigDecimal qty = this.defaultZeroBigDecimal((BigDecimal) changeData.getNewValue()); int rowIndex = changeData.getRowIndex(); int parentRowIndex = changeData.getParentRowIndex(); - BigDecimal totalqty = (BigDecimal)this.getModel().getValue("totalqty", rowIndex, parentRowIndex); - BigDecimal preQty = (BigDecimal)this.getModel().getValue("preqty", rowIndex, parentRowIndex); + BigDecimal totalqty = (BigDecimal) this.getModel().getValue("totalqty", rowIndex, parentRowIndex); + BigDecimal preQty = (BigDecimal) this.getModel().getValue("preqty", rowIndex, parentRowIndex); BigDecimal balanceQty = totalqty.subtract(preQty); - if (qty.compareTo(balanceQty) > 0) { -// this.getView().showMessage(String.format(ResManager.loadKDString("本期计量数量不能超过%s(总数量-期初累计计量数量)。", "ContractMeasureBillEditPlugin_4", "ec-contract-formplugin", new Object[0]), balanceQty.intValue())); -// this.getModel().setValue("thisqty", BigDecimal.ZERO, rowIndex, parentRowIndex); - } else { - this.getModel().setValue("lstqty", preQty.add(qty), rowIndex, parentRowIndex); - BigDecimal taxPrice = (BigDecimal)this.getModel().getValue("curtaxprice", rowIndex, parentRowIndex); - BigDecimal amount = taxPrice.multiply(qty); - this.getModel().setValue("thisoftaxmount", amount, rowIndex, parentRowIndex); - if (this.isInContract()) { - this.countPercent(rowIndex, parentRowIndex); - } - +// if (qty.compareTo(balanceQty) > 0) { +//// this.getView().showMessage(String.format(ResManager.loadKDString("本期计量数量不能超过%s(总数量-期初累计计量数量)。", "ContractMeasureBillEditPlugin_4", "ec-contract-formplugin", new Object[0]), balanceQty.intValue())); +//// this.getModel().setValue("thisqty", BigDecimal.ZERO, rowIndex, parentRowIndex); +// } else { + this.getModel().setValue("lstqty", preQty.add(qty), rowIndex, parentRowIndex); + BigDecimal taxPrice = (BigDecimal) this.getModel().getValue("curtaxprice", rowIndex, parentRowIndex); + BigDecimal amount = taxPrice.multiply(qty); + this.getModel().setValue("thisoftaxmount", amount, rowIndex, parentRowIndex); + if (this.isInContract()) { + this.countPercent(rowIndex, parentRowIndex); } + +// } } @Override @@ -54,8 +55,8 @@ public class ContractEeasurementBillPlugin extends ContractMeasureBillEditPlugin List listingIds = new ArrayList(); int rowIndex; - for(rowIndex = 0; rowIndex < rowCount; ++rowIndex) { - DynamicObject listing = (DynamicObject)this.getModel().getValue("listing", rowIndex); + for (rowIndex = 0; rowIndex < rowCount; ++rowIndex) { + DynamicObject listing = (DynamicObject) this.getModel().getValue("listing", rowIndex); if (listing != null) { // listingIds.add(listing.getPkValue()); } @@ -63,9 +64,9 @@ public class ContractEeasurementBillPlugin extends ContractMeasureBillEditPlugin qFilters.add(new QFilter("id", "not in", listingIds)); rowIndex = this.getModel().getEntryCurrentRowIndex("listmodelentry"); - String listModelId = (String)this.getModel().getValue("listmodelid", rowIndex); + String listModelId = (String) this.getModel().getValue("listmodelid", rowIndex); qFilters.add(new QFilter("listingmodel", "=", StringUtils.isNotBlank(listModelId) ? Long.parseLong(listModelId) : 0L)); - DynamicObject contract = (DynamicObject)this.getModel().getValue("contract"); + DynamicObject contract = (DynamicObject) this.getModel().getValue("contract"); if (contract != null) { qFilters.add(new QFilter("contractid", "=", contract.getLong("id"))); } @@ -77,9 +78,35 @@ public class ContractEeasurementBillPlugin extends ContractMeasureBillEditPlugin } } -// @Override -// public void propertyChanged(PropertyChangedArgs e) { -// super.propertyChanged(e); + @Override + public void propertyChanged(PropertyChangedArgs e) { + super.propertyChanged(e); + + String propName = e.getProperty().getName(); + ChangeData changeData = e.getChangeSet()[0]; + if (StringUtils.equals(propName, "contract")) { + this.onContractChanged(changeData); + } else if (StringUtils.equals(propName, "period")) { + this.onPeriodChanged(changeData); + } else if (!StringUtils.equals(propName, "begindate") && !StringUtils.equals(propName, "enddate")) { + if (StringUtils.equals(propName, "thisqty")) { + this.onThisQtyChanged(changeData); + } else if (StringUtils.equals(propName, "thisamount")) { + this.onThisAmountChanged(changeData); + } else if (StringUtils.equals(propName, "thisoftaxmount")) { + this.onThisOfTaxAmountChanged(changeData); + } else if (StringUtils.equals(propName, "thistax")) { + this.onThisTaxChanged(changeData); + } else if (StringUtils.equals(propName, "ismeasurebymatin")) { + this.isMeasureByMaterialInChanged(changeData); + } else if (StringUtils.equals(propName, PriceAdjustModeEnum.ADJUST_AMOUNT.getValue())) { + this.onAdjustAmountChange(changeData); + } else if (StringUtils.equals(propName, PriceAdjustModeEnum.ADJUST_TAX.getValue())) { + this.onAdjustTaxChange(changeData); + } + } else { + this.onDateChanged(changeData, propName); + } // String name = e.getProperty().getName(); // ChangeData changeData = e.getChangeSet()[0]; // int rowIndex = changeData.getRowIndex(); @@ -131,6 +158,6 @@ public class ContractEeasurementBillPlugin extends ContractMeasureBillEditPlugin //// this.getView().updateView(); //// } //// -//// } -// } +// } + } } diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ResourceFilterExtPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ResourceFilterExtPlugin.java index 6de9cf0..b2da35d 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ResourceFilterExtPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ResourceFilterExtPlugin.java @@ -34,7 +34,8 @@ public class ResourceFilterExtPlugin extends ResourceItemListPlugin { } else if (contractType.toString().equals("sbcg")) {//设备采购 this.setResourceTypeStyle("equipment"); this.afterSelectedTag("equipment"); - }else if (contractType.toString().equals("qtcc") || contractType.toString().equals("lwlcc")) {//产出物 + }else if (contractType.toString().equals("qtcc") || contractType.toString().equals("lwlcc")|| contractType.toString().equals("ck")|| + contractType.toString().equals("zyfbcc")|| contractType.toString().equals("jjbc")) {//产出物 this.setResourceTypeStyle("turnover"); this.afterSelectedTag("turnover"); }else {