Commit c7604fb6 by 王昆

gsb

parent ed2b4c56
...@@ -60,7 +60,8 @@ class APIBase extends DocBase { ...@@ -60,7 +60,8 @@ class APIBase extends DocBase {
var fullname = gname + "." + methodname; var fullname = gname + "." + methodname;
var lst = [ var lst = [
"test.testApi", "test.testApi",
"test.testOrder" "test.testOrder",
"test.testInvoice",
]; ];
var x = lst.indexOf(fullname); var x = lst.indexOf(fullname);
return x >= 0; return x >= 0;
......
...@@ -5,6 +5,8 @@ class TestAPI extends APIBase { ...@@ -5,6 +5,8 @@ class TestAPI extends APIBase {
super(); super();
this.orderSve = system.getObject("service.order.orderSve"); this.orderSve = system.getObject("service.order.orderSve");
this.platformUtils = system.getObject("util.businessManager.opPlatformUtils"); this.platformUtils = system.getObject("util.businessManager.opPlatformUtils");
this.restClient = system.getObject("util.restClient");
} }
async test(pobj, query, req) { async test(pobj, query, req) {
// var tmp = await this.orderSve.createLicense(pobj.action_body); // var tmp = await this.orderSve.createLicense(pobj.action_body);
...@@ -33,6 +35,22 @@ class TestAPI extends APIBase { ...@@ -33,6 +35,22 @@ class TestAPI extends APIBase {
return "success"; 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() { exam() {
return ""; return "";
} }
......
...@@ -104,6 +104,45 @@ class InvoiceService extends ServiceBase { ...@@ -104,6 +104,45 @@ class InvoiceService extends ServiceBase {
"dstatus": "1060", "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) { async apiCalcInvoice(pobj) {
...@@ -547,13 +586,37 @@ class InvoiceService extends ServiceBase { ...@@ -547,13 +586,37 @@ class InvoiceService extends ServiceBase {
} }
var rs = await this.callms("invoice", "platformAssignment", pobj); var rs = await this.callms("invoice", "platformAssignment", pobj);
if (rs.status == 0) { if (rs.status == 0) {
this.pushDeliver(pobj); // this.pushDeliver(pobj);
console.log(pobj);
this.sendInvoiceToDz(pobj);
return rs; return rs;
} else { } else {
return system.getResult(null, rs.msg); 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 * @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