Commit 2182080a by 兰国旗

laolan

parent 2f4558e9
......@@ -61,7 +61,7 @@ class OpProductAPI extends APIBase {
break;
//2020-12-17 baidu reg start -----------------
case "getRegProducePrice"://获取reg产品price
opResult = await this.productSve.getRegProducePrice(pobj.actionBody,pobj.appInfo);
opResult = await this.productSve.getRegProducePrice(pobj.actionBody);
break;
//2020-12-17 baidu reg end -----------------
......
......@@ -241,7 +241,20 @@ class ProductService extends ServiceBase {
//2020-12-21 baidu reg copy todo
async getRegProducePrice(actionBody){
let pathCode = actionBody.pathCode;
console.log('actionBody---',actionBody)
if(actionBody.pathCode){
var pathCode = actionBody.pathCode;
}else{
var itemCode = {
item_code:actionBody.typeCode
}
var pathSql = "SELECT path_code FROM p_product WHERE item_code = :item_code";
var pathCodeData = await this.customQuery(pathSql,itemCode);
if(pathCodeData){
var pathCode = pathCodeData[0].path_code;
}
}
console.log('pathCode---',pathCode)
let channelItemCode = actionBody.channelItemCode;
const code1 = pathCode.split('/')[1];//一级产品码
const code2 = pathCode.split('/')[2];//二级产品码
......@@ -322,14 +335,16 @@ class ProductService extends ServiceBase {
break;
// 2020-12-21新增 /REG/GSREG/ 询价方法
case 'REG':
if(actionBody.city && actionBody.taxpayerType ){
let str = actionBody.city + actionBody.taxpayerType;
producesql += ` AND pc.price_desc LIKE '%${str}%'`;
}
if(actionBody.companyProperties){
producesql += ` AND pc.additions_desc LIKE '%${actionBody.companyProperties}%'`;
}else{
return system.getResultFail(null,'actionBody.companyProperties and actionBody.companyProperties can not be empty!')
if(code2 == "GSREG"){
if(actionBody.city && actionBody.taxpayerType ){
let str = actionBody.city + actionBody.taxpayerType;
producesql += ` AND pc.price_desc LIKE '%${str}%'`;
}
if(actionBody.companyProperties){
producesql += ` AND pc.additions_desc LIKE '%${actionBody.companyProperties}%'`;
}else{
return system.getResultFail(null,'actionBody.companyProperties and actionBody.companyProperties can not be empty!')
}
}
break;
default:
......
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