浏览代码

汇总表相关

MaiXinRong 2 年之前
父节点
当前提交
cd6a6c5648
共有 5 个文件被更改,包括 18 次插入15 次删除
  1. 9 1
      app/lib/ledger.js
  2. 1 0
      app/lib/rpt_data_analysis.js
  3. 4 6
      app/service/report.js
  4. 4 4
      app/service/rpt_gather_memory.js
  5. 0 4
      sql/update.sql

+ 9 - 1
app/lib/ledger.js

@@ -567,6 +567,14 @@ class pos {
         }
     }
 
+    getLedgerPosKey() {
+        const result = [];
+        for (const prop in this.ledgerPos) {
+            result.push(prop);
+        }
+        return result;
+    }
+
     getLedgerPos(mid) {
         return this.ledgerPos[itemsPre + mid];
     }
@@ -598,7 +606,7 @@ class pos {
 
 class gatherPos extends pos {
     loadGatherPos(ledgerId, sourcePosRange, loadFun) {
-        let posRange = this.getledgerPos(itemsPre + ledgerId);
+        let posRange = this.getLedgerPos(itemsPre + ledgerId);
         if (!posRange) {
             posRange = [];
             this.ledgerPos[itemsPre + ledgerId] = posRange;

+ 1 - 0
app/lib/rpt_data_analysis.js

@@ -1214,6 +1214,7 @@ const gatherSelectConverse = {
         for (const t of options.table) {
             switch (t) {
                 case 'mem_gather_stage_bills':
+                case 'mem_gather_stage_pos':
                 case 'mem_gather_stage_pay':
                 case 'mem_gather_deal_bills':
                 case 'mem_union_data':

+ 4 - 6
app/service/report.js

@@ -370,14 +370,12 @@ module.exports = app => {
                         rst[filter] = await jhHelper3.gatherBills(memFieldKeys[filter], customDefine.gather_select, customSelect ? customSelect.gather_select : null);
                         break;
                     case 'mem_gather_stage_bills':
-                        runnableRst.push(service.rptGatherMemory.getGatherStageBills(memFieldKeys[filter],
-                            customDefine.gather_select, customSelect ? customSelect.gather_select : null));
-                        runnableKey.push(filter);
+                        rst[filter] = await service.rptGatherMemory.getGatherStageBills(memFieldKeys[filter],
+                            customDefine.gather_select, customSelect ? customSelect.gather_select : null);
                         break;
                     case 'mem_gather_stage_pos':
-                        runnableRst.push(service.rptGatherMemory.getGatherStageBills(memFieldKeys[filter],
-                            customDefine.gather_select, customSelect ? customSelect.gather_select : null));
-                        runnableKey.push(filter);
+                        rst[filter] = await service.rptGatherMemory.getGatherStagePos(memFieldKeys[filter],
+                            customDefine.gather_select, customSelect ? customSelect.gather_select : null);
                         break;
                     // case 'mem_material_bills':
                     //     rst[filter] = await service.rptGatherMemory.getMaterialBills(params.tender_id, params.material_order, memFieldKeys[filter]);

+ 4 - 4
app/service/rpt_gather_memory.js

@@ -358,7 +358,7 @@ module.exports = app => {
                 const l = this.ctx.helper._.find(billsData, {id: d.id});
                 this.ctx.helper._.assignIn(l, d);
             }
-            const pos = new Ledger.pos(this.ctx, { id: 'id', ledgerId: 'lid' });
+            const pos = new Ledger.pos({ id: 'id', ledgerId: 'lid' });
             const posData = await this.ctx.service.pos.getAllDataByCondition({ where: { tid: tender.id} });
             let billsIndexData = {};
             for (const bd of billsData) {
@@ -396,7 +396,7 @@ module.exports = app => {
                 const posRange = pos.getLedgerPos(sourceNode.id);
                 if (!posRange || posRange.length === 0) return;
                 resultPos.loadGatherPos(gatherNode.id, posRange, (gatherPos, sourcePos) => {
-                    gatherUtils.gatherZonePos(gatherPos, sourcePos, completeData.prefix, helper);
+                    gatherUtils.gatherZonePos(tender, gatherPos, sourcePos, completeData.prefix, helper);
                 });
             });
         }
@@ -441,7 +441,7 @@ module.exports = app => {
                 const l = this.ctx.helper._.find(billsData, {id: d.id});
                 this.ctx.helper._.assignIn(l, d);
             }
-            const pos = new Ledger.pos(this.ctx, { id: 'id', ledgerId: 'lid' });
+            const pos = new Ledger.pos({ id: 'id', ledgerId: 'lid' });
             const posData = await this.ctx.service.pos.getAllDataByCondition({ where: { tid: tender.id } });
             if (stage) {
                 await this.ctx.service.stage.doCheckStage(stage);
@@ -475,7 +475,7 @@ module.exports = app => {
                 const posRange = pos.getLedgerPos(sourceNode.id);
                 if (!posRange || posRange.length === 0) return;
                 resultPos.loadGatherPos(gatherNode.id, posRange, (gatherPos, sourcePos) => {
-                    gatherUtils.gatherStagePos(gatherPos, sourcePos, completeData.prefix, helper);
+                    gatherUtils.gatherStagePos(tender, gatherPos, sourcePos, completeData.prefix, helper);
                 });
             });
         }

+ 0 - 4
sql/update.sql

@@ -1,5 +0,0 @@
-ALTER TABLE `zh_material_stage_bills` ADD `expr` VARCHAR(1000) NULL DEFAULT NULL COMMENT '表达式' AFTER `quantity`;
-UPDATE `zh_material_stage_bills` a, `zh_material_bills` b SET a.`expr`= b.`expr` WHERE a.`mb_id` = b.`id`;
-
-UPDATE `zh_material_bills` a, `zh_material` b SET a.`expr`= null WHERE a.`mid` = b.`id` AND t_type = 2 AND b.`is_stage_self` = 1;