Commit 1cc03026 by 孙亚楠

dd

parent 25f7cfce
......@@ -92,5 +92,14 @@ class InvoiceService extends ServiceBase {
let rs = await this.callms("order", "updateItemInvoice", params);
return rs;
}
/**
*
* @param params
* @returns {Promise<void>}
*/
async invoiceBycreditCode(params){
return await this.callms("invoice", "invoiceBycreditCode", params);
}
}
module.exports = InvoiceService;
\ No newline at end of file
......@@ -16,6 +16,8 @@ class MerchantApplet extends AppletBase {
this.merchantId = 1;
this.businessmenSve = system.getObject("service.saas.businessmenSve");
this.tradeSve = system.getObject("service.trade.tradeSve");
this.saasInvoiceSve = system.getObject("service.saas.invoiceSve");
}
async test(o, obj, req) {
......@@ -306,6 +308,40 @@ class MerchantApplet extends AppletBase {
}
}
/**
* 发票管理
* @param pobj1
* @param pobj2
* @param req
* @returns {Promise<void>}
*/
async invoiceBycreditCode(pobj1, pobj2, req){
let loginUser = await this.getLoginUser(pobj2.merchant_id, pobj2.openid);
pobj2.merchant_app_user_id = loginUser.id;
pobj2.attrs=["credit_code"];
if(!pobj2.merchant_app_user_id){
return system.getResult(null, `登录失效,请重新登录`);
}
try{
let creditCodeArray =await this.businessmenSve.assorderBusinessmenInfo(pobj2);
if(creditCodeArray.status != 0){
return creditCodeArray;
}
let creditCodes = [];
for (let val of creditCodeArray.data) {
creditCodes.push(val.credit_code);
}
if(!creditCodes || creditCodes.length ==0){
return sys.getResult([]);
}
pobj2.credit_code_array = creditCodes;
return await this.saasInvoiceSve.invoiceBycreditCode(pobj2);
}catch (e) {
console.log(e);
return system.getResult(null,`系统错误`);
}
}
}
module.exports = MerchantApplet;
\ No newline at end of file
......@@ -5,6 +5,7 @@
1. [订单详情](#orderInfo)
1. [个体户管理/个体户详情](#saasorderbusinessmenPage)
1. [转账交易](#saasTradeBusinessmenPage)
1. [发票管理](#invoiceBycreditCode)
## **<a name="idNoValid"> 身份证校验</a>**
[返回到目录](#menu)
##### URL
......@@ -365,6 +366,86 @@
```
## **<a name="invoiceBycreditCode"> 发票管理</a>**
[返回到目录](#menu)
##### URL
[/applet/merchantApplet/saasTradeBusinessmenPage]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
``` javascript
{
"merchant_id":"11249768207001229",
"openid":"od1Y85NtLgV1tFdKsPUXV8LhMMzI",
"status":"1060"
}
```
#### 返回结果
```javascript
{
"status": 0,
"msg": "操作成功",
"data": [
{
"from_name": "孙亚楠首饰店",
"to_name": "大森森金融有限公司",
"to_credit_code": "DSSJRC123123",
"to_addr": "狗熊岭",
"to_mobile": "18833836392",
"to_bank": "工商银行",
"to_account": "DSSJR",
"invoice_time": "2020-05-10 08:00:00",
"invoice_img": "https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_wxapplet_1588990656115.jpg",
"invoice_amount": 1,
"created_at": "2020-05-09 10:03:21",
"status": "1060",
"status_name": "已完成"
},
{
"from_name": "孙亚楠首饰店",
"to_name": "大森森金融有限公司",
"to_credit_code": "DSSJRC123123",
"to_addr": "狗熊岭",
"to_mobile": "18833836392",
"to_bank": "工商银行",
"to_account": "DSSJR",
"invoice_time": "2020-05-09 08:00:00",
"invoice_img": "https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_wxapplet_1589008890884.jpg",
"invoice_amount": 1,
"created_at": "2020-05-09 14:58:48",
"status": "1060",
"status_name": "已完成"
},
{
"from_name": "孙亚楠首饰店",
"to_name": "大森森金融有限公司",
"to_credit_code": "DSSJRC123123",
"to_addr": "狗熊岭",
"to_mobile": "18833836392",
"to_bank": "工商银行",
"to_account": "DSSJR123",
"invoice_time": "2020-05-08 08:00:00",
"invoice_img": "https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_wxapplet_1588927248512.jpg",
"invoice_amount": 1,
"created_at": "2020-05-08 14:34:15",
"status": "1060",
"status_name": "已完成"
}
],
"bizmsg": "empty",
"requestid": "ee8443a2a2c74d88a68275b51c35eec7"
}
```
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