Przeglądaj źródła

报表内存表,缓存相关

MaiXinRong 5 lat temu
rodzic
commit
49f1848495
1 zmienionych plików z 5 dodań i 3 usunięć
  1. 5 3
      app/service/revise_audit.js

+ 5 - 3
app/service/revise_audit.js

@@ -270,9 +270,6 @@ module.exports = app => {
                     // 无下一审核人表示,审核结束
                     if (nextAudit) {
                         await transaction.update(this.tableName, {id: nextAudit.id, status: auditConst.status.checking, begin_time: time});
-                        // 最新一期跟台账相关的缓存数据应过期
-                        const lastStage = await this.ctx.service.stage.getLastestStage(t.id, true);
-                        if (lastStage) await transaction.update(this.ctx.service.stage.tableName, {id: lastStage.id, cache_time_l: new Date()});
 
                         // 短信通知-需要审批提醒功能
                         // 下一人
@@ -287,6 +284,11 @@ module.exports = app => {
                     } else {
                         // 同步修订信息
                         await transaction.update(this.ctx.service.ledgerRevise.tableName, {id: revise.id, status: checkType, end_time: time});
+                        // 最新一期跟台账相关的缓存数据应过期
+                        const lastStage = await this.ctx.service.stage.getLastestStage(revise.tid, true);
+                        const cacheTime = new Date();
+                        if (lastStage) await transaction.update(this.ctx.service.stage.tableName,
+                            {id: lastStage.id, cache_time_l: cacheTime, cache_time_r: cacheTime});
                         // 拷贝修订数据至台账
                         await this._replaceLedgerByRevise(transaction, revise);
                         const sum = await this.ctx.service.reviseBills.addUp({tender_id: revise.tid, is_leaf: true});