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)); + } +}