Commit 36106559 by 宋毅

tj

parent e47c3eb3
......@@ -4,7 +4,6 @@ var settings = require("../../../../config/settings");
class OrderAPI extends APIBase {
constructor() {
super();
this.utilsProductSve = system.getObject("service.utilsSve.utilsProductSve");
}
/**
* 接口跳转-POST请求
......@@ -24,9 +23,9 @@ class OrderAPI extends APIBase {
}
async opActionProcess(pobj, action_type, req) {
var opResult = null;
switch (action_type) {
switch (action_type) {
case "addOrder"://创建订单
opResult = await this.utilsProductSve.findByTypeCode(pobj, pobj.actionBody);
opResult = await this.addOrder(pobj, pobj.actionBody);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
......@@ -34,6 +33,36 @@ class OrderAPI extends APIBase {
}
return opResult;
}
async addOrder(pobj, actionBody) {
if (!actionBody.product_info) {
return system.getResult(null, "产品信息有误,20010");
}
var interface_info = actionBody.product_info.interface_info;
if (!interface_info) {
return system.getResult(null, "产品接口信息有误,20030");
}
if (!interface_info.interface_type) {
return system.getResult(null, "产品接口类型信息有误,20050");
}
if (!interface_info.interface_url) {
return system.getResult(null, "产品接口地址信息有误,20080");
}
var opResult = null;
if (interface_info.interface_type == "bd") {
if (!interface_info.params) {
return system.getResult(null, "产品接口参数信息有误,20110");
}//操作的方法名称
var invokeObj = system.getObject(interface_info.interface_url);
if (!invokeObj[interface_info.params]) {
return system.getResult(null, "产品接口参数方法信息有误,20130");
}
opResult = await invokeObj[interface_info.params].apply(invokeObj, pobj);
}
else if (interface_info.interface_type == "yc") {
}
return opResult;
}
}
module.exports = OrderAPI;
\ No newline at end of file
......@@ -28,7 +28,7 @@ module.exports = {
//订单类型
"order_type": { "zzdd": "自主订单", "dkxd": "代客下单" },
//订单付款状态
"order_pay_status": { 1: "待付款", 2: "已付款", 4: "待服务", 8: "已完成" },
"order_status": { 1: "待付款", 2: "已付款", 4: "待服务", 8: "已完成" },
//帐户类型( 支付类型)
"pay_account_type": { "cash": "现金", "bank": "银行", "wx": "微信", "alipay": "支付宝", "other": "其它" },
//订单服务付款状态
......
......@@ -14,14 +14,14 @@ module.exports = (db, DataTypes) => {
payTime :DataTypes.DATE,// 渠道有支付时间则用渠道的支付时间
quantity :DataTypes.INTEGER,// 订单数量(即产品的倍数,默认值为1)
serviceQuantity :DataTypes.INTEGER,// 订单服务数量(即与订单数量相对应)
orderPayStatusName :DataTypes.STRING(50),//
orderPayStatus :{
orderStatusName :DataTypes.STRING(50),//
orderStatus :{
type: DataTypes.INTEGER,
set: function (val) {
this.setDataValue("orderPayStatus", val);
this.setDataValue("orderPayStatusName", uiconfig.config.pdict.order_pay_status[val]);
this.setDataValue("orderStatus", val);
this.setDataValue("orderStatusName", uiconfig.config.pdict.order_status[val]);
}
},// 订单付款状态dfk: 待付款, zfpz: 已上传支付凭证, yfk: 已付款, bfyfk: 部分已付款, ddqx: 订单取消, tkclz: 退款处理中, bfytk: 部分已退款, ytk: 已退款,zfshbtg:支付审核不通过
},// 订单状态dfk: 1: 待付款, 2: 已付款, 4: 待服务, 8: 已完成
totalSum :DataTypes.DECIMAL(12, 2),// 订单总额(产品价格×优惠费率×订单件数)
payTotalSum :DataTypes.DECIMAL(12, 2),// 订单付款总额
refundSum :DataTypes.DECIMAL(12, 2),// 退款金额
......
......@@ -6,7 +6,7 @@ module.exports = (db, DataTypes) => {
uapp_id: DataTypes.INTEGER,//
sourceOrderNo :DataTypes.STRING(64),//来源单号
productType_id :DataTypes.INTEGER,//产品类型Id
productOneType_id :DataTypes.INTEGER,//产品大类Id
pathCode :DataTypes.STRING(512), //产品类型编码路径,如:1/2
itemCode :DataTypes.STRING(64),//产品编码
itemName :DataTypes.STRING(100),//产品名称
channelItemCode :DataTypes.STRING(100),// 渠道产品编码
......
......@@ -3,7 +3,7 @@ var settings={
host: "43.247.184.32",
port: 8967,
password: "Gongsibao2018",
db:8,
db:9,
},
database:{
dbname : "center_order",
......
......@@ -4,11 +4,11 @@ var ENVINPUT = {
DB_PORT: process.env.DB_PORT,
DB_USER: process.env.DB_USER,
DB_PWD: process.env.DB_PWD,
DB_NAME: process.env.CENTER_CHANNEL_DB_NAME,
DB_NAME: process.env.CENTER_ORDER_DB_NAME,
REDIS_HOST: process.env.REDIS_HOST,
REDIS_PORT: process.env.REDIS_PORT,
REDIS_PWD: process.env.REDIS_PWD,
REDIS_DB: process.env.CENTER_CHANNEL_REDIS_DB,
REDIS_DB: process.env.CENTER_ORDER_REDIS_DB,
APP_ENV: process.env.APP_ENV ? process.env.APP_ENV : "dev"
};
var settings = {
......@@ -16,7 +16,7 @@ var settings = {
appKey: "201911061250",
secret: "f99d413b767f09b5dff0b3610366cc46",
salt: "%iatpD1gcxz7iF#B",
cacheprefix: "centerChannel",
cacheprefix: "centerOrder",
usertimeout: 3600,//单位秒
basepath: path.normalize(path.join(__dirname, '../..')),
port: process.env.NODE_PORT || 4011,
......
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