From cfb429d6999d054ac91b6ec7b972a30b7726af16 Mon Sep 17 00:00:00 2001 From: zoujiangtao Date: Thu, 14 Nov 2024 14:48:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=BA=EF=BC=9A=E9=82=B9?= =?UTF-8?q?=E6=B1=9F=E6=B6=9B=20=E4=BF=AE=E6=94=B9=E5=86=85=E5=AE=B9?= =?UTF-8?q?=EF=BC=9A=E6=B5=8B=E8=AF=95=E8=A1=A8=E5=8D=95=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E6=97=B6=E9=97=B4=EF=BC=9A2024/11/14?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sys/plugin/form/ApiTestBillPlugin.java | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/form/ApiTestBillPlugin.java diff --git a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/form/ApiTestBillPlugin.java b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/form/ApiTestBillPlugin.java new file mode 100644 index 0000000..b0be6fd --- /dev/null +++ b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/form/ApiTestBillPlugin.java @@ -0,0 +1,46 @@ +package shkd.sys.sys.plugin.form; + +import com.alibaba.fastjson.JSONObject; +import kd.bos.bill.AbstractBillPlugIn; +import kd.bos.form.control.Toolbar; +import kd.bos.form.control.events.ItemClickEvent; +import kd.sdk.plugin.Plugin; +import shkd.sys.sys.mservice.BIPService; + +import java.util.EventObject; + +/** + * 单据界面插件 + */ +public class ApiTestBillPlugin extends AbstractBillPlugIn implements Plugin { + @Override + public void registerListener(EventObject e) { +// super.registerListener(e); + + // 获取工具栏,监听整个工具栏 + Toolbar save = this.getView().getControl("tbmain"); + // 监听工具栏这个按钮的点击事件 + save.addItemClickListener(this); + + // 获取除了工具栏上的其他按钮 + // Button save = this.getView().getControl("qwz5_baritemap"); + // save.addClickListener(this); // 添加出菜单栏点击事件监听 + } + @Override + public void itemClick(ItemClickEvent evt) { + super.itemClick(evt); + // 获取键 + String key = evt.getItemKey(); + + if ("shkd_token".equals(key)) { + String bipToken = BIPService.getBIPToken(); + this.getView().showTipNotification(bipToken); + } + + if ("shkd_api".equals(key)) { + JSONObject jsonObject = BIPService.paymentSlipsJson(); + this.getView().showTipNotification(jsonObject.toJSONString()); + } + } + +} \ No newline at end of file