Commit a767ed72 by 王昆

gsb

parent 038fcdbc
const system = require("../system");
class Dictionary {
constructor() {
// 交易字典
this.SAAS_INTEVOICE = {
order_type: {"00": "未设置", "10": "平台交易", "20": "商户交易"},
acc_type: {"00": "银行", "01": "支付宝", "02": "微信"},
};
this.SAAS_INVOICE_APPLY = {
trade_status: {"00": "成功", "01": "待处理", "02": "失败"}
}
}
getDict(module, field) {
return (this[(module || "")] || {})[field] || {};
}
// setRowName("ORDER", order, ["order_type", "acc_type", "trade_mode", "trade_status", "check_status"]);
setRowName(module, row, fields, concat) {
if(!module || !row || !fields || fields.length == 0) {
return;
}
concat = concat || "_";
for (let field of fields) {
row[field + concat + "name"] = this.getDict(module, field)[row[field] || ""] || "";
}
}
// setRowsName("ORDER", orders, ["order_type", "acc_type", "trade_mode", "trade_status", "check_status"]);
setRowsName(module, rows, fields, concat) {
if(!module || !rows || !fields || fields.length == 0) {
return;
}
for(let row of rows) {
this.setRowName(module, row, fields, concat)
}
}
}
module.exports = Dictionary;
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