|
|
@@ -0,0 +1,55 @@
|
|
|
+/**
|
|
|
+ * Created by Tony on 2019/3/27.
|
|
|
+ */
|
|
|
+
|
|
|
+let test = require('tape');
|
|
|
+import JpcEx from "../../../modules/reports/rpt_component/jpc_ex";
|
|
|
+import JV from "../../../modules/reports/rpt_component/jpc_value_define";
|
|
|
+let config = require("../../../config/config.js");
|
|
|
+config.setupDb(process.env.NODE_ENV);
|
|
|
+let mongoose = require("mongoose");
|
|
|
+let fileUtils = require("../../../modules/common/fileUtils");
|
|
|
+let path = require('path');
|
|
|
+let dbm = require("../../../config/db/db_manager");
|
|
|
+let rpt_cfg = require('./rpt_cfg');
|
|
|
+dbm.connect(process.env.NODE_ENV);
|
|
|
+
|
|
|
+let demoPrjs = [662, 664];
|
|
|
+let userId_Leng = "5c3ffa9aa0a92732f41216e0"; //小冷User Id (养护的)
|
|
|
+// let userId_me = "5b6a60b1c4ba33000dd417c0"; //我的
|
|
|
+let userId_Dft = userId_Leng;
|
|
|
+
|
|
|
+//统一引用models
|
|
|
+fileUtils.getGlobbedFiles('../../../modules/all_models/*.js').forEach(function(modelPath) {
|
|
|
+ require(path.resolve(modelPath));
|
|
|
+});
|
|
|
+
|
|
|
+//config.setupCache();
|
|
|
+let cfgCacheUtil = require("../../../config/cacheCfg");
|
|
|
+cfgCacheUtil.setupDftCache();
|
|
|
+
|
|
|
+let fsUtil = require("../../../public/fsUtil");
|
|
|
+
|
|
|
+let rptTplFacade = require("../../../modules/reports/facade/rpt_template_facade");
|
|
|
+let rptTplDataFacade = require("../../../modules/reports/facade/rpt_tpl_data_facade");
|
|
|
+
|
|
|
+import rptDataExtractor from "../../../modules/reports/util/rpt_yanghu_data_util";
|
|
|
+
|
|
|
+let fs = require('fs');
|
|
|
+//设置Date Format函数
|
|
|
+fs.readFile(__dirname.slice(0, __dirname.length - 18) + '/public/web/date_util.js', 'utf8', 'r', function (err, data) {
|
|
|
+ eval(data);
|
|
|
+});
|
|
|
+
|
|
|
+test('测试 - 测试模板啦: ', function (t) {
|
|
|
+ //project_facade.getBudgetSummayDatas([517,521]);
|
|
|
+
|
|
|
+});
|
|
|
+
|
|
|
+test('close the connection', function (t) {
|
|
|
+ setTimeout(function () {
|
|
|
+ mongoose.disconnect();
|
|
|
+ t.pass('closing db connection');
|
|
|
+ t.end();
|
|
|
+ }, 1000);
|
|
|
+});
|