|
@@ -26,6 +26,8 @@ class loadGclBaseTree {
|
|
|
// this.parent下原来的节点
|
|
|
this.baseNodes = [];
|
|
|
|
|
|
+ this.ignoreParent = setting.ignoreParent;
|
|
|
+
|
|
|
// 缓存
|
|
|
this.keyNodeId = setting.maxId ? setting.maxId + 1 : 1;
|
|
|
}
|
|
@@ -120,7 +122,7 @@ class loadGclBaseTree {
|
|
|
quantity: 0,
|
|
|
is_leaf: source.is_leaf,
|
|
|
hasPos: false,
|
|
|
- }
|
|
|
+ };
|
|
|
this.keyNodeId += 1;
|
|
|
this.parent.children.push(node);
|
|
|
this.items.push(node);
|
|
@@ -329,9 +331,10 @@ class gatherStageGclTree extends loadGclBaseTree {
|
|
|
}
|
|
|
gather(source, parent) {
|
|
|
parent = parent ? parent : this.parent;
|
|
|
- const node = this.addNode(source, parent, function (node, source) {
|
|
|
+ const checkFun = function (node, source) {
|
|
|
return (source.is_tp && node.is_tp) || (!source.is_tp && !node.is_tp);
|
|
|
- });
|
|
|
+ };
|
|
|
+ const node = this.ignoreParent ? this.addNodeWithoutParent(source, checkFun) : this.addNode(source, parent, checkFun);
|
|
|
if (node.is_tp) {
|
|
|
node.contract_tp = this.ctx.helper.add(node.contract_tp, source.contract_tp);
|
|
|
} else {
|
|
@@ -377,12 +380,12 @@ class sumLoad {
|
|
|
this.ctx = ctx;
|
|
|
}
|
|
|
|
|
|
- recusiveLoadGatherGcl(node, parent, ignoreParent) {
|
|
|
+ recusiveLoadGatherGcl(node, parent, ignoreParent = false) {
|
|
|
const isLeaf = !node.children || node.children.length === 0;
|
|
|
- const cur = (!ignoreParent || isLeaf) && node.b_code ? this.loadTree.gather(node, parent) : parent;
|
|
|
+ const cur = (!ignoreParent || isLeaf) && node.b_code ? this.loadTree.gather(node, parent) : parent;
|
|
|
if (isLeaf) return;
|
|
|
for (const child of node.children) {
|
|
|
- this.recusiveLoadGatherGcl(child, cur);
|
|
|
+ this.recusiveLoadGatherGcl(child, cur, ignoreParent);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -469,7 +472,7 @@ class sumLoad {
|
|
|
}
|
|
|
|
|
|
async stageGatherGcl(select, maxId, tenders, defaultData) {
|
|
|
- const ignoreParent = this.ctx.tender.info.fun_rela.ignoreParent;
|
|
|
+ const ignoreParent = this.ctx.tender.info.fun_rela.sum_load.ignoreParent;
|
|
|
this.loadTree = new gatherStageGclTree(this.ctx, {
|
|
|
parent: select, maxId, type: 'ledger', defaultData, ignoreParent,
|
|
|
});
|