ソースを参照

计算速度相关

MaiXinRong 5 年 前
コミット
3a1a2ddb0c
2 ファイル変更6 行追加6 行削除
  1. 3 3
      app/service/pos.js
  2. 3 3
      app/service/revise_pos.js

+ 3 - 3
app/service/pos.js

@@ -173,7 +173,7 @@ module.exports = app => {
             if (data.sgfh_qty !== undefined || data.sjcl_qty !== undefined || data.qtcl_qty !== undefined) {
                 const op = await this.getDataById(data.id);
                 const bills = await this.ctx.service.ledger.getDataById(op.lid);
-                const billsPos = await this.getAllDataByCondition({where: {lid: op.lid} });
+                const billsPos = await this.getAllDataByCondition({where: {tid: tid, lid: op.lid} });
 
                 const precision = this.ctx.helper.findPrecision(this.ctx.tender.info.precision, bills.unit);
                 if (data.sgfh_qty !== undefined) {
@@ -231,7 +231,7 @@ module.exports = app => {
             if (data.length === 0) return;
             const op = await this.getDataById(data[0].id);
             const bills = await this.ctx.service.ledger.getDataById(op.lid);
-            const billsPos = await this.getAllDataByCondition({where: {lid: op.lid} });
+            const billsPos = await this.getAllDataByCondition({where: {tid: tid, lid: op.lid} });
             const precision = this.ctx.helper.findPrecision(this.ctx.tender.info.precision, bills.unit);
             for (const d of data) {
                 if (d.sgfh_qty !== undefined || d.sjcl_qty !== undefined || d.qtcl_qty !== undefined) {
@@ -293,7 +293,7 @@ module.exports = app => {
 
             const pos = await this.getPosData({tid: tid, id: data});
             const bills = await this.ctx.service.ledger.getDataById(pos[0].lid);
-            const billsPos = await this.getAllDataByCondition({ where: {lid: bills.id} });
+            const billsPos = await this.getAllDataByCondition({ where: {tid: tid, lid: bills.id} });
             const updateBills = {id: bills.id, sgfh_qty: null, sjcl_qty: null, qtcl_qty: null, quantity: null};
             for (const bp of billsPos) {
                 if (data.indexOf(bp.id) >= 0) continue;

+ 3 - 3
app/service/revise_pos.js

@@ -124,7 +124,7 @@ module.exports = app => {
             if (data.sgfh_qty !== undefined || data.sjcl_qty !== undefined || data.qtcl_qty !== undefined) {
                 const op = await this.getDataById(data.id);
                 const bills = await this.ctx.service.reviseBills.getDataById(op.lid);
-                const billsPos = await this.getAllDataByCondition({where: {lid: op.lid} });
+                const billsPos = await this.getAllDataByCondition({where: {tid: tid, lid: op.lid} });
 
                 const precision = this.ctx.helper.findPrecision(this.ctx.tender.info.precision, bills.unit);
                 if (data.sgfh_qty !== undefined) {
@@ -182,7 +182,7 @@ module.exports = app => {
             if (data.length === 0) return;
             const op = await this.getDataById(data[0].id);
             const bills = await this.ctx.service.reviseBills.getDataById(op.lid);
-            const billsPos = await this.getAllDataByCondition({where: {lid: op.lid} });
+            const billsPos = await this.getAllDataByCondition({where: {tid: tid, lid: op.lid} });
             const precision = this.ctx.helper.findPrecision(this.ctx.tender.info.precision, bills.unit);
             for (const d of data) {
                 if (d.sgfh_qty !== undefined || d.sjcl_qty !== undefined || d.qtcl_qty !== undefined) {
@@ -244,7 +244,7 @@ module.exports = app => {
 
             const pos = await this.getPosData({tid: tid, id: data});
             const bills = await this.ctx.service.reviseBills.getDataById(pos[0].lid);
-            const billsPos = await this.getAllDataByCondition({ where: {lid: bills.id} });
+            const billsPos = await this.getAllDataByCondition({ where: {tid: tid, lid: bills.id} });
             const updateBills = {id: bills.id, sgfh_qty: null, sjcl_qty: null, qtcl_qty: null, quantity: null};
             for (const bp of billsPos) {
                 if (data.indexOf(bp.id) >= 0) continue;