<?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 bp_master_account_save() {
                
                var bp_master_account_list = [];
                
                bp_master_account_list=$ctx.parameter.getChild('bp_account_list').getChildren();
                
                
               
               
               for (var i = 0;i < bp_master_account_list.length;i++){
                 var bp_master_account_save_bm = $bm('app.bp_master.bp_master_account_save'); 
                 
                 var list = bp_master_account_save_bm.update({
                     
                     bp_id:bp_master_account_list[i].bp_id,
                     
                     bank_account_name:bp_master_account_list[i].bank_account_name,
                     bank_account_num:bp_master_account_list[i].bank_account_num,
                     
                     bank_full_name:bp_master_account_list[i].bank_full_name,
                     bank_branch_name:bp_master_account_list[i].bank_branch_name,
                     
                     deducted_card:bp_master_account_list[i].deducted_card,
                     bank_account_type:bp_master_account_list[i].bank_account_type, 
                     start_date: bp_master_account_list[i].start_date,
                     end_date: bp_master_account_list[i].end_date,
                    
                     user_id:$ctx.parameter.user_id
                 }); 
                 var result = {
                    result: $ctx.parameter.return_status,
                    message: $ctx.parameter.return_message,
                    
                };
               
                 
               }
                try {
                    
                     $ctx.parameter.return_status = 'S';
                    $ctx.parameter.return_message = '保存成功';
                $ctx.parameter.json = JSON.stringify(result);
            }catch (e) {
                    $ctx.success = "true";
                    $ctx.parameter.return_status = 'E';
                    $ctx.parameter.return_message = $ctx.get('/error/@message') || String(e);
                }
                
                $ctx.parameter.json = JSON.stringify(result);
            }
            if ($ctx.parameter.return_status != 'E'&& $ctx.parameter.return_status != 'TIMEOUT') {
                bp_master_account_save();
            }
        ]]></s:server-script>
    </a:init-procedure>
    <a:service-output output="/parameter/@json"/>
</a:service>
