|
@@ -217,7 +217,9 @@ module.exports = app => {
|
|
|
// await encodeSignatureDataUri(roleRel, this.app.baseDir);
|
|
|
// await encodeDummySignatureDataUri(pageRst, this.app.baseDir);
|
|
|
// const stageFlow = await ctx.service.stageAudit.getAuditGroupByListWithOwner(params.stage_id, params.stage_times);
|
|
|
- // const customSelect = await ctx.service.rptCustomDefine.getCustomDefine(params.tender_id, params.stage_id, params.rpt_tpl_id);
|
|
|
+ // const customSelect = await ctx.service.rptCustomDefine.getDataByCondition({
|
|
|
+ // tid: params.tender_id, sid: params.stage_id, rid: params.rpt_tpl_id
|
|
|
+ // });
|
|
|
//
|
|
|
// // console.log('encodeSignatureDataUri!');
|
|
|
// ctx.body = {
|
|
@@ -422,7 +424,7 @@ async function checkStg(ctx, params) {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-async function getReportData(ctx, params, filters, memFieldKeys) {
|
|
|
+/*async function getReportData(ctx, params, filters, memFieldKeys) {
|
|
|
const rst = {};
|
|
|
const runnableRst = [];
|
|
|
const runnableKey = []; // 这个配合runnableRst用,未来考虑并行查询优化
|
|
@@ -523,14 +525,14 @@ async function getReportData(ctx, params, filters, memFieldKeys) {
|
|
|
}
|
|
|
}
|
|
|
return rst;
|
|
|
-}
|
|
|
+}*/
|
|
|
|
|
|
async function getAllPagesCommon(ctx, rptTpl, params, option, outputType, baseDir) {
|
|
|
const rptDataUtil = new rptDataExtractor();
|
|
|
rptDataUtil.initialize(rptTpl);
|
|
|
const filter = rptDataUtil.getDataRequestFilter();
|
|
|
// console.log(filter.tables);
|
|
|
- const rawDataObj = await ctx.service.report.getReportData(params, filter.tables, filter.memFieldKeys);
|
|
|
+ const rawDataObj = await ctx.service.report.getReportData(params, filter.tables, filter.memFieldKeys, rptTpl);
|
|
|
// console.log(rawDataObj);
|
|
|
try {
|
|
|
const printCom = JpcEx.createNew();
|
|
@@ -554,7 +556,9 @@ async function getAllPagesCommon(ctx, rptTpl, params, option, outputType, baseDi
|
|
|
}
|
|
|
const dftOption = params.option || JV.PAGING_OPTION_NORMAL;
|
|
|
printCom.initialize(rptTpl);
|
|
|
- const customDefine = await ctx.service.rptCustomDefine.getCustomDefine(params.tender_id, params.stage_id, params.rpt_tpl_id);
|
|
|
+ const customDefine = await ctx.service.rptCustomDefine.getDataByCondition({
|
|
|
+ tid: params.tender_id, sid: params.stage_id, rid: params.rpt_tpl_id
|
|
|
+ });
|
|
|
// ctx.helper
|
|
|
printCom.analyzeData(ctx.helper, rptTpl, tplData, defProperties, dftOption, outputType, customDefine);
|
|
|
// console.log(JSON.stringify(rptTpl));
|
|
@@ -645,13 +649,17 @@ async function getMultiRptsCommon(ctx, params, outputType, baseDir) {
|
|
|
const dftOption = params.option || JV.PAGING_OPTION_NORMAL;
|
|
|
|
|
|
printCom.initialize(rptTpl);
|
|
|
- const customDefine = await ctx.service.rptCustomDefine.getCustomDefine(params.tender_id, params.stage_id, params.rpt_tpl_id);
|
|
|
+ const customDefine = await ctx.service.rptCustomDefine.getDataByCondition({
|
|
|
+ tid: params.tender_id, sid: params.stage_id, rid: params.rpt_tpl_id
|
|
|
+ });
|
|
|
// console.log(rptTpl);
|
|
|
printCom.analyzeData(ctx.helper, rptTpl, tplData, defProperties, dftOption, outputType, customDefine);
|
|
|
const maxPages = printCom.totalPages;
|
|
|
let pageRst = null;
|
|
|
// console.log(maxPages);
|
|
|
- const customDefine = await ctx.service.rptCustomDefine.getCustomDefine(params.tender_id, params.stage_id, params.rpt_tpl_id);
|
|
|
+ const customDefine = await ctx.service.rptCustomDefine.getDataByCondition({
|
|
|
+ tid: params.tender_id, sid: params.stage_id, rid: params.rpt_tpl_id
|
|
|
+ });
|
|
|
if (maxPages > 0) {
|
|
|
pageRst = printCom.outputAsSimpleJSONPageArray(ctx.helper, rptTpl, tplData, 1, maxPages, defProperties, params.custCfg, customDefine);
|
|
|
} else {
|