合同台账-列表-删除归档附件

This commit is contained in:
李靖 2024-06-28 11:18:43 +08:00
parent 1a233f303f
commit edd7d34197
1 changed files with 27 additions and 0 deletions

View File

@ -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<Object> 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<Map<String, Object>> templist = AttachmentServiceHelper.getAttachments("er_contractbill",
pk + "", "shkd_attachmentpanelap");
for(Map<String, Object> 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);