|
@@ -79,6 +79,15 @@ const testSetting4 = {
|
|
|
tenderId: 2436,
|
|
|
sorder: 1,
|
|
|
};
|
|
|
+const testSetting5 = {
|
|
|
+ postData: {
|
|
|
+ account: 'fuqingqing',
|
|
|
+ project: 'P0505',
|
|
|
+ project_password: '123456',
|
|
|
+ },
|
|
|
+ tenderId: 2142,
|
|
|
+ sorder: 4,
|
|
|
+};
|
|
|
|
|
|
const reportDataAnalysis = require('../../../app/lib/rpt_data_analysis');
|
|
|
|
|
@@ -149,7 +158,21 @@ describe('test/app/service/report_memory.test.js', () => {
|
|
|
const stage = yield ctx.service.stage.getDataByCondition({tid: testSetting.tenderId, order: testSetting.sorder});
|
|
|
data.mem_stage_im_tz = yield ctx.service.reportMemory.getStageImTzData(stage.tid, stage.id, [], false);
|
|
|
yield ctx.helper.saveBufferFile(JSON.stringify(data.mem_stage_im_tz, "", "\t"), path.join(savePath, 'mem_stage_im_tz.json'));
|
|
|
+ console.log(ctx.helper._.map(data.mem_stage_im_tz, 'calc_memo'));
|
|
|
data.mem_stage_im_tz_bills = yield ctx.service.reportMemory.getStageImTzBillsData(stage.tid, stage.id, [], false);
|
|
|
yield ctx.helper.saveBufferFile(JSON.stringify(data.mem_stage_im_tz_bills, "", "\t"), path.join(savePath, 'mem_stage_im_tz_bills.json'));
|
|
|
});
|
|
|
+ it('test getStageImZlData', function* () {
|
|
|
+ const ctx = app.mockContext();
|
|
|
+ const testSetting = testSetting5;
|
|
|
+ ctx.session = {};
|
|
|
+ const loginResult = yield ctx.service.projectAccount.accountLogin(testSetting.postData, 2);
|
|
|
+ assert(loginResult);
|
|
|
+
|
|
|
+ const data = {};
|
|
|
+ const stage = yield ctx.service.stage.getDataByCondition({tid: testSetting.tenderId, order: testSetting.sorder});
|
|
|
+ data.mem_stage_im_zl = yield ctx.service.reportMemory.getStageImZlData(stage.tid, stage.id, []);
|
|
|
+ yield ctx.helper.saveBufferFile(JSON.stringify(data.mem_stage_im_zl, "", "\t"), path.join(savePath, 'mem_stage_im_zl.json'));
|
|
|
+ console.log(ctx.helper._.map(data.mem_stage_im_zl, 'calc_memo'));
|
|
|
+ });
|
|
|
});
|