瀏覽代碼

注释插件

sbtjtserver/zhaoxh 8 月之前
父節點
當前提交
d8c5891a97
共有 1 個文件被更改,包括 1301 次插入0 次删除
  1. 1301 0
      src/main/java/fi/cas/formplugin/ApBillListPlugin.java

+ 1301 - 0
src/main/java/fi/cas/formplugin/ApBillListPlugin.java

@@ -0,0 +1,1301 @@
+//package fi.cas.formplugin;
+//
+//import com.alibaba.fastjson.JSON;
+//import kd.bos.bill.BillOperationStatus;
+//import kd.bos.bill.BillShowParameter;
+//import kd.bos.bill.OperationStatus;
+//import kd.bos.dataentity.OperateOption;
+//import kd.bos.dataentity.RefObject;
+//import kd.bos.dataentity.entity.DynamicObject;
+//import kd.bos.dataentity.entity.DynamicObjectCollection;
+//import kd.bos.dataentity.resource.ResManager;
+//import kd.bos.dataentity.serialization.SerializationUtils;
+//import kd.bos.dataentity.utils.StringUtils;
+//import kd.bos.entity.EntityMetadataCache;
+//import kd.bos.entity.datamodel.ListSelectedRow;
+//import kd.bos.entity.datamodel.ListSelectedRowCollection;
+//import kd.bos.entity.operate.IEntityOperate;
+//import kd.bos.entity.operate.result.OperationResult;
+//import kd.bos.exception.KDBizException;
+//import kd.bos.filter.FilterColumn;
+//import kd.bos.form.*;
+//import kd.bos.form.control.events.BeforeItemClickEvent;
+//import kd.bos.form.control.events.ItemClickEvent;
+//import kd.bos.form.events.*;
+//import kd.bos.form.operate.AbstractOperate;
+//import kd.bos.form.operate.FormOperate;
+//import kd.bos.form.operate.SignOperateCallback;
+//import kd.bos.list.BillList;
+//import kd.bos.list.ListShowParameter;
+//import kd.bos.list.events.BeforeShowBillFormEvent;
+//import kd.bos.logging.Log;
+//import kd.bos.logging.LogFactory;
+//import kd.bos.mvc.list.ListView;
+//import kd.bos.orm.query.QFilter;
+//import kd.bos.orm.util.CollectionUtils;
+//import kd.bos.servicehelper.BusinessDataServiceHelper;
+//import kd.bos.servicehelper.DispatchServiceHelper;
+//import kd.bos.servicehelper.QueryServiceHelper;
+//import kd.bos.servicehelper.botp.BFTrackerServiceHelper;
+//import kd.bos.servicehelper.operation.OperationServiceHelper;
+//import kd.bos.servicehelper.operation.SaveServiceHelper;
+//import kd.fi.cas.business.errorcode.PaymentErrorCode;
+//import kd.fi.cas.business.helper.PayBillHepler;
+//import kd.fi.cas.business.opservice.impl.PaymentPayImpl;
+//import kd.fi.cas.consts.BillTypeConstants;
+//import kd.fi.cas.enums.*;
+//import kd.fi.cas.formplugin.common.AbstractCasBillListPlugin;
+//import kd.fi.cas.formplugin.helper.InitCheckPluginHelper;
+//import kd.fi.cas.helper.*;
+//import kd.fi.cas.util.EmptyUtil;
+//import org.apache.commons.lang3.tuple.Pair;
+//
+//import java.util.*;
+//import java.util.stream.Collectors;
+//import java.util.stream.Stream;
+//
+///**
+// * 应付销账单列表件
+// * 2024-08-15 wangj
+// * 主要功能:应付销账单标准列表插件改
+// */
+//public class ApBillListPlugin extends AbstractCasBillListPlugin implements SignCallbackLisenter {
+//    private static final String KEY_CHANGECHG_CALLBACK = "KEY_CHANGECHG_CALLBACK";
+//    private static final String BAR_VIEWDIAGRAM = "barviewdiagram";
+//    private static final String KEY_CALLBACK_CHARGEBACK = "CALLBACK_CHARGEBACK";
+//    private static final String KEY_CANCELLATION = "cancellation";
+//    private static final String CONFIRM_DEL_CALLBACK = "CONFIRM_DEL_CALLBACK";
+//    private static final String KEY_DIFFPAY_CALLBACK = "KEY_DIFFPAY_CALLBACK";
+//    private static final String KEY_CLOSECALLBACK_CHARGEBACK = "CALLBACK_SELECTDRAFT";
+//    private static final String BAR_BATCH_INPUT = "batchinput";
+//    private FilterContainerInitArgs initArgs;
+//    private static Log logger = LogFactory.getLog(kd.fi.cas.formplugin.PaymentBillList.class);
+//    private List<String> settleTypes;
+//
+//    public ApBillListPlugin() {
+//        this.settleTypes = Arrays.asList(SettleMentTypeEnum.PROMISSORY.getValue(), SettleMentTypeEnum.CHECK.getValue(), SettleMentTypeEnum.DRAFT.getValue(), SettleMentTypeEnum.BUSINESS.getValue(), SettleMentTypeEnum.BANK.getValue());
+//    }
+//
+//    public boolean isFromControlCenter() {
+//        FormShowParameter formShowParameter = this.getView().getFormShowParameter();
+//        Object isUnTreated = formShowParameter.getCustomParam("isUnTreated");
+//        return EmptyUtil.isEmpty(isUnTreated) ? false : (Boolean)isUnTreated;
+//    }
+//
+//    public boolean isTrack() {
+//        FormShowParameter formShowParameter = this.getView().getFormShowParameter();
+//        Object isTrack = formShowParameter.getCustomParam("isTrack");
+//        return EmptyUtil.isEmpty(isTrack) ? false : (Boolean)isTrack;
+//    }
+//
+//    public void setFilter(SetFilterEvent e) {
+//        super.setFilter(e);
+//        ListShowParameter listShowParameter = (ListShowParameter)this.getView().getFormShowParameter();
+//        String parentFormId = listShowParameter.getParentFormId();
+//        Object isFromTrack = listShowParameter.getCustomParams().getOrDefault("isFromTrack", (Object)null);
+//        PaymentQueryHelper.enhanceNumFilterToIdFilter(e.getQFilters());
+//        logger.info("付款单-调度中心 parentFormId :" + parentFormId + "; === " + this.isFromControlCenter());
+//        if (this.isFromControlCenter() && "fca_control_index".equals(parentFormId)) {
+//            if (e.getMainOrgQFilter() != null) {
+//                e.getMainOrgQFilter().clearNests();
+//            }
+//
+//            Object authOrgIds = listShowParameter.getCustomParam("authOrgIds");
+//            Long p = 0L;
+//            if (authOrgIds instanceof Integer) {
+//                p = ((Integer)authOrgIds).longValue();
+//            } else if (authOrgIds instanceof Long) {
+//                p = (Long)authOrgIds;
+//            } else if (authOrgIds instanceof String) {
+//                p = Long.valueOf(authOrgIds.toString());
+//            }
+//
+//            e.getQFilters().add(PayBillListPlugnHelper.getFcaFilter((String)listShowParameter.getCustomParam("status"), p));
+//        } else if (("cas_apphome_grid".equals(parentFormId) || "fca_apphome".equals(parentFormId) || "fs_apphome".equals(parentFormId)) && (null == isFromTrack || isFromTrack.toString().trim().equals(""))) {
+//            e.getQFilters().add(PayBillListPlugnHelper.getListFilter(listShowParameter.getBillFormId(), (String)listShowParameter.getCustomParam("appid")));
+//        }
+//
+//    }
+//
+//    public void afterBindData(EventObject e) {
+//        super.afterBindData(e);
+//        if (this.isFromControlCenter()) {
+//            String status = (String)this.getView().getFormShowParameter().getCustomParam("status");
+//            if (BillStatusEnum.SAVE.getValue().equals(status)) {
+//                this.getView().setVisible(false, new String[]{"tblnew", "tblcheck", "tblcopy", "tblpay", "barinfochg", "baritemap2", "tblprint"});
+//            } else if (BillStatusEnum.SUBMIT.getValue().equals(status)) {
+//                this.getView().setVisible(false, new String[]{"tblnew", "tblsubmit", "tblcopy", "tblpay", "barinfochg", "baritemap2", "tblprint"});
+//            } else {
+//                this.getView().setVisible(false, new String[]{"tblnew", "tblsubmit", "tblcopy", "tblcheck", "barinfochg", "baritemap2", "tblprint"});
+//            }
+//        }
+//
+//    }
+//
+//    public void beforeItemClick(BeforeItemClickEvent evt) {
+//        String opKey = evt.getOperationKey();
+//        BillList billList = (BillList)this.getControl("billlistap");
+//        ListSelectedRowCollection selectRows = billList.getSelectedRows();
+//        Set selectRowsPks;
+//        QFilter[] delFilters;
+//        DynamicObject[] paybills;
+//        if ("delete".equals(opKey) && selectRows.size() > 0) {
+////            selectRowsPks = (Set)selectRows.parallelStream().map((row) -> {
+////                return row.getPrimaryKeyValue();
+////            }).collect(Collectors.toSet());
+////            delFilters = new QFilter[]{new QFilter("id", "in", selectRowsPks), new QFilter("hotaccount", "!=", "2"), new QFilter("sourcebilltype", "=", "cas_recbill")};
+////            paybills = BusinessDataServiceHelper.load("nckd_cas_apbill_xz", "billno", delFilters);
+////            if (EmptyUtil.isNoEmpty(paybills)) {
+////                evt.setCancel(true);
+////                String billnoStr = (String)((Stream)Arrays.stream(paybills).parallel()).map((d) -> {
+////                    return d.getString("billno");
+////                }).collect(Collectors.joining("、"));
+////                this.getView().showConfirm(String.format(ResManager.loadKDString("%s付款单由内部收付协同业务自动生成,是否确认删除?", "PaymentBillEdit_23", "fi-cas-formplugin", new Object[0]), billnoStr), MessageBoxOptions.YesNo, ConfirmTypes.Default, new ConfirmCallBackListener("CONFIRM_DEL_CALLBACK", this));
+////            }
+//        } else if ("pay".equals(opKey) && selectRows.size() > 0) {
+//            selectRowsPks = (Set)selectRows.parallelStream().map((row) -> {
+//                return row.getPrimaryKeyValue();
+//            }).collect(Collectors.toSet());
+//            delFilters = new QFilter[]{new QFilter("id", "in", selectRowsPks)};
+//            paybills = BusinessDataServiceHelper.load("nckd_cas_apbill_xz", "billno,org,settletype", delFilters);
+//            if (EmptyUtil.isNoEmpty(paybills)) {
+//                boolean hasErrorData = false;
+//                DynamicObject[] var9 = paybills;
+//                int var10 = paybills.length;
+//
+//                for(int var11 = 0; var11 < var10; ++var11) {
+//                    DynamicObject dataEntity = var9[var11];
+//                    long orgId = dataEntity.getDynamicObject("org").getLong("id");
+//                    boolean selectDraftFlag = SystemParameterHelper.getParameterBoolean(orgId, "cs122");
+//                    String settleTypeKey = DraftHelper.getKey(dataEntity.get("settletype"));
+//                    logger.info("selectDraftFlag is:" + selectDraftFlag + ",key:" + settleTypeKey);
+//                    boolean isdraft = SystemParameterHelper.getCdmParameterBoolean(orgId, "isdraft");
+//                    boolean ischeck = SystemParameterHelper.getCdmParameterBoolean(orgId, "ischeck");
+//                    boolean ispromissorynote = SystemParameterHelper.getCdmParameterBoolean(orgId, "ispromissorynote");
+//                    if (!CasHelper.isEmpty(settleTypeKey)) {
+//                        String typeName;
+//                        switch (settleTypeKey) {
+//                            case "isdraft":
+//                                if (isdraft && !selectDraftFlag) {
+//                                    typeName = ResManager.loadKDString("汇票", "DraftHelper_4", "fi-cas-common", new Object[0]);
+//                                    this.cancelAndWarn(evt, dataEntity, typeName);
+//                                }
+//                                break;
+//                            case "ischeck":
+//                                if (ischeck && !selectDraftFlag) {
+//                                    typeName = ResManager.loadKDString("支票", "DraftHelper_5", "fi-cas-common", new Object[0]);
+//                                    this.cancelAndWarn(evt, dataEntity, typeName);
+//                                }
+//                                break;
+//                            case "ispromissorynote":
+//                                if (ispromissorynote && !selectDraftFlag) {
+//                                    typeName = ResManager.loadKDString("本票", "DraftHelper_6", "fi-cas-common", new Object[0]);
+//                                    this.cancelAndWarn(evt, dataEntity, typeName);
+//                                }
+//                        }
+//                    }
+//                }
+//            }
+//        }
+//
+//        if ("commitbe".equals(opKey) && selectRows.size() > 0) {
+//            OperateOption op = OperateOption.create();
+//            op.setVariableValue("ishasright", "true");
+//            Object[] selectedRowPks = this.getSelectedRows().getPrimaryKeyValues();
+//            OperationResult operationResult = OperationServiceHelper.executeOperate("beforecommitbe", "nckd_cas_apbill_xz", selectedRowPks, op);
+//            if (!operationResult.isSuccess() && operationResult.isNeedSign()) {
+//                SignOperateCallback signOperate = new SignOperateCallback(this.getView(), this, op, ClientCallback.SignClientType.Secondry, "signbeforecommitbe");
+//                OperationResult ops = signOperate.sign(operationResult);
+//                evt.setCancel(true);
+//                if (!ops.isSuccess()) {
+//                    logger.info(" beforecommitbe sign error ");
+//                    if (ops.isShowMessage() && EmptyUtil.isNoEmpty(ops.getMessage())) {
+//                        this.getView().showTipNotification(ops.getMessage());
+//                    }
+//                }
+//            }
+//        }
+//
+//    }
+//
+//    private void cancelAndWarn(BeforeItemClickEvent evt, DynamicObject dataEntity, String typeName) {
+//        String msg = String.format(ResManager.loadKDString("%1$s :结算方式类别为%2$s的付款单不支持确认付款", "DraftHelper_7_1", "fi-cas-common", new Object[0]), dataEntity.getString("billno"), typeName);
+//        evt.setCancel(true);
+//        this.getView().showTipNotification(msg);
+//    }
+//
+//    public void itemClick(ItemClickEvent evt) {
+//        super.itemClick(evt);
+//        String key = evt.getItemKey();
+//        switch (key.toLowerCase(Locale.ENGLISH)) {
+//            case "tblnew4ap":
+//                this.addNew(PaymentTypeEnum.AP, "nckd_cas_apbill_xz");
+//                break;
+//            case "tblnew4er":
+//                this.addNew(PaymentTypeEnum.ER, "nckd_cas_apbill_xz");
+//                break;
+//            case "tblnew4otr":
+//                this.addNew(PaymentTypeEnum.OTR, "nckd_cas_apbill_xz");
+//                break;
+//            case "tblnew4syn":
+//                this.addNew(PaymentTypeEnum.SYN, "nckd_cas_apbill_xz_synonym");
+//                break;
+//            case "tblnew4cash":
+//                this.addNew(PaymentTypeEnum.CASH, "nckd_cas_apbill_xz_cash");
+//            case "tbloffset":
+//            default:
+//                break;
+//            case "tblbeforesubmit":
+//                this.beforeSubmit();
+//                break;
+//            case "barviewdiagram":
+//                this.viewDiagram();
+//                break;
+//            case "viewsettle":
+//                this.viewSettle();
+//                break;
+//            case "tblcancelpay":
+//                this.cancelPay();
+//                break;
+//            case "viewdrafbill":
+//                this.viewDrafBill();
+//                break;
+//            case "tblnewspan":
+//                this.addNew(PaymentTypeEnum.SPAN, "nckd_cas_apbill_xz_spanmainpart");
+//                break;
+//            case "batchinput":
+//                this.viewBatchInput();
+//        }
+//
+//    }
+//
+//    private void openEditView(String opName) {
+//        BillList billList = (BillList)this.getView().getControl("billlistap");
+//        ListSelectedRowCollection selectedRows = billList.getSelectedRows();
+//        Object[] selectedRowPks = selectedRows.getPrimaryKeyValues();
+//        if (selectedRowPks.length != 1) {
+//            this.getView().showErrorNotification(ResManager.loadKDString("请选中一行再进行操作", "PaymentBillList_22", "fi-cas-formplugin", new Object[0]));
+//        } else {
+//            ListSelectedRow currentSelectedRowInfo = selectedRows.get(0);
+//            String billStatus = currentSelectedRowInfo.getBillStatus();
+//            if (!BillStatusEnum.RENOTE.getValue().equals(billStatus) && !BillStatusEnum.CHARGEBANK.getValue().equals(billStatus) && !BillStatusEnum.REFUND.getValue().equals(billStatus) && !BillStatusEnum.DEAD.getValue().equals(billStatus) && !BillStatusEnum.SAVE.getValue().equals(billStatus)) {
+//                Object primaryKeyValue = currentSelectedRowInfo.getPrimaryKeyValue();
+//                DynamicObject paybillDO = BusinessDataServiceHelper.loadSingle(primaryKeyValue, "nckd_cas_apbill_xz", "paymenttype");
+//                DynamicObject paymenttype = paybillDO.getDynamicObject("paymenttype");
+//                boolean ispartpayment = paymenttype.getBoolean("ispartpayment");
+//                if (!ispartpayment) {
+//                    this.getView().showErrorNotification(ResManager.loadKDString("此单据付款类型没有参与应付结算,不能进行此操作", "PaymentBillList_24", "fi-cas-formplugin", new Object[0]));
+//                } else {
+//                    BillShowParameter showParameter = new BillShowParameter();
+//                    showParameter.setCustomParam("op_supplecontract", opName);
+//                    showParameter.setPkId(primaryKeyValue);
+//                    showParameter.setCaption(ResManager.loadKDString("付款单", "PaymentBillList_25", "fi-cas-formplugin", new Object[0]));
+//                    showParameter.setFormId("nckd_cas_apbill_xz_contract");
+//                    showParameter.getOpenStyle().setShowType(ShowType.MainNewTabPage);
+//                    this.getView().showForm(showParameter);
+//                }
+//            } else {
+//                this.getView().showErrorNotification(ResManager.loadKDString("单据状态不符合,不能进行此操作", "PaymentBillList_23", "fi-cas-formplugin", new Object[0]));
+//            }
+//        }
+//    }
+//
+//    private void openChangeChg(String sourceType, String sourceAction) {
+//        FormShowParameter showParameter = new FormShowParameter();
+//        BillList billList = (BillList)this.getView().getControl("billlistap");
+//        ListSelectedRowCollection selectedRows = billList.getSelectedRows();
+//        Long sourceId = (Long)selectedRows.get(0).getPrimaryKeyValue();
+//        StyleCss css = new StyleCss();
+//        css.setWidth("700");
+//        css.setHeight("400");
+//        showParameter.getOpenStyle().setInlineStyleCss(css);
+//        showParameter.setCustomParam("sourceId", sourceId);
+//        showParameter.setCustomParam("sourceType", sourceType);
+//        showParameter.setCustomParam("sourceAction", sourceAction);
+//        showParameter.setFormId("cas_changemodeselection");
+//        showParameter.getOpenStyle().setShowType(ShowType.Modal);
+//        showParameter.setStatus(OperationStatus.ADDNEW);
+//        showParameter.setCloseCallBack(new CloseCallBack(this, "KEY_CHANGECHG_CALLBACK"));
+//        this.getView().showForm(showParameter);
+//    }
+//
+//    private void addNew(PaymentTypeEnum paymentType, String formId) {
+//        this.getPageCache().put("paymentType", paymentType.name());
+//        this.getPageCache().put("formId", formId);
+//        this.getView().invokeOperation("new");
+//    }
+//
+//    public void closedCallBack(ClosedCallBackEvent e) {
+//        super.closedCallBack(e);
+//        PayBillListPlugnHelper.closeCallBack(e.getActionId(), this.getView(), e.getReturnData());
+//    }
+//
+//    private void beforeSubmit() {
+//        BillList billList = (BillList)this.getControl("billlistap");
+//        ListSelectedRowCollection selectedRows = billList.getSelectedRows();
+//        if (selectedRows.size() <= 0) {
+//            this.getView().showTipNotification(ResManager.loadKDString("请选择要执行的数据!", "PaymentBillList_0", "fi-cas-formplugin", new Object[0]));
+//        } else {
+//            this.getView().invokeOperation("beforesubmit");
+//        }
+//
+//    }
+//
+//    private void viewDiagram() {
+//        BillList billList = (BillList)this.getControl("billlistap");
+//        ListSelectedRowCollection selectedRows = billList.getSelectedRows();
+//        Object[] selectedRowPks = selectedRows.getPrimaryKeyValues();
+//        if (selectedRowPks.length != 1) {
+//            this.getView().showTipNotification(ResManager.loadKDString("请选择要执行的数据!", "PaymentBillList_0", "fi-cas-formplugin", new Object[0]));
+//        } else {
+//            ListSelectedRow selectedRow = selectedRows.get(0);
+//            Long billId = (Long)selectedRow.getPrimaryKeyValue();
+//            FormShowParameter showParameter = new FormShowParameter();
+//            showParameter.setFormId("wf_viewflowchart");
+//            showParameter.setClientParam("billId", billId);
+//            showParameter.getOpenStyle().setShowType(ShowType.NewWindow);
+//            this.getView().showForm(showParameter);
+//        }
+//    }
+//
+//    private void viewSettle() {
+//        BillList billList = (BillList)this.getControl("billlistap");
+//        ListSelectedRowCollection selectedRows = billList.getSelectedRows();
+//        Object[] selectedRowPks = selectedRows.getPrimaryKeyValues();
+//        if (selectedRowPks.length == 0) {
+//            this.getView().showTipNotification(ResManager.loadKDString("请选择要执行的数据!", "PaymentBillList_3", "fi-cas-formplugin", new Object[0]));
+//        } else if (selectedRowPks.length > 1) {
+//            this.getView().showTipNotification(ResManager.loadKDString("请选择单条数据联查!", "PaymentBillList_4", "fi-cas-formplugin", new Object[0]));
+//        } else {
+//            Object primaryKey = selectedRowPks[0];
+//            List<Long> mainSettleIds = SettleRecordQueryHelperForCas.getSettleIdsByMain("ap_settlerecord", "nckd_cas_apbill_xz", new Object[]{primaryKey});
+//            List<Long> asstSettleIds = SettleRecordQueryHelperForCas.getSettleIdsByAsst("ap_settlerecord", "nckd_cas_apbill_xz", new Object[]{primaryKey});
+//            Set<Long> settleRecordIds = new HashSet();
+//            settleRecordIds.addAll(mainSettleIds);
+//            settleRecordIds.addAll(asstSettleIds);
+//            if (settleRecordIds.size() > 0) {
+//                PayBillListPlugnHelper.viewSettle(settleRecordIds, this.getView());
+//            } else {
+//                this.getView().showTipNotification(ResManager.loadKDString("暂无结算记录。", "PaymentBillList_5", "fi-cas-formplugin", new Object[0]));
+//            }
+//        }
+//
+//    }
+//
+//    public void beforeDoOperation(BeforeDoOperationEventArgs args) {
+//        super.beforeDoOperation(args);
+//        AbstractOperate op = (AbstractOperate)args.getSource();
+//        String key = op.getOperateKey();
+//        BillList list;
+//        ListSelectedRowCollection selectedRows;
+//        DynamicObject dbData;
+//        Object[] selectedRowPks;
+//        DynamicObject[] payBills;
+//        ListSelectedRowCollection lstCollection;
+//        DynamicObject payBill;
+//        int var45;
+//        if ("trackdown".equals(key)) {
+//            list = (BillList)this.getView().getControl("billlistap");
+//            selectedRows = list.getSelectedRows();
+//            lstCollection = list.getSelectedRows();
+//            payBill = BusinessDataServiceHelper.loadSingle(lstCollection.get(0).getPrimaryKeyValue(), "nckd_cas_apbill_xz", "id,settletype");
+//            dbData = payBill.getDynamicObject("settletype");
+//            if (dbData != null) {
+//                String settlementtype = dbData.getString("settlementtype");
+//                if (EmptyUtil.isNoEmpty(settlementtype) && this.settleTypes.contains(settlementtype)) {
+//                    op.getOption().setVariableValue("botp_track_edit_status", "true");
+//                }
+//            }
+//        } else {
+//            FormOperate operate;
+//            if ("chargeback".equals(key)) {
+//                operate = (FormOperate)args.getSource();
+//                operate.getOption().setVariableValue("strictvalidation", String.valueOf(true));
+//            } else if ("invalid".equals(key)) {
+//                boolean result = op.getOption().tryGetVariableValue("cancellation", new RefObject());
+//                if (!result) {
+//                    list = (BillList)this.getView().getControl("billlistap");
+//                    lstCollection = list.getSelectedRows();
+//                    args.cancel = true;
+//                    if (CasHelper.getSelectedRowSize(lstCollection) > 1) {
+//                        this.getView().showTipNotification(ResManager.loadKDString("作废仅支持对单张单据处理,请修改选择范围。", "PaymentBillList_8", "fi-cas-formplugin", new Object[0]));
+//                        return;
+//                    }
+//
+//                    this.getView().showConfirm(ResManager.loadKDString("作废选中记录后,将无法恢复,确认要作废该记录吗?", "PaymentBillList_9", "fi-cas-formplugin", new Object[0]), MessageBoxOptions.OKCancel, new ConfirmCallBackListener("cancellation", this));
+//                }
+//            } else {
+//                DynamicObject settletype;
+//                String payConfirm;
+//                if ("endorse".equals(key)) {
+//                    list = (BillList)this.getView().getControl("billlistap");
+//                    selectedRows = list.getSelectedRows();
+//                    if (CasHelper.getSelectedRowSize(selectedRows) > 1) {
+//                        this.getView().showTipNotification(ResManager.loadKDString("背书仅支持对单张单据处理,请修改选择范围。", "PaymentBillList_20", "fi-cas-formplugin", new Object[0]));
+//                        args.cancel = true;
+//                        return;
+//                    }
+//
+//                    if (selectedRows.size() == 1) {
+//                        DynamicObject info = BusinessDataServiceHelper.loadSingle(selectedRows.get(0).getPrimaryKeyValue(), "nckd_cas_apbill_xz");
+//                        payBill = info.getDynamicObject("payeracctbank");
+//                        payConfirm = info.getString("billstatus");
+//                        if (!BillStatusEnum.AUDIT.getValue().equals(payConfirm)) {
+//                            this.getView().showTipNotification(ResManager.loadKDString("只有已审核状态的单据允许背书。", "PaymentBillDraftEditPlugin_2", "fi-cas-formplugin", new Object[0]));
+//                            args.cancel = true;
+//                            return;
+//                        }
+//
+//                        if (PriorityEnum.DEFER.getValue().equals(info.getString("priority"))) {
+//                            this.getView().showTipNotification(ResManager.loadKDString("单据已冻结,不支持该操作。", "PaymentBillFreezeValidator_0", "fi-cas-opplugin", new Object[0]));
+//                            args.cancel = true;
+//                            return;
+//                        }
+//
+//                        if (!InitCheckPluginHelper.checkInitForPlugin(this.getView(), info.getDynamicObject("org"), new String[0])) {
+//                            args.setCancel(true);
+//                            return;
+//                        }
+//
+//                        if (PaymentBillPluginHelper.checkPayeeTypeFreeze(Collections.singletonList(info))) {
+//                            this.getView().showTipNotification((new PaymentErrorCode()).CANOTDOTHISOP_WHENSUPPLIERFREEZE().getMessage());
+//                            args.setCancel(true);
+//                            return;
+//                        }
+//
+//                        settletype = info.getDynamicObject("settletype");
+//                        DynamicObjectCollection draftbills = info.getDynamicObjectCollection("draftbill");
+//                        if (settletype == null || draftbills == null || !settletype.getString("settlementtype").equals("5") && !settletype.getString("settlementtype").equals("6") || draftbills.size() == 0) {
+//                            this.getView().showTipNotification(ResManager.loadKDString("背书仅适应结算方式类型是承兑汇票、支票或本票且结算号选择了库存票据的付款单,你所选单据不支持背书", "PaymentBillDraftEditPlugin_3", "fi-cas-formplugin", new Object[0]));
+//                            args.cancel = true;
+//                            return;
+//                        }
+//
+//                        if (!DraftHelper.isHasRecDrafBill(draftbills)) {
+//                            args.setCancel(true);
+//                            this.getView().showTipNotification(ResManager.loadKDString("背书仅适用选择了库存应收票据的付款单,你所选单据不支持背书", "PaymentBillDraftEditPlugin_10", "fi-cas-formplugin", new Object[0]));
+//                            return;
+//                        }
+//
+//                        if (DraftHelper.isHasPayDrafBill(draftbills)) {
+//                            args.setCancel(true);
+//                            this.getView().showTipNotification(ResManager.loadKDString("存在应付票据不能确认背书,请在确认付款环节选择需要关联付款的应付票据和已背书的应收票据", "PaymentBillDraftEditPlugin_10_1", "fi-cas-formplugin", new Object[0]));
+//                            return;
+//                        }
+//
+//                        if (!DraftHelper.isParameterDraftOn((Long)selectedRows.get(0).getPrimaryKeyValue(), "nckd_cas_apbill_xz")) {
+//                            args.setCancel(true);
+//                            this.getView().showTipNotification(ResManager.loadKDString("该组织没有启用相应的系统参数,请配置相应的系统参数!", "PaymentBillDraftEditPlugin_4", "fi-cas-formplugin", new Object[0]));
+//                            return;
+//                        }
+//
+//                        if (payBill != null && PayBillCrossHelper.isIfmBankAcc(payBill)) {
+//                            throw new KDBizException(ResManager.loadKDString("内部账户请选择内部结算付款。", "PaymentErrorCode_48", "fi-cas-business", new Object[0]));
+//                        }
+//
+//                        if (settletype != null && draftbills != null && draftbills.size() > 0 && Arrays.asList("5", "6").contains(settletype.getString("settlementtype"))) {
+//                            Pair<String, List<String>> result = (Pair) DispatchServiceHelper.invokeBizService("tmc", "cdm", "EBDraftAllocationService", "doDraftAllocationService", new Object[]{info});
+//                            if (result != null) {
+//                                if ("ING".equals(result.getLeft())) {
+//                                    args.cancel = true;
+//                                    info.set("billstatus", BillStatusEnum.DRAFTING.getValue());
+//                                    SaveServiceHelper.save(new DynamicObject[]{info});
+//                                    this.getView().showSuccessNotification(BillStatusEnum.DRAFTING.getName());
+//                                    this.getView().invokeOperation("refresh");
+//                                } else if (!"S".equals(result.getLeft())) {
+//                                    args.cancel = true;
+//                                    this.getView().showErrorNotification(String.join("\n", (Iterable)result.getRight()));
+//                                }
+//                            }
+//                        }
+//                    }
+//                } else {
+//                    DynamicObject[] payableBills;
+//                    DynamicObject accountBank;
+//                    DynamicObject payableBill;
+//                    if ("recbook".equals(key)) {
+//                        list = (BillList)this.getControl("billlistap");
+//                        selectedRows = list.getSelectedRows();
+//                        if (CasHelper.getSelectedRowSize(selectedRows) > 1) {
+//                            args.setCancel(true);
+//                            this.getView().showTipNotification(ResManager.loadKDString("请选择单条数据!", "ReceivingBillList_10", "fi-cas-formplugin", new Object[0]));
+//                        } else {
+//                            Long primaryKeyValue = (Long)selectedRows.get(0).getPrimaryKeyValue();
+//                            payBill = BusinessDataServiceHelper.loadSingle(primaryKeyValue, "nckd_cas_apbill_xz");
+//                            if (!BillStatusEnum.AUDIT.getValue().equals(payBill.getString("billstatus"))) {
+//                                args.setCancel(true);
+//                                this.getView().showTipNotification(ResManager.loadKDString("只有已审核状态的单据允许开票登记。", "PaymentBillDraftEditPlugin_5", "fi-cas-formplugin", new Object[0]));
+//                            } else if (PriorityEnum.DEFER.getValue().equals(payBill.getString("priority"))) {
+//                                args.setCancel(true);
+//                                this.getView().showTipNotification(ResManager.loadKDString("单据已冻结,不支持该操作。", "PaymentBillFreezeValidator_0", "fi-cas-opplugin", new Object[0]));
+//                            } else {
+//                                if (!InitCheckPluginHelper.checkInitForPlugin(this.getView(), payBill.getDynamicObject("org"), new String[0])) {
+//                                    args.setCancel(true);
+//                                    return;
+//                                }
+//
+//                                if (PaymentBillPluginHelper.checkPayeeTypeFreeze(Collections.singletonList(payBill))) {
+//                                    this.getView().showTipNotification((new PaymentErrorCode()).CANOTDOTHISOP_WHENSUPPLIERFREEZE().getMessage());
+//                                    args.setCancel(true);
+//                                    return;
+//                                }
+//
+//                                if (!DraftHelper.isDraftBill(primaryKeyValue, "nckd_cas_apbill_xz")) {
+//                                    args.setCancel(true);
+//                                    this.getView().showTipNotification(ResManager.loadKDString("开票登记仅适用结算方式类型是承兑汇票、支票或本票的付款单,你所选单据不支持开票登记!", "PaymentBillDraftEditPlugin_6", "fi-cas-formplugin", new Object[0]));
+//                                } else if (this.isDraftBill(payBill)) {
+//                                    args.setCancel(true);
+//                                    if (DraftHelper.isHasRecDrafBill((DynamicObjectCollection)payBill.get("draftbill"))) {
+//                                        this.getView().showTipNotification(ResManager.loadKDString("付款单已选择相关应收票据,请进行背书处理!", "PaymentBillDraftEditPlugin_7", "fi-cas-formplugin", new Object[0]));
+//                                    } else {
+//                                        this.getView().showTipNotification(ResManager.loadKDString("付款单已选择相关应付票据,请进行确认付款处理!", "PaymentBillDraftEditPlugin_11", "fi-cas-formplugin", new Object[0]));
+//                                    }
+//                                } else if (!DraftHelper.isParameterDraftOn(primaryKeyValue, "nckd_cas_apbill_xz")) {
+//                                    args.setCancel(true);
+//                                    this.getView().showTipNotification(ResManager.loadKDString("该组织没有启用相应的系统参数,请配置相应的系统参数!", "PaymentBillDraftEditPlugin_4", "fi-cas-formplugin", new Object[0]));
+//                                } else {
+//                                    Map<String, HashSet<Long>> botpMap = BFTrackerServiceHelper.findTargetBills("nckd_cas_apbill_xz", new Long[]{primaryKeyValue});
+//                                    HashSet<Long> pkValues = (HashSet)botpMap.get("cdm_payablebill");
+//                                    boolean isExistNotDeadFlag = false;
+//                                    if (null != pkValues && pkValues.size() > 0) {
+//                                        payableBills = BusinessDataServiceHelper.load("cdm_payablebill", "id,billstatus", new QFilter[]{new QFilter("id", "in", pkValues.toArray())});
+//                                        DynamicObject[] var58 = payableBills;
+//                                        int var60 = payableBills.length;
+//
+//                                        for(int var62 = 0; var62 < var60; ++var62) {
+//                                            payableBill = var58[var62];
+//                                            if (!BillStatusEnum.DEAD.getValue().equals(payableBill.getString("billstatus"))) {
+//                                                isExistNotDeadFlag = true;
+//                                            }
+//                                        }
+//                                    }
+//
+//                                    if (isExistNotDeadFlag) {
+//                                        args.setCancel(true);
+//                                        this.getView().showTipNotification(ResManager.loadKDString("付款单已进行开票登记!", "PaymentBillDraftEditPlugin_8", "fi-cas-formplugin", new Object[0]));
+//                                    }
+//
+//                                    accountBank = payBill.getDynamicObject("payeracctbank");
+//                                    if (null != accountBank && AccountBankHelper.isClosed(accountBank.getLong("id"))) {
+//                                        throw new KDBizException(String.format(ResManager.loadKDString("账户%s当前状态为已销户,暂无法进行业务处理。", "PaymentErrorCode_47", "fi-cas-business", new Object[0]), accountBank.getString("number")));
+//                                    }
+//
+//                                    if (accountBank != null && PayBillCrossHelper.isIfmBankAcc(accountBank)) {
+//                                        throw new KDBizException(ResManager.loadKDString("内部账户请选择内部结算付款。", "PaymentErrorCode_48", "fi-cas-business", new Object[0]));
+//                                    }
+//                                }
+//                            }
+//                        }
+//                    } else if ("submit".equals(key)) {
+//                        list = (BillList)this.getControl("billlistap");
+//                        selectedRowPks = list.getSelectedRows().getPrimaryKeyValues();
+//                        if (selectedRowPks != null && selectedRowPks.length > 0) {
+//                            payBills = BusinessDataServiceHelper.load(selectedRowPks, EntityMetadataCache.getDataEntityType("nckd_cas_apbill_xz"));
+//                            List<DynamicObject> updateBills = new ArrayList(payBills.length);
+//                            DynamicObject[] var42 = payBills;
+//                            var45 = payBills.length;
+//
+//                            for(int var50 = 0; var50 < var45; ++var50) {
+//                                accountBank = var42[var50];
+//                                boolean isRemove = false;
+//                                DynamicObjectCollection collection = accountBank.getDynamicObjectCollection("entry");
+//                                Iterator<DynamicObject> iterator = collection.iterator();
+//
+//                                while(iterator.hasNext()) {
+//                                    payableBill = (DynamicObject)iterator.next();
+//                                    if (CasHelper.isEmpty(payableBill.get("e_payableamt"))) {
+//                                        iterator.remove();
+//                                        isRemove = true;
+//                                    }
+//                                }
+//
+//                                if (isRemove) {
+//                                    updateBills.add(accountBank);
+//                                }
+//                            }
+//
+//                            if (updateBills.size() > 0) {
+//                                SaveServiceHelper.save((DynamicObject[])updateBills.toArray(new DynamicObject[0]));
+//                            }
+//                        }
+//                    } else if ("payschback".equals(key)) {
+//                        operate = (FormOperate)args.getSource();
+//                        operate.getOption().setVariableValue("strictvalidation", String.valueOf(true));
+//                    } else if ("pay".equals(key)) {
+//                        list = (BillList)this.getView().getControl("billlistap");
+//                        selectedRows = list.getSelectedRows();
+//                        Set<Object> selectRowsPks = new HashSet();
+//                        selectedRows.forEach((listSelectedRow) -> {
+//                            selectRowsPks.add(listSelectedRow.getPrimaryKeyValue());
+//                        });
+//                        String draftIds = op.getOption().getVariableValue("draftids", "");
+//                        if (selectRowsPks.size() == 1 && StringUtils.isEmpty(draftIds)) {
+//                            dbData = BusinessDataServiceHelper.loadSingle(selectedRows.get(0).getPrimaryKeyValue(), EntityMetadataCache.getDataEntityType("nckd_cas_apbill_xz"));
+//                            settletype = (DynamicObject)dbData.get("org");
+//                            Long pkValue = (Long)settletype.getPkValue();
+//                            boolean selectDraftFlag = SystemParameterHelper.getParameterBoolean(pkValue, "cs122");
+//                            if (selectDraftFlag && PaymentBillPluginHelper.needSelectedDraft(dbData) && BillStatusEnum.AUDIT.getValue().equals(dbData.getString("billstatus"))) {
+//                                PayBillListPlugnHelper.showSelectDraftForm(new CloseCallBack(this, "CALLBACK_SELECTDRAFT"), this.getView(), selectedRows.get(0).getPrimaryKeyValue());
+//                                args.setCancel(true);
+//                                return;
+//                            }
+//                        }
+//
+//                        if (StringUtils.isEmpty(draftIds)) {
+//                            payConfirm = op.getOption().getVariableValue("payConfirm", "");
+//                            if (StringUtils.isEmpty(payConfirm)) {
+//                                if (selectedRows.size() <= 0) {
+//                                    throw new KDBizException(ResManager.loadKDString("请选择要执行的数据!", "PaymentBillList_0", "fi-cas-formplugin", new Object[0]));
+//                                }
+//
+//                                Object[] pkArray = selectRowsPks.toArray(new Object[0]);
+//                                QFilter pkFilter = new QFilter("id", "in", pkArray);
+//                                payableBills = BusinessDataServiceHelper.load("nckd_cas_apbill_xz", "org,dpcurrency,basecurrency,isdiffcur", new QFilter[]{pkFilter});
+//                                Set<Long> orgIds = new HashSet(10);
+//                                boolean isSameCurrency = true;
+//                                boolean isSameDpCurrency = true;
+//                                boolean isForeignCurrency = false;
+//                                boolean isSameParam = true;
+//                                Long preDpCurrencyId = 0L;
+//                                Long preBasecurrencyId = 0L;
+//                                String param = null;
+//                                Map<Long, Set<String>> cs1047Params = new HashMap(10);
+//                                if (payableBills != null && payableBills.length > 0) {
+//                                    DynamicObject[] var21 = payableBills;
+//                                    int var22 = payableBills.length;
+//
+//                                    for(int var23 = 0; var23 < var22; ++var23) {
+//                                        payBill = var21[var23];
+//                                        long orgId = (Long)payBill.getDynamicObject("org").getPkValue();
+//                                        new HashSet(1);
+//                                        Set cs1046;
+//                                        if (!orgIds.contains(orgId)) {
+//                                            cs1046 = SystemParameterHelper.getParameterComboxs(orgId, "cs1046");
+//                                            String setParamToString = PayBillListPlugnHelper.setParamToString(cs1046);
+//                                            if (param == null) {
+//                                                param = setParamToString;
+//                                            } else if (!param.equals(setParamToString)) {
+//                                                isSameParam = false;
+//                                            }
+//
+//                                            cs1047Params.put(orgId, cs1046);
+//                                        } else {
+//                                            cs1046 = (Set)cs1047Params.get(orgId);
+//                                        }
+//
+//                                        orgIds.add(orgId);
+//                                        if (payBill.getBoolean("isdiffcur") && cs1046.contains(SysParamCs1046Enum.DIFF.getValue()) && selectRowsPks.size() > 1) {
+//                                            throw new KDBizException(ResManager.loadKDString("存在异币别需要确认付款的单据,不能批量确认付款。", "PaymentBillList_26", "fi-cas-formplugin", new Object[0]));
+//                                        }
+//
+//                                        Long dpcurrencyId = payBill.getDynamicObject("dpcurrency").getLong("id");
+//                                        if (preDpCurrencyId == 0L) {
+//                                            preDpCurrencyId = dpcurrencyId;
+//                                        } else if (!preDpCurrencyId.equals(dpcurrencyId)) {
+//                                            isSameDpCurrency = false;
+//                                        }
+//
+//                                        Long basecurrencyId = payBill.getDynamicObject("basecurrency").getLong("id");
+//                                        if (preBasecurrencyId == 0L) {
+//                                            preBasecurrencyId = basecurrencyId;
+//                                        } else if (!preBasecurrencyId.equals(basecurrencyId)) {
+//                                            isSameCurrency = false;
+//                                        }
+//
+//                                        if (!basecurrencyId.equals(dpcurrencyId)) {
+//                                            isForeignCurrency = true;
+//                                        }
+//                                    }
+//                                }
+//
+//                                if (!isSameParam) {
+//                                    throw new KDBizException(ResManager.loadKDString("所选单据存在多个付款资金组织系统参数“允许确认付款环节更新/补充信息”选项不一致,不能批量确认付款,请重新选择。", "PaymentBillList_34", "fi-cas-formplugin", new Object[0]));
+//                                }
+//
+//                                Set<String> cs1047 = (Set)cs1047Params.get(orgIds.iterator().next());
+//                                if (cs1047.contains(SysParamCs1046Enum.FOREIGN.getValue()) && (!isSameDpCurrency || !isSameCurrency)) {
+//                                    throw new KDBizException(ResManager.loadKDString("开启了系统参数确认付款环节更新外币业务的付款汇率,但所选存在付款币别、业务主币别不一致的单据,不能批量确认付款,请重新选择。", "PaymentBillList_35", "fi-cas-formplugin", new Object[0]));
+//                                }
+//
+//                                Object pk;
+//                                if (selectRowsPks.size() > 1) {
+//                                    if (isForeignCurrency && cs1047.contains(SysParamCs1046Enum.FOREIGN.getValue())) {
+//                                        pk = selectedRows.get(0).getPrimaryKeyValue();
+//                                        payBill = BusinessDataServiceHelper.loadSingle(pk, "nckd_cas_apbill_xz");
+//                                        PayBillListPlugnHelper.showDiffPayRateForm(new CloseCallBack(this, "KEY_DIFFPAY_CALLBACK"), this.getView(), payBill);
+//                                        args.setCancel(true);
+//                                    } else if (cs1047.contains(SysParamCs1046Enum.PAYDATE.getValue())) {
+//                                        PayBillListPlugnHelper.showDiffPayDateForm(new CloseCallBack(this, "KEY_DIFFPAY_CALLBACK"), this.getView());
+//                                        args.setCancel(true);
+//                                    }
+//                                } else {
+//                                    pk = selectedRows.get(0).getPrimaryKeyValue();
+//                                    payBill = BusinessDataServiceHelper.loadSingle(pk, "nckd_cas_apbill_xz");
+//                                    if (PaymentBillPluginHelper.isShowPayConfirm(payBill, cs1047)) {
+//                                        if (!DraftHelper.isAllPayDrafBill(payBill.getDynamicObjectCollection("draftbill")) && !payBill.getBoolean("feepay")) {
+//                                            (new PaymentPayImpl()).validate(payBill);
+//                                            PayBillListPlugnHelper.showDiffPayForm(new CloseCallBack(this, "KEY_DIFFPAY_CALLBACK"), this.getView(), payBill);
+//                                            args.setCancel(true);
+//                                        }
+//                                    } else {
+//                                        (new PaymentPayImpl()).validate(payBill);
+//                                    }
+//                                }
+//                            }
+//                        }
+//                    }
+//                }
+//            }
+//        }
+//
+//        if (Arrays.asList("unaudit", "chargeback", "invalid", "delete", "pay").contains(key) && (!"invalid".equals(key) || "invalid".equals(key) && op.getOption().tryGetVariableValue("cancellation", new RefObject()))) {
+//            list = (BillList)this.getControl("billlistap");
+//            selectedRowPks = list.getSelectedRows().getPrimaryKeyValues();
+//            if (selectedRowPks != null && selectedRowPks.length > 0) {
+//                payBills = BusinessDataServiceHelper.load(selectedRowPks, EntityMetadataCache.getDataEntityType("nckd_cas_apbill_xz"));
+//                DynamicObject[] var41 = payBills;
+//                int var46 = payBills.length;
+//
+//                for(var45 = 0; var45 < var46; ++var45) {
+//                    payBill = var41[var45];
+//                    if (PayBillHepler.getViewSettle(payBill).size() > 0) {
+//                        this.getView().showErrorNotification(String.format(ResManager.loadKDString("%s已存在结算记录,导致操作失败。如需继续执行操作,请先反结算。", "PaymentBillList_36", "fi-cas-formplugin", new Object[0]), String.join(payBill.getString("billno"), "【", "】")));
+//                        args.setCancel(true);
+//                        return;
+//                    }
+//                }
+//            }
+//        }
+//
+//    }
+//
+//    private Boolean isDraftBill(DynamicObject payBill) {
+//        return !CasHelper.isEmpty(payBill.get("draftbill")) && ((DynamicObjectCollection)payBill.get("draftbill")).size() != 0 ? Boolean.TRUE : Boolean.FALSE;
+//    }
+//
+//    private boolean payInfoChgvaild(String chgtype) {
+//        BillList list = (BillList)this.getView().getControl("billlistap");
+//        ListSelectedRowCollection selectedRows = list.getSelectedRows();
+//        if (CasHelper.getSelectedRowSize(selectedRows) > 1) {
+//            this.getView().showTipNotification(ResManager.loadKDString("请选择单条数据进行支付信息变更!", "PaymentBillList_10", "fi-cas-formplugin", new Object[0]));
+//            return false;
+//        } else {
+//            DynamicObjectCollection query = QueryServiceHelper.query("nckd_cas_apbill_xz", "billstatus,matchflag", new QFilter[]{new QFilter("id", "=", selectedRows.get(0).getPrimaryKeyValue())});
+//            if (query.size() < 1) {
+//                this.getView().showTipNotification(ResManager.loadKDString("请选择单条数据进行支付信息变更!", "PaymentBillList_10", "fi-cas-formplugin", new Object[0]));
+//                this.getView().invokeOperation("refresh");
+//                return false;
+//            } else {
+//                Object newStatus = ((DynamicObject)query.get(0)).getString("billstatus");
+//                if (!newStatus.equals("C")) {
+//                    this.getView().showTipNotification(ResManager.loadKDString("只有已审核的单据才能进行支付信息变更。", "PaymentBillList_11", "fi-cas-formplugin", new Object[0]));
+//                    return false;
+//                } else {
+//                    String matchFlag = ((DynamicObject)query.get(0)).getString("matchflag");
+//                    if (!AutoMatchFlagEnum.NONE.getValue().equals(matchFlag)) {
+//                        this.getView().showTipNotification(ResManager.loadKDString("已匹配的单据不允许发起变更", "PaymentBillList_50", "fi-cas-formplugin", new Object[0]));
+//                        return false;
+//                    } else {
+//                        Object selectPk = selectedRows.get(0).getPrimaryKeyValue();
+//                        Boolean ischangepaych = QueryServiceHelper.exists("cas_paychgbill", new QFilter[]{new QFilter("sourcebillid", "=", selectPk), new QFilter("sourcetype", "=", "nckd_cas_apbill_xz"), new QFilter("chgtype", "=", chgtype), new QFilter("iscashconfirm", "!=", "1")});
+//                        if (ischangepaych) {
+//                            this.getView().showTipNotification(ResManager.loadKDString("该单据正在变更支付信息流程中,无法再次变更。", "PaymentBillList_12", "fi-cas-formplugin", new Object[0]));
+//                            return false;
+//                        } else {
+//                            DynamicObject casPayBill = BusinessDataServiceHelper.loadSingle("nckd_cas_apbill_xz", "id,entrustorg,applyorg", new QFilter[]{new QFilter("id", "=", selectPk)});
+//                            if (!CasHelper.isEmpty(casPayBill)) {
+//                                if (!CasHelper.isEmpty(casPayBill.get("entrustorg"))) {
+//                                    this.getView().showTipNotification(ResManager.loadKDString("委托付款业务不支持支付信息变更。", "PaymentBillList_20", "fi-cas-formplugin", new Object[0]));
+//                                    return false;
+//                                }
+//
+//                                if (!CasHelper.isEmpty(casPayBill.get("applyorg"))) {
+//                                    this.getView().showTipNotification(ResManager.loadKDString("申请付款组织业务不支持支付信息变更。", "PaymentBillList_21", "fi-cas-formplugin", new Object[0]));
+//                                    return false;
+//                                }
+//                            }
+//
+//                            return true;
+//                        }
+//                    }
+//                }
+//            }
+//        }
+//    }
+//
+//    public void confirmCallBack(MessageBoxClosedEvent messageBoxClosedEvent) {
+//        super.confirmCallBack(messageBoxClosedEvent);
+//        String id = messageBoxClosedEvent.getCallBackId();
+//        MessageBoxResult res = messageBoxClosedEvent.getResult();
+//        if (StringUtils.equals(id, "CONFIRM_CANCELPAY_CALLBACK") && MessageBoxResult.Yes.equals(res)) {
+//            BillList billList = (BillList)this.getView().getControl("billlistap");
+//            ListSelectedRowCollection selectedRows = billList.getSelectedRows();
+//            if (selectedRows.size() > 0) {
+//                List<Long> paymentBillPks = new LinkedList();
+//                Iterator var7 = selectedRows.iterator();
+//
+//                while(var7.hasNext()) {
+//                    ListSelectedRow selectedRow = (ListSelectedRow)var7.next();
+//                    paymentBillPks.add((Long)selectedRow.getPrimaryKeyValue());
+//                }
+//
+//                QFilter payPidFilter = new QFilter("id", "in", paymentBillPks);
+//                DynamicObject[] payobjs = BusinessDataServiceHelper.load("nckd_cas_apbill_xz", "id,billno", new QFilter[]{payPidFilter});
+//                if (!this.cancelPayCheckSettle(paymentBillPks, payobjs)) {
+//                    this.getView().invokeOperation("cancelpay");
+//                }
+//            }
+//        }
+//
+//        if (StringUtils.equals(id, "CONFIRM_CANCELPAY_SETTLE_CALLBACK") && MessageBoxResult.Yes.equals(res)) {
+//            this.getView().invokeOperation("cancelpay");
+//        }
+//
+//        OperateOption option;
+//        if (StringUtils.equals(id, "cancellation") && MessageBoxResult.Yes.equals(res)) {
+//            option = OperateOption.create();
+//            option.setVariableValue("cancellation", "yes");
+//            this.getView().invokeOperation("invalid", option);
+//        }
+//
+//        if (id.equals("CONFIRM_DEL_CALLBACK")) {
+//            option = OperateOption.create();
+//            if (MessageBoxResult.Yes.equals(res)) {
+//                option.setVariableValue("delrecpay", "1");
+//                this.getView().invokeOperation("delete", option);
+//            }
+//        }
+//
+//    }
+//
+//    public void afterDoOperation(AfterDoOperationEventArgs e) {
+//        super.afterDoOperation(e);
+//        AbstractOperate op = (AbstractOperate)e.getSource();
+//        String key = op.getOperateKey();
+//        OperationResult operationResult = e.getOperationResult();
+//        List successPkIds;
+//        if ((!"pay".equals(key) || !operationResult.isSuccess()) && (!"cancelpay".equals(key) || !operationResult.isSuccess())) {
+//            if ("unitecommitbe".equals(key) && operationResult.isSuccess()) {
+//                this.getView().showSuccessNotification(ResManager.loadKDString("合并提交银企成功!", "PaymentBillList_16", "fi-cas-formplugin", new Object[0]));
+//            } else if (("chargeback".equals(key) || "payschback".equals(key)) && operationResult.isSuccess()) {
+//                successPkIds = operationResult.getSuccessPkIds();
+//                if (!CollectionUtils.isEmpty(successPkIds)) {
+//                    this.chargeBack(successPkIds, key);
+//                }
+//            } else if ("trackdownchgbill".equals(key) && operationResult.isSuccess()) {
+//                this.trackdownChgBill();
+//            } else if ("chargebacknoreason".equals(key)) {
+//                String reason = ResManager.loadKDString("自动退单", "PaymentBillList_37", "fi-cas-formplugin", new Object[0]);
+//                successPkIds = operationResult.getSuccessPkIds();
+//                Map<String, Object> data = new HashMap(16);
+//                data.put("billid", successPkIds);
+//                data.put("reason", reason);
+//                data.put("operateKey", "chargeback");
+//                PayBillListPlugnHelper.closeCallBack("CALLBACK_CHARGEBACK", this.getView(), data);
+//            }
+//        }
+//
+//        boolean refreshFlg = !"refresh".equals(key) && !"exportbylist".equals(key) && !"paypushchg".equals(key) && !"recpushchg".equals(key) && !"modify".equals(key);
+//        if (refreshFlg) {
+//            ((ListView)this.getView()).refresh();
+//        }
+//
+//        if ("beforesubmit".equals(key)) {
+//            successPkIds = operationResult.getSuccessPkIds();
+//            if (successPkIds != null && successPkIds.size() > 0) {
+//                operationResult.setShowMessage(false);
+//                this.getView().invokeOperation("submit");
+//            }
+//        } else if ("chargebackwrite".equals(key) && operationResult.isSuccess()) {
+//            ((IEntityOperate)e.getSource()).setCancelRefresh(false);
+//        } else if ("supplecontract".equals(key) && operationResult.isSuccess()) {
+//            this.openEditView("supplecontract");
+//        } else {
+//            boolean flag;
+//            if ("paypushchg".equals(key) && operationResult.isSuccess()) {
+//                flag = this.payInfoChgvaild("paychg");
+//                if (flag) {
+//                    PayBillListPlugnHelper.payInfoChg("nckd_cas_apbill_xz", "payAction", "cas_paychgbill_paychg", (String)null, this.getView());
+//                }
+//            } else if ("recpushchg".equals(key) && operationResult.isSuccess()) {
+//                flag = this.payInfoChgvaild("recchg");
+//                if (flag) {
+//                    this.openChangeChg("nckd_cas_apbill_xz", "recAction");
+//                }
+//            } else if ("urgentpay".equals(key) && operationResult.isSuccess()) {
+//                successPkIds = operationResult.getSuccessPkIds();
+//                if (!CollectionUtils.isEmpty(successPkIds)) {
+//                    this.getView().showSuccessNotification(ResManager.loadKDString("加急成功", "PaymentBillList_38", "fi-cas-formplugin", new Object[0]));
+//                }
+//            } else if ("cancelurgentpay".equals(key) && operationResult.isSuccess()) {
+//                successPkIds = operationResult.getSuccessPkIds();
+//                if (!CollectionUtils.isEmpty(successPkIds)) {
+//                    this.getView().showSuccessNotification(ResManager.loadKDString("取消加急成功", "PaymentBillList_39", "fi-cas-formplugin", new Object[0]));
+//                }
+//            }
+//        }
+//
+//        if (Arrays.asList("pay", "cancelpay", "syncbankbillstatus").contains(key) && operationResult != null && operationResult.isSuccess()) {
+//            this.getView().invokeOperation("refresh");
+//        }
+//
+//    }
+//
+//    public void filterContainerInit(FilterContainerInitArgs args) {
+//        super.filterContainerInit(args);
+//        this.initArgs = args;
+//        ListShowParameter listShowParameter = (ListShowParameter)this.getView().getFormShowParameter();
+//        String status = (String)listShowParameter.getCustomParam("status");
+//        String parentFormId = listShowParameter.getParentFormId();
+//        Iterator var5;
+//        FilterColumn filterColumn;
+//        List defaultValues;
+//        if (null == this.getCachedOrgList()) {
+//            var5 = args.getCommonFilterColumns().iterator();
+//
+//            while(var5.hasNext()) {
+//                filterColumn = (FilterColumn)var5.next();
+//                if ("org.id".equals(filterColumn.getFieldName())) {
+//                    defaultValues = filterColumn.getDefaultValues();
+//                    if (null != defaultValues && defaultValues.size() > 0) {
+//                        List<Long> selectedOrgIdList = (List)defaultValues.stream().filter((t) -> {
+//                            return StringUtils.isNotEmpty(t.toString());
+//                        }).map((item) -> {
+//                            return Long.valueOf(item.toString());
+//                        }).collect(Collectors.toList());
+//                        this.cacheSelectedOrgIdList(selectedOrgIdList);
+//                    }
+//                }
+//            }
+//        }
+//
+//        if (this.isFromControlCenter() && "fca_control_index".equals(parentFormId) || this.isTrack()) {
+//            var5 = args.getCommonFilterColumns().iterator();
+//
+//            while(var5.hasNext()) {
+//                filterColumn = (FilterColumn)var5.next();
+//                if ("org.id".equals(filterColumn.getFieldName())) {
+//                    filterColumn.setDefaultValue("");
+//                }
+//
+//                if ("billstatus".equals(filterColumn.getFieldName())) {
+//                    if (EmptyUtil.isNoEmpty(status)) {
+//                        defaultValues = Arrays.asList(status.split(","));
+//                        filterColumn.setDefaultValues(defaultValues);
+//                    } else {
+//                        filterColumn.setDefaultValues(new Object[]{""});
+//                    }
+//                }
+//
+//                if ("bizdate".equals(filterColumn.getFieldName())) {
+//                    filterColumn.setDefaultValue("");
+//                }
+//            }
+//        }
+//
+//        this.fillToolBar();
+//    }
+//
+//    public void filterContainerSearchClick(FilterContainerSearchClickArgs args) {
+//        super.filterContainerSearchClick(args);
+//        List<Long> selectedOrgIdList = args.getSelectMainOrgIds();
+//        if (selectedOrgIdList.size() > 0) {
+//            List<Object> object = this.getCachedOrgList();
+//            if (null == object || !object.toString().equals(selectedOrgIdList.toString())) {
+//                this.cacheSelectedOrgIdList(selectedOrgIdList);
+//                this.filterContainerInit(this.initArgs);
+//            }
+//        }
+//
+//    }
+//
+//    private void cacheSelectedOrgIdList(List<Long> selectedOrgIdList) {
+//        if (selectedOrgIdList != null) {
+//            this.getPageCache().put("selectedOrgIdList", SerializationUtils.toJsonString(selectedOrgIdList));
+//        } else {
+//            this.getPageCache().put("selectedOrgIdList", (String)null);
+//        }
+//
+//    }
+//
+//    protected List<Object> getCachedOrgList() {
+//        return this.getPageCache().get("selectedOrgIdList") != null ? (List)SerializationUtils.fromJsonString(this.getPageCache().get("selectedOrgIdList"), List.class) : null;
+//    }
+//
+//    private void fillToolBar() {
+//        this.getView().setVisible(false, new String[]{"recbook", "endorse"});
+//        List<Object> object = this.getCachedOrgList();
+//        if (object != null && object.size() != 0) {
+//            List<Long> cachedOrgList = (List)this.getCachedOrgList().stream().map((item) -> {
+//                return Long.valueOf(item.toString());
+//            }).collect(Collectors.toList());
+//            Iterator var3 = cachedOrgList.iterator();
+//
+//            boolean isdraft;
+//            boolean ischeck;
+//            boolean ispromissorynote;
+//            do {
+//                if (!var3.hasNext()) {
+//                    return;
+//                }
+//
+//                Long orgId = (Long)var3.next();
+//                isdraft = SystemParameterHelper.getCdmParameterBoolean(orgId, "isdraft");
+//                ischeck = SystemParameterHelper.getCdmParameterBoolean(orgId, "ischeck");
+//                ispromissorynote = SystemParameterHelper.getCdmParameterBoolean(orgId, "ispromissorynote");
+//            } while(!isdraft && !ischeck && !ispromissorynote);
+//
+//            this.getView().setVisible(true, new String[]{"recbook", "endorse"});
+//        } else {
+//            this.getView().setVisible(true, new String[]{"recbook", "endorse"});
+//        }
+//    }
+//
+//    public void beforeShowBill(BeforeShowBillFormEvent e) {
+//        super.beforeShowBill(e);
+//        BillShowParameter showParameter = e.getParameter();
+//        Object billId = showParameter.getPkId();
+//        BillOperationStatus billStatus = showParameter.getBillStatus();
+//        OperationStatus operationStatus = showParameter.getStatus();
+//        String operateType;
+//        if (billId != null) {
+//            if (OperationStatus.ADDNEW.equals(operationStatus)) {
+//                operateType = this.getPageCache().get("operate");
+//                if (operateType != null) {
+//                    showParameter.getCustomParams().put("operate", operateType);
+//                } else {
+//                    showParameter.getCustomParams().put("operate", OperateTypeEnum.COPY);
+//                }
+//            } else {
+//                DynamicObject info = BusinessDataServiceHelper.loadSingle(billId, "nckd_cas_apbill_xz", "id, billtype");
+//                DynamicObject billtype = info.getDynamicObject("billtype");
+//                if (billtype != null && BillTypeConstants.PAYBILL_SYN.equals(billtype.getPkValue())) {
+//                    showParameter.setFormId("nckd_cas_apbill_xz_synonym");
+//                    showParameter.setCaption(ResManager.loadKDString("同名转账", "PaymentBillEdit_24", "fi-cas-formplugin", new Object[0]));
+//                } else if (billtype != null && BillTypeConstants.PAYBILL_SPAN.equals(billtype.getPkValue())) {
+//                    showParameter.setFormId("nckd_cas_apbill_xz_spanmainpart");
+//                    showParameter.setCaption(ResManager.loadKDString("跨主体调拨", "PaymentBillEdit_28", "fi-cas-formplugin", new Object[0]));
+//                } else if (billtype != null && BillTypeConstants.PAYBILL_CASH.equals(billtype.getPkValue())) {
+//                    showParameter.setFormId("nckd_cas_apbill_xz_cash");
+//                    showParameter.setCaption(ResManager.loadKDString("现金存取", "PaymentBillEdit_25", "fi-cas-formplugin", new Object[0]));
+//                }
+//
+//                showParameter.setCustomParam("showConer", true);
+//            }
+//        } else if (BillOperationStatus.ADDNEW == billStatus) {
+//            showParameter.getCustomParams().put("paymentType", this.getPageCache().get("paymentType"));
+//            operateType = this.getPageCache().get("formId");
+//            if (StringUtils.isNotBlank(operateType)) {
+//                showParameter.setFormId(operateType);
+//            }
+//
+//            this.getView().showForm(showParameter);
+//        }
+//
+//    }
+//
+//    private void trackdownChgBill() {
+//        BillList list = (BillList)this.getView().getControl("billlistap");
+//        ListSelectedRowCollection selectedRows = list.getSelectedRows();
+//        Object[] selectedIds = selectedRows.getPrimaryKeyValues();
+//        if (selectedIds.length != 1) {
+//            this.getView().showTipNotification(ResManager.loadKDString("请选择单条数据进行操作!", "AgentPayBillList_20", "fi-cas-formplugin", new Object[0]));
+//        }
+//
+//        DynamicObject[] paychgbill = BusinessDataServiceHelper.load("cas_paychgbill", "id,chgtype", new QFilter[]{new QFilter("sourcebillid", "=", selectedIds[0])});
+//        if (EmptyUtil.isEmpty(paychgbill) || paychgbill.length == 0) {
+//            this.getView().showTipNotification(ResManager.loadKDString("此单无变更单", "AgentPayBillList_21", "fi-cas-formplugin", new Object[0]));
+//        }
+//
+//        if (paychgbill.length == 1) {
+//            String formId = "";
+//            if (ChgTypeEnum.RECCHG.getValue().equals(paychgbill[0].getString("chgtype"))) {
+//                formId = "cas_paychgbill_recchg";
+//            } else {
+//                formId = "cas_paychgbill_paychg";
+//            }
+//
+//            BillShowParameter showParameter = new BillShowParameter();
+//            showParameter.setFormId(formId);
+//            showParameter.setPkId(paychgbill[0].getPkValue());
+//            showParameter.getOpenStyle().setShowType(ShowType.NonModal);
+//            this.getView().showForm(showParameter);
+//        } else {
+//            ListShowParameter showParameter = new ListShowParameter();
+//            showParameter.setHasRight(true);
+//            showParameter.setIsolationOrg(false);
+//            showParameter.setBillFormId("cas_paychgbill");
+//            List<QFilter> qFilters = new ArrayList();
+//            Set<Object> pks = new HashSet(paychgbill.length);
+//            DynamicObject[] var8 = paychgbill;
+//            int var9 = paychgbill.length;
+//
+//            for(int var10 = 0; var10 < var9; ++var10) {
+//                DynamicObject targetBill = var8[var10];
+//                pks.add(targetBill.get("id"));
+//            }
+//
+//            qFilters.add(new QFilter("id", "in", pks));
+//            showParameter.getListFilterParameter().setQFilters(qFilters);
+//            showParameter.getOpenStyle().setShowType(ShowType.MainNewTabPage);
+//            showParameter.setStatus(OperationStatus.VIEW);
+//            showParameter.setShowFilter(false);
+//            showParameter.setShowQuickFilter(false);
+//            showParameter.setCustomParam("isshowtoolbarap", "no");
+//            showParameter.setCustomParam("istmctracebillop", "yes");
+//            this.getView().showForm(showParameter);
+//        }
+//
+//    }
+//
+//    private void cancelPay() {
+//        BillList billList = (BillList)this.getView().getControl("billlistap");
+//        ListSelectedRowCollection selectedRows = billList.getSelectedRows();
+//        if (selectedRows.size() <= 0) {
+//            this.getView().showTipNotification(ResManager.loadKDString("请选择要执行的数据!", "PaymentBillList_0", "fi-cas-formplugin", new Object[0]));
+//        } else {
+//            List<Long> paymentBillPks = new LinkedList();
+//            Iterator var4 = selectedRows.iterator();
+//
+//            while(var4.hasNext()) {
+//                ListSelectedRow selectedRow = (ListSelectedRow)var4.next();
+//                paymentBillPks.add((Long)selectedRow.getPrimaryKeyValue());
+//            }
+//
+//            QFilter payPidFilter = new QFilter("id", "in", paymentBillPks);
+//            DynamicObject[] payobjs = BusinessDataServiceHelper.load("nckd_cas_apbill_xz", "id,billno,isvoucher,billstatus,org", new QFilter[]{payPidFilter});
+//            StringBuilder sb = new StringBuilder();
+//            int flag = 0;
+//            DynamicObject[] var8 = payobjs;
+//            int var9 = payobjs.length;
+//
+//            for(int var10 = 0; var10 < var9; ++var10) {
+//                DynamicObject obj = var8[var10];
+//                int CS114 = SystemParameterHelper.getParameterInteger(obj.getDynamicObject("org").getLong("id"), "cs116");
+//                if (3 == CS114 && VoucherBookHelper.checkVoucherExist(obj.getPkValue(), "nckd_cas_apbill_xz")) {
+//                    ++flag;
+//                    String billno = obj.getString("billno");
+//                    sb.append(String.format(ResManager.loadKDString("(%s)单据已经生成凭证\r\n", "PaymentBillList_17", "fi-cas-formplugin", new Object[0]), billno));
+//                }
+//            }
+//
+//            if (flag == 1) {
+//                this.getView().showConfirm(sb.substring(0, sb.length() - 1) + ResManager.loadKDString(",是否继续取消付款?", "PaymentBillList_18", "fi-cas-formplugin", new Object[0]), MessageBoxOptions.YesNo, ConfirmTypes.Default, new ConfirmCallBackListener("CONFIRM_CANCELPAY_CALLBACK", this));
+//            } else if (flag > 0) {
+//                this.getView().showConfirm(String.format(ResManager.loadKDString("存在%d个已生成凭证的单据,是否继续取消付款?", "PaymentBillList_19", "fi-cas-formplugin", new Object[0]), flag), sb.toString(), MessageBoxOptions.YesNo, ConfirmTypes.Default, new ConfirmCallBackListener("CONFIRM_CANCELPAY_CALLBACK", this));
+//            } else if (!this.cancelPayCheckSettle(paymentBillPks, payobjs)) {
+//                this.getView().invokeOperation("cancelpay");
+//            }
+//        }
+//
+//    }
+//
+//    private void chargeBack(List<Object> billid, String operateKey) {
+//        FormShowParameter showParameter = new FormShowParameter();
+//        showParameter.setFormId("cas_chargeback");
+//        showParameter.setCustomParam("billid", JSON.toJSONString(billid));
+//        showParameter.setCustomParam("operateKey", operateKey);
+//        showParameter.getOpenStyle().setShowType(ShowType.NonModal);
+//        showParameter.setCloseCallBack(new CloseCallBack(this, "CALLBACK_CHARGEBACK"));
+//        this.getView().showForm(showParameter);
+//    }
+//
+//    private Boolean cancelPayCheckSettle(List<Long> paymentBillPks, DynamicObject[] payobjs) {
+//        Boolean result = Boolean.FALSE;
+//        List<Long> mainBillIds = SettleRecordQueryHelperForCas.getBillIdsByMain("ap_settlerecord", "nckd_cas_apbill_xz", paymentBillPks.toArray(), (QFilter)null);
+//        List<Long> asstBillIds = SettleRecordQueryHelperForCas.getBillIdsByAsst("ap_settlerecord", "nckd_cas_apbill_xz", paymentBillPks.toArray(), (QFilter)null);
+//        Set<Long> settleRecordIds = new HashSet();
+//        settleRecordIds.addAll(mainBillIds);
+//        settleRecordIds.addAll(asstBillIds);
+//        if (settleRecordIds.size() > 0) {
+//            StringBuilder settleSb = new StringBuilder();
+//            int settleFlag = 0;
+//            DynamicObject[] var9 = payobjs;
+//            int var10 = payobjs.length;
+//
+//            for(int var11 = 0; var11 < var10; ++var11) {
+//                DynamicObject obj = var9[var11];
+//                if (settleRecordIds.contains(obj.getPkValue())) {
+//                    ++settleFlag;
+//                    String billno = obj.getString("billno");
+//                    settleSb.append(String.format(ResManager.loadKDString("(%s)单据已经完成结算\r\n", "PaymentBillList_28", "fi-cas-formplugin", new Object[0]), billno));
+//                }
+//            }
+//
+//            if (settleFlag == 1) {
+//                this.getView().showConfirm(settleSb.substring(0, settleSb.length() - 1) + ResManager.loadKDString(",如果继续操作将会自动反结算对应的结算记录,是否继续?", "PaymentBillList_29", "fi-cas-formplugin", new Object[0]), MessageBoxOptions.YesNo, ConfirmTypes.Default, new ConfirmCallBackListener("CONFIRM_CANCELPAY_SETTLE_CALLBACK", this));
+//            } else if (settleFlag > 1) {
+//                this.getView().showConfirm(String.format(ResManager.loadKDString("存在%d个已经完成结算的单据,如果继续操作将会自动反结算对应的结算记录,是否继续?", "PaymentBillList_30", "fi-cas-formplugin", new Object[0]), settleFlag), settleSb.toString(), MessageBoxOptions.YesNo, ConfirmTypes.Default, new ConfirmCallBackListener("CONFIRM_CANCELPAY_SETTLE_CALLBACK", this));
+//            }
+//
+//            result = Boolean.TRUE;
+//        }
+//
+//        return result;
+//    }
+//
+//    private void viewDrafBill() {
+//        BillList billList = (BillList)this.getControl("billlistap");
+//        ListSelectedRowCollection selectedRows = billList.getSelectedRows();
+//        Object[] selectedRowPks = selectedRows.getPrimaryKeyValues();
+//        if (selectedRowPks.length == 0) {
+//            this.getView().showTipNotification(ResManager.loadKDString("请选择要执行的数据!", "PaymentBillList_3", "fi-cas-formplugin", new Object[0]));
+//        } else if (selectedRowPks.length > 1) {
+//            this.getView().showTipNotification(ResManager.loadKDString("请选择单条数据联查!", "PaymentBillList_4", "fi-cas-formplugin", new Object[0]));
+//        } else {
+//            Object primaryKey = selectedRowPks[0];
+//            DynamicObject paybill = BusinessDataServiceHelper.loadSingle(primaryKey, "nckd_cas_apbill_xz", "id,draftbill");
+//            DynamicObjectCollection draftBills = paybill.getDynamicObjectCollection("draftbill");
+//            if (draftBills == null || draftBills.size() <= 0) {
+//                this.getView().showTipNotification(ResManager.loadKDString("暂无关联的票据记录。", "PaymentBillDraftEditPlugin_9", "fi-cas-formplugin", new Object[0]));
+//                return;
+//            }
+//
+//            Set<Long> idSet = new HashSet();
+//            Iterator var8 = draftBills.iterator();
+//
+//            while(var8.hasNext()) {
+//                DynamicObject draftBill = (DynamicObject)var8.next();
+//                idSet.add(((DynamicObject)draftBill.get("fbasedataid")).getLong("id"));
+//            }
+//
+//            PayBillListPlugnHelper.viewDrafBill(idSet, this.getView());
+//        }
+//
+//    }
+//
+//    private void viewBatchInput() {
+//        FormShowParameter showPage = new FormShowParameter();
+//        showPage.setFormId("cas_batchpaybill");
+//        showPage.setAppId("cas");
+//        showPage.setStatus(OperationStatus.EDIT);
+//        showPage.getOpenStyle().setShowType(ShowType.Modal);
+//        this.getView().showForm(showPage);
+//    }
+//
+//    public void signCallback(SignCallbackEvent evt) {
+//        if (evt.getCallbackId().equals("signbeforecommitbe")) {
+//            ClientMethodResult ret = evt.getResult();
+//            if (ret.getSuccess()) {
+//                OperateOption operateOption = OperateOption.create();
+//                operateOption.setVariableValue("ishasright", "true");
+//                operateOption.setVariableValue("signCallbackFlag", "true");
+//                operateOption.setVariableValue("signFirstSave", "false");
+//                operateOption.setVariableValue("signResult", SerializationUtils.toJsonString(evt.getResult().getResult()));
+//                operateOption.setVariableValue("clearResult", evt.getClearText());
+//                OperationResult operationResult = this.getView().invokeOperation("beforecommitbe", operateOption);
+//                if (operationResult.isSuccess()) {
+//                    this.getView().invokeOperation("commitbe");
+//                } else {
+//                    logger.info(" signcallback fail ");
+//                    if (EmptyUtil.isNoEmpty(operationResult.getMessage())) {
+//                        evt.getView().showTipNotification(operationResult.getMessage());
+//                    }
+//                }
+//            } else {
+//                logger.info(" signbeforecommitbe SignCallbackEvent fail ");
+//            }
+//        }
+//
+//    }
+//}