From 4e78f4c85bdf5d37ec8d1a2003c4462d30c5432d Mon Sep 17 00:00:00 2001 From: ptt <2403326863@qq.com> Date: Fri, 25 Apr 2025 15:31:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=90=8C=E6=8F=90=E4=BA=A4=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E5=90=88=E5=90=8C=E6=B8=85=E5=8D=95=E9=87=91=E9=A2=9D?= =?UTF-8?q?=E4=B8=8E=E5=90=88=E5=90=8C=E9=87=91=E9=A2=9D=E7=9A=84=E5=B7=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repc/recon/opplugin/ContractOPPlugin.java | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/main/java/shkd/repc/recon/opplugin/ContractOPPlugin.java b/main/java/shkd/repc/recon/opplugin/ContractOPPlugin.java index 32fc9b9..afa1961 100644 --- a/main/java/shkd/repc/recon/opplugin/ContractOPPlugin.java +++ b/main/java/shkd/repc/recon/opplugin/ContractOPPlugin.java @@ -49,27 +49,36 @@ public class ContractOPPlugin extends AbstractOperationServicePlugIn { } //合同清单(定额) DynamicObjectCollection invoiceentryinfos; + BigDecimal qeug_amounts = BigDecimal.ZERO;//金额(元)_合计 + //合同清单(定额) + DynamicObjectCollection orderformentry; + BigDecimal qeug_taxtotalprices = BigDecimal.ZERO;//金额(元)_合计 + boolean isEntry = false; try { //合同监控列表点击提交会提示找不到:qeug_invoiceentryinfo属性 invoiceentryinfos = dataEntity.getDynamicObjectCollection("qeug_invoiceentryinfo"); - if (!invoiceentryinfos.isEmpty()) { - for (DynamicObject invoiceentryinfo : invoiceentryinfos) { - BigDecimal qeug_amount = invoiceentryinfo.getBigDecimal("qeug_amount"); - } - } + //合同监控列表点击提交会提示找不到:qeug_orderformentry属性 + orderformentry = dataEntity.getDynamicObjectCollection("qeug_orderformentry"); }catch (Exception e){ dataEntity = BusinessDataServiceHelper.loadSingle(dataEntity.getPkValue(),"recon_contractbill"); invoiceentryinfos = dataEntity.getDynamicObjectCollection("qeug_invoiceentryinfo"); + orderformentry = dataEntity.getDynamicObjectCollection("qeug_orderformentry"); } - BigDecimal qeug_amounts = BigDecimal.ZERO;//金额(元)_合计 if (!invoiceentryinfos.isEmpty()) { + isEntry = true; for (DynamicObject invoiceentryinfo : invoiceentryinfos) { qeug_amounts = qeug_amounts.add(invoiceentryinfo.getBigDecimal("qeug_amount")); } } + if (!orderformentry.isEmpty()) { + isEntry = true; + for (DynamicObject orderform : orderformentry) { + qeug_taxtotalprices = qeug_taxtotalprices.add(orderform.getBigDecimal("qeug_taxtotalprice")); + } + } BigDecimal amount = dataEntity.getBigDecimal("amount");//合同金额 // 检查 qeug_amounts 是否大于 amount - if (qeug_amounts.setScale(2, RoundingMode.HALF_UP).compareTo(amount) > 0) { + if (isEntry&&qeug_amounts.add(qeug_taxtotalprices).setScale(2, RoundingMode.HALF_UP).compareTo(amount) < 0) { this.addErrorMessage(extendedDataEntity, "合同清单(定额)的金额之和不能大于合同金额"); } // DynamicObjectCollection qeug_orderformentry1 = dataEntity.getDynamicObjectCollection("qeug_orderformentry");