Commit 83008621 by 王昆

gsb

parent 8d939bf6
...@@ -24,12 +24,11 @@ class InvoiceCtl extends CtlBase { ...@@ -24,12 +24,11 @@ class InvoiceCtl extends CtlBase {
return system.getResult(null, `系统错误 错误信息 ${error}`); return system.getResult(null, `系统错误 错误信息 ${error}`);
} }
} }
// 交易信息列表页
// 平台交易列表 async tradePage(params, pobj2, req) {
async platformPage(params, pobj2, req) {
try { try {
params.unInvoice = 1; params.unInvoice = 1;
params.order_type = "10"; params.order_type = params.fee_type;
params.trade_status = "00"; params.trade_status = "00";
this.doTimeCondition(params, ["createBegin", "createEnd"]); this.doTimeCondition(params, ["createBegin", "createEnd"]);
return await this.tradeSve.itemPage(params); return await this.tradeSve.itemPage(params);
...@@ -37,15 +36,17 @@ class InvoiceCtl extends CtlBase { ...@@ -37,15 +36,17 @@ class InvoiceCtl extends CtlBase {
return system.getResult(null, `系统错误 错误信息 ${error}`); return system.getResult(null, `系统错误 错误信息 ${error}`);
} }
} }
// 交易列表
// 商户交易列表 async platformPage(params, pobj2, req) {
async merchantPage(params, pobj2, req) {
try { try {
params.unInvoice = 1; if (["00", "10", "20"].indexOf(params.fee_type) == -1) {
params.order_type = "20"; return system.getResultSuccess({count:0, rows:[], fee_type: params.fee_type});
params.trade_status = "00"; }
this.doTimeCondition(params, ["createBegin", "createEnd"]); if(params.fee_type == "00") {
return await this.tradeSve.itemPage(params); return this.orderPage(params, pobj2, req);
} else {
return this.tradePage(params, pobj2, req);
}
} catch (error) { } catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`); return system.getResult(null, `系统错误 错误信息 ${error}`);
} }
...@@ -61,7 +62,6 @@ class InvoiceCtl extends CtlBase { ...@@ -61,7 +62,6 @@ class InvoiceCtl extends CtlBase {
} }
} }
// 发票申请 // 发票申请
async apply(params, pobj2, req) { async apply(params, pobj2, req) {
try { try {
......
...@@ -14,6 +14,18 @@ class MerchantCtl extends CtlBase { ...@@ -14,6 +14,18 @@ class MerchantCtl extends CtlBase {
} }
} }
// 开票类型字典获取
async feeTypeDic(params, pobj2, req) {
try {
// params.forceUpdate = true;
let feeType = await this.merchantSve.getFeeTypeWithCache(params);
let dic = [{"type": "00", "name": "注册订单付款"}, {"type": feeType, "name": "转账交易付款"}];
return system.getResultSuccess(dic);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async info(params, pobj2, req) { async info(params, pobj2, req) {
try { try {
return await this.merchantSve.info(params); return await this.merchantSve.info(params);
......
...@@ -43,7 +43,9 @@ class UserCtl extends CtlBase { ...@@ -43,7 +43,9 @@ class UserCtl extends CtlBase {
async setLogin(user) { async setLogin(user) {
let loginsid = "saasmcth_" + uuidv4(); let loginsid = "saasmcth_" + uuidv4();
// loginsid = "saasmcth_" + "2cb49932-fa02-44f0-90db-9f06fe02e5c7"; if (settings.env = "dev") {
loginsid = "saasmcth_" + "2cb49932-fa02-44f0-90db-9f06fe02e5c7";
}
await this.redisClient.setWithEx(loginsid, JSON.stringify(user), 60 * 60 * 5); await this.redisClient.setWithEx(loginsid, JSON.stringify(user), 60 * 60 * 5);
return loginsid; return loginsid;
} }
......
...@@ -26,6 +26,7 @@ class MerchantService extends ServiceBase { ...@@ -26,6 +26,7 @@ class MerchantService extends ServiceBase {
if(rs.data && rs.data.sign) { if(rs.data && rs.data.sign) {
this.transSignFields([rs.data.sign]); this.transSignFields([rs.data.sign]);
await this.setChannel([rs.data]); await this.setChannel([rs.data]);
await this.setMain(rs.data.rows);
} }
return rs; return rs;
} }
...@@ -62,7 +63,7 @@ class MerchantService extends ServiceBase { ...@@ -62,7 +63,7 @@ class MerchantService extends ServiceBase {
async getMerchantWithCache(params) { async getMerchantWithCache(params) {
let key = this.INFO_KEY + params.id; let key = this.INFO_KEY + params.id;
let merchant = await this.redisClient.get(key); let merchant = await this.redisClient.get(key);
if(!merchant || params.forceUpdate) { if(!merchant || !merchant.id || params.forceUpdate) {
let info = await this.info(params) || {}; let info = await this.info(params) || {};
merchant = info.data || {}; merchant = info.data || {};
await this.redisClient.setWithEx(key, JSON.stringify(merchant), 60 * 31); await this.redisClient.setWithEx(key, JSON.stringify(merchant), 60 * 31);
...@@ -72,6 +73,12 @@ class MerchantService extends ServiceBase { ...@@ -72,6 +73,12 @@ class MerchantService extends ServiceBase {
return merchant; return merchant;
} }
async getFeeTypeWithCache(params) {
let merchant = await this.getMerchantWithCache({id: params.saas_merchant_id}) || {};
let sign = merchant.sign || {};
return sign.main_id_trade ? "10" : "20";
}
async getSettings(merchant_id) { async getSettings(merchant_id) {
if(!merchant_id) { if(!merchant_id) {
return; return;
......
...@@ -187,7 +187,7 @@ class System { ...@@ -187,7 +187,7 @@ class System {
merchant: dev + ":3101" + path, merchant: dev + ":3101" + path,
// 订单服务 // 订单服务
order: local + ":3103" + path, order: dev + ":3103" + path,
// 发票服务 // 发票服务
invoice: dev + ":3105" + path, invoice: dev + ":3105" + path,
......
<a name="menu">目录</a> <a name="menu">目录</a>
1. [发票申请-功能1-交易列表](#merchantPage) 1. [费用记录类型](#feeTypeDic)
1. [发票申请-功能2-交易列表](#platformPage) 1. [发票申请-功能2-交易&订单列表](#platformPage)
1. [发票申请-功能2](#apply2) 1. [发票申请-功能2](#apply2)
1. [发票申请-功能3-订单列表](#orderPage)
1. [商户抬头](#merchantTitle) 1. [商户抬头](#merchantTitle)
1. [商户地址](#merchantAddr) 1. [商户地址](#merchantAddr)
1. [商户地址编辑](#merchantAddrSave) 1. [商户地址编辑](#merchantAddrSave)
...@@ -10,22 +9,18 @@ ...@@ -10,22 +9,18 @@
1. [发票列表](#invoicePage) 1. [发票列表](#invoicePage)
1. [平台查询发票详情](#invoiceOrder) 1. [平台查询发票详情](#invoiceOrder)
## **<a name="orderPage"> 发票申请-功能1-交易列表</a>**
## **<a name="feeTypeDic"> 费用记录类型</a>**
[返回到目录](#menu) [返回到目录](#menu)
##### URL ##### URL
[/web/saas/invoiceCtl/orderPage] [/web/saas/merchantCtl/feeTypeDic]
#### 参数格式 `JSON` #### 参数格式 `JSON`
#### HTTP请求方式 `POST` #### HTTP请求方式 `POST`
``` javascript ``` javascript
{ {}
"currentPage": 1,
"pageSize": 10,
"createBegin": "", // 创建时间-开始 可以只选开始,也可以只选结束,格式:2020-04-03
"createEnd": "" // 创建时间-结束
}
``` ```
...@@ -35,40 +30,22 @@ ...@@ -35,40 +30,22 @@
{ {
"status": 0, "status": 0,
"msg": "success", "msg": "success",
"data": { "data": [
"count": 1493, {
"rows": [ "type": "00",
{ "name": "注册订单付款"
"id": "1298463038002876", // id },
"trade_no": "T10014949456718", // 打款编号 {
"acc_name": "11", // 收款户名 "type": "10",
"acc_no": "3", // 收款账号 "name": "转账交易付款"
"trade_status": "01", // 交易状态 }
"trade_status_name": "待处理", // 交易状态名称 ]
"trade_desc": "", // 交易描述 }
"trade_receipt": "", // 回执图片,判断为空时不显示按钮
"amt": 131083.32, // 商户请求打款金额
"actual_amt": 131083.32, // 实发金额
"service_tax": 2621.66, // 服务费
"deduct_amt": 128535.56, // 总扣款金额
"credit_code": "92321311MA205KN92J", // 信用代码
"out_trade_no": "13695922219233720", // 商户订单号
"created_at": "2020-04-03 11:38:19", // 创建时间
"order_id": "1298386120003945", // 订单id
"open_bank": "4", // 开户行全称
"trade_time": null, // 交易时间
"remark": "6", // 打款备注
"service_rate": 0, // 服务费比率
}
]
},
"requestid": "d14ae10263ec45ab8cd3be23ab59faf2"
}
``` ```
## **<a name="platformPage"> 发票申请-功能2-交易列表</a>** ## **<a name="platformPage"> 发票申请-功能2-交易&订单列表</a>**
[返回到目录](#menu) [返回到目录](#menu)
##### URL ##### URL
[/web/saas/invoiceCtl/platformPage] [/web/saas/invoiceCtl/platformPage]
...@@ -78,6 +55,7 @@ ...@@ -78,6 +55,7 @@
{ {
"currentPage": 1, "currentPage": 1,
"pageSize": 10, "pageSize": 10,
"fee_type": "00", // 00 注册订单 10功能2转账交易 20功能3转账交易
"createBegin": "", // 创建时间-开始 可以只选开始,也可以只选结束,格式:2020-04-03 "createBegin": "", // 创建时间-开始 可以只选开始,也可以只选结束,格式:2020-04-03
"createEnd": "" // 创建时间-结束 "createEnd": "" // 创建时间-结束
} }
...@@ -87,10 +65,13 @@ ...@@ -87,10 +65,13 @@
#### 返回结果 #### 返回结果
```javascript ```javascript
fee_type == "00"
{ {
"status": 0, "status": 0,
"msg": "success", "msg": "success",
"data": { "data": {
"feeType": "20", // 00 注册订单 10功能2转账交易 20功能3转账交易
"count": 1493, "count": 1493,
"rows": [ "rows": [
{ {
...@@ -121,29 +102,9 @@ ...@@ -121,29 +102,9 @@
}, },
"requestid": "d14ae10263ec45ab8cd3be23ab59faf2" "requestid": "d14ae10263ec45ab8cd3be23ab59faf2"
} }
```
## **<a name="orderPage"> 发票申请-功能3-订单列表</a>**
[返回到目录](#menu)
##### URL
[/web/saas/invoiceCtl/orderPage]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
``` javascript
{
"currentPage": "1",
"pageSize": "10",
"createBegin": "", // 创建时间 开始
"createEnd": "" // 创建时间 结束
}
``` fee_type == "10" || fee_type == "20"
#### 返回结果
```javascript
{ {
"status": 0, "status": 0,
"msg": "success", "msg": "success",
...@@ -186,8 +147,10 @@ ...@@ -186,8 +147,10 @@
}, },
"requestid": "00521a0a0f094c8d982bf4375fbe91b1" "requestid": "00521a0a0f094c8d982bf4375fbe91b1"
} }
``` ```
## **<a name="merchantTitle"> 商户抬头</a>** ## **<a name="merchantTitle"> 商户抬头</a>**
[返回到目录](#menu) [返回到目录](#menu)
##### URL ##### URL
......
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