|
@@ -13,6 +13,8 @@ const path = require('path');
|
|
|
let savePath;
|
|
|
const mockData = {};
|
|
|
|
|
|
+const reportDataAnalysis = require('../../../app/lib/rpt_data_analysis');
|
|
|
+
|
|
|
describe('test/app/service/report_memory.test.js', () => {
|
|
|
// 准备测试数据
|
|
|
before(function* () {
|
|
@@ -36,8 +38,23 @@ describe('test/app/service/report_memory.test.js', () => {
|
|
|
// 期部位明细数据
|
|
|
it('test getStagePos', function* () {
|
|
|
const ctx = app.mockContext(mockData);
|
|
|
+ const select = {
|
|
|
+ tenders: [{tid: 2283}, {tid: 2281}],
|
|
|
+ type: 'final',
|
|
|
+ };
|
|
|
+ const define = {
|
|
|
+ enable: true,
|
|
|
+ setting: JSON.stringify({
|
|
|
+ title: '请选择汇总的标段',
|
|
|
+ type: 'final',
|
|
|
+ })
|
|
|
+ };
|
|
|
|
|
|
- const result = yield ctx.service.reportMemory.getMaterialGl(2418, 2);
|
|
|
- yield ctx.helper.saveBufferFile(JSON.stringify(result, "", "\t"), path.join(savePath, 'test-result.json'));
|
|
|
+ const data = {};
|
|
|
+ data.mem_gather_stage_pay = yield ctx.service.rptGatherMemory.getGatherStagePay([], define, select);
|
|
|
+ yield ctx.helper.saveBufferFile(JSON.stringify(data.mem_gather_stage_pay, "", "\t"), path.join(savePath, 'mem_gather_stage_pay.json'));
|
|
|
+ reportDataAnalysis.analysisObj.gatherSelectConverse.fun(ctx, data, [], {table: ['mem_gather_stage_pay']}, {
|
|
|
+ tplDefine: {gather_select: define}, cDefine: {gather_select: select}});
|
|
|
+ yield ctx.helper.saveBufferFile(JSON.stringify(data.mem_gather_stage_pay, "", "\t"), path.join(savePath, 'mem_gather_stage_pay_converse.json'));
|
|
|
});
|
|
|
});
|