sum_load.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537
  1. 'use strict';
  2. /**
  3. *
  4. *
  5. * @author Mai
  6. * @date
  7. * @version
  8. */
  9. const Ledger = require('../lib/ledger');
  10. class loadGclBaseTree {
  11. /**
  12. * 构造函数
  13. * @param {Array} tempData - 清单模板数据
  14. */
  15. constructor (ctx, setting) {
  16. this.ctx = ctx;
  17. this.parent = setting.parent;
  18. this.parent.children = [];
  19. this.defaultData = setting.defaultData;
  20. // 常量
  21. this.splitChar = '-';
  22. // 索引
  23. // 仅通过addNode或addNodeWithoutParent添加节点
  24. this.items = [];
  25. // this.parent下原来的节点
  26. this.baseNodes = [];
  27. this.ignoreParent = setting.ignoreParent;
  28. // 缓存
  29. this.keyNodeId = setting.maxId ? setting.maxId + 1 : 1;
  30. }
  31. /**
  32. * 根据 编号 查找 父项项目节
  33. * @param {String} code - 子项编号
  34. * @returns {*}
  35. */
  36. findNode(node, parent, check) {
  37. parent = parent || this.parent;
  38. if (!parent.children) return null;
  39. for (const child of parent.children) {
  40. const checkLeaf = (child.is_leaf && node.is_leaf) || (!child.is_leaf && !node.is_leaf);
  41. if (child.b_code === node.b_code && child.name === node.name && child.unit === node.unit
  42. && checkLeaf && !child.hasPos && (!check || check(child, node))) {
  43. return child;
  44. }
  45. }
  46. return null;
  47. }
  48. /**
  49. * 添加 树节点 并完善该节点的树结构
  50. * @param {Object} node - 添加节点
  51. * @param {Object} parent - 父项
  52. * @returns {*}
  53. */
  54. addNode(source, parent, check) {
  55. parent = parent ? parent : this.parent;
  56. let node = this.findNode(source, parent, check);
  57. if (!node) {
  58. if (!parent.children) parent.children = [];
  59. node = {
  60. id: this.ctx.app.uuid.v4(),
  61. tender_id: this.ctx.tender.id,
  62. ledger_id: this.keyNodeId,
  63. ledger_pid: parent.ledger_id,
  64. level: parent.level +1,
  65. full_path: parent.full_path + '-' + this.keyNodeId,
  66. order: parent.children.length + 1,
  67. children: [],
  68. b_code: source.b_code,
  69. name: source.name,
  70. unit: source.unit,
  71. deal_qty: 0,
  72. sgfh_qty: 0,
  73. qtcl_qty: 0,
  74. sjcl_qyt: 0,
  75. quantity: 0,
  76. is_leaf: source.is_leaf,
  77. hasPos: false,
  78. };
  79. this.keyNodeId += 1;
  80. parent.children.push(node);
  81. this.items.push(node);
  82. }
  83. return node;
  84. }
  85. findLeaf(node, check) {
  86. for (const bn of this.baseNodes) {
  87. if (bn.b_code === node.b_code && bn.name === node.name && bn.unit === node.unit
  88. && bn.is_leaf && !bn.hasPos && (!check || check(bn, node))) return bn;
  89. }
  90. for (const i of this.items) {
  91. if (i.b_code === node.b_code && i.name === node.name && i.unit === node.unit
  92. && i.is_leaf && !i.hasPos && (!check || check(i, node))) return i;
  93. }
  94. return null;
  95. }
  96. addNodeWithoutParent(source, check) {
  97. let node = this.findLeaf(source, check);
  98. if (!node) {
  99. node = {
  100. id: this.ctx.app.uuid.v4(),
  101. tender_id: this.ctx.tender.id,
  102. ledger_id: this.keyNodeId,
  103. ledger_pid: this.parent.ledger_id,
  104. level: this.parent.level + 1,
  105. full_path: this.parent.full_path + '-' + this.keyNodeId,
  106. order: this.parent.children.length + 1,
  107. b_code: source.b_code,
  108. name: source.name,
  109. unit: source.unit,
  110. deal_qty: 0,
  111. sgfh_qty: 0,
  112. qtcl_qty: 0,
  113. sjcl_qty: 0,
  114. quantity: 0,
  115. is_leaf: source.is_leaf,
  116. hasPos: false,
  117. };
  118. this.keyNodeId += 1;
  119. this.parent.children.push(node);
  120. this.items.push(node);
  121. }
  122. return node;
  123. }
  124. gather(source, parent) {}
  125. getUpdateData() {}
  126. resortChildrenByCode(node) {
  127. const helper = this.ctx.helper;
  128. if (!node.children || node.children.length === 0) return;
  129. node.children.sort((x, y) => {
  130. return helper.compareCode(x.b_code, y.b_code);
  131. });
  132. for (const [i, c] of node.children.entries()) {
  133. this.resortChildrenByCode(c);
  134. c.order = i + 1;
  135. }
  136. }
  137. resortByCode() {
  138. this.resortChildrenByCode(this.parent);
  139. }
  140. recursiveCalculate(dealBills, node) {
  141. if (node.children && node.children.length > 0) {
  142. for (const child of node.children) {
  143. this.recursiveCalculate(dealBills, child);
  144. }
  145. } else {
  146. const p = this.ctx.helper.findPrecision(this.ctx.tender.info.precision, node.unit);
  147. node.deal_qty = this.ctx.helper.round(node.deal_qty, p.value);
  148. node.sgfh_qty = this.ctx.helper.round(node.sgfh_qty, p.value);
  149. node.sjcl_qty = this.ctx.helper.round(node.sjcl_qty, p.value);
  150. node.qtcl_qty = this.ctx.helper.round(node.qtcl_qty, p.value);
  151. node.quantity = this.ctx.helper.round(node.quantity, p.value);
  152. if (!node.unit_price) {
  153. const db = dealBills.find(x => { return x.code === node.b_code && x.name === node.name && x.unit === node.unit });
  154. if (!db) return;
  155. node.unit_price = db.unit_price;
  156. }
  157. node.deal_tp = this.ctx.helper.mul(node.deal_qty, node.unit_price, this.ctx.tender.info.decimal.tp);
  158. node.sgfh_tp = this.ctx.helper.mul(node.sgfh_qty, node.unit_price, this.ctx.tender.info.decimal.tp);
  159. node.sjcl_tp = this.ctx.helper.mul(node.sjcl_qty, node.unit_price, this.ctx.tender.info.decimal.tp);
  160. node.qtcl_tp = this.ctx.helper.mul(node.qtcl_qty, node.unit_price, this.ctx.tender.info.decimal.tp);
  161. node.total_price = this.ctx.helper.mul(node.quantity, node.unit_price, this.ctx.tender.info.decimal.tp);
  162. }
  163. }
  164. calculateAll(dealBills) {
  165. this.recursiveCalculate(dealBills, this.parent);
  166. }
  167. }
  168. class loadLedgerGclTree extends loadGclBaseTree {
  169. gather(source, parent) {
  170. const node = this.addNode(source, parent);
  171. node.deal_qty = this.ctx.helper.add(node.deal_qty, source.deal_qty);
  172. node.sgfh_qty = this.ctx.helper.add(node.sgfh_qty, source.sgfh_qty);
  173. node.qtcl_qty = this.ctx.helper.add(node.qtcl_qty, source.qtcl_qty);
  174. node.sjcl_qty = this.ctx.helper.add(node.sjcl_qty, source.sjcl_qty);
  175. node.quantity = this.ctx.helper.add(node.quantity, source.quantity);
  176. return node;
  177. }
  178. getUpdateData() {
  179. const update = [];
  180. if (this.items.length > 0) update.push({id: this.parent.id, ledger_id: this.parent.ledger_id, is_leaf: 0});
  181. const create = [];
  182. for (const i of this.items) {
  183. create.push({
  184. id: i.id, tender_id: i.tender_id, ledger_id: i.ledger_id, ledger_pid: i.ledger_pid,
  185. level: i.level, order: i.order, full_path: i.full_path, is_leaf: !i.children || i.children.length === 0,
  186. b_code: i.b_code, name: i.name, unit: i.unit, unit_price: i.unit_price || 0,
  187. deal_qty: i.deal_qty, deal_tp: i.deal_tp || 0,
  188. sgfh_qty: i.sgfh_qty, sjcl_qty: i.sjcl_qty, qtcl_qty: i.qtcl_qty, quantity: i.quantity,
  189. sgfh_tp: i.sgfh_tp || 0, sjcl_tp: i.sjcl_tp || 0, qtcl_tp: i.qtcl_tp || 0, total_price: i.total_price || 0,
  190. });
  191. }
  192. return {update, create};
  193. }
  194. }
  195. class updateReviseGclTree extends loadGclBaseTree {
  196. constructor (ctx, setting) {
  197. super(ctx, setting);
  198. this.errors = [];
  199. }
  200. loadBase(datas, pos) {
  201. datas.sort((x, y) => { return x.level === y.level ? x.order - y.order : x.level - y.level; });
  202. const Index = {};
  203. for (const d of datas) {
  204. const parent = this.parent.ledger_id === d.ledger_pid ? this.parent : Index[d.ledger_pid];
  205. if (!parent) continue;
  206. if (!parent.children) parent.children = [];
  207. const relaPos = pos.filter(x => {return x.lid === d.id});
  208. const baseNode = {
  209. id: d.id,
  210. ledger_id: d.ledger_id,
  211. ledger_pid: d.ledger_pid,
  212. level: d.level,
  213. is_leaf: d.is_leaf,
  214. full_path: d.full_path,
  215. b_code: d.b_code,
  216. name: d.name,
  217. unit: d.unit,
  218. unit_price: d.unit_price,
  219. org_deal_qty: d.deal_qty || 0,
  220. org_sgfh_qty: d.sgfh_qty || 0,
  221. org_sjcl_qty: d.sjcl_qty || 0,
  222. org_qtcl_qty: d.qtcl_qty || 0,
  223. org_qty: d.quantity || 0,
  224. org_order: d.order,
  225. sgfh_qty: 0,
  226. sjcl_qty: 0,
  227. qtcl_qty: 0,
  228. quantity: 0,
  229. hasPos: relaPos.length > 0,
  230. };
  231. parent.children.push(baseNode);
  232. Index[baseNode.ledger_id] = baseNode;
  233. this.baseNodes.push(baseNode);
  234. }
  235. }
  236. gather(source, parent) {
  237. const node = this.addNode(source, parent);
  238. node.deal_qty = this.ctx.helper.add(node.deal_qty, source.deal_qty);
  239. node.sgfh_qty = this.ctx.helper.add(node.sgfh_qty, source.sgfh_qty);
  240. node.qtcl_qty = this.ctx.helper.add(node.qtcl_qty, source.qtcl_qty);
  241. node.sjcl_qty = this.ctx.helper.add(node.sjcl_qty, source.sjcl_qty);
  242. node.quantity = this.ctx.helper.add(node.quantity, source.quantity);
  243. return node;
  244. }
  245. getUpdateData() {
  246. const result = {update: [], errors: [], create: []};
  247. if (this.baseNodes.length === 0) {
  248. if (this.items.length > 0) result.update.push({id: this.parent.id, ledger_id: this.parent.ledger_id, is_leaf: 0});
  249. } else {
  250. for (const bn of this.baseNodes) {
  251. if (bn.children && bn.children.length > 0) continue;
  252. if (bn.deal_qty < bn.org_deal_qty || bn.sjcl_qty < bn.org_sjcl_qty || bn.qtcl_qty < bn.org_qtcl_qty || bn.sgfh_qty < bn.org_sgfh_qty) {
  253. result.errors.push({
  254. ledger_id: bn.ledger_id,
  255. b_code: bn.b_code, name: bn.name, unit: bn.unit,
  256. deal_qty: bn.deal_qty, sgfh_qty: bn.sgfh_qty, sjcl_qty: bn.sjcl_qty, qtcl_qty: bn.qtcl_qty, qty: bn.quantity, type: 'less',
  257. });
  258. if (bn.order !== bn.org_order) {
  259. result.update.push({
  260. id: bn.id, ledger_id: bn.ledger_id, order: bn.order,
  261. });
  262. }
  263. } else if (bn.sjcl_qty !== bn.org_sjcl_qty || bn.qtcl_qty !== bn.org_qtcl_qty || bn.sgfh_qty !== bn.org_sgfh_qty) {
  264. result.update.push({
  265. id: bn.id, ledger_id: bn.ledger_id, unit_price: bn.unit_price || 0, order: bn.order,
  266. deal_qty: bn.deal_qty, deal_tp: bn.deal_tp || 0,
  267. sgfh_qty: bn.sgfh_qty, sjcl_qty: bn.sjcl_qty, qtcl_qty: bn.qtcl_qty, quantity: bn.quantity,
  268. sgfh_tp: bn.sgfh_tp || 0, sjcl_tp: bn.sjcl_tp || 0, qtcl_tp: bn.qtcl_tp || 0, total_price: bn.total_price || 0,
  269. });
  270. } else if (bn.order != bn.org_order) {
  271. result.update.push({
  272. id: bn.id, ledger_id: bn.ledger_id, order: bn.order,
  273. });
  274. }
  275. }
  276. }
  277. for (const i of this.items) {
  278. result.create.push({
  279. id: i.id, tender_id: i.tender_id, ledger_id: i.ledger_id, ledger_pid: i.ledger_pid,
  280. level: i.level, order: i.order, full_path: i.full_path, is_leaf: !i.children || i.children.length === 0,
  281. b_code: i.b_code, name: i.name, unit: i.unit, unit_price: i.unit_price || 0,
  282. deal_qty: i.deal_qty, deal_tp: i.deal_tp || 0,
  283. sgfh_qty: i.sgfh_qty, sjcl_qty: i.sjcl_qty, qtcl_qty: i.qtcl_qty, quantity: i.quantity,
  284. sgfh_tp: i.sgfh_tp || 0, sjcl_tp: i.sjcl_tp || 0, qtcl_tp: i.qtcl_tp || 0, total_price: i.total_price || 0,
  285. })
  286. }
  287. return result;
  288. }
  289. }
  290. class gatherStageGclTree extends loadGclBaseTree {
  291. loadBase(datas, pos) {
  292. datas.sort((x, y) => { return x.level === y.level ? x.order - y.order : x.level - y.level; });
  293. const Index = {};
  294. for (const d of datas) {
  295. const parent = this.parent.ledger_id === d.ledger_pid ? this.parent : Index[d.ledger_pid];
  296. if (!parent) continue;
  297. if (!parent.children) parent.children = [];
  298. const relaPos = pos.filter(x => {return x.lid === d.id});
  299. const baseNode = {
  300. id: d.id,
  301. ledger_id: d.ledger_id,
  302. ledger_pid: d.ledger_pid,
  303. level: d.level,
  304. is_leaf: d.is_leaf,
  305. full_path: d.full_path,
  306. b_code: d.b_code,
  307. name: d.name,
  308. unit: d.unit,
  309. unit_price: d.unit_price,
  310. org_contract_qty: d.contract_qty || 0,
  311. org_contract_tp: d.contract_tp || 0,
  312. org_order: d.order,
  313. contract_qty: 0,
  314. contract_tp: 0,
  315. is_tp: d.is_tp,
  316. hasPos: relaPos.length > 0,
  317. };
  318. parent.children.push(baseNode);
  319. Index[baseNode.ledger_id] = baseNode;
  320. this.baseNodes.push(baseNode);
  321. }
  322. }
  323. _gatherChange(node, source) {
  324. if (!source.change_detail || source.change_detail.length === 0) return;
  325. if (!node.change_detail) node.change_detail = [];
  326. for (const cd of source.change_detail) {
  327. if (!cd.qty) continue;
  328. let ncd = node.change_detail.find(x => { return x.cid === cd.cid; });
  329. if (!ncd) {
  330. ncd = { cid: cd.cid, c_code: cd.c_code };
  331. node.change_detail.push(ncd);
  332. }
  333. ncd.qty = this.ctx.helper.add(ncd.qty, cd.qty);
  334. }
  335. }
  336. gather(source, parent) {
  337. parent = parent ? parent : this.parent;
  338. const checkFun = function (node, source) {
  339. return (source.is_tp && node.is_tp) || (!source.is_tp && !node.is_tp);
  340. };
  341. const node = this.ignoreParent ? this.addNodeWithoutParent(source, checkFun) : this.addNode(source, parent, checkFun);
  342. if (node.is_tp) {
  343. node.contract_tp = this.ctx.helper.add(node.contract_tp, source.contract_tp);
  344. } else {
  345. node.contract_qty = this.ctx.helper.add(node.contract_qty, source.contract_qty);
  346. node.contract_tp = this.ctx.helper.mul(node.unit_price, node.contract_qty, this.ctx.tender.info.decimal.tp);
  347. }
  348. this._gatherChange(node, source);
  349. return node;
  350. }
  351. getUpdateData() {
  352. const result = {update: [], errors: []};
  353. for (const bn of this.baseNodes) {
  354. if (bn.contract_qty !== bn.org_contract_qty || bn.contract_tp !== bn.org_contract_tp) {
  355. result.update.push({lid: bn.id, contract_qty: bn.contract_qty, contract_tp: bn.contract_tp });
  356. }
  357. if (bn.change_detail && bn.change_detail.length > 0) {
  358. for (const cd of bn.change_detail) {
  359. result.errors.push({
  360. ledger_id: bn.ledger_id,
  361. b_code: bn.b_code, name: bn.name, unit: bn.unit,
  362. c_code: cd.c_code, qty: cd.qty, type: 'qc',
  363. });
  364. }
  365. }
  366. }
  367. for (const i of this.items) {
  368. result.errors.push({ b_code: i.b_code, name: i.name, unit: i.unit, qty: i.contract_qty, type: 'miss' });
  369. if (i.change_detail && i.change_detail.length > 0) {
  370. for (const cd of i.change_detail) {
  371. result.errors.push({
  372. b_code: i.b_code, name: i.name, unit: i.unit,
  373. c_code: cd.c_code, qty: cd.qty, type: 'miss-qc',
  374. });
  375. }
  376. }
  377. }
  378. return result;
  379. }
  380. }
  381. class sumLoad {
  382. constructor (ctx) {
  383. this.ctx = ctx;
  384. }
  385. recusiveLoadGatherGcl(node, parent, ignoreParent = false) {
  386. const isLeaf = !node.children || node.children.length === 0;
  387. const cur = (!ignoreParent || isLeaf) && node.b_code ? this.loadTree.gather(node, parent) : parent;
  388. if (isLeaf) return;
  389. for (const child of node.children) {
  390. this.recusiveLoadGatherGcl(child, cur, ignoreParent);
  391. }
  392. }
  393. async loadGatherGcl(select, maxId, tenders, defaultData) {
  394. this.loadTree = new loadLedgerGclTree(this.ctx, {
  395. parent: select, maxId, type: 'ledger', defaultData,
  396. });
  397. for (const tender of tenders) {
  398. const billsData = await this.ctx.service.ledger.getData(tender.tid);
  399. const billsTree = new Ledger.billsTree(this.ctx, {
  400. id: 'ledger_id',
  401. pid: 'ledger_pid',
  402. order: 'order',
  403. level: 'level',
  404. rootId: -1,
  405. keys: ['id', 'tender_id', 'ledger_id'],
  406. stageId: 'id',
  407. });
  408. billsTree.loadDatas(billsData);
  409. for (const top of billsTree.children) {
  410. if ([1].indexOf(top.node_type) < 0) continue;
  411. this.recusiveLoadGatherGcl(top, null);
  412. }
  413. }
  414. this.loadTree.resortByCode();
  415. const dealBills = await this.ctx.service.dealBills.getAllDataByCondition({ where: { tender_id: this.ctx.tender.id } });
  416. this.loadTree.calculateAll(dealBills);
  417. return this.loadTree;
  418. }
  419. async updateGatherGcl(select, maxId, tenders, defaultData) {
  420. this.loadTree = new updateReviseGclTree(this.ctx, {
  421. parent: select, maxId, type: 'ledger', defaultData,
  422. });
  423. const posterity = await this.ctx.service.reviseBills.getPosterityByParentId(this.ctx.tender.id, select.ledger_id);
  424. const pos = await this.ctx.service.revisePos.getData(this.ctx.tender.id);
  425. this.loadTree.loadBase(posterity, pos);
  426. for (const tender of tenders) {
  427. const billsData = await this.ctx.service.ledger.getData(tender.tid);
  428. const billsTree = new Ledger.billsTree(this.ctx, {
  429. id: 'ledger_id',
  430. pid: 'ledger_pid',
  431. order: 'order',
  432. level: 'level',
  433. rootId: -1,
  434. keys: ['id', 'tender_id', 'ledger_id'],
  435. stageId: 'id',
  436. });
  437. billsTree.loadDatas(billsData);
  438. for (const top of billsTree.children) {
  439. if ([1].indexOf(top.node_type) < 0) continue;
  440. this.recusiveLoadGatherGcl(top, null);
  441. }
  442. }
  443. this.loadTree.resortByCode();
  444. const dealBills = await this.ctx.service.dealBills.getAllDataByCondition({ where: { tender_id: this.ctx.tender.id } });
  445. this.loadTree.calculateAll(dealBills);
  446. return this.loadTree;
  447. }
  448. _loadCurStageAndChange(billsData, curStageBills, curStageChange) {
  449. const billsIndex = {};
  450. for (const b of billsData) {
  451. billsIndex[b.id] = b;
  452. }
  453. for (const csb of curStageBills) {
  454. const b = billsIndex[csb.lid];
  455. if (!b) continue;
  456. b.contract_qty = csb.contract_qty;
  457. b.contract_tp = csb.contract_tp;
  458. }
  459. for (const csc of curStageChange) {
  460. if (!csc.qty) continue;
  461. const b = billsIndex[csc.lid];
  462. if (!b) continue;
  463. if (!b.change_detail) b.change_detail = [];
  464. let c = b.change_detail.find(x => { return x.cid === csc.cid });
  465. if (!c) {
  466. c = { cid: csc.cid };
  467. b.change_detail.push(c);
  468. }
  469. c.qty = this.ctx.helper.add(c.qty, csc.qty);
  470. }
  471. }
  472. async stageGatherGcl(select, maxId, tenders, defaultData) {
  473. const ignoreParent = this.ctx.tender.info.fun_rela.sum_load.ignoreParent;
  474. this.loadTree = new gatherStageGclTree(this.ctx, {
  475. parent: select, maxId, type: 'ledger', defaultData, ignoreParent,
  476. });
  477. const posterity = await this.ctx.service.ledger.getPosterityByParentId(this.ctx.tender.id, select.ledger_id);
  478. const pos = await this.ctx.service.revisePos.getData(this.ctx.tender.id);
  479. this.loadTree.loadBase(posterity, pos);
  480. for (const tender of tenders) {
  481. if (!tender.stage) continue;
  482. const billsData = await this.ctx.service.ledger.getData(tender.tid);
  483. const stage = await this.ctx.service.stage.getDataByCondition({tid: tender.tid, order: tender.stage});
  484. if (!stage) throw '选择的期不存在';
  485. const curStageData = await this.ctx.service.stageBills.getLastestStageData2(tender.tid, stage.id);
  486. const curStageChange = await this.ctx.service.stageChangeFinal.getSumLoadFinalData(stage.id);
  487. this._loadCurStageAndChange(billsData, curStageData, curStageChange);
  488. const billsTree = new Ledger.billsTree(this.ctx, {
  489. id: 'ledger_id',
  490. pid: 'ledger_pid',
  491. order: 'order',
  492. level: 'level',
  493. rootId: -1,
  494. keys: ['id', 'tender_id', 'ledger_id'],
  495. stageId: 'id',
  496. });
  497. billsTree.loadDatas(billsData);
  498. for (const top of billsTree.children) {
  499. if ([1].indexOf(top.node_type) < 0) continue;
  500. this.recusiveLoadGatherGcl(top, null, ignoreParent);
  501. }
  502. }
  503. return this.loadTree;
  504. }
  505. }
  506. module.exports = sumLoad;