From 3346b244d9f3d4a9e89eac28e9be1877ddad71b1 Mon Sep 17 00:00:00 2001 From: xuhaihui <2098865055@qq.com> Date: Mon, 12 Jan 2026 17:09:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B6=E5=85=A5=E5=90=88=E5=90=8C=E5=B1=A5?= =?UTF-8?q?=E7=BA=A6=E8=AE=B0=E5=BD=95=E5=88=97=E8=A1=A8=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=B7=E6=96=B0=E5=8E=86=E5=8F=B2=E9=87=91?= =?UTF-8?q?=E9=A2=9D=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/InPerFormRecordsListPlugin.java | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/InPerFormRecordsListPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/InPerFormRecordsListPlugin.java index bbf5d94..161d59f 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/InPerFormRecordsListPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/InPerFormRecordsListPlugin.java @@ -2,8 +2,12 @@ package zcgj.zcdev.zcdev.pr.plugin.form; import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.bos.entity.datamodel.ListSelectedRow; +import kd.bos.entity.datamodel.ListSelectedRowCollection; import kd.bos.form.ShowType; +import kd.bos.form.control.events.ItemClickEvent; import kd.bos.form.events.HyperLinkClickArgs; +import kd.bos.list.BillList; import kd.bos.list.ListShowParameter; import kd.bos.list.plugin.AbstractListPlugin; import kd.bos.mvc.list.ListView; @@ -11,7 +15,9 @@ import kd.bos.orm.query.QCP; import kd.bos.orm.query.QFilter; import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.bos.servicehelper.QueryServiceHelper; +import kd.bos.servicehelper.operation.SaveServiceHelper; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; @@ -44,4 +50,45 @@ public class InPerFormRecordsListPlugin extends AbstractListPlugin { this.getView().showForm(listShowParameter); } } + + @Override + public void itemClick(ItemClickEvent evt) { + super.itemClick(evt); + String itemKey = evt.getItemKey(); + if ("zcgj_amountrefresher".equals(itemKey)) { + BillList billList = this.getView().getControl(AbstractListPlugin.BILLLISTID); + //获取到选中行的数据 + ListSelectedRowCollection selectedRows = billList.getSelectedRows(); + if (selectedRows.isEmpty()) { + this.getView().showTipNotification(String.format("请选择要确认的数据。")); + return; + } + for (ListSelectedRow selectedRow : selectedRows) { + Long contractSettleId = (Long) selectedRow.getPrimaryKeyValue(); + QFilter accountTableFilter = new QFilter("id", QCP.equals, contractSettleId); + DynamicObject ec_in_performrecords = BusinessDataServiceHelper.loadSingle("ec_in_performrecords", + "id,billno,entryentity,entryentity.amount,entryentity.notaxamount,entryentity.tax," + + "zcgj_taxperformeamou,zcgj_performamount,zcgj_taxamount", new QFilter[]{accountTableFilter}); + BigDecimal totalAmount = BigDecimal.ZERO; // 价税合计总额 + BigDecimal totalNotaxAmount = BigDecimal.ZERO; // 不含税金额总额 + BigDecimal totalTax = BigDecimal.ZERO; // 税额总额 + DynamicObjectCollection entryEntityCollection = ec_in_performrecords.getDynamicObjectCollection("entryentity"); + if (entryEntityCollection.size() == 0) { + continue; + } + for (DynamicObject entryEntity : entryEntityCollection) { + BigDecimal amount = entryEntity.getBigDecimal("amount");//价税合计 + BigDecimal notaxamount = entryEntity.getBigDecimal("notaxamount");//金额 + BigDecimal tax = entryEntity.getBigDecimal("tax");//税额 + totalAmount = totalAmount.add(amount); + totalNotaxAmount = totalNotaxAmount.add(notaxamount); + totalTax = totalTax.add(tax); + } + ec_in_performrecords.set("zcgj_taxperformeamou", totalAmount.abs());//含税履约金额 + ec_in_performrecords.set("zcgj_performamount", totalNotaxAmount.abs());//履约金额(不含税) + ec_in_performrecords.set("zcgj_taxamount", totalTax.abs());//履约税额 + SaveServiceHelper.update(ec_in_performrecords); + } + } + } }