From f64ab9497c229816990c02f332cd1447a9f7497f Mon Sep 17 00:00:00 2001 From: xiaoshi <2272816786@qq.com> Date: Thu, 5 Dec 2024 18:44:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B6=E5=85=A5=E4=B8=8E=E6=94=AF=E5=87=BA?= =?UTF-8?q?=E5=90=88=E5=90=8C=E8=AE=A1=E9=87=8F=E6=B8=85=E5=8D=95=E8=BF=87?= =?UTF-8?q?=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/ContractEeasurementBillPlugin.java | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) 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 97ed124..2c403e8 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 @@ -1,9 +1,17 @@ package zcgj.zcdev.zcdev.pr.plugin.form; +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.dataentity.utils.StringUtils; import kd.bos.entity.datamodel.events.ChangeData; +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.formplugin.ContractMeasureBillEditPlugin; import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; public class ContractEeasurementBillPlugin extends ContractMeasureBillEditPlugin { @@ -29,4 +37,38 @@ public class ContractEeasurementBillPlugin extends ContractMeasureBillEditPlugin } } + + @Override + protected void doNewListEntry() { + { + boolean inContract = this.isInContract(); + String formId = inContract ? "ec_intreelisting" : "ec_outtreelisting"; + ListShowParameter param = ShowFormHelper.createShowListForm(formId, true, 3, true); + List qFilters = param.getListFilterParameter().getQFilters(); + int rowCount = this.getModel().getEntryRowCount("listentry"); + List listingIds = new ArrayList(); + + int rowIndex; + for(rowIndex = 0; rowIndex < rowCount; ++rowIndex) { + DynamicObject listing = (DynamicObject)this.getModel().getValue("listing", rowIndex); + if (listing != null) { +// listingIds.add(listing.getPkValue()); + } + } + + qFilters.add(new QFilter("id", "not in", listingIds)); + rowIndex = this.getModel().getEntryCurrentRowIndex("listmodelentry"); + 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"); + if (contract != null) { + qFilters.add(new QFilter("contractid", "=", contract.getLong("id"))); + } + + param.setCustomParam("listmodelid", listModelId); + CloseCallBack callBack = new CloseCallBack(this, "newlistentry"); + param.setCloseCallBack(callBack); + this.getView().showForm(param); + } + } }