Commit 22333022 by 王昆

dd

parent b4867666
......@@ -379,6 +379,22 @@ class OrderCtl extends CtlBase {
}
}
/**
* 获取账簿用户信息
* @param {*} pobj
* @param {*} pobj2
* @param {*} req
* @id
*/
async getCustomerById(pobj, pobj2, req){
if(!pobj.id){
return system.getResult(null,`参数错误 ID 不能为空`);
}
let res = await this.orderSve.getCustomerById(pobj.invoice_id);
return res;
}
}
......
......@@ -185,7 +185,7 @@ class InvoiceService extends ServiceBase {
let url = settings.ntapi().uploadDetail;
let res = await this.callApi(url, _params, "提交发票");
console.log(res);
if(!res || !res.data) {
if(!res || res.code!='000000') {
return system.getResult(null, "提交发票失败");
}
//更新发票建账
......
......@@ -251,5 +251,25 @@ class OrderService extends ServiceBase {
return system.getResult(null,`系统错误 错误信息 ${error}`);
}
}
/**
* 获取用户账簿信息
* @param {*} params
* id 个体工商户ID
*/
async getCustomerById(params){
try {
let businessmen = await this.callms("order", "queryObusinessmen", {id:params.id});
if(!businessmen || !businessmen.data){
return system.getResult(null,`个体工商户不存在`);
}
let url = settings.ntapi().getCustomerById;
let res = await this.callApi(url, {id:businessmen.customer_id}, "获取用户账簿信息");
return res;
} catch (error) {
console.log(error);
return system.getResult(null,`系统错误`);
}
}
}
module.exports = OrderService;
\ No newline at end of file
......@@ -109,6 +109,8 @@ var settings = {
getCustomerById: domain + "/nga-api/getCustomerById",
// 上传发票
uploadDetail: domain + "/nga-api/uploadDetail",
//获取用户账簿
getCustomerById:domain+"/nga-api/getCustomerById"
}
},
redis: function () {
......
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