浏览代码

报表预处理,join调整

MaiXinRong 4 年之前
父节点
当前提交
19d2b926ec
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 2 2
      app/lib/rpt_data_analysis.js
  2. 1 1
      app/service/stage_detail.js

+ 2 - 2
app/lib/rpt_data_analysis.js

@@ -627,10 +627,10 @@ const join = {
                 for (const k of options.keyFields) {
                     switch (k.type) {
                         case 'string':
-                            if (x[k.main] !== s[k.sub] && (!_.isNil(x[k.main]) || !_.isNil(s[k.sub]))) return false;
+                            if ((x[k.main] || '') !== (s[k.sub] || '')) return false;
                             break;
                         case 'number':
-                            if (!ctx.helper.checkZero(ctx.helper.sub(x[k.main] - s[k.sub]))) return false;
+                            if (!ctx.helper.checkZero(ctx.helper.sub(x[k.main], s[k.sub]))) return false;
                             break;
                     }
                 }

+ 1 - 1
app/service/stage_detail.js

@@ -129,8 +129,8 @@ module.exports = app => {
             if (data.uuid) {
                 const org = await this.getLastestImStageData(this.ctx.tender.id, this.ctx.stage.id, data.lid, data.uuid);
                 const order = this.ctx.stage.curAuditor ? this.ctx.stage.curAuditor.order : 0;
+                delete org.flow;
                 if (org.times === this.ctx.stage.times && org.order === order) {
-                    delete org.flow;
                     const newData = this._.assign(org, data);
                     await this.db.update(this.tableName, newData);
                     return newData;