<?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 import="app/app_login_check.js"><![CDATA[
            function lov_query() {
                var con_for_payment_list_details;
                try {
                    var con_for_payment_list_bm = $bm('app.lov.app_hls_con_for_payment');
            
                    var con_for_payment_list_map = con_for_payment_list_bm.queryAsMap({
                        id_card_no: $ctx.parameter.id_card_no
                    });
            
                    con_for_payment_list_details = con_for_payment_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_for_payment_list: []
                };
                var con_for_payment_list = result.con_for_payment_list;
            
                for (var i = 0;i < con_for_payment_list_details.length;i++) {
                    var con_for_payment_list_detail = con_for_payment_list_details[i];
                    con_for_payment_list.push({
                        "contract_id": con_for_payment_list_detail.contract_id,
                        "contract_number": con_for_payment_list_detail.contract_number,
                        "project_number": con_for_payment_list_detail.project_number,
                        "bp_id_tenant_n": con_for_payment_list_detail.bp_id_tenant_n
                    });
                }
            
            
                $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>
