Commit 1f81197a by 王昆

dd

parent 8b3cf5fa
......@@ -177,6 +177,24 @@ class InvoiceCtl extends CtlBase {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
/**
* 发票账单列表
* @param {*} params
* @param {*} pobj2
* @param {*} req
*/
async invoiceOrder(params, pobj2, req){
if(!params.id){
return system.getResult(null,`发票ID 不能为空`);
}
try {
return await this.invoiceSve.invoiceOrder(params);
} catch (error) {
console.log(error);
return system.getResult(null,`系统错误`);
}
}
}
module.exports = InvoiceCtl;
......@@ -4,9 +4,10 @@ const settings = require("../../../../config/settings")
class InvoiceService extends ServiceBase {
constructor() {
super();
this.tradeSve = system.getObject("service.trade.tradeSve");
}
async merchantinvoicePage(params){
async merchantinvoicePage(params) {
var rs = await this.callms("invoice", "merchantinvoicePage", params);
if (rs && rs.data && rs.data.rows) {
this.transOrderField(rs.data.rows);
......@@ -14,7 +15,7 @@ class InvoiceService extends ServiceBase {
return rs;
}
async merchantinvoiceapplyPage(params){
async merchantinvoiceapplyPage(params) {
var rs = await this.callms("invoice", "merchantinvoiceapplyPage", params);
if (rs && rs.data && rs.data.rows) {
this.transOrderField(rs.data.rows);
......@@ -22,7 +23,7 @@ class InvoiceService extends ServiceBase {
return rs;
}
async applySave(params){
async applySave(params) {
var rs = await this.callms("invoice", "invoiceapplySave", params);
return rs;
}
......@@ -37,5 +38,38 @@ class InvoiceService extends ServiceBase {
}
}
/**
* 发票详情
* @param {*} params
*/
async invoiceOrder(params) {
try {
let saasInvoiceApply = await this.callms("invoice", "saasInvoiceInfo", params);
if (saasInvoiceApply.status != 0 || !saasInvoiceApply.data) {
return system.getResult(null, `系统错误`);
}
saasInvoiceApply = saasInvoiceApply.data;
let tradOrder = [];
if (saasInvoiceApply.fee_type == "00") { //个体户注册订单
tradOrder = [];
} else { //查询流水
let tradOrderRes = await this.tradeSve.invoiceTrade({
id: saasInvoiceApply.id,
order_type: saasInvoiceApply.fee_type
});
if (tradOrderRes.status == 0) {
tradOrder = tradOrderRes.data;
}
}
saasInvoiceApply.tradOrder = tradOrder;
return system.getResult(saasInvoiceApply);
} catch (error) {
console.log(error);
return system.getResult(null, `系统错误`);
}
}
}
module.exports = InvoiceService;
module.exports = InvoiceService;
\ No newline at end of file
......@@ -295,6 +295,10 @@ class TradeService extends ServiceBase {
row.service_rate = system.f2y(row.service_rate);
}
}
async invoiceTrade(params) {
let rs = await this.callms("trade", "invoiceTrade", params) || {};
return rs;
}
}
module.exports = TradeService;
\ No newline at end of file
......@@ -184,7 +184,7 @@ class System {
order: dev + ":3103" + path,
// 发票服务
invoice: local + ":3105" + path,
invoice: dev + ":3105" + path,
// 用户服务
uc: dev + ":3106" + path,
......
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