|
@@ -193,13 +193,12 @@ module.exports = app => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- async getStageImTzData(tid, sid, fields) {
|
|
|
+ async getStageImTzData(tid, sid, fields, readCache = true) {
|
|
|
await this.ctx.service.tender.checkTender(tid);
|
|
|
await this.ctx.service.stage.checkStage(sid);
|
|
|
- const cache = await this._getReportMemoryCache('mem_stage_im_tz', tid, sid, this.ctx.stage.cacheTime, stageImVersion);
|
|
|
- if (cache) {
|
|
|
- // console.log('cache');
|
|
|
- return cache;
|
|
|
+ if (readCache) {
|
|
|
+ const cache = await this._getReportMemoryCache('mem_stage_im_tz', tid, sid, this.ctx.stage.cacheTime, stageImVersion);
|
|
|
+ if (cache) return cache;
|
|
|
}
|
|
|
|
|
|
// console.log('build');
|
|
@@ -218,11 +217,13 @@ module.exports = app => {
|
|
|
return this.stageImData.main;
|
|
|
}
|
|
|
|
|
|
- async getStageImTzBillsData(tid, sid, fields) {
|
|
|
+ async getStageImTzBillsData(tid, sid, fields, readCache = true) {
|
|
|
await this.ctx.service.tender.checkTender(tid);
|
|
|
await this.ctx.service.stage.checkStage(sid);
|
|
|
- const cache = await this._getReportMemoryCache('mem_stage_im_tz_bills', tid, sid, this.ctx.stage.cacheTime, stageImVersion);
|
|
|
- if (cache) return cache;
|
|
|
+ if (readCache) {
|
|
|
+ const cache = await this._getReportMemoryCache('mem_stage_im_tz_bills', tid, sid, this.ctx.stage.cacheTime, stageImVersion);
|
|
|
+ if (cache) return cache;
|
|
|
+ }
|
|
|
|
|
|
if (!this.stageImData) {
|
|
|
this.stageImData = {};
|
|
@@ -239,11 +240,13 @@ module.exports = app => {
|
|
|
return this.stageImData.bills;
|
|
|
}
|
|
|
|
|
|
- async getStageImZlData(tid, sid, fields) {
|
|
|
+ async getStageImZlData(tid, sid, fields, readCache = true) {
|
|
|
await this.ctx.service.tender.checkTender(tid);
|
|
|
await this.ctx.service.stage.checkStage(sid);
|
|
|
- const cache = await this._getReportMemoryCache('mem_stage_im_zl', tid, sid, this.ctx.stage.cacheTime, stageImVersion);
|
|
|
- if (cache) return cache;
|
|
|
+ if (readCache) {
|
|
|
+ const cache = await this._getReportMemoryCache('mem_stage_im_zl', tid, sid, this.ctx.stage.cacheTime, stageImVersion);
|
|
|
+ if (cache) return cache;
|
|
|
+ }
|
|
|
|
|
|
this.stageImData = {};
|
|
|
try {
|