From 9a013c9e20eee6e1110ee9180062397420e4c947 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 12 Jan 2026 18:20:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BA=BA=EF=BC=9A=E9=82=B9?= =?UTF-8?q?=E6=B1=9F=E6=B6=9B=20=E6=8F=90=E4=BA=A4=E6=97=B6=E9=97=B4?= =?UTF-8?q?=EF=BC=9A2026=E5=B9=B401=E6=9C=8812=E6=97=A5=20=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E5=86=85=E5=AE=B9=EF=BC=9A=E5=86=85=E9=83=A8=E8=B4=A6?= =?UTF-8?q?=E6=88=B7=E5=AF=B9=E8=B4=A6=E5=8D=95=E4=BB=A3=E7=A0=81=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sys/plugin/list/JszxdzdListPlugin.java | 113 +++++++++++++----- 1 file changed, 85 insertions(+), 28 deletions(-) diff --git a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/list/JszxdzdListPlugin.java b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/list/JszxdzdListPlugin.java index b54b945..1b6c6e7 100644 --- a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/list/JszxdzdListPlugin.java +++ b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/plugin/list/JszxdzdListPlugin.java @@ -184,7 +184,14 @@ public class JszxdzdListPlugin extends AbstractListPlugin implements Plugin { } this.getView().showSuccessNotification("更新成功"); this.getView().invokeOperation("refresh"); - } else if ("shkd_confirmre".equals(itemKey)) { + } else if ("shkd_confirmre".equals(itemKey) || "shkd_parentconfirmre".equals(itemKey)) { + // 获取勾选的单据ID + BillList billList = this.getControl("billlistap"); + ListSelectedRowCollection selectedRows = billList.getSelectedRows(); + if (CollectionUtils.isEmpty(selectedRows)) { + return; + } + String msg = "是否确认对账"; // 详细消息 // String detail = "消息体\r\nmessage body..."; @@ -194,11 +201,25 @@ public class JszxdzdListPlugin extends AbstractListPlugin implements Plugin { // 确认提示类型 // Default:默认提示 Save:保存提交类提示 Delete:删除类提示 Wait:等待类提示 Fail:失败类提示 ConfirmTypes confirmTypes = ConfirmTypes.Default; - // 确认框回调 新建 确认 回复 监听器对象 - ConfirmCallBackListener confirmCallBackListener = new ConfirmCallBackListener("confirmre", this); + + ConfirmCallBackListener confirmCallBackListener; + if ("shkd_confirmre".equals(itemKey)) { + // 确认框回调 新建 确认 回复 监听器对象 + confirmCallBackListener = new ConfirmCallBackListener("confirmre", this); + }else { + // 确认框回调 新建 确认 回复 监听器对象 + confirmCallBackListener = new ConfirmCallBackListener("parentconfirmre", this); + } // 显示弹窗 this.getView().showConfirm(msg, options, confirmTypes, confirmCallBackListener); - } else if ("shkd_cancelre".equals(itemKey)) { + } else if ("shkd_cancelre".equals(itemKey) || "shkd_parentcancelre".equals(itemKey)) { + // 获取勾选的单据ID + BillList billList = this.getControl("billlistap"); + ListSelectedRowCollection selectedRows = billList.getSelectedRows(); + if (CollectionUtils.isEmpty(selectedRows)) { + return; + } + String msg = "是否取消对账"; // 详细消息 // String detail = "消息体\r\nmessage body..."; @@ -209,8 +230,15 @@ public class JszxdzdListPlugin extends AbstractListPlugin implements Plugin { // Default:默认提示 Save:保存提交类提示 Delete:删除类提示 Wait:等待类提示 Fail:失败类提示 ConfirmTypes confirmTypes = ConfirmTypes.Default; - // 确认框回调 新建 确认 回复 监听器对象 - ConfirmCallBackListener confirmCallBackListener = new ConfirmCallBackListener("cancelre", this); + ConfirmCallBackListener confirmCallBackListener; + if ("shkd_cancelre".equals(itemKey)) { + // 确认框回调 新建 确认 回复 监听器对象 + confirmCallBackListener = new ConfirmCallBackListener("cancelre", this); + }else { + // 确认框回调 新建 确认 回复 监听器对象 + confirmCallBackListener = new ConfirmCallBackListener("parentcancelre", this); + } + // 显示弹窗 this.getView().showConfirm(msg, options, confirmTypes, confirmCallBackListener); @@ -228,44 +256,73 @@ public class JszxdzdListPlugin extends AbstractListPlugin implements Plugin { // 获取勾选的单据ID BillList billList = this.getControl("billlistap"); ListSelectedRowCollection selectedRows = billList.getSelectedRows(); - Set setIds = new HashSet<>(); if (CollectionUtils.isNotEmpty(selectedRows)) { + Set setIds = new HashSet<>(); for (ListSelectedRow selectedRow : selectedRows) { setIds.add(toLong(selectedRow.getPrimaryKeyValue())); } - } else { - this.getView().showTipNotification("请选择至少一条数据"); - return; + List longs = new ArrayList<>(setIds); + for (Long aLong : longs) { + DynamicObject dynamicObject = BusinessDataServiceHelper.loadSingle(aLong, billFormId); + dynamicObject.set("shkd_sfyz", true); + SaveServiceHelper.save(new DynamicObject[]{dynamicObject}); + } + this.getView().invokeOperation("refresh"); } - - List longs = new ArrayList<>(setIds); - for (Long aLong : longs) { - DynamicObject dynamicObject = BusinessDataServiceHelper.loadSingle(aLong, billFormId); - dynamicObject.set("shkd_sfyz", true); - SaveServiceHelper.save(new DynamicObject[]{dynamicObject}); - } - this.getView().invokeOperation("refresh"); } else if (evt.getResult() == MessageBoxResult.Yes && "cancelre".equals(callBackId)) { String billFormId = ((IListView) this.getView()).getBillFormId(); // 获取勾选的单据ID BillList billList = this.getControl("billlistap"); ListSelectedRowCollection selectedRows = billList.getSelectedRows(); - Set setIds = new HashSet<>(); if (CollectionUtils.isNotEmpty(selectedRows)) { + Set setIds = new HashSet<>(); for (ListSelectedRow selectedRow : selectedRows) { setIds.add(toLong(selectedRow.getPrimaryKeyValue())); } - } else { - this.getView().showTipNotification("请选择至少一条数据"); - return; + List longs = new ArrayList<>(setIds); + for (Long aLong : longs) { + DynamicObject dynamicObject = BusinessDataServiceHelper.loadSingle(aLong, billFormId); + dynamicObject.set("shkd_sfyz", false); + SaveServiceHelper.save(new DynamicObject[]{dynamicObject}); + } + this.getView().invokeOperation("refresh"); } - List longs = new ArrayList<>(setIds); - for (Long aLong : longs) { - DynamicObject dynamicObject = BusinessDataServiceHelper.loadSingle(aLong, billFormId); - dynamicObject.set("shkd_sfyz", false); - SaveServiceHelper.save(new DynamicObject[]{dynamicObject}); + } else if ( evt.getResult() == MessageBoxResult.Yes && "parentconfirmre".equals(callBackId)) { + String billFormId = ((IListView) this.getView()).getBillFormId(); + // 获取勾选的单据ID + BillList billList = this.getControl("billlistap"); + ListSelectedRowCollection selectedRows = billList.getSelectedRows(); + if (CollectionUtils.isNotEmpty(selectedRows)) { + Set setIds = new HashSet<>(); + for (ListSelectedRow selectedRow : selectedRows) { + setIds.add(toLong(selectedRow.getPrimaryKeyValue())); + } + List longs = new ArrayList<>(setIds); + for (Long aLong : longs) { + DynamicObject dynamicObject = BusinessDataServiceHelper.loadSingle(aLong, billFormId); + dynamicObject.set("shkd_parentsfyz", true); + SaveServiceHelper.save(new DynamicObject[]{dynamicObject}); + } + this.getView().invokeOperation("refresh"); + } + } else if ( evt.getResult() == MessageBoxResult.Yes && "parentcancelre".equals(callBackId)) { + String billFormId = ((IListView) this.getView()).getBillFormId(); + // 获取勾选的单据ID + BillList billList = this.getControl("billlistap"); + ListSelectedRowCollection selectedRows = billList.getSelectedRows(); + if (CollectionUtils.isNotEmpty(selectedRows)) { + Set setIds = new HashSet<>(); + for (ListSelectedRow selectedRow : selectedRows) { + setIds.add(toLong(selectedRow.getPrimaryKeyValue())); + } + List longs = new ArrayList<>(setIds); + for (Long aLong : longs) { + DynamicObject dynamicObject = BusinessDataServiceHelper.loadSingle(aLong, billFormId); + dynamicObject.set("shkd_parentsfyz", false); + SaveServiceHelper.save(new DynamicObject[]{dynamicObject}); + } + this.getView().invokeOperation("refresh"); } - this.getView().invokeOperation("refresh"); } }