Commit c7604fb6 by 王昆

gsb

parent ed2b4c56
......@@ -60,7 +60,8 @@ class APIBase extends DocBase {
var fullname = gname + "." + methodname;
var lst = [
"test.testApi",
"test.testOrder"
"test.testOrder",
"test.testInvoice",
];
var x = lst.indexOf(fullname);
return x >= 0;
......
......@@ -5,6 +5,8 @@ class TestAPI extends APIBase {
super();
this.orderSve = system.getObject("service.order.orderSve");
this.platformUtils = system.getObject("util.businessManager.opPlatformUtils");
this.restClient = system.getObject("util.restClient");
}
async test(pobj, query, req) {
// var tmp = await this.orderSve.createLicense(pobj.action_body);
......@@ -33,6 +35,22 @@ class TestAPI extends APIBase {
return "success";
}
async testInvoice() {
let params = {
uploadPeriod: "201910",
companyId: "102",
customerId: "498757",
userId: 43,
file: [
"https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_37001579517783654202020185623654wzr.jpg",
]
};
let apiurl = "https://nga-api.gongsibao.com/nga-sass//billInfo/uploadFileForAliyun";
console.log(apiurl, params);
let rs = await this.restClient.execPost(params, apiurl);
console.log(rs);
}
exam() {
return "";
}
......
......@@ -104,6 +104,45 @@ class InvoiceService extends ServiceBase {
"dstatus": "1060",
}
};
this.invoiceConfig = {
498757: {
uploadPeriod: "201910",
companyId: "102",
customerId: "498757",
userId: 43,
},
498758: {
uploadPeriod: "201910",
companyId: "102",
customerId: "498758",
userId: 43,
},
498759: {
uploadPeriod: "201910",
companyId: "102",
customerId: "498759",
userId: 43,
},
498760: {
uploadPeriod: "201910",
companyId: "102",
customerId: "498760",
userId: 43,
},
498765: {
uploadPeriod: "201910",
companyId: "102",
customerId: "498765",
userId: 43,
},
498763: {
uploadPeriod: "201910",
companyId: "102",
customerId: "498763",
userId: 43,
},
}
}
async apiCalcInvoice(pobj) {
......@@ -547,13 +586,37 @@ class InvoiceService extends ServiceBase {
}
var rs = await this.callms("invoice", "platformAssignment", pobj);
if (rs.status == 0) {
this.pushDeliver(pobj);
// this.pushDeliver(pobj);
console.log(pobj);
this.sendInvoiceToDz(pobj);
return rs;
} else {
return system.getResult(null, rs.msg);
}
}
async sendInvoiceToDz(obj) {
console.log(obj, "1111111111111111111111111111111111111111obj");
// 查发票
let invoiceApply = await this.callms("invoice", "queryInvoice", {
id: obj.id
});
console.log(invoiceApply, "00000000000000000000000000000000000000000000000000000000000");
let params = this.invoiceConfig[invoiceApply.merchantId];
let invoice = invoiceApply.data.invoice || {};
params.file = [
invoice.invoiceImg,
]
let apiurl = "https://nga-api.gongsibao.com/nga-sass//billInfo/uploadFileForAliyun";
console.log(apiurl, params);
let rs = await this.restClient.execPost(params, apiurl);
console.log(rs, "11111111111111111111111111111111111111111111111");
return rs;
}
/**
* 交付商审批
* @param {*} pobj
......
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