<?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 get_current_time() {
                var leaseFlag_map;
                var leaseFlag;
                try {
                    var leaseFlag_query = $bm('wx.WX100.get_current_time');
                    leaseFlag_map = leaseFlag_query.queryAsMap({
                        lease_start_date:$ctx.parameter.leaseStartDate
                    });
                    var existsFlag_details = leaseFlag_map.getChildren();
                    leaseFlag = existsFlag_details[0].lease_flag;
                    $ctx.parameter.return_status = '0';
                    $ctx.parameter.return_message = '执行成功';
                } catch (e) {
                    $ctx.success = "false";
                    $ctx.parameter.return_status = '1';
                    $ctx.parameter.return_message = String(e);
                    leaseFlag = '';
                }

                //返回结果
                var result = {
                    code: $ctx.parameter.return_status,
                    message: $ctx.parameter.return_message,
                    leaseFlag: leaseFlag
                };
                $ctx.parameter.json = JSON.stringify(result);
            }
            if ($ctx.parameter.return_status != 'E' && $ctx.parameter.return_status != 'TIMEOUT') {
                get_current_time();
            }
        ]]></s:server-script>
    </a:init-procedure>
    <a:service-output output="/parameter/@json"/>
</a:service>