From 22a04670b13baad2c9914539448131a63bee576b Mon Sep 17 00:00:00 2001 From: xiaoshi <2272816786@qq.com> Date: Mon, 23 Dec 2024 09:35:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=20=20?= =?UTF-8?q?=E5=90=88=E5=90=8C=E7=BB=93=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pr/plugin/form/ContractPublicBillPlugin.java | 14 ++++++++++++++ .../operate/InContractSettlementValidator.java | 8 ++++++-- .../operate/OutContractSettlementValidator.java | 8 ++++++-- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ContractPublicBillPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ContractPublicBillPlugin.java index 3f473b9..4bbbe1c 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ContractPublicBillPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/ContractPublicBillPlugin.java @@ -1,6 +1,7 @@ package zcgj.zcdev.zcdev.pr.plugin.form; import kd.bos.bill.AbstractBillPlugIn; +import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.LocaleString; import kd.bos.entity.datamodel.events.PropertyChangedArgs; import kd.bos.form.field.ComboEdit; @@ -64,6 +65,19 @@ public class ContractPublicBillPlugin extends AbstractBillPlugIn implements Plug ComboEdit comboEdit = getView().getControl("zcgj_belongingsector"); comboEdit.setComboItems(comboList); } + }else if (name.equals("contracttype")){ +// Object contracttype = this.getModel().getValue("contracttype"); +// if(contracttype!=null && contracttype!=""){ +// DynamicObject contracttypeInfo = (DynamicObject)contracttype; +// String number = contracttypeInfo.getString("number"); +// if(number.equals("jjfb")||number.equals("hfzl")||number.equals("jjbc")||number.equals("jjzb")){ +// this.getView().setVisible(true,"zcgj_xmtz"); +// }else{ +// this.getView().setVisible(false,"zcgj_xmtz"); +// +// } +// this.getView().updateView("treelistentry"); +// } } } } \ No newline at end of file diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/InContractSettlementValidator.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/InContractSettlementValidator.java index f52a3d9..a5ea3cc 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/InContractSettlementValidator.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/InContractSettlementValidator.java @@ -31,8 +31,12 @@ public class InContractSettlementValidator extends InContractSettleValidator { if (itementry.size() == 0) { this.addErrorMessage(dataEntity, ResManager.loadKDString("支付合同项不能为空", "InContractSettleValidator_0", "ec-contract-opplugin", new Object[0])); } - BigDecimal oftaxamount = itementry.get(0).getBigDecimal("oftaxamount"); - if (oftaxamount.compareTo(new BigDecimal(0)) > 0) { + BigDecimal amount = new BigDecimal(0); + for (DynamicObject object : itementry) { + BigDecimal oftaxamount = object.getBigDecimal("oftaxamount"); + amount = amount.add(oftaxamount); + } + if (amount.compareTo(new BigDecimal(0)) <= 0) { this.addErrorMessage(dataEntity, ResManager.loadKDString("支付合同项分录中的金额不能为空!", "InContractSettleValidator_0", "ec-contract-opplugin", new Object[0])); } DynamicObject contract = BusinessDataServiceHelper.loadSingle(dataEntity.getDataEntity().getDynamicObject("contract").getPkValue(), "ec_in_contract"); diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/OutContractSettlementValidator.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/OutContractSettlementValidator.java index e0145a8..15a0e0c 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/OutContractSettlementValidator.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/OutContractSettlementValidator.java @@ -22,8 +22,12 @@ public class OutContractSettlementValidator extends OutContractSettleValidator { if (itementry.isEmpty()) { this.addErrorMessage(dataEntity, ResManager.loadKDString("支付合同项不能为空", "InContractSettleValidator_0", "ec-contract-opplugin", new Object[0])); } - BigDecimal oftaxamount = itementry.get(0).getBigDecimal("oftaxamount"); - if (oftaxamount.compareTo(new BigDecimal(0)) > 0) { + BigDecimal amount = new BigDecimal(0); + for (DynamicObject object : itementry) { + BigDecimal oftaxamount = object.getBigDecimal("oftaxamount"); + amount = amount.add(oftaxamount); + } + if (amount.compareTo(new BigDecimal(0)) <= 0) { this.addErrorMessage(dataEntity, ResManager.loadKDString("支付合同项分录中的金额不能为空!", "InContractSettleValidator_0", "ec-contract-opplugin", new Object[0])); } if (contractTemp == null) {