Commit d7580a3d by 庄冰

product

parent b2603e1e
......@@ -226,6 +226,21 @@ class TmOrderAPI extends APIBase {
case "getProductListByTypeCode"://获取产品列表(根据父类产品编码获取)
opResult = await this.appProductSve.findByProductTypeCode(action_body);
break;
case "getCAProductDetail"://根据渠道产品码获取产品详情 ---应用中心
// opResult = await this.appProductSve.findByChannelItemCode(action_body);
pobj["app"] =req.appInfo;
opResult = await this.appProductSve.getProductDetailByCode(pobj);
break;
case "getCAProductListByTypeOneCode"://获取产品列表(根据产品一类编码获取) ---应用中心
// opResult = await this.appProductSve.findByProductOneTypeCode(action_body);
pobj["app"] = req.appInfo;
opResult = await this.appProductSve.findByTypeOneCode(pobj);
break;
case "getCAProductListByTypeCode"://获取产品列表(根据父类产品编码获取) ---应用中心
// opResult = await this.appProductSve.findByProductTypeCode(action_body);
pobj["app"] = req.appInfo;
opResult = await this.appProductSve.findByTypeCode(pobj);
break;
case "subGsbOrderInfo"://提交公司宝订单信息
opResult = await this.orderSve.gsbOrderInfo(pobj, req);
break;
......
......@@ -95,5 +95,67 @@ class AppProductService extends ServiceBase {
});
return system.getResultSuccess(pList);
}
//--------------------------------应用中心获取产品信息-start-----------------------------------------------------
/**
* 根据产品类型码获取产品列表
* @param {*} obj
*/
async findByTypeCode(obj){
var app = obj.app;
if(!app || !app.uapp_id){
return system.getResultFail(-100, "渠道信息有误");
}
obj["uapp_id"]=app.uapp_id;
obj["actionType"]="findByTypeCode";
// var typeCode = obj.typeCode;
// if(!typeCode){
// return system.getResultFail(-101, "产品类型编码有误");
// }
var rc = system.getObject("util.restClient");
var url = settings.centerAppUrl() + "action/opProduct/springBoard";
var rtn= await rc.execPost(obj, url);
var result = JSON.parse(rtn.stdout);
return result;
}
/**
* 根据产品类型码获取产品列表
* @param {*} obj
*/
async findByTypeOneCode(obj){
var app = obj.app;
if(!app || !app.uapp_id){
return system.getResultFail(-100, "渠道信息有误");
}
obj["uapp_id"]=app.uapp_id;
obj["actionType"]="findByTypeOneCode";
// var typeCode = obj.typeCode;
// if(!typeCode){
// return system.getResultFail(-101, "产品类型编码有误");
// }
var rc = system.getObject("util.restClient");
var url = settings.centerAppUrl() + "action/opProduct/springBoard";
var rtn= await rc.execPost(obj, url);
var result = JSON.parse(rtn.stdout);
return result;
}
/**
* 获取产品详情
* @param {*} obj
*/
async getProductDetailByCode(obj){
var app = obj.app;
if(!app || !app.uapp_id){
return system.getResultFail(-100, "渠道信息有误");
}
obj["uapp_id"]=app.uapp_id;
obj["actionType"]="getProductDetailByCode";
var rc = system.getObject("util.restClient");
var url = settings.centerAppUrl() + "action/opProduct/springBoard";
var rtn= await rc.execPost(obj, url);
var result = JSON.parse(rtn.stdout);
return result;
}
//--------------------------------应用中心获取产品信息--end----------------------------------------------------
}
module.exports = AppProductService;
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