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 { ...@@ -4,7 +4,6 @@ class MerchantCtl extends CtlBase {
constructor() { constructor() {
super(); super();
this.merchantSve = system.getObject("service.saas.merchantSve"); this.merchantSve = system.getObject("service.saas.merchantSve");
this.merchantuserSve = system.getObject("service.uc.merchantuserSve");
} }
async dics(params, pobj2, req) { async dics(params, pobj2, req) {
...@@ -69,42 +68,6 @@ class MerchantCtl extends CtlBase { ...@@ -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; 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 { ...@@ -169,10 +169,5 @@ class MerchantService extends ServiceBase {
} }
} }
async saasinvoicePage(params){
var rs = await this.callms("invoice", "saasinvoicePage", params);
return rs;
}
} }
module.exports = MerchantService; module.exports = MerchantService;
...@@ -89,6 +89,7 @@ class TradeService extends ServiceBase { ...@@ -89,6 +89,7 @@ class TradeService extends ServiceBase {
item_count: itemList.length, item_count: itemList.length,
acc_type: params.acc_type, acc_type: params.acc_type,
order_file: params.fileUrl, order_file: params.fileUrl,
order_type: "10",
// 付款凭证信息 // 付款凭证信息
pay_voucher: "", pay_voucher: "",
pay_bank_account: main.bank_account, pay_bank_account: main.bank_account,
......
...@@ -171,8 +171,8 @@ class System { ...@@ -171,8 +171,8 @@ class System {
var path = "/api/op/action/springboard"; var path = "/api/op/action/springboard";
if (settings.env == "dev") { if (settings.env == "dev") {
// var domain = "http://192.168.18.237"; // var domain = "http://192.168.18.237";
let dev = "http://127.0.0.1"; let local = "http://127.0.0.1";
//let dev = "http://39.107.234.14"; let dev = "http://39.107.234.14";
return { return {
// 公共服务 // 公共服务
common: dev + ":3102" + path, common: dev + ":3102" + path,
...@@ -181,19 +181,18 @@ class System { ...@@ -181,19 +181,18 @@ class System {
merchant: dev + ":3101" + path, merchant: dev + ":3101" + path,
// 订单服务 // 订单服务
order: dev + ":3103" + path, order: local + ":3103" + path,
// 发票服务 // 发票服务
invoice: dev + ":3105" + path, invoice: local + ":3105" + path,
// 用户服务 // 用户服务
uc: dev + ":3106" + path, uc: dev + ":3106" + path,
// 交易 // 交易
trade: dev + ":3107" + path, trade: local + ":3107" + path,
} }
} else { } else {
var odomain = "http://123.57.217.203"
return { return {
common: "xggsvecommon-service" + path, common: "xggsvecommon-service" + path,
merchant: "xggsvemerchant-service" + path, merchant: "xggsvemerchant-service" + path,
......
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