From edd7d34197db34de38a03c094ab8421fca11c340 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=9D=96?= Date: Fri, 28 Jun 2024 11:18:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=90=8C=E5=8F=B0=E8=B4=A6-=E5=88=97?= =?UTF-8?q?=E8=A1=A8-=E5=88=A0=E9=99=A4=E5=BD=92=E6=A1=A3=E9=99=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fi/em/plugin/ContractBillExtList.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/shkd-cosmic-debug/src/main/java/shkd/fi/em/plugin/ContractBillExtList.java b/shkd-cosmic-debug/src/main/java/shkd/fi/em/plugin/ContractBillExtList.java index 9a47acd..5cabff5 100644 --- a/shkd-cosmic-debug/src/main/java/shkd/fi/em/plugin/ContractBillExtList.java +++ b/shkd-cosmic-debug/src/main/java/shkd/fi/em/plugin/ContractBillExtList.java @@ -25,6 +25,7 @@ import kd.bos.form.control.events.UploadEvent; import kd.bos.form.control.events.UploadListener; import kd.bos.form.events.AfterDoOperationEventArgs; import kd.bos.form.events.BeforeDoOperationEventArgs; +import kd.bos.form.events.MessageBoxClosedEvent; import kd.bos.form.operate.FormOperate; import kd.bos.list.plugin.AbstractListPlugin; import kd.bos.logging.Log; @@ -54,6 +55,14 @@ public class ContractBillExtList extends AbstractListPlugin implements Plugin, U ListSelectedRowCollection selectedRowCollection = listView.getSelectedRows(); List pks = (List)selectedRowCollection.stream().map(ListSelectedRow::getPrimaryKeyValue).collect(Collectors.toList()); switch (key) { + case "deleteattachment": + if (pks.size() != 1) { + this.getView().showTipNotification("请选择一行数据进行归档附件上传操作。"); + return; + } + this.getView().showConfirm("确认要删除归档附件吗?", MessageBoxOptions.OKCancel, + new ConfirmCallBackListener("deleteAttachmentCallBack", this)); + break; case "newsp2": BillShowParameter parameter3 = new BillShowParameter(); parameter3.setCustomParam("newsp", "newsp"); @@ -98,6 +107,24 @@ public class ContractBillExtList extends AbstractListPlugin implements Plugin, U } } + @Override + public void confirmCallBack(MessageBoxClosedEvent messageBoxClosedEvent) { + // super.confirmCallBack(messageBoxClosedEvent); + if(messageBoxClosedEvent.getResult() == MessageBoxResult.Yes + && "deleteAttachmentCallBack".equals(messageBoxClosedEvent.getCallBackId())){ + ListSelectedRowCollection selectedRowCollection = ((ListView) this.getView()).getSelectedRows(); + Object pk = selectedRowCollection.get(0).getPrimaryKeyValue(); + List> templist = AttachmentServiceHelper.getAttachments("er_contractbill", + pk + "", "shkd_attachmentpanelap"); + for(Map tempMap : templist) { + System.out.println(tempMap); + AttachmentServiceHelper.remove("er_contractbill", pk, tempMap.get("uid")); + } + this.getView().showConfirm("删除归档附件成功!", MessageBoxOptions.OK, + new ConfirmCallBackListener("upload_success", this)); + } + } + @Override public void itemClick(ItemClickEvent evt) { System.out.println(evt);