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