<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:ns1="leaf.application.action" xmlns:p="uncertain.proc" xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
    <a:init-procedure>
        <s:server-script><![CDATA[
            function lov_query() {
                var lov_list_details;
                try {
                    var lov_list_bm = $bm('wx.wx_bank_card_change');
                    var lov_list_map = lov_list_bm.queryAsMap({
                        contract_id: $ctx.parameter.contract_id
                    });
                    lov_list_details = lov_list_map.getChildren();
                    $ctx.parameter.return_status = 'S';
                    $ctx.parameter.return_message = '执行成功';
                } catch (e) {
                    $ctx.success = "true";
                    $ctx.parameter.return_status = 'E';
                    $ctx.parameter.return_message = String(e);
                }
            
            
                var result = {
                    result: $ctx.parameter.return_status,
                    message: $ctx.parameter.return_message,
                    con_list: []
                };
                var con_list = result.con_list;
                if (lov_list_details) {
                    for (var i = 0;i < lov_list_details.length;i++) {
                        var lov_list_detail = lov_list_details[i];
                        con_list.push({
                            "direct_debit_bank_id": lov_list_detail.direct_debit_bank_id,
                            "direct_debit_bank_id_n": lov_list_detail.direct_debit_bank_id_n,
                             "withhold_way": lov_list_detail.withhold_way,
                            "withhold_way_n": lov_list_detail.withhold_way_n,
                            "ebank_city": lov_list_detail.ebank_city,
                             "ebank_city_n": lov_list_detail.ebank_city_n,
                            "ebank_province": lov_list_detail.ebank_province,
                             "ebank_province_n": lov_list_detail.ebank_province_n,
                            "dd_remark": lov_list_detail.dd_remark,
                             "dd_bank_branch_name": lov_list_detail.dd_bank_branch_name,
                            "bp_id_tenant": lov_list_detail.bp_id_tenant,
                             "bp_id_tenant_n": lov_list_detail.bp_id_tenant_n,
                            "cell_phone": lov_list_detail.cell_phone,
                             "contract_id": lov_list_detail.contract_id,
                        });
                    }
                }
            
                $ctx.parameter.json = JSON.stringify(result);
            }
            if ($ctx.parameter.return_status != 'E'&& $ctx.parameter.return_status != 'TIMEOUT') {
                lov_query();
            }
        ]]></s:server-script>
    </a:init-procedure>
    <a:service-output output="/parameter/@json"/>
</a:service>