|
|
@@ -27,7 +27,7 @@ const { output } = require("pdfkit");
|
|
|
//统一回调函数
|
|
|
let callback = function(req, res, err, data){
|
|
|
if(err){
|
|
|
- res.json({success: false, error: err});
|
|
|
+ res.json({success: false, error: err, message: err});
|
|
|
}
|
|
|
else{
|
|
|
//res.send({success: true, data: data});
|
|
|
@@ -325,7 +325,7 @@ async function getMultiRptsCommonEx(user_id, prj_ids_arr, rpt_ids, pageSize, ori
|
|
|
let rptPageRstArray = await Promise.all(parallelFunctions);
|
|
|
cb(null, rptPageRstArray);
|
|
|
} catch (ex) {
|
|
|
- console.log(ex);
|
|
|
+ console.log(ex.message);
|
|
|
cb('Has exception!', null);
|
|
|
}
|
|
|
}
|
|
|
@@ -709,7 +709,8 @@ module.exports = {
|
|
|
getMultiRptsCommonEx(user_id, prj_ids_arr, rpt_ids, pageSize, orientation, customizeCfg, dftOption, JV.OUTPUT_TYPE_PDF, function (err, rptPageRstArray) {
|
|
|
// getMultiRptsCommon(user_id, prj_id, rpt_ids, pageSize, orientation, customizeCfg, dftOption, JV.OUTPUT_TYPE_NORMAL, function (err, rptPageRstArray) {
|
|
|
if(err){
|
|
|
- console.log('导出Excel错误(生成数据过程错误), userId: ' + user_id + ', prjId' + prj_id);
|
|
|
+ console.log(`导出Excel错误(生成数据过程错误), userId: ${user_id}, prjId: ${prj_id}`);
|
|
|
+ console.log(err);
|
|
|
callback(req, res, '数据有误', null);
|
|
|
} else {
|
|
|
if ((rpt_bill_tpl_ids && rpt_bill_tpl_ids.length > 0) || (rpt_glj_tpl_ids && rpt_glj_tpl_ids.length > 0)) {
|
|
|
@@ -771,7 +772,8 @@ module.exports = {
|
|
|
let pri_Run_Parallel_Functions = function (parallelFunctions) {
|
|
|
async.parallel(parallelFunctions, function (err, fileRstArray) {
|
|
|
if (err) {
|
|
|
- console.log('导出Excel错误(导出数据过程错误), userId: ' + user_id + ', prjId' + prj_id);
|
|
|
+ console.log(`导出Excel错误(生成数据过程错误), userId: ${user_id}, prjId: ${prj_id}`);
|
|
|
+ console.log(err);
|
|
|
callback(req, res, '数据导出错误', null);
|
|
|
} else {
|
|
|
// console.log(err);
|
|
|
@@ -783,7 +785,8 @@ module.exports = {
|
|
|
getMultiRptsCommonEx(user_id, prj_ids_arr, rpt_ids, pageSize, orientation, customizeCfg, dftOption, JV.OUTPUT_TYPE_PDF, function (err, rptPageRstArray) {
|
|
|
// getMultiRptsCommon(user_id, prj_id, rpt_ids, pageSize, orientation, customizeCfg, dftOption, JV.OUTPUT_TYPE_NORMAL, function (err, rptPageRstArray) {
|
|
|
if (err) {
|
|
|
- console.log('导出Excel错误(生成数据过程错误), userId: ' + user_id + ', prjId' + prj_id);
|
|
|
+ console.log(`导出Excel错误(生成数据过程错误), userId: ${user_id}, prjId: ${prj_id}`);
|
|
|
+ console.log(err);
|
|
|
callback(req, res, '数据生成错误', null);
|
|
|
} else {
|
|
|
if ((rpt_bill_tpl_ids && rpt_bill_tpl_ids.length > 0) || (rpt_glj_tpl_ids && rpt_glj_tpl_ids.length > 0)) {
|
|
|
@@ -952,7 +955,8 @@ module.exports = {
|
|
|
console.log(0);
|
|
|
getMultiRptsCommon(user_id, prj_id, rpt_ids, pageSize, orientation, customizeCfg, dftOption, JV.OUTPUT_TYPE_PDF, function (err, rptPageRstArray) {
|
|
|
if (err) {
|
|
|
- console.log('导出Excel错误(生成数据过程错误), userId: ' + user_id + ', prjId' + prj_id);
|
|
|
+ console.log('导出Excel错误(生成数据过程错误), userId: ' + user_id + ', prjId' + prj_id);
|
|
|
+ console.log(err);
|
|
|
callback(req, res, '数据生成错误', null);
|
|
|
} else {
|
|
|
if ((rpt_bill_tpl_ids && rpt_bill_tpl_ids.length > 0) || (rpt_glj_tpl_ids && rpt_glj_tpl_ids.length > 0)) {
|