|
@@ -435,6 +435,7 @@ module.exports = app => {
|
|
|
});
|
|
|
|
|
|
// console.log('encodeSignatureDataUri!');
|
|
|
+ // fsUtil.writeObjToFile(pageRst, 'D:/GitHome/Temp/testBuiltPageResult2.js');
|
|
|
return {
|
|
|
data: pageRst,
|
|
|
signatureRelInfo: roleRel,
|
|
@@ -459,38 +460,6 @@ module.exports = app => {
|
|
|
// console.log('in getReport');
|
|
|
const params = JSON.parse(ctx.request.body.params);
|
|
|
ctx.body = await this._getReport(ctx, params);
|
|
|
- // // console.log(params);
|
|
|
- // let rptTpl = await ctx.service.rptTpl.getTplById(params.rpt_tpl_id);
|
|
|
- // if (!rptTpl || rptTpl.length !== 1) {
|
|
|
- // throw '获取模板失败';
|
|
|
- // }
|
|
|
- // rptTpl = JSON.parse(rptTpl[0].rpt_content);
|
|
|
- // // console.log('get the template!');
|
|
|
- // const pageRst = await getAllPagesCommon(ctx, rptTpl, params, JV.PAGING_OPTION_NORMAL, JV.OUTPUT_TYPE_NORMAL, this.app.baseDir);
|
|
|
- // // console.log(pageRst);
|
|
|
- // // const roleRel = (params.stage_status === 3) ? (await ctx.service.roleRptRel.getRoleRptRelByDetailIds(params.tender_id, params.rpt_tpl_id)) : [];
|
|
|
- // const roleRel = await ctx.service.roleRptRel.getRoleRptRelByDetailIds(params.tender_id, params.rpt_tpl_id); // 新需求中,允许在非审核状态下设置签名
|
|
|
- // const stgAudit = await ctx.service.stageAudit.getStageAudit(params.stage_id, params.stage_times);
|
|
|
- // // console.log('after role stage!');
|
|
|
- // // console.log(roleRel);
|
|
|
- // 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.getDataByCondition({
|
|
|
- // tid: params.tender_id, sid: params.stage_id, rid: params.rpt_tpl_id
|
|
|
- // });
|
|
|
- //
|
|
|
- // // console.log('encodeSignatureDataUri!');
|
|
|
- // ctx.body = {
|
|
|
- // data: pageRst,
|
|
|
- // signatureRelInfo: roleRel,
|
|
|
- // stageAudit: stgAudit,
|
|
|
- // debugInfo: ctx.app.config.is_debug ? ctx.debugInfo : null,
|
|
|
- // customDefine: rptTpl[JV.NODE_CUSTOM_DEFINE],
|
|
|
- // stageFlow,
|
|
|
- // customSelect,
|
|
|
- // };
|
|
|
- // // ctx.body = { data: { msg: 'test the network' } };
|
|
|
ctx.status = 201;
|
|
|
} catch (ex) {
|
|
|
console.log(ex);
|
|
@@ -498,6 +467,17 @@ module.exports = app => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ async getTestReport(ctx) {
|
|
|
+ try {
|
|
|
+ const file = 'D:/GitHome/Temp/导出PDF_格式样本1.js';
|
|
|
+ const tplObj = JSON.parse(fs.readFileSync(file, 'utf-8'));
|
|
|
+ ctx.body = { data: tplObj };
|
|
|
+ ctx.status = 201;
|
|
|
+ } catch (ex) {
|
|
|
+ this.setMessage(ex.toString(), this.messageType.ERROR);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取多批次报表数据
|
|
|
*
|