From a54d746552b3f92035ccf8fbe1fb093d97e13ba9 Mon Sep 17 00:00:00 2001 From: zhangzhiguo <421587375@qq.com> Date: Mon, 24 Nov 2025 17:24:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=8F=B0=E8=B4=A6=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E7=95=8C=E9=9D=A2=E6=8F=92=E4=BB=B6=E9=87=8D=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/EquipmentCardListPluginExt.java | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/EquipmentCardListPluginExt.java diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/EquipmentCardListPluginExt.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/EquipmentCardListPluginExt.java new file mode 100644 index 0000000..41d52b8 --- /dev/null +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/EquipmentCardListPluginExt.java @@ -0,0 +1,64 @@ +package zcgj.zcdev.zcdev.pr.plugin.form; + +import kd.bos.bill.OperationStatus; +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.dataentity.resource.ResManager; +import kd.bos.dataentity.utils.StringUtils; +import kd.bos.form.FormShowParameter; +import kd.bos.form.ShowType; +import kd.bos.form.events.BeforeExportFileEvent; +import kd.bos.form.events.HyperLinkClickArgs; +import kd.bos.mvc.list.ListView; +import kd.bos.servicehelper.BusinessDataServiceHelper; + +import java.util.EventObject; +import java.util.HashMap; +import java.util.Map; + +/** + * 设备台账列表界面插件重写 + */ +public class EquipmentCardListPluginExt extends EquipmentCardListPlugin{ + public void registerListener(EventObject e) { + super.registerListener(e); + } + + public void billListHyperLinkClick(HyperLinkClickArgs args) { + super.billListHyperLinkClick(args); + String fieldName = args.getHyperLinkClickEvent().getFieldName(); + if (StringUtils.equalsIgnoreCase(fieldName, "number")) { + this.toEquipInfoView(args); + } + + } + + protected void toEquipInfoView(HyperLinkClickArgs args) { + Map map = new HashMap(); + ListView view = (ListView)this.getView(); + Object focusRowPkId = view.getFocusRowPkId(); + DynamicObject equipment = BusinessDataServiceHelper.loadSingle(focusRowPkId, "eceq_equipment_card"); + String status = equipment.getString("billstatus"); + if (StringUtils.equals(status, "C")) { + map.put("formId", "eceq_equipinfo"); + map.put("pkId", focusRowPkId.toString()); + FormShowParameter parameter = FormShowParameter.createFormShowParameter(map); + parameter.setAppId("eceq"); + //parameter.setStatus(OperationStatus.VIEW); + parameter.getOpenStyle().setShowType(ShowType.MainNewTabPage); + this.getView().showForm(parameter); + args.setCancel(true); + } + + } + + public void beforeExportFile(BeforeExportFileEvent e) { + super.beforeExportFile(e); + String oldName = e.getFileName(); + String[] nameSplit = oldName.split("_"); + if (ResManager.loadKDString("新增设备", "EquipmentCardListPlugin_0", "ec-eceq-formplugin", new Object[0]).equals(nameSplit[1])) { + nameSplit[1] = ResManager.loadKDString("设备台账", "EquipmentCardListPlugin_1", "ec-eceq-formplugin", new Object[0]); + } + + e.setFileName(String.join("_", nameSplit)); + } +}