From c55ed5d85a1b5d2524e6badf7051fe373f967f48 Mon Sep 17 00:00:00 2001 From: zhangzhiguo Date: Fri, 27 Dec 2024 11:09:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BD=E5=A4=96=E4=BD=8F=E5=AE=BF=E6=A0=87?= =?UTF-8?q?=E5=87=86=E5=A2=9E=E5=8A=A0=E8=87=AA=E5=8A=A8=E5=8F=96=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/TripstandAccmodationAutoPlugin.java | 40 ++++++++++++++----- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/TripstandAccmodationAutoPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/TripstandAccmodationAutoPlugin.java index 5f2ccf0..bdd0401 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/TripstandAccmodationAutoPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/TripstandAccmodationAutoPlugin.java @@ -1,12 +1,18 @@ package zcgj.zcdev.zcdev.fs.plugin.form; import kd.bos.bill.AbstractBillPlugIn; +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.dataentity.entity.DynamicObjectCollection; import kd.bos.form.ConfirmCallBackListener; import kd.bos.form.MessageBoxOptions; import kd.bos.form.MessageBoxResult; import kd.bos.form.control.events.BeforeClickEvent; import kd.bos.form.control.events.BeforeItemClickEvent; +import kd.bos.form.control.events.ItemClickEvent; import kd.bos.form.events.MessageBoxClosedEvent; +import kd.bos.orm.query.QCP; +import kd.bos.orm.query.QFilter; +import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.sdk.plugin.Plugin; import java.util.EventObject; @@ -18,13 +24,8 @@ public class TripstandAccmodationAutoPlugin extends AbstractBillPlugIn implemen public void registerListener(EventObject e) { super.registerListener(e); //监听工具栏按钮点击事件 - this.addItemClickListeners("zcgj_auto_get_data"); - this.addClickListeners("zcgj_auto_get_data"); - } - - @Override - public void beforeClick(BeforeClickEvent evt) { - super.beforeClick(evt); + this.addItemClickListeners("advcontoolbarap"); + //this.addClickListeners("advcontoolbarap"); } @Override @@ -34,7 +35,7 @@ public class TripstandAccmodationAutoPlugin extends AbstractBillPlugIn implemen evt.setCancel(true); ConfirmCallBackListener confirmCallBackListener = new ConfirmCallBackListener("submitconfirm", this); //设置页面确认框,参数为:标题,选项框类型,回调监听 - this.getView().showConfirm("您确认提交该办公用品登记单吗?", MessageBoxOptions.YesNoCancel, confirmCallBackListener); + this.getView().showConfirm("此操作将会覆盖现有当前标准明细数据。", MessageBoxOptions.YesNo, confirmCallBackListener); } super.beforeItemClick(evt); } @@ -47,11 +48,28 @@ public class TripstandAccmodationAutoPlugin extends AbstractBillPlugIn implemen if (MessageBoxResult.Yes.equals(messageBoxClosedEvent.getResult())) { //如果点击确认按钮,则调用提交操作 // this.getView().invokeOperation("submit"); - this.getView().showMessage("你好"); + //QFilter filterOrgId = new QFilter("number", QCP.equals,rootOrgCode);//中材矿山建设有限公司 + DynamicObject[] consumeStays = BusinessDataServiceHelper.load("zcgj_consume_stays", "zcgj_tripexpenseitem,zcgj_triparea,zcgj_currency," + + "zcgj_standardamount,zcgj_highseasonstandardam", new QFilter[]{}); + DynamicObjectCollection entryEntity = this.getModel().getDataEntity(true).getDynamicObjectCollection("entryentity"); + entryEntity.clear(); + getView().updateView(); + for (DynamicObject dynamicObject : consumeStays) { + DynamicObject dynamicObject1 = entryEntity.addNew(); + dynamicObject1.set("tripstandardtype",dynamicObject.getDynamicObject("zcgj_tripexpenseitem"));//差旅项目 + dynamicObject1.set("triparea",dynamicObject.getDynamicObject("zcgj_triparea"));//出差地域 + dynamicObject1.set("currency",dynamicObject.getDynamicObject("zcgj_currency"));//币别 + dynamicObject1.set("standardamount",dynamicObject.getBigDecimal("zcgj_standardamount"));//标准人天 + dynamicObject1.set("highseasonstandardamount",dynamicObject.getBigDecimal("zcgj_highseasonstandardam"));//旺季标准 + } + getView().updateView(); + if(consumeStays!=null){ + this.getView().showMessage("取数完成,共获取"+consumeStays.length+"条数据!"); + }else{ + this.getView().showMessage("取数完成,共获取0条数据!"); + } } else if (MessageBoxResult.No.equals(messageBoxClosedEvent.getResult())) { - } else if (MessageBoxResult.Cancel.equals(messageBoxClosedEvent.getResult())) { - // 点击取消的相关处理逻辑。。。。 } }