浏览代码

变更令指标

TonyKang 5 年之前
父节点
当前提交
74e702ba4c
共有 2 个文件被更改,包括 25 次插入0 次删除
  1. 8 0
      app/controller/report_controller.js
  2. 17 0
      app/service/change_audit_list.js

+ 8 - 0
app/controller/report_controller.js

@@ -359,6 +359,14 @@ async function getReportData(ctx, params, filters) {
                     runnableRst.push(ctx.service.reportMemory.getMonthProgress(params.tender_id));
                     runnableKey.push('mem_month_progress');
                     break;
+                case 'change':
+                    runnableRst.push(ctx.service.change.getListByStatus(params.tender_id, 3)); // 获取所有审核通过的变更主信息
+                    runnableKey.push('change');
+                    break;
+                case 'change_audit_list':
+                    runnableRst.push(ctx.service.changeAuditList.getChangeAuditBills(params.tender_id)); // 获取所有审核通过的变更清单
+                    runnableKey.push('change_audit_list');
+                    break;
                 default:
                     break;
             }

+ 17 - 0
app/service/change_audit_list.js

@@ -36,6 +36,23 @@ module.exports = app => {
             }
             return result;
         }
+
+        /**
+         * 报表用
+         * Tony Kang
+         * @param {tid} tid - 标段id
+         * @return {void}
+         */
+        async getChangeAuditBills(tid) {
+            const sql = 'SELECT cb.*' +
+                '  FROM ' + this.tableName + ' cb' +
+                '  LEFT JOIN ' + this.ctx.service.change.tableName + ' c ON cb.cid = c.cid' +
+                '  WHERE c.tid = ? and c.status = 3' +
+                '  ORDER BY cb.cid, cb.code';
+            const param = [tid];
+            const result = await this.db.query(sql, param);
+            return result;
+        }
     }
 
     return ChangeAuditList;