Commit 806f79e4 by 王昆

gsb

parent 6270133b
...@@ -102,7 +102,10 @@ class ActionAPI extends APIBase { ...@@ -102,7 +102,10 @@ class ActionAPI extends APIBase {
case "signNames": case "signNames":
opResult = await this.obusinessmenSve.signNames(action_body); opResult = await this.obusinessmenSve.signNames(action_body);
break; break;
case "businessmenMapByCreditCodes":
opResult = await this.obusinessmenSve.mapByCreditCodes(action_body);
break;
// 统计数据(平台) // 统计数据(平台)
case "statTransData": //数据简报 (本月交易数据) case "statTransData": //数据简报 (本月交易数据)
opResult = await this.oorderSve.statTransData(action_body); opResult = await this.oorderSve.statTransData(action_body);
......
...@@ -79,6 +79,28 @@ class ObusinessmenDao extends Dao { ...@@ -79,6 +79,28 @@ class ObusinessmenDao extends Dao {
} }
} }
} }
async mapByCreditCodes(creditCodes, attrs) {
let result = {};
if (!creditCodes || creditCodes.length == 0) {
return result;
}
var sql = [];
sql.push("SELECT");
sql.push(attrs || "*");
sql.push("FROM");
sql.push(this.model.tableName);
sql.push("WHERE credit_code IN (:creditCodes)");
let list = await this.customQuery(sql.join(" "), {creditCodes: creditCodes}) || [];
if (list.length == 0) {
return result;
}
for (var item of list) {
result[item.credit_code] = item;
}
return result;
}
} }
module.exports = ObusinessmenDao; module.exports = ObusinessmenDao;
\ No newline at end of file
...@@ -348,6 +348,10 @@ class ObusinessmenService extends ServiceBase { ...@@ -348,6 +348,10 @@ class ObusinessmenService extends ServiceBase {
} }
} }
async mapByCreditCodes(params) {
return this.dao.mapByCreditCodes(params.creditCodes, params.attrs) || {};
}
} }
module.exports = ObusinessmenService; module.exports = ObusinessmenService;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment