con_contract_query.lsc 2.88 KB
Newer Older
Spencer Chang's avatar
Spencer Chang committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
<?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_contract_query() {
                var con_contract_list_details;
                try {
                    //合同报表查询
                    var con_contract_bm= $bm('app.chart.con_information_mainten');
                    var con_contract_list_map = con_contract_bm.queryAsMap({
                        searchInput: $ctx.parameter.searchInput,
                        created_date: $ctx.parameter.time,
                        pagesize: $ctx.parameter.pagesize,
                      	offsize: $ctx.parameter.offsize,
                      	user_id:$ctx.parameter.user_id,
                      	authority_flag:'Y'                     //权限标志
                    });
                    con_contract_list_details = con_contract_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_contract:[]
                   
                };
                var con_contract = result.con_contract;
                if (con_contract_list_details) {
                    for (var i = 0;i < con_contract_list_details.length;i++) {
                        var con_contract_list_detail = con_contract_list_details[i];
                        con_contract.push({
                            "document_type_n": con_contract_list_detail.document_type_n,
                            "contract_number": con_contract_list_detail.contract_number,
                            "bp_id_tenant_n": con_contract_list_detail.bp_id_tenant_n,
                            "creation_date": con_contract_list_detail.creation_date,
                            "contract_id": con_contract_list_detail.contract_id,
                            "cdd_list_id": con_contract_list_detail.cdd_list_id
                        });
                    }
                }
                
                
                $ctx.parameter.json = JSON.stringify(result);
            }
            if ($ctx.parameter.return_status != 'E'&& $ctx.parameter.return_status != 'TIMEOUT') {
                con_contract_query();
            }
        ]]></s:server-script>
    </a:init-procedure>
    <a:service-output output="/parameter/@json"/>
</a:service>