Commit 453a538f by zhaoxiqing

gsb

parents b762da0f 2da45be7
var system = require("../../../system")
const CtlBase = require("../../ctlms.base");
class InvoiceCtl extends CtlBase {
constructor() {
super();
this.orderSve = system.getObject("service.saas.orderSve");
this.tradeSve = system.getObject("service.trade.tradeSve");
this.merchantSve = system.getObject("service.trade.tradeSve");
this.invoiceSve = system.getObject("service.saas.invoiceSve");
}
// 注册订单列表
async orderPage(params, pobj2, req) {
try {
params.unInvoice = 1;
params.handle_statuses = ['20', '30'];
this.doTimeCondition(params, ["createBegin", "createEnd"]);
return await this.orderSve.page(params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
// 平台交易列表
async platformPage(params, pobj2, req) {
try {
params.unInvoice = 1;
params.order_type = "10";
params.trade_status = "00";
this.doTimeCondition(params, ["createBegin", "createEnd"]);
return await this.tradeSve.itemPage(params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
// 商户交易列表
async merchantPage(params, pobj2, req) {
try {
params.unInvoice = 1;
params.order_type = "20";
params.trade_status = "00";
this.doTimeCondition(params, ["createBegin", "createEnd"]);
return await this.tradeSve.itemPage(params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
// 商户抬头信息
async apply(params, pobj2, req) {
try {
return await this.orderSve.page(params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
// 商户交付信息
async apply(params, pobj2, req) {
try {
return await this.orderSve.page(params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
// 发票申请
async apply(params, pobj2, req) {
try {
return await this.orderSve.page(params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
//发票列表
async saasinvoicePage(params, pobj2, req) {
try {
let rs = await this.invoiceSve.saasinvoicePage(params);
return rs;
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
}
module.exports = InvoiceCtl;
......@@ -4,7 +4,6 @@ class MerchantCtl extends CtlBase {
constructor() {
super();
this.merchantSve = system.getObject("service.saas.merchantSve");
this.merchantuserSve = system.getObject("service.uc.merchantuserSve");
}
async dics(params, pobj2, req) {
......@@ -69,42 +68,6 @@ class MerchantCtl extends CtlBase {
}
}
async userInfo(params, pobj2, req) {
try {
let rs = await this.merchantuserSve.info(params);
await this.merchantSve.setMerchant([rs.data]);
return system.getResultSuccess(rs);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async userSave(params, pobj2, req) {
try {
return await this.merchantuserSve.save(params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async userPage(params, pobj2, req) {
try {
let rs = await this.merchantuserSve.page(params);
await this.merchantSve.setMerchant(rs.data.rows);
return rs;
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
async saasinvoicePage(params, pobj2, req) {
try {
let rs = await this.merchantSve.saasinvoicePage(params);
return rs;
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
}
module.exports = MerchantCtl;
const system = require("../../../system");
const ServiceBase = require("../../svems.base")
const settings = require("../../../../config/settings")
class InvoiceService extends ServiceBase {
constructor() {
super();
}
async saasinvoicePage(params){
var rs = await this.callms("invoice", "saasinvoicePage", params);
if (rs && rs.data && rs.data.rows) {
this.transOrderField(rs.data.rows);
}
return rs;
}
transOrderField(rows) {
if (!rows || rows.length == 0) {
return;
}
for (let row of rows) {
row.price = system.f2y(row.price);
}
}
}
module.exports = InvoiceService;
......@@ -169,10 +169,5 @@ class MerchantService extends ServiceBase {
}
}
async saasinvoicePage(params){
var rs = await this.callms("invoice", "saasinvoicePage", params);
return rs;
}
}
module.exports = MerchantService;
......@@ -89,6 +89,7 @@ class TradeService extends ServiceBase {
item_count: itemList.length,
acc_type: params.acc_type,
order_file: params.fileUrl,
order_type: "10",
// 付款凭证信息
pay_voucher: "",
pay_bank_account: main.bank_account,
......
......@@ -171,8 +171,8 @@ class System {
var path = "/api/op/action/springboard";
if (settings.env == "dev") {
// var domain = "http://192.168.18.237";
let dev = "http://127.0.0.1";
//let dev = "http://39.107.234.14";
let local = "http://127.0.0.1";
let dev = "http://39.107.234.14";
return {
// 公共服务
common: dev + ":3102" + path,
......@@ -181,19 +181,18 @@ class System {
merchant: dev + ":3101" + path,
// 订单服务
order: dev + ":3103" + path,
order: local + ":3103" + path,
// 发票服务
invoice: dev + ":3105" + path,
invoice: local + ":3105" + path,
// 用户服务
uc: dev + ":3106" + path,
// 交易
trade: dev + ":3107" + path,
trade: local + ":3107" + path,
}
} else {
var odomain = "http://123.57.217.203"
return {
common: "xggsvecommon-service" + path,
merchant: "xggsvemerchant-service" + path,
......
<a name="menu">目录</a>
1. [发票申请-功能1-交易列表](#merchantPage)
1. [发票申请-功能2-交易列表](#platformPage)
1. [发票申请-功能3-订单列表](#orderPage)
1. [发票申请](#apply)
## **<a name="orderPage"> 发票申请-功能1-交易列表</a>**
[返回到目录](#menu)
##### URL
[/web/saas/invoiceCtl/orderPage]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
``` javascript
{
"currentPage": 1,
"pageSize": 10,
"createBegin": "", // 创建时间-开始 可以只选开始,也可以只选结束,格式:2020-04-03
"createEnd": "" // 创建时间-结束
}
```
#### 返回结果
```javascript
{
"status": 0,
"msg": "success",
"data": {
"count": 1493,
"rows": [
{
"id": "1298463038002876", // id
"trade_no": "T10014949456718", // 打款编号
"acc_name": "11", // 收款户名
"acc_no": "3", // 收款账号
"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>**
[返回到目录](#menu)
##### URL
[/web/saas/invoiceCtl/platformPage]
``` javascript
{
"currentPage": 1,
"pageSize": 10,
"createBegin": "", // 创建时间-开始 可以只选开始,也可以只选结束,格式:2020-04-03
"createEnd": "" // 创建时间-结束
}
```
#### 返回结果
```javascript
{
"status": 0,
"msg": "success",
"data": {
"count": 1493,
"rows": [
{
"id": "1298463038002876", // id
"trade_no": "T10014949456718", // 打款编号
"acc_name": "11", // 收款户名
"acc_no": "3", // 收款账号
"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="orderPage"> 发票申请-功能3-订单列表</a>**
[返回到目录](#menu)
##### URL
[/web/saas/invoiceCtl/orderPage]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
``` javascript
{
"currentPage": "1",
"pageSize": "10",
"createBegin": "", // 创建时间 开始
"createEnd": "" // 创建时间 结束
}
```
#### 返回结果
```javascript
{
"status": 0,
"msg": "success",
"data": {
"count": 0,
"rows": [
{
"id": "1726724188001516", // 订单编号
"price": 1500, // 订单价格
"pay_voucher_img": "0", // 付款凭证
"audit_remark": "", // 审核凭证
"deliver_man": "", // 交付联系人
"deliver_mobile": "", // 交付联系电话
"deliver_addr": "", // 邮寄地址
"created_at": "2020-03-21 07:45:18", // 创建时间
"status": "3030", // 订单状态
"status_name": "已交付" // 订单状态名称
// 订单信息
"bminfo": {
"idcard_front": "11111", // 身份证正面
"idcard_back": "11111", // 身份证反面
"legal_name": "11111", // 法人名称
"legal_mobile": "11111", // 手机号
"legal_idno": "11111", // 身份证号码
"company_names": "11111", // 个体户名称
"bank_front": "11111", // 银行卡正面图
"bank_back": "11111", // 银行卡反面图
"bank_name": "11111", // 开户行
"bank_no": "11111", // 银行卡号
"bank_mobile": "11111", // 预留手机号
"domicile_id": "", // 注册地id
"domicile_name": "", // 注册地
"business_scope_id": "", // 经营范围id
"business_type": "", // 经营范围类型
"business_scope": "", // 经营范围详情
}
}
],
"total": 1
},
"requestid": "00521a0a0f094c8d982bf4375fbe91b1"
}
```
## **<a name="apply"> 发票申请</a>**
[返回到目录](#menu)
##### URL
[/web/saas/invoiceCtl/apply]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
``` javascript
{
"currentPage": "1",
"pageSize": "10",
"createBegin": "", // 创建时间 开始
"createEnd": "" // 创建时间 结束
}
```
#### 返回结果
```javascript
{
"status": 0,
"msg": "success",
"data": {
"count": 0,
"rows": [
{
"id": "1726724188001516", // 订单编号
"price": 1500, // 订单价格
"pay_voucher_img": "0", // 付款凭证
"audit_remark": "", // 审核凭证
"deliver_man": "", // 交付联系人
"deliver_mobile": "", // 交付联系电话
"deliver_addr": "", // 邮寄地址
"created_at": "2020-03-21 07:45:18", // 创建时间
"status": "3030", // 订单状态
"status_name": "已交付" // 订单状态名称
// 订单信息
"bminfo": {
"idcard_front": "11111", // 身份证正面
"idcard_back": "11111", // 身份证反面
"legal_name": "11111", // 法人名称
"legal_mobile": "11111", // 手机号
"legal_idno": "11111", // 身份证号码
"company_names": "11111", // 个体户名称
"bank_front": "11111", // 银行卡正面图
"bank_back": "11111", // 银行卡反面图
"bank_name": "11111", // 开户行
"bank_no": "11111", // 银行卡号
"bank_mobile": "11111", // 预留手机号
"domicile_id": "", // 注册地id
"domicile_name": "", // 注册地
"business_scope_id": "", // 经营范围id
"business_type": "", // 经营范围类型
"business_scope": "", // 经营范围详情
}
}
],
"total": 1
},
"requestid": "00521a0a0f094c8d982bf4375fbe91b1"
}
```
\ No newline at end of file
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