Commit 52009e37 by 孙亚楠

d

parent 339ee15f
......@@ -4,7 +4,10 @@ var settings = require("../../../../config/settings");
class ActionAPI extends APIBase {
constructor() {
super();
this.accountSve = system.getObject("service.account.accountSve");
this.eorderSve = system.getObject("service.eorder.eorderSve");
this.eorderproductSve = system.getObject("service.eorder.eorderproductSve");
this.eorderauthlogSve = system.getObject("service.eorder.eorderauthlogSve");
this.eordersignlogSve = system.getObject("service.eorder.eordersignlogSve");
}
/**
* 接口跳转
......@@ -32,35 +35,17 @@ class ActionAPI extends APIBase {
async handleRequest(action_process, action_type, action_body) {
var opResult = null;
switch (action_type) {
// 测试
case "test":
opResult = await this.accountSve.test(action_body);
case "saveEorder":// 保存订单
opResult = await this.eorderSve.saveEorder(action_body);
break;
// 创建账户
case "accountCreate":
opResult = await this.accountSve.createAccount(action_body);
case "auditEorder":// 审核订单
opResult = await this.eorderSve.auditEorder(action_body);
break;
// 账户余额查询
case "accountInfo":
opResult = await this.accountSve.accountInfo(action_body);
case "getEorderById":// 查看订单
opResult = await this.eorderSve.getEorderById(action_body);
break;
// 账户充值
case "accountRecharge":
opResult = await this.accountSve.accountRecharge(action_body);
break;
// 账户充值
case "accountRefund":
opResult = await this.accountSve.accountRefund(action_body);
break;
case "accountTrade":
opResult = await this.accountSve.accountTrade(action_body);
break;
case "accountTradePage":
opResult = await this.accountSve.accountTradePage(action_body);
break;
// 账户交易
case "test4":
opResult = await this.accountSve.test(action_body);
case "pageEorder":// 查看订单
opResult = await this.eorderSve.pageEorder(action_body);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
......
const system=require("../../../system");
const Dao=require("../../dao.base");
class EorderDao extends Dao{
constructor(){
super(Dao.getModelName(EorderDao));
}
}
module.exports=EorderDao;
const system=require("../../../system");
const Dao=require("../../dao.base");
class EorderauthlogDao extends Dao{
constructor(){
super(Dao.getModelName(EorderauthlogDao));
}
}
module.exports=EorderauthlogDao;
const system=require("../../../system");
const Dao=require("../../dao.base");
class EorderproductDao extends Dao{
constructor(){
super(Dao.getModelName(EorderproductDao.js));
}
}
module.exports=EorderproductDao;
const system=require("../../../system");
const Dao=require("../../dao.base");
class EordersignlogDao extends Dao{
constructor(){
super(Dao.getModelName(EordersignlogDao));
}
}
module.exports=EordersignlogDao;
'use strict'
/**
* 订单表
*/
module.exports = function (db, DataTypes) {
return db.define('eorder', {
merchant_id: {type: DataTypes.STRING, field: 'merchant_id', allowNull: true, defaultValue:'',comment:'商户id' },
merchant_name: {type: DataTypes.STRING, field: 'merchant_name', allowNull: true, defaultValue:'',comment:'商户名称' },
sign_name: {type: DataTypes.STRING, field: 'sign_name', allowNull: true,defaultValue:'', comment:'签署名称' },
sign_id: { type: DataTypes.STRING, field: 'sign_id', allowNull: false,defaultValue:'', comment:'签署ID'},
product_id: {type: DataTypes.STRING, field: 'product_id', allowNull: true,defaultValue:'', comment:'产品id'},
product_type: {type: DataTypes.STRING, field: 'product_type', allowNull: true,defaultValue:'', comment:'产品类型'},
product_unit_price:{ type: DataTypes.STRING, field: 'product_unit_price', allowNull: true, defaultValue:'',comment:'产品单价'},
product_desc:{ type: DataTypes.STRING, field: 'product_desc', allowNull: true, defaultValue:'',comment:'产品描述'},
price: { type: DataTypes.BIGINT, field: 'price', allowNull: true, defaultValue:0,comment:'订单价格'},
product_specifications: { type: DataTypes.INTEGER, field: 'price', allowNull: true, defaultValue:0,comment:'产品规格数量'},
contract_url: {type: DataTypes.STRING, field: 'contract_url', allowNull: true, defaultValue:'',comment:'合同Url' },
live_start: {type: DataTypes.DATE, field: 'live_start', allowNull: true, defaultValue:null, comment:'生效时间' },
live_end: {type: DataTypes.DATE, field: 'live_end', allowNull: true, defaultValue:null, comment:'结束时间' },
audit_status: {type: DataTypes.STRING, field: 'audit_status', allowNull: true, defaultValue:'10', comment:'审核状态10 待审核 20 审核成功 30 审核失败' },
audit_remark: {type: DataTypes.STRING, field: 'audit_remark', allowNull: true, defaultValue:'', comment:'审核备注' },
audit_user_id: {type: DataTypes.STRING, field: 'audit_user_id', allowNull: true, defaultValue:'', comment:'审核人' },
live_status: {type: DataTypes.STRING, field: 'live_status', allowNull: true, defaultValue:'10', comment:'生效状态10 待生效 20 已生效 30 已终止' },
pay_status: {type: DataTypes.STRING, field: 'pay_status', allowNull: true, defaultValue:'10', comment:'支付状态10 待支付 20 已支付 30 支付失败' },
engine_account_id: {type: DataTypes.STRING, field: 'engine_account_id', allowNull: true, defaultValue:'', comment:'计费引擎账户id' },
created_at: { type: DataTypes.DATE, field: 'created_at', allowNull: false},
updated_at: { type: DataTypes.DATE, field: 'updated_at', allowNull: false},
deleted_at: { type: DataTypes.DATE, field: 'deleted_at', allowNull: true },
version: { type: DataTypes.BIGINT, field: 'version', defalut:0,allowNull: true }
},
{
paranoid: true, //假的删除
underscored: true,
version: true,
freezeTableName: true,
tableName: 'e_order',
});
}
'use strict'
/**
* 身份认证日志表
*/
module.exports = function (db, DataTypes) {
return db.define('eorderauthlog', {
order_id: {type: DataTypes.STRING, field: 'order_id', allowNull: true, defaultValue:'',comment:'订单号' },
product_id: {type: DataTypes.STRING, field: 'product_id', allowNull: true,defaultValue:'', comment:'产品id'},
spended_at: {type: DataTypes.DATE, field: 'spended_at', allowNull: true, defaultValue:null, comment:'生效时间' },
platform_id: {type: DataTypes.STRING, field: 'platform_id', allowNull: true, defaultValue:'',comment:'平台ID' },
platform_name: {type: DataTypes.STRING, field: 'platform_name', allowNull: true,defaultValue:'', comment:'平台名称' },
spended_num: { type: DataTypes.INTEGER, field: 'spended_num', allowNull: false,defaultValue:0, comment:'消费数量'},
user_name: {type: DataTypes.STRING, field: 'user_name', allowNull: true,defaultValue:'', comment:'使用方'},
actual_spend_name:{ type: DataTypes.STRING, field: 'actual_spend_name', allowNull: true, defaultValue:'',comment:'实际使用方'},
engine_trade_id:{ type: DataTypes.STRING, field: 'engine_trade_id', allowNull: true, defaultValue:'',comment:'引擎交易id'},
pass: { type: DataTypes.INTEGER, field: 'pass', allowNull: true, defaultValue:0,comment:'是否通过'},
created_at: { type: DataTypes.DATE, field: 'created_at', allowNull: false},
updated_at: { type: DataTypes.DATE, field: 'updated_at', allowNull: false},
deleted_at: { type: DataTypes.DATE, field: 'deleted_at', allowNull: true },
version: { type: DataTypes.BIGINT, field: 'version', defalut:0,allowNull: true }
},
{
paranoid: true, //假的删除
underscored: true,
version: true,
freezeTableName: true,
tableName: 'e_order_auth_log',
});
}
'use strict'
/**
* 电子签订单关联产品表
*/
module.exports = function (db, DataTypes) {
return db.define('eorderproduct', {
order_id: {type: DataTypes.STRING, field: 'order_id', allowNull: true, defaultValue:'',comment:'订单号' },
product_id: {type: DataTypes.STRING, field: 'product_id', allowNull: true,defaultValue:'', comment:'产品id'},
created_at: { type: DataTypes.DATE, field: 'created_at', allowNull: false},
updated_at: { type: DataTypes.DATE, field: 'updated_at', allowNull: false},
deleted_at: { type: DataTypes.DATE, field: 'deleted_at', allowNull: true },
version: { type: DataTypes.BIGINT, field: 'version', defalut:0,allowNull: true }
},
{
paranoid: true, //假的删除
underscored: true,
version: true,
freezeTableName: true,
tableName: 'e_order_product',
});
}
'use strict'
/**
* 电子签合同日志表
*/
module.exports = function (db, DataTypes) {
return db.define('eordersignlog', {
order_id: {type: DataTypes.STRING, field: 'order_id', allowNull: true, defaultValue:'',comment:'订单号' },
product_id: {type: DataTypes.STRING, field: 'product_id', allowNull: true,defaultValue:'', comment:'产品id'},
spended_at: {type: DataTypes.DATE, field: 'spended_at', allowNull: true, defaultValue:null, comment:'生效时间' },
platform_id: {type: DataTypes.STRING, field: 'platform_id', allowNull: true, defaultValue:'',comment:'平台ID' },
platform_name: {type: DataTypes.STRING, field: 'platform_name', allowNull: true,defaultValue:'', comment:'平台名称' },
spended_num: { type: DataTypes.INTEGER, field: 'spended_num', allowNull: false,defaultValue:0, comment:'消费数量'},
actual_spend_name:{ type: DataTypes.STRING, field: 'actual_spend_name', allowNull: true, defaultValue:'',comment:'实际使用方'},
engine_trade_id: {type: DataTypes.STRING, field: 'engine_trade_id', allowNull: true,defaultValue:'', comment:'引擎交易id'},
engine_contract_id:{ type: DataTypes.STRING, field: 'engine_contract_id', allowNull: true, defaultValue:'',comment:'引擎合同id(签署ID)'},
engine_contract_name:{ type: DataTypes.STRING, field: 'engine_contract_name', allowNull: true, defaultValue:'',comment:'引擎合同名称(签署任务名称)'},
created_at: { type: DataTypes.DATE, field: 'created_at', allowNull: false},
updated_at: { type: DataTypes.DATE, field: 'updated_at', allowNull: false},
deleted_at: { type: DataTypes.DATE, field: 'deleted_at', allowNull: true },
version: { type: DataTypes.BIGINT, field: 'version', defalut:0,allowNull: true }
},
{
paranoid: true, //假的删除
underscored: true,
version: true,
freezeTableName: true,
tableName: 'e_order_sign_log',
});
}
const system = require("../../../system");
const ServiceBase = require("../../sve.base")
class EorderSve extends ServiceBase {
constructor() {
super("eorder", ServiceBase.getDaoName(EorderSve));
this.eorderprodcutDao = system.getObject("db.eorder.eorderprodcutDao");
}
/**
* fn:保存订单
* @param params
* @returns {Promise<void>}
*/
async saveEorder(params){
}
/**
* fn:审核订单
* @param params
* @returns {Promise<void>}
*/
async auditEorder(params){
}
/**
* fn:根据ID查询订单信息
* @param params
* @returns {Promise<void>}
*/
async getEorderById(params){
}
/**
* fn:订单查询(分页)
* @param params
* @returns {Promise<void>}
*/
async pageEorder(params){
}
}
module.exports = EorderSve;
\ No newline at end of file
const system = require("../../../system");
const ServiceBase = require("../../sve.base")
class EorderauthlogSve extends ServiceBase {
constructor() {
super("eorderauthlogSve", ServiceBase.getDaoName(EorderauthlogSve));
// this.accounttradeDao = system.getObject("db.account.accounttradeDao");
}
}
module.exports = EorderauthlogSve;
\ No newline at end of file
const system = require("../../../system");
const ServiceBase = require("../../sve.base")
class EorderproductSve extends ServiceBase {
constructor() {
super("eorderproduct", ServiceBase.getDaoName(EorderproductSve));
// this.accounttradeDao = system.getObject("db.account.accounttradeDao");
}
}
module.exports = EorderproductSve;
\ No newline at end of file
const system = require("../../../system");
const ServiceBase = require("../../sve.base")
class EordersignlogSve extends ServiceBase {
constructor() {
super("eordersignlog", ServiceBase.getDaoName(EordersignlogSve));
// this.accounttradeDao = system.getObject("db.account.accounttradeDao");
}
}
module.exports = EordersignlogSve;
\ No newline at end of file
......@@ -6,15 +6,13 @@ var settings={
db:10,
},
database:{
dbname : "engine-product",
dbname : "esign-sve-order",
user: "write",
password: "write",
config: {
// host: '192.168.18.237',
// port: 3306,
host: '43.247.184.35',
port: 8899,
timezone: '+08:00',
dialect: 'mysql',
operatorsAliases: false,
pool: {
......@@ -26,8 +24,7 @@ var settings={
debug:false,
dialectOptions:{
requestTimeout: 999999,
// instanceName:'DEV'
} //设置MSSQL超时时间
}
}
},
reqEsDevUrl:"http://192.168.4.249:9200/",
......
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