|
@@ -34,8 +34,15 @@ module.exports = app => {
|
|
|
* @private
|
|
|
*/
|
|
|
async _calculateNodeIndex(transaction, condition, globalParams, newParam, gRelaParam) {
|
|
|
+ // let time1 = new Date();
|
|
|
const nodeParams = await this.ctx.service.tenderParam.getAllDataByCondition({where: condition});
|
|
|
+ // await this.ctx.service.log.addLog('node' + this.serialNo + ':select tenderParam', new Date() - time1);
|
|
|
+ //
|
|
|
+ // time1 = new Date();
|
|
|
const nodeIndexes = await this.ctx.service.tenderIndex.getAllDataByCondition({where: condition});
|
|
|
+ // await this.ctx.service.log.addLog('node' + this.serialNo + ':select tenderIndex', new Date() - time1);
|
|
|
+ //
|
|
|
+ // time1 = new Date();
|
|
|
let relaParam;
|
|
|
if (newParam) {
|
|
|
for (const np of nodeParams) {
|
|
@@ -56,6 +63,7 @@ module.exports = app => {
|
|
|
value: u.value,
|
|
|
});
|
|
|
}
|
|
|
+ // await this.ctx.service.log.addLog('node' + this.serialNo + ':update tenderIndex', new Date() - time1);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -83,7 +91,12 @@ module.exports = app => {
|
|
|
const nodes = await this.ctx.service.tenderNode.getAllDataByCondition({where: condition});
|
|
|
const indexes = await this.ctx.service.tenderIndex.getAllDataByCondition({where: condition});
|
|
|
const params = await this.ctx.service.tenderParam.getAllDataByCondition({where: condition});
|
|
|
+
|
|
|
+ // this.serialNo = 1;
|
|
|
for (const node of nodes) {
|
|
|
+ // condition.node_id = node.node_id;
|
|
|
+ // await this._calculateNodeIndex(transaction, condition, globalParams);
|
|
|
+ // this.serialNo += 1;
|
|
|
node.indexes = indexes.filter(function (a) {
|
|
|
return a.node_id === node.node_id;
|
|
|
});
|