Explorar o código

报表数据调整

MaiXinRong %!s(int64=2) %!d(string=hai) anos
pai
achega
f4af11bfda
Modificáronse 1 ficheiros con 6 adicións e 2 borrados
  1. 6 2
      app/service/report_memory.js

+ 6 - 2
app/service/report_memory.js

@@ -389,7 +389,9 @@ module.exports = app => {
                     await this.ctx.service.stage.checkStage(sid);
                 }
 
-                const billsData = await this.ctx.service.ledger.getData(this.ctx.tender.id);
+                const billsData = this.ctx.stage.ledgerHis
+                    ? await this.ctx.helper.loadLedgerDataFromOss(this.ctx.stage.ledgerHis.bills_file)
+                    : await this.ctx.service.ledger.getData(this.ctx.tender.id);
                 if (this._checkFieldsExist(fields, billsFields.stageDgn)) {
                     const dgnData = await this.ctx.service.stageBillsDgn.getDgnData(this.ctx.tender.id);
                     for (const d of dgnData) {
@@ -539,7 +541,9 @@ module.exports = app => {
 
                 const stage = this.ctx.stage, helper = this.ctx.helper;
                 const validRole = this.stageValidRole;
-                const billsData = await this.ctx.service.ledger.getData(this.ctx.tender.id);
+                const billsData = this.ctx.stage.ledgerHis
+                    ? await this.ctx.helper.loadLedgerDataFromOss(this.ctx.stage.ledgerHis.bills_file)
+                    : await this.ctx.service.ledger.getData(this.ctx.tender.id);
                 const allStageBills = await this.ctx.service.stageBills.getAllDataByCondition({where: {sid: sid}});
 
                 const stageBillsIndex = {}, timesLen = 100;