con_bp_master_query.lsc 1.89 KB
Newer Older
1 2 3 4 5 6 7 8
<?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 con_bp_master_query() {
                var existsFlag_map;
                var existsFlag;
                try {
chenzhuo's avatar
chenzhuo committed
9
                    var existsFlag_query = $bm('wx.WX100.con_bp_master_query');
10 11 12 13 14 15 16 17 18 19 20 21 22 23
                    existsFlag_map = existsFlag_query.queryAsMap({
                        social_code:$ctx.parameter.idNo,
                        bp_name:$ctx.parameter.name,
                        agent_id_no:$ctx.parameter.agentIdNo,
                        agent_name:$ctx.parameter.agentName
                    });
                    var existsFlag_details = existsFlag_map.getChildren();
                    existsFlag = existsFlag_details[0].existsFlag;
                    $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);
24
                    existsFlag = '1'
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
                }

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