one_car_query.lsc 8.5 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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:s="leaf.plugin.script" xmlns:msg="leaf.application.features.msg" xmlns:a="http://www.leaf-framework.org/application" xmlns:task="leaf.application.task" xmlns:p="uncertain.proc" final-page="true" trace="true">
    <a:init-procedure>
        <s:server-script><![CDATA[
            //同步视图结果进入数据库
            
            function query_inter() {
                try {
                    var one_car_query_bm = $bm('one_car.CAR100.one_car_query');
                    var one_car_update_bm = $bm('one_car.CAR100.one_car_update');
                    var one_car_map = one_car_query_bm.queryAsMap();
                    var one_car_details = one_car_map.getChildren();
                    var one_car_detail;
                    if (one_car_details) {
                        for (var i = 0;i < one_car_details.length;i++) {
                            one_car_detail = one_car_details[i];
                            one_car_update_bm.update({
                                fld_make: one_car_detail.fld_make,
                                fld_model: one_car_detail.fld_model,
                                fld_trim: one_car_detail.fld_trim,
                                fld_ccsj: one_car_detail.fld_ccsj,
                                fld_price: one_car_detail.fld_price,
                                is_delete_column: one_car_detail.is_delete_column
                            });
                        }
                    }
                    //println("第一车网查询数据条数: " + one_car_details.length);
                } catch (e) {
                    println(e);
                    var logger = $logger("server-script");
                    logger.severe(e.message);
                }
            }
            //同步汽车厂商表
            
            
            function synchronism_CarMake() {
                try {
                    var one_car_carmake_bm = $bm('one_car.CAR100.one_car_CarMake');
                    var one_car_carmake_update = $bm('one_car.CAR100.one_car_CarMake_update');
                    var one_car_carmake = one_car_carmake_bm.queryAsMap();
                    var carmake_details = one_car_carmake.getChildren();
                    var carmake_detail;
                    if (carmake_details) {
                        for (var i = 0;i < carmake_details.length;i++) {
                            carmake_detail = carmake_details[i];
                            one_car_carmake_update.update({
                                fld_makeid: carmake_detail.fld_makeid,
                                fld_make: carmake_detail.fld_make,
                                fld_country: carmake_detail.fld_country,
                                is_delete_column: carmake_detail.is_delete_column
            
                            });
                        }
                    }
                    //println("第一车网厂商表查询数据条数: " + carmake_details.length);
                } catch (e) {
                    println(e);
                    var logger = $logger("server-script");
                    logger.severe(e.message);
                }
            }
            //同步汽车品牌表
            
            function synchronism_CarModel() {
                try {
                    var one_car_carmodel_bm = $bm('one_car.CAR100.one_car_CarModel');
                    var one_car_carmodel_update = $bm('one_car.CAR100.one_car_CarModel_update');
                    var one_car_carmodel = one_car_carmodel_bm.queryAsMap();
                    var carmodel_details = one_car_carmodel.getChildren();
                    var carmodel_detail;
                    if (carmodel_details) {
                        for (var i = 0;i < carmodel_details.length;i++) {
                            carmodel_detail = carmodel_details[i];
                            one_car_carmodel_update.update({
                                fld_modelid: carmodel_detail.fld_modelid,
                                fld_model: carmodel_detail.fld_model,
                                fld_serial: carmodel_detail.fld_serial,
                                //fld_type: carmodel_detail.fld_type,
                                fld_makeid: carmodel_detail.fld_makeid,
                                is_delete_column: carmodel_detail.is_delete_column
            
                            });
                        }
                    }
                    //println("第一车网汽车品牌表查询数据条数: " + carmodel_details.length);
                } catch (e) {
                    println(e);
                    var logger = $logger("server-script");
                    logger.severe(e.message);
                }
            }
            
            //同步汽车款式表
            
            function synchronism_CarTrim() {
                try {
                    var one_car_cartrim_bm = $bm('one_car.CAR100.one_car_CarTrim');
                    var one_car_cartrim_update = $bm('one_car.CAR100.one_car_CarTrim_update');
                    var one_car_cartrim = one_car_cartrim_bm.queryAsMap();
                    var cartrim_details = one_car_cartrim.getChildren();
                    var cartrim_detail;
                    if (cartrim_details) {
                        for (var i = 0;i < cartrim_details.length;i++) {
                            cartrim_detail = cartrim_details[i];
                            one_car_cartrim_update.update({
                                fld_trimid: cartrim_detail.fld_trimid,
                                fld_trim: cartrim_detail.fld_trim,
                                fld_ccsj: cartrim_detail.fld_ccsj,
                                fld_cxnk: cartrim_detail.fld_cxnk,
                                fld_redcode: cartrim_detail.fld_redcode,
                                fld_makeid: cartrim_detail.fld_makeid,
                                fld_modelid: cartrim_detail.fld_modelid,
                                fld_status: cartrim_detail.fld_status,
                                fld_enddate: cartrim_detail.fld_enddate,
                                fld_price: cartrim_detail.fld_price,
                                is_delete_column: cartrim_detail.is_delete_column
            
                            });
                        }
                    }
                    //println("第一车网汽车款式表查询数据条数: " + cartrim_details.length);
                } catch (e) {
                    println(e);
                    var logger = $logger("server-script");
                    logger.severe(e.message);
                }
            }
            //同步汽车款式指导价表
            
            
            function synchronism_Carguidedprice() {
                try {
                    var one_car_carguidedprice_bm = $bm('one_car.CAR100.one_car_carguidedprice');
                    var one_car_carguidedprice_update = $bm('one_car.CAR100.one_car_carguidedprice_update');
                    var one_car_carguidedprice = one_car_carguidedprice_bm.queryAsMap();
                    var carguidedprice_details = one_car_carguidedprice.getChildren();
                    var carguidedprice_detail;
                    if (carguidedprice_details) {
                        for (var i = 0;i < carguidedprice_details.length;i++) {
                            carguidedprice_detail = carguidedprice_details[i];
                            one_car_carguidedprice_update.update({
                                fld_trimid: carguidedprice_detail.fld_trimid,
                                fld_price: carguidedprice_detail.fld_price,
                                is_delete_column: carguidedprice_detail.is_delete_column
            
                            });
                        }
                    }
                    //println("第一车网汽车款式指导价表查询数据条数: " + carguidedprice_details.length);
                } catch (e) {
                    println(e);
                    var logger = $logger("server-script");
                    logger.severe(e.message);
                }
            }
            
            try {
                synchronism_CarMake();
                synchronism_CarModel();
                synchronism_CarTrim();
                synchronism_Carguidedprice();
                query_inter();
            } catch (e) {
                println(e);
                var logger = $logger("server-script");
                logger.severe(e.message);
            }
        ]]></s:server-script>
    </a:init-procedure>
</a:service>