Commit b3e03fd4 by 王栋源

wdy

parents 6839f33b 083c850b
...@@ -29,7 +29,10 @@ class OpProductAPI extends APIBase { ...@@ -29,7 +29,10 @@ class OpProductAPI extends APIBase {
opResult = await this.productSve.getProductDetail(pobj.actionBody, pobj.appInfo); opResult = await this.productSve.getProductDetail(pobj.actionBody, pobj.appInfo);
break; break;
case "getProductInterface"://获取产品接口信息 case "getProductInterface"://获取产品接口信息
opResult = await this.productSve.getProductInterface(pobj.actionBody); opResult = await this.productSve.getProductInterface(pobj, pobj.actionBody);
break;
case "getAppInterface"://获取应用接口信息
opResult = await this.productSve.getAppInterface(pobj, pobj.actionBody);
break; break;
case "getaliicProduce"://阿里工商获取产品信息 case "getaliicProduce"://阿里工商获取产品信息
opResult = await this.productSve.getaliicProduce(pobj.actionBody); opResult = await this.productSve.getaliicProduce(pobj.actionBody);
......
const system = require("../../../system");
const Dao = require("../../dao.base");
class InterfaceinfoDao extends Dao {
constructor() {
super(Dao.getModelName(InterfaceinfoDao));
}
}
module.exports = InterfaceinfoDao;
const system = require("../../../system");
const Dao = require("../../dao.base");
class OpinterfaceDao extends Dao {
constructor() {
super(Dao.getModelName(OpinterfaceDao));
}
}
module.exports = OpinterfaceDao;
const system = require("../../../system");
const Dao = require("../../dao.base");
class ProductInterfaceDao extends Dao {
constructor() {
super(Dao.getModelName(ProductInterfaceDao));
}
async getListByProductPriceId(productPriceId) {
return await this.model.findAll({
where: {
product_price_id: productPriceId
},
attributes: [
"id",
"interface_url",
"method_name",
"params",
"interface_type",
"interface_type_name",
"op_type",
"op_type_name",
"desc"],
raw: true
});
}
}
module.exports = ProductInterfaceDao;
...@@ -29,7 +29,7 @@ module.exports = { ...@@ -29,7 +29,7 @@ module.exports = {
//接口类型 //接口类型
"interface_type": { "bd": "本地", "yc": "远程" }, "interface_type": { "bd": "本地", "yc": "远程" },
//操作类型 //操作类型
"op_type": { "addOrder": "添加订单", "pushOrder": "推送订单", "pushBusiness": "推送商机", "pushUpdateOrder": "推送修改订单", "pushUpdateContacts": "推送修改订单联系人" }, "op_type": { "addOrder": "添加订单", "pushOrder": "推送订单", "pushUpdateOrder": "推送修改订单", "pushUpdateOrderContacts": "推送修改订单联系人", "pushOrderBusiness": "推送订单商机", "pushOrderRefund": "推送订单退款", "pushNeedBusiness": "推送需求商机", "pushNeedNote": "推送需求小计", "pushCloseNeed": "推送关闭需求", "pushNeedSolution": "推送需求方案", "pushCloseNeedSolution": "推送关闭需求方案" },
//--------- //---------
"logLevel": { "debug": 0, "info": 1, "warn": 2, "error": 3, "fatal": 4 }, "logLevel": { "debug": 0, "info": 1, "warn": 2, "error": 3, "fatal": 4 },
......
...@@ -2,8 +2,7 @@ const system = require("../../../system"); ...@@ -2,8 +2,7 @@ const system = require("../../../system");
const settings = require("../../../../config/settings"); const settings = require("../../../../config/settings");
const uiconfig = system.getUiConfig2(settings.appKey); const uiconfig = system.getUiConfig2(settings.appKey);
module.exports = (db, DataTypes) => { module.exports = (db, DataTypes) => {
return db.define("productinterface", { return db.define("interfaceinfo", {
product_id: DataTypes.INTEGER,
interface_url: DataTypes.STRING(255), interface_url: DataTypes.STRING(255),
method_name: DataTypes.STRING(100), method_name: DataTypes.STRING(100),
params: DataTypes.STRING(1024), params: DataTypes.STRING(1024),
...@@ -33,7 +32,7 @@ module.exports = (db, DataTypes) => { ...@@ -33,7 +32,7 @@ module.exports = (db, DataTypes) => {
freezeTableName: true, freezeTableName: true,
timestamps: true, timestamps: true,
updatedAt: false, updatedAt: false,
tableName: 'p_product_interface', tableName: 'p_interface_info',
validate: { validate: {
}, },
......
const system = require("../../../system");
const settings = require("../../../../config/settings");
const uiconfig = system.getUiConfig2(settings.appKey);
module.exports = (db, DataTypes) => {
return db.define("opinterface", {
uapp_id: DataTypes.INTEGER,
interface_id: DataTypes.INTEGER,
product_id: DataTypes.INTEGER,
is_enabled: { //状态 0禁用 1启用
type: DataTypes.BOOLEAN,
defaultValue: true,
},
}, {
paranoid: false,//假的删除
underscored: true,
version: true,
freezeTableName: true,
timestamps: true,
updatedAt: false,
tableName: 'p_op_interface',
validate: {
},
indexes: [
]
});
}
...@@ -2,9 +2,9 @@ const system = require("../../../system"); ...@@ -2,9 +2,9 @@ const system = require("../../../system");
const ServiceBase = require("../../sve.base"); const ServiceBase = require("../../sve.base");
const settings = require("../../../../config/settings"); const settings = require("../../../../config/settings");
class ProductInterfaceService extends ServiceBase { class InterfaceinfoService extends ServiceBase {
constructor() { constructor() {
super("dbproduct", ServiceBase.getDaoName(ProductInterfaceService)); super("dbapp", ServiceBase.getDaoName(InterfaceinfoService));
} }
} }
module.exports = ProductInterfaceService; module.exports = InterfaceinfoService;
const system = require("../../../system");
const ServiceBase = require("../../sve.base");
const settings = require("../../../../config/settings");
class OpinterfaceService extends ServiceBase {
constructor() {
super("dbproduct", ServiceBase.getDaoName(OpinterfaceService));
}
}
module.exports = OpinterfaceService;
...@@ -6,7 +6,6 @@ class ProductService extends ServiceBase { ...@@ -6,7 +6,6 @@ class ProductService extends ServiceBase {
constructor() { constructor() {
super("dbproduct", ServiceBase.getDaoName(ProductService)); super("dbproduct", ServiceBase.getDaoName(ProductService));
this.productpriceDao = system.getObject("db.dbproduct.productpriceDao"); this.productpriceDao = system.getObject("db.dbproduct.productpriceDao");
this.productinterfaceDao = system.getObject("db.dbproduct.productinterfaceDao");
} }
/** /**
* 通过产品类别编码路径获取产品列表 * 通过产品类别编码路径获取产品列表
...@@ -48,11 +47,18 @@ class ProductService extends ServiceBase { ...@@ -48,11 +47,18 @@ class ProductService extends ServiceBase {
* 获取产品接口信息 * 获取产品接口信息
* @param {*} actionBody productId产品id * @param {*} actionBody productId产品id
*/ */
async getProductInterface(actionBody) { async getProductInterface(pobj, actionBody) {
var list = await this.productinterfaceDao.getListByProductPriceId(actionBody.productPriceId); var sql = "select * from v_op_interface where is_enabled=1 and uapp_id=" + pobj.appInfo.uapp_id + " and product_id=" + actionBody.product_id;
// if (!item) { var list = await this.customQuery(sql);
// return system.getResult(null, "product to interface is data empty !"); return system.getResultSuccess(list);
// } }
/**
* 获取应用接口信息
* @param {*} actionBody
*/
async getAppInterface(pobj, actionBody) {
var sql = "select * from v_op_interface where is_enabled=1 and product_id is null and uapp_id=" + pobj.appInfo.uapp_id;
var list = await this.customQuery(sql);
return system.getResultSuccess(list); return system.getResultSuccess(list);
} }
...@@ -62,7 +68,7 @@ class ProductService extends ServiceBase { ...@@ -62,7 +68,7 @@ class ProductService extends ServiceBase {
if (actionBody.regType == "ali.companyreg") { if (actionBody.regType == "ali.companyreg") {
var area=actionBody.area||""; var area=actionBody.area||"";
producesql = "SELECT pc.pay_code payCode,pt.channel_item_code channelItemCode FROM `p_product` pt JOIN p_product_price pc ON pt.id = pc.product_id WHERE pt.channel_item_name LIKE '%" + actionBody.city producesql = "SELECT pc.pay_code payCode,pt.channel_item_code channelItemCode FROM `p_product` pt JOIN p_product_price pc ON pt.id = pc.product_id WHERE pt.channel_item_name LIKE '%" + actionBody.city
+ "%' AND pc.price_desc LIKE '%" + actionBody.area + "%' AND pc.price_desc LIKE '%" + area
+ "%' and pc.additions_desc LIKE '%" + actionBody.companyCategory + "%' ;" + "%' and pc.additions_desc LIKE '%" + actionBody.companyCategory + "%' ;"
}else{ }else{
producesql = "SELECT pc.pay_code payCode,pt.channel_item_code channelItemCode FROM `p_product` pt JOIN p_product_price pc ON pt.id = pc.product_id WHERE pt.channel_item_name LIKE '%" + actionBody.park producesql = "SELECT pc.pay_code payCode,pt.channel_item_code channelItemCode FROM `p_product` pt JOIN p_product_price pc ON pt.id = pc.product_id WHERE pt.channel_item_name LIKE '%" + actionBody.park
......
...@@ -128,7 +128,7 @@ class utilsTlBankSve extends AppServiceBase { ...@@ -128,7 +128,7 @@ class utilsTlBankSve extends AppServiceBase {
return param_result; return param_result;
} }
var reqUrl = payParam.pay_url + "/pay"; var reqUrl = payParam.pay_url + "/pay";
var result = await this.execReqInfo("getQrCode", reqUrl, param_result.req_param); var result = await this.execReqInfo("getQrCode", reqUrl, jsonObj);
if (result.status != 0) { if (result.status != 0) {
return result; return result;
} }
...@@ -279,9 +279,9 @@ class utilsTlBankSve extends AppServiceBase { ...@@ -279,9 +279,9 @@ class utilsTlBankSve extends AppServiceBase {
return param_result; return param_result;
} }
var reqUrl = payParam.pay_url + "/query"; var reqUrl = payParam.pay_url + "/query";
console.log(param_result.req_param, "data............"); // console.log(param_result.req_param, "data............");
var result = await this.execReqInfo("queryOrder", reqUrl, param_result.req_param); var result = await this.execReqInfo("queryOrder", reqUrl, jsonObj);
if (result.status != 0) { if (result.status != 0) {
return result; return result;
} }
......
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