Tony Kang před 2 roky
rodič
revize
f0b8d3b401

+ 10 - 0
app/controller/payment_controller.js

@@ -1,5 +1,7 @@
 'use strict';
 const accountGroup = require('../const/account_group').group;
+const JV = require('../reports/rpt_component/jpc_value_define');
+
 module.exports = app => {
 
     class PaymentController extends app.BaseController {
@@ -228,10 +230,18 @@ module.exports = app => {
                 const rptProjectList = rptProject.items ? JSON.parse(rptProject.items) : [];
                 const rptTplList = [];
                 if (rptProjectList.length > 0) {
+                    const params = { tender_id: id };
                     for (const rpt of rptProjectList) {
                         const rptTpl = await ctx.service.rptTpl.getDataById(rpt.ID);
                         // 根据模板ID获取报表JSON
+                        //* 
                         const pageRst = ctx.service.jpcReport.getAllPreviewPagesCommon(rptTpl, 'A4');
+                        /* /
+                        //--------------------
+                        params.rpt_tpl_id = rpt.ID;
+                        const actRptTpl = JSON.parse(rptTpl.rpt_content);
+                        const pageRst = await ctx.service.jpcReport.getAllPagesCommon(ctx, actRptTpl, params, JV.PAGING_OPTION_NORMAL, JV.OUTPUT_TYPE_NORMAL, this.app.baseDir, null);
+                        // */
                     }
                 }
                 const renderData = {

+ 7 - 82
app/controller/report_controller.js

@@ -415,7 +415,7 @@ module.exports = app => {
                 copyCustomSelect = { tid: params.tender_id, rid: params.rpt_tpl_id, sid: -1, change_select: params.change_select };
             }
 
-            const pageRst = await getAllPagesCommon(ctx, rptTpl, params, JV.PAGING_OPTION_NORMAL, JV.OUTPUT_TYPE_NORMAL, this.app.baseDir, copyCustomSelect);
+            const pageRst = await ctx.service.jpcReport.getAllPagesCommon(ctx, rptTpl, params, JV.PAGING_OPTION_NORMAL, JV.OUTPUT_TYPE_NORMAL, this.app.baseDir, copyCustomSelect);
             for (const page of pageRst.items) {
                 page[JV.PROP_WATERMARK_CELLS] = [];
             }
@@ -514,7 +514,8 @@ module.exports = app => {
                 return;
             }
             await this._saveCustomSelects(params);
-            const pageRstArr = await getMultiRptsCommon(ctx, params, JV.OUTPUT_TYPE_NORMAL, this.app.baseDir) || [];
+            // const pageRstArr = await getMultiRptsCommon(ctx, params, JV.OUTPUT_TYPE_NORMAL, this.app.baseDir) || [];
+            const pageRstArr = await ctx.service.jpcReport.getMultiRptsCommon(ctx, params, JV.OUTPUT_TYPE_NORMAL, this.app.baseDir) || [];
             for (const pageRst of pageRstArr) {
                 for (const page of pageRst.items) {
                     page[JV.PROP_WATERMARK_CELLS] = [];
@@ -590,7 +591,8 @@ module.exports = app => {
 
             const roleRelArr = (params.stage_status === 3) ? (await ctx.service.roleRptRel.getRoleRptRelByDetailIds(params.tender_id, params.rpt_ids, params.stage_id)) : [];
             // const roleRel = (params.stage_status === 3) ? (await ctx.service.roleRptRel.getRoleRptRelByDetailIds(params.tender_id, params.rpt_tpl_id)) : [];
-            const pageRstArr = await getMultiRptsCommon(ctx, params, JV.OUTPUT_TYPE_NORMAL, baseDir);
+            // const pageRstArr = await getMultiRptsCommon(ctx, params, JV.OUTPUT_TYPE_NORMAL, baseDir);
+            const pageRstArr = await ctx.service.jpcReport.getMultiRptsCommon(ctx, params, JV.OUTPUT_TYPE_NORMAL, baseDir);
             // console.log('params.stage_status: ' + params.stage_status);
             // fsUtil.writeObjToFile(pageRstArr, 'D:/GitHome/temp/testBuiltPageResult1.js');
             for (const pageRst of pageRstArr) {
@@ -780,7 +782,8 @@ module.exports = app => {
             const stgAuditForOrg = await ctx.service.stageAudit.getStageAudit(params.stage_id, 1);
             const stageList = await ctx.service.stage.getValidStagesShort(params.tender_id);
 
-            const pageRstArr = await getMultiRptsCommon(ctx, params, JV.OUTPUT_TYPE_NORMAL, this.app.baseDir);
+            // const pageRstArr = await getMultiRptsCommon(ctx, params, JV.OUTPUT_TYPE_NORMAL, this.app.baseDir);
+            const pageRstArr = await ctx.service.jpcReport.getMultiRptsCommon(ctx, params, JV.OUTPUT_TYPE_NORMAL, this.app.baseDir);
             // fsUtil.writeObjToFile(pageRstArr, 'D:/GitHome/temp/pageRstArrForExcel.js');
             for (const pageRst of pageRstArr) {
                 for (const page of pageRst.items) {
@@ -925,59 +928,6 @@ async function checkStg(ctx, params) {
     }
 }
 
-async function getAllPagesCommon(ctx, rptTpl, params, option, outputType, baseDir, customSelect) {
-    const rptDataUtil = new rptDataExtractor();
-    rptDataUtil.initialize(rptTpl);
-    const filter = rptDataUtil.getDataRequestFilter();
-    const rawDataObj = await ctx.service.report.getReportData(params, filter.tables, filter.memFieldKeys,
-        rptTpl[JV.NODE_CUSTOM_DEFINE], customSelect);
-    // console.log(rawDataObj);
-    try {
-        const printCom = JpcEx.createNew();
-        if (params.pageSize) rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_PAGE_SIZE] = params.pageSize;
-        if (params.orientation && (params.orientation !== 'null')) rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_ORIENTATION] = params.orientation;
-
-        // let defProperties = await ctx.service.rptPreDefineCfg.getCfgById('Administrator');
-        // defProperties = JSON.parse(defProperties[0].defined_content);
-        const defProperties = RPT_DEF_PROPERTIES;
-        // console.log('defProperties: ');
-        // console.log(defProperties);
-
-        // console.log('before assemble');
-
-        // fsUtil.writeObjToFile(rawDataObj, 'D:/GitHome/temp/JL_Assemble_RawDataDataBefore' + (new Date()).getTime() + '.js');
-        const tplData = rptDataUtil.assembleData(ctx, rawDataObj, baseDir, printCom, customSelect);
-        // console.log(tplData);
-
-        if (params.custCfg) {
-            setupCustomizeCfg(params.custCfg, rptTpl, defProperties);
-        } else {
-            // setupCustomizeCfg(defProperties, rptTpl, defProperties);
-        }
-        const dftOption = params.option || JV.PAGING_OPTION_NORMAL;
-        printCom.initialize(rptTpl);
-        // 在ctx.helper里夹带私货,增加当前期status及times
-        // ctx.helper.current_stage_status = params.stage_status;
-        // ctx.helper.current_stage_times = params.stage_times;
-        printCom.analyzeData(ctx.helper, rptTpl, tplData, defProperties, dftOption, outputType, customSelect);
-        // console.log(JSON.stringify(rptTpl));
-        const maxPages = printCom.totalPages;
-        let pageRst = null;
-        if (maxPages > 0) {
-            pageRst = printCom.outputAsSimpleJSONPageArray(ctx.helper, rptTpl, tplData, 1, maxPages, defProperties, params.custCfg, customSelect);
-        } else {
-            pageRst = printCom.outputAsPreviewPage(rptTpl, defProperties);
-        }
-        // fsUtil.writeObjToFile(pageRst, 'D:/GitHome/temp/计量testBuiltPageResult.jsp');
-        // console.log(pageRst);
-        pageRst.id = params.rpt_tpl_id;
-        return pageRst;
-    } catch (ex) {
-        console.log('报表数据异常, tender id: ' + params.tender_id);
-        console.log(ex);
-    }
-}
-
 async function getMultiRptsCommon(ctx, params, outputType, baseDir) {
     for (let idx = 0; idx < params.rpt_ids.length; idx++) {
         params.rpt_ids[idx] = parseInt(params.rpt_ids[idx]); // 转换一下,以防万一
@@ -1459,31 +1409,6 @@ async function getWatermarkPicData(pageRst, baseDir) {
     return rst;
 }
 
-async function createExportRequestJob(ctx) {
-    const params = JSON.parse(ctx.request.body.params);
-    // const uuidArr = params.uuidArr;
-    const baseDir = this.app.baseDir;
-    const roleRelArr = (params.stage_status === 3) ? (await ctx.service.roleRptRel.getRoleRptRelByDetailIds(params.tender_id, params.rpt_ids, params.stage_id)) : [];
-    const pageRstArr = await getMultiRptsCommon(ctx, params, JV.OUTPUT_TYPE_NORMAL, this.app.baseDir);
-    await this.ctx.helper.recursiveMkdirSync(this.app.baseDir + '/app/public/download');
-    for (let idx = 0; idx < pageRstArr.length; idx++) {
-        let roleRel = null;
-        for (const roleR of roleRelArr) {
-            if (roleR.rpt_id === params.rpt_ids[idx]) {
-                roleRel = JSON.parse(roleR.rel_content);
-                break;
-            }
-        }
-        if (params.exportType === 'xlsx') {
-            const zip = rpt_xl_util.exportExcel(pageRstArr[idx], params.pageSize, null, params.isOneSheet, null, null, baseDir, roleRel, null); // 给个null报表名称,返回zip对象自己处理,这样就不用改接口结构了
-            zip.generateNodeStream({ type: 'nodebuffer', streamFiles: true })
-                .pipe(fs.createWriteStream(baseDir + '/app/public/download/' + params.uuidArr[idx] + '.xlsx'));
-        } else if (params.exportType === 'pdf') {
-            // PDF的后期补上
-        }
-    }
-}
-
 function mergeTextSignature(isTxtSignature, status, pageData, singleRoleRel, rpt_ids, stgAudit, stageList) {
     // 依据需求,有些用户不需要签名图片,那么从源头上把签名从signature_cells转移到cells下,省得后续 预览、打印、导出PDF、导出EXCEL每个地方都改动
     const _mergeSingle = function(_page, _roleRelList, isDeleteSignCell, checkAudit = false) {

+ 4 - 3
app/public/report/js/rpt_main.js

@@ -679,7 +679,8 @@ let rptControlObj = {
                 // 未来可能会有额外处理,目前空着
             }
             if (node.flags && node.flags.amendmentType === 'splitArchive') {
-                splitArchives.push(node.refId);
+                // splitArchives.push(node.refId);
+                splitArchives.push({rpt_id: node.refId, split_field_id: parseInt(node.splitArchiveField)});
             }
         }
     },
@@ -1417,10 +1418,10 @@ function getExcelOutputOption() {
 }
 function _getSplitAmendmentParam(params, tplNode) {
     if (params.amendmentType === undefined || params.amendmentType === null) {
-        params.splitArchiveReports = [];
+        params.splitArchives = [];
     }
     if (tplNode.flags && tplNode.flags.amendmentType === 'splitArchive' && !params.splitArchiveReports.includes(tplNode.refId)) {
-        params.splitArchiveReports.push(tplNode.refId);
+        params.splitArchives.push({rpt_id: tplNode.refId, split_field_id: parseInt(tplNode.splitArchiveField)});
     }
 }
 

+ 3 - 0
app/reports/rpt_component/jpc_bill_tab.js

@@ -57,6 +57,9 @@ JpcBillTabSrv.prototype.createNew = function() {
         const pageStatus = [true, true, true, true, true, true, true, true];
         JpcBandHelper.setBandArea(bands, rptTpl, pageStatus, true, false);
         const unitFactor = JpcCommonHelper.getUnitFactor(rptTpl);
+        me.signatureRst = [];
+        me.signatureDateRst = [];
+        me.signatureAuditRst = [];
         me.interactRst = [];
         rst = rst.concat(me.outputPreviewContent(rptTpl, bands, unitFactor, controls, pageStatus, $CURRENT_RPT));
         rst = rst.concat(JpcDiscreteHelper.outputPreviewDiscreteInfo(rptTpl[JV.NODE_BILL_INFO][JV.NODE_DISCRETE_INFO], bands, unitFactor, pageStatus, $CURRENT_RPT, me.interactRst));

+ 180 - 35
app/service/jpc_report.js

@@ -10,6 +10,13 @@ const JV = require('../reports/rpt_component/jpc_value_define');
 const rpt_xl_util = require('../reports/util/rpt_excel_util');
 const rptDataExtractor = require('../reports/util/rpt_calculation_data_util');
 const RPT_DEF_PROPERTIES = require('../const/report_defined_properties');
+const needCustomTables = [
+    'mem_custom_select',
+    'mem_gather_stage_bills', 'mem_gather_deal_bills', 'mem_gather_stage_pay', 'mem_gather_tender_info',
+    'mem_stage_sum_bills', 'mem_stage_sum_pay',
+    'mem_jh_gather_im_change', 'mem_jh_im_change', 'mem_jh_gather_stage_bills_compare',
+    'mem_material_sum_gl',
+];
 
 module.exports = app => {
 
@@ -28,41 +35,179 @@ module.exports = app => {
         }
 
         async getAllPagesCommon(ctx, rptTpl, params, option, outputType, baseDir, customSelect) {
-            // const rptDataUtil = new rptDataExtractor();
-            // rptDataUtil.initialize(rptTpl);
-            // const filter = rptDataUtil.getDataRequestFilter();
-            // const rawDataObj = await ctx.service.report.getReportData(params, filter.tables, filter.memFieldKeys,
-            //     rptTpl[JV.NODE_CUSTOM_DEFINE], customSelect);
-            // // console.log(rawDataObj);
-            // try {
-            //     const printCom = JpcEx.createNew();
-            //     if (params.pageSize) rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_PAGE_SIZE] = params.pageSize;
-            //     if (params.orientation && (params.orientation !== 'null')) rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_ORIENTATION] = params.orientation;
-
-            //     const defProperties = RPT_DEF_PROPERTIES;
-            //     const tplData = rptDataUtil.assembleData(ctx, rawDataObj, baseDir, printCom, customSelect);
-
-            //     if (params.custCfg) {
-            //         setupCustomizeCfg(params.custCfg, rptTpl, defProperties);
-            //     } else {
-            //         // setupCustomizeCfg(defProperties, rptTpl, defProperties);
-            //     }
-            //     const dftOption = params.option || JV.PAGING_OPTION_NORMAL;
-            //     printCom.initialize(rptTpl);
-            //     printCom.analyzeData(ctx.helper, rptTpl, tplData, defProperties, dftOption, outputType, customSelect);
-            //     const maxPages = printCom.totalPages;
-            //     let pageRst = null;
-            //     if (maxPages > 0) {
-            //         pageRst = printCom.outputAsSimpleJSONPageArray(ctx.helper, rptTpl, tplData, 1, maxPages, defProperties, params.custCfg, customSelect);
-            //     } else {
-            //         pageRst = printCom.outputAsPreviewPage(rptTpl, defProperties);
-            //     }
-            //     pageRst.id = params.rpt_tpl_id;
-            //     return pageRst;
-            // } catch (ex) {
-            //     console.log('报表数据异常, tender id: ' + params.tender_id);
-            //     console.log(ex);
-            // }
+            const rptDataUtil = new rptDataExtractor();
+            rptDataUtil.initialize(rptTpl);
+            const filter = rptDataUtil.getDataRequestFilter();
+            const rawDataObj = await ctx.service.report.getReportData(params, filter.tables, filter.memFieldKeys,
+                rptTpl[JV.NODE_CUSTOM_DEFINE], customSelect);
+            // console.log(rawDataObj);
+            try {
+                const printCom = JpcEx.createNew();
+                if (params.pageSize) rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_PAGE_SIZE] = params.pageSize;
+                if (params.orientation && (params.orientation !== 'null')) rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_ORIENTATION] = params.orientation;
+
+                const defProperties = RPT_DEF_PROPERTIES;
+                const tplData = rptDataUtil.assembleData(ctx, rawDataObj, baseDir, printCom, customSelect);
+
+                if (params.custCfg) {
+                    setupCustomizeCfg(params.custCfg, rptTpl, defProperties);
+                } else {
+                    // setupCustomizeCfg(defProperties, rptTpl, defProperties);
+                }
+                const dftOption = params.option || JV.PAGING_OPTION_NORMAL;
+                printCom.initialize(rptTpl);
+                printCom.analyzeData(ctx.helper, rptTpl, tplData, defProperties, dftOption, outputType, customSelect);
+                const maxPages = printCom.totalPages;
+                let pageRst = null;
+                if (maxPages > 0) {
+                    pageRst = printCom.outputAsSimpleJSONPageArray(ctx.helper, rptTpl, tplData, 1, maxPages, defProperties, params.custCfg, customSelect);
+                } else {
+                    pageRst = printCom.outputAsPreviewPage(rptTpl, defProperties);
+                }
+                pageRst.id = params.rpt_tpl_id;
+                return pageRst;
+            } catch (ex) {
+                console.log('报表数据异常, tender id: ' + params.tender_id);
+                console.log(ex);
+            }
+        }
+
+        async getMultiRptsCommon(ctx, params, outputType, baseDir) {
+            for (let idx = 0; idx < params.rpt_ids.length; idx++) {
+                params.rpt_ids[idx] = parseInt(params.rpt_ids[idx]); // 转换一下,以防万一
+            }
+            const rptTpls = await ctx.service.rptTpl.getAllTplByIds(params.rpt_ids);
+            rptTpls.sort(function(rpt1, rpt2) {
+                return params.rpt_ids.indexOf(rpt1.id) - params.rpt_ids.indexOf(rpt2.id);
+            });
+            for (let rtIdx = 0; rtIdx < rptTpls.length; rtIdx++) {
+                const id = rptTpls[rtIdx].id;
+                rptTpls[rtIdx] = JSON.parse(rptTpls[rtIdx].rpt_content);
+                rptTpls[rtIdx].id = id;
+            }
+
+            const rptDataUtil = new rptDataExtractor();
+            const filterTables = [];
+            const memFieldKeys = {};
+            let customSelect = {};
+            let customDefine = {};
+            for (const rptTpl of rptTpls) {
+                rptDataUtil.initialize(rptTpl);
+                const filter = rptDataUtil.getDataRequestFilter();
+                // console.log(filter);
+                for (const table of filter.tables) {
+                    if (filterTables.indexOf(table) < 0 && needCustomTables.indexOf(table) < 0) {
+                        filterTables.push(table);
+                    }
+                    // memFieldKeys[table] = [];
+                }
+                for (const tableKeyProp in filter.memFieldKeys) {
+                    if (needCustomTables.indexOf(tableKeyProp) >= 0) continue;
+                    if (!memFieldKeys.hasOwnProperty(tableKeyProp)) {
+                        memFieldKeys[tableKeyProp] = [];
+                    }
+                    for (const mfKey of filter.memFieldKeys[tableKeyProp]) {
+                        if (memFieldKeys[tableKeyProp].indexOf(mfKey) < 0) {
+                            memFieldKeys[tableKeyProp].push(mfKey);
+                        }
+                    }
+                }
+
+                // 输出报表的时候要把客户选择的数据的参数加进来
+                let finCustomSelect = {};
+                if (rptTpl[JV.NODE_CUSTOM_DEFINE]) {
+                    finCustomSelect = rptTpl[JV.NODE_CUSTOM_DEFINE] && rptTpl[JV.NODE_CUSTOM_DEFINE][JV.NODE_CUS_AUDIT_SELECT].enable
+                        ? await ctx.service.rptCustomDefine.getCustomDefine(params.tender_id, params.stage_id, rptTpl.id)
+                        : await ctx.service.rptCustomDefine.getCustomDefine(params.tender_id, -1, rptTpl.id);
+                }
+                if (finCustomSelect) {
+                    customDefine = rptTpl[JV.NODE_CUSTOM_DEFINE];
+                    customSelect = finCustomSelect;
+                }
+
+            }
+            const rawDataObj = await ctx.service.report.getReportData(params, filterTables, memFieldKeys, customDefine, customSelect);
+            // const rawDataObj = await ctx.service.report.getReportData(params, filterTables, memFieldKeys, {}, {});
+            try {
+                const rptPageRstArray = [];
+                // 2. 一个一个模板创建数据
+                // let defProperties = await ctx.service.rptPreDefineCfg.getCfgById('Administrator');
+                // defProperties = JSON.parse(defProperties[0].defined_content);
+                const defProperties = RPT_DEF_PROPERTIES;
+                for (let tplIdx = 0; tplIdx < rptTpls.length; tplIdx++) {
+                    const rptTpl = (rptTpls[tplIdx]._doc) ? rptTpls[tplIdx]._doc : rptTpls[tplIdx];
+                    rptDataUtil.initialize(rptTpl);
+                    let customSelect = rptTpl[JV.NODE_CUSTOM_DEFINE] && rptTpl[JV.NODE_CUSTOM_DEFINE][JV.NODE_CUS_AUDIT_SELECT].enable
+                        ? await ctx.service.rptCustomDefine.getCustomDefine(params.tender_id, params.stage_id, rptTpl.id)
+                        : await ctx.service.rptCustomDefine.getCustomDefine(params.tender_id, -1, rptTpl.id);
+                    if (rptTpl[JV.NODE_CUSTOM_DEFINE] && rptTpl[JV.NODE_CUSTOM_DEFINE][JV.NODE_CUS_CHANGE_SELECT] && rptTpl[JV.NODE_CUSTOM_DEFINE][JV.NODE_CUS_CHANGE_SELECT].enable) {
+                        customSelect = { tid: params.tender_id, rid: params.rpt_tpl_id, sid: -1, change_select: params.customSelect[tplIdx].change_select };
+                    }
+
+                    // 从汇总的rawDataObj中拷贝所需数据表至curRawDataObj,以供后续使用
+                    const curRawDataObj = {};
+                    const filter = rptDataUtil.getDataRequestFilter();
+                    for (const table of filter.tables) {
+                        curRawDataObj[table] = ctx.helper.clone(rawDataObj[table]);
+                    }
+                    // 如果是用户交互类型的表,则应该单独获取数据
+                    if ((params.customSelect && params.customSelect[tplIdx]) || rptTpl[JV.NODE_CUSTOM_DEFINE][JV.NODE_CUS_OPTION]) {
+                        const cfTables = [],
+                            cmFieldKeys = [];
+                        const curFilter = rptDataUtil.getDataRequestFilter();
+                        for (const table of curFilter.tables) {
+                            if (needCustomTables.indexOf(table) >= 0) {
+                                cfTables.push(table);
+                            }
+                        }
+                        for (const tableKeyProp in filter.memFieldKeys) {
+                            if (needCustomTables.indexOf(tableKeyProp) < 0) continue;
+                            if (!cmFieldKeys.hasOwnProperty(tableKeyProp)) {
+                                cmFieldKeys[tableKeyProp] = [];
+                            }
+                            for (const mfKey of filter.memFieldKeys[tableKeyProp]) {
+                                if (cmFieldKeys[tableKeyProp].indexOf(mfKey) < 0) {
+                                    cmFieldKeys[tableKeyProp].push(mfKey);
+                                }
+                            }
+                        }
+                        const customRawDataObj = await ctx.service.report.getReportData(params, cfTables, cmFieldKeys,
+                            rptTpl[JV.NODE_CUSTOM_DEFINE], customSelect);
+                        for (const prop in customRawDataObj) {
+                            curRawDataObj[prop] = customRawDataObj[prop];
+                        }
+                    }
+
+                    const tplData = rptDataUtil.assembleData(ctx, curRawDataObj, baseDir, null, customSelect);
+                    const printCom = JpcEx.createNew();
+                    rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_PAGE_SIZE] = params.pageSize;
+
+                    if (params.pageSize) rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_PAGE_SIZE] = params.pageSize;
+                    if (params.orientation && (params.orientation !== 'null')) rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_ORIENTATION] = params.orientation;
+                    if (params.custCfg) setupCustomizeCfg(params.custCfg, rptTpl, defProperties);
+                    const dftOption = params.option || JV.PAGING_OPTION_NORMAL;
+
+                    printCom.initialize(rptTpl);
+                    // console.log(rptTpl);
+                    printCom.analyzeData(ctx.helper, rptTpl, tplData, defProperties, dftOption, outputType, customSelect);
+                    const maxPages = printCom.totalPages;
+                    let pageRst = null;
+                    // console.log(maxPages);
+                    if (maxPages > 0) {
+                        pageRst = printCom.outputAsSimpleJSONPageArray(ctx.helper, rptTpl, tplData, 1, maxPages, defProperties, params.custCfg, customSelect);
+                    } else {
+                        pageRst = printCom.outputAsPreviewPage(rptTpl, defProperties);
+                    }
+                    pageRst.id = rptTpl.id;
+                    rptPageRstArray.push(pageRst);
+                }
+                return rptPageRstArray;
+            } catch (ex) {
+                console.log(`'报表数据异常(getMultiRptsCommon): project_id ${params.project_id}, tender_id: ${params.tender_id}, stage_id: ${params.stage_id}`);
+                console.log(ex);
+            } finally {
+                //
+            }
         }
 
         getAllPreviewPagesCommon(rawRptTpl, pageSize) {