Browse Source

优化调试cache最大值

ellisran 1 year ago
parent
commit
39504449f3
2 changed files with 7 additions and 1 deletions
  1. 6 0
      app/base/base_tree_service.js
  2. 1 1
      app/controller/revise_controller.js

+ 6 - 0
app/base/base_tree_service.js

@@ -333,6 +333,12 @@ class TreeService extends Service {
     async _getMaxLid(mid) {
         const cacheKey = this.setting.keyPre + mid;
         let maxId = parseInt(await this.cache.get(cacheKey));
+        // 判断是否存在变更新增部位maxId,有则取两者最大值
+        const changeReviseCacheKey = 'change_ledger_maxLid2:' + mid;
+        const changeReviseMaxId = await this.cache.get(changeReviseCacheKey);
+        if (changeReviseMaxId) {
+            maxId = !maxId ? parseInt(changeReviseMaxId) : Math.max(maxId, parseInt(changeReviseMaxId));
+        }
         if (!maxId) {
             const sql = 'SELECT Max(??) As max_id FROM ?? Where ' + this.setting.mid + ' = ?';
             const sqlParam = [this.setting.kid, this.tableName, mid];

+ 1 - 1
app/controller/revise_controller.js

@@ -54,7 +54,7 @@ module.exports = app => {
             const changeList = await ctx.service.change.getAllDataByCondition({
                 where: {
                     tid: ctx.tender.id,
-                    status: [audit.flow.status.checking, audit.flow.status.backnew],
+                    status: [audit.change.status.checking, audit.change.status.checkNoPre],
                 },
             });
             if (changeList.length > 0) {