Browse Source

台账修订,批量插入清单-计量单元相关

maixinrong 5 năm trước cách đây
mục cha
commit
5f4580f5ec
2 tập tin đã thay đổi với 18 bổ sung4 xóa
  1. 8 4
      app/service/revise_bills.js
  2. 10 0
      config/config.temp.js

+ 8 - 4
app/service/revise_bills.js

@@ -126,18 +126,20 @@ module.exports = app => {
                 }
                 // 数据库创建新增节点数据
                 await this.transaction.insert(this.tableName, bills);
-                await this.transaction.insert(this.ctx.service.revisePos.tableName, pos);
+                if (pos.length > 0) {
+                    await this.transaction.insert(this.ctx.service.revisePos.tableName, pos);
+                }
                 this._cacheMaxLid(tid, maxId + data.length);
                 await this.transaction.commit();
             } catch (err) {
-                await this.transaction.rollback();
+                await this.transaction.rollback();console.log(lastChild);
                 throw err;
             }
 
             // 查询应返回的结果
             result.ledger.create = await this.getDataById(newIds);
             if (!lastChild) {
-                result.ledger.update = await this.getDataByKid(select.id);
+                result.ledger.update = await this.getDataById(select.id);
             }
             result.pos = await this.ctx.service.revisePos.getDataByLid(tid, newIds);
             return result;
@@ -215,7 +217,9 @@ module.exports = app => {
                 await this._updateChildrenOrder(tid, select.ledger_pid, select.order+1);
                 // 数据库创建新增节点数据
                 await this.transaction.insert(this.tableName, bills);
-                await this.transaction.insert(this.ctx.service.revisePos.tableName, pos);
+                if (pos.length > 0) {
+                    await this.transaction.insert(this.ctx.service.revisePos.tableName, pos);
+                }
                 this._cacheMaxLid(tid, maxId + data.length);
                 await this.transaction.commit();
             } catch (err) {

+ 10 - 0
config/config.temp.js

@@ -53,5 +53,15 @@ module.exports = appInfo => {
         rolling: true, // 每次都更新session有效期
     };
 
+    // 是否压缩替换前端js
+    config.min = false;
+
+    config.logger = {
+        consoleLevel: 'WARN',
+        disableConsoleAfterReady: false,
+    };
+
+    config.is_debug = true;
+
     return config;
 };