Commit a5862c72 by 孙亚楠

dd

parent 38e9db1d
const system = require("../../../system"); const system = require("../../../system");
const ServiceBase = require("../../svems.base") const ServiceBase = require("../../svems.base");
const settings = require("../../../../config/settings") const settings = require("../../../../config/settings");
class InvoiceService extends ServiceBase { class InvoiceService extends ServiceBase {
constructor() { constructor() {
super(); super();
this.userSve = system.getObject("service.uc.userSve");
} }
async processDics(params) { async processDics(params) {
var rs = await this.callms("invoice", "processDics", params); var rs = await this.callms("invoice", "processDics", params);
...@@ -48,9 +50,36 @@ class InvoiceService extends ServiceBase { ...@@ -48,9 +50,36 @@ class InvoiceService extends ServiceBase {
async invoice(params) { async invoice(params) {
var rs = await this.callms("invoice", "invoice", params); var rs = await this.callms("invoice", "invoice", params);
await this.setUcUser([rs.data]);
return rs; return rs;
} }
async setUcUser(rows) {
if (!rows || rows.length == 0) {
return;
}
let ids = [];
for (let row of rows) {
if (row.bd_id) {
ids.push(row.bd_id);
}
if (row.assign_user_id) {
ids.push(row.assign_user_id);
}
}
let userRs = await this.userSve.mapByIds({ ids: ids });
let userMap = userRs.data || {};
for (let row of rows) {
let user = userMap[row.bd_id] || {};
row.bd_name = user.realName || "";
let assignUser = userMap[row.assign_user_id] || {};
row.assign_user_name = assignUser.realName || "";
}
}
} }
module.exports = InvoiceService; module.exports = InvoiceService;
\ 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