Commit 2f4558e9 by 兰国旗

baiduxunjia

parent 230db19d
...@@ -60,8 +60,8 @@ class OpProductAPI extends APIBase { ...@@ -60,8 +60,8 @@ class OpProductAPI extends APIBase {
opResult = await this.productSve.updateProductPrice(pobj.actionBody,pobj.appInfo); opResult = await this.productSve.updateProductPrice(pobj.actionBody,pobj.appInfo);
break; break;
//2020-12-17 baidu reg start ----------------- //2020-12-17 baidu reg start -----------------
case "getRegProduce"://获取reg产品price case "getRegProducePrice"://获取reg产品price
opResult = await this.productSve.getRegProduce(pobj.actionBody,pobj.appInfo); opResult = await this.productSve.getRegProducePrice(pobj.actionBody,pobj.appInfo);
break; break;
//2020-12-17 baidu reg end ----------------- //2020-12-17 baidu reg end -----------------
......
...@@ -121,21 +121,21 @@ class ProductService extends ServiceBase { ...@@ -121,21 +121,21 @@ class ProductService extends ServiceBase {
//baidu reg gongshang 询价 2020-12-17 //baidu reg gongshang 询价 2020-12-17
async getRegProduce(actionBody,appInfo) { // async getRegProducePrice(actionBody,appInfo) {
var uapp_id = appInfo && appInfo.uapp_id?appInfo.uapp_id:""; // var uapp_id = appInfo && appInfo.uapp_id?appInfo.uapp_id:"";
var producesql = "SELECT pc.pay_code payCode,pt.channel_item_code channelItemCode,pc.price price FROM `p_product` pt JOIN p_product_price pc ON pt.id = pc.product_id WHERE pt.channel_item_code LIKE '%" + actionBody.typeCode // var producesql = "SELECT pc.pay_code payCode,pt.channel_item_code channelItemCode,pc.price price FROM `p_product` pt JOIN p_product_price pc ON pt.id = pc.product_id WHERE pt.channel_item_code LIKE '%" + actionBody.typeCode
+ "%' AND pc.price_desc='"+actionBody.province+"' "; // + "%' AND pc.price_desc='"+actionBody.province+"' ";
if(uapp_id){ // if(uapp_id){
producesql = producesql+" and uapp_id="+uapp_id; // producesql = producesql+" and uapp_id="+uapp_id;
} // }
var produceinfo = await this.customQuery(producesql); // var produceinfo = await this.customQuery(producesql);
if (produceinfo) { // if (produceinfo) {
actionBody.payCode = produceinfo[0].payCode; // actionBody.payCode = produceinfo[0].payCode;
actionBody.channelItemCode = produceinfo[0].channelItemCode; // actionBody.channelItemCode = produceinfo[0].channelItemCode;
actionBody.price = produceinfo[0].price; // actionBody.price = produceinfo[0].price;
} // }
return system.getResultSuccess(actionBody); // return system.getResultSuccess(actionBody);
} // }
/** /**
* 工商H5 产品询价 * 工商H5 产品询价
...@@ -240,7 +240,7 @@ class ProductService extends ServiceBase { ...@@ -240,7 +240,7 @@ class ProductService extends ServiceBase {
//2020-12-21 baidu reg copy todo //2020-12-21 baidu reg copy todo
async getRegProduce(actionBody){ async getRegProducePrice(actionBody){
let pathCode = actionBody.pathCode; let pathCode = actionBody.pathCode;
let channelItemCode = actionBody.channelItemCode; let channelItemCode = actionBody.channelItemCode;
const code1 = pathCode.split('/')[1];//一级产品码 const code1 = pathCode.split('/')[1];//一级产品码
...@@ -322,11 +322,14 @@ class ProductService extends ServiceBase { ...@@ -322,11 +322,14 @@ class ProductService extends ServiceBase {
break; break;
// 2020-12-21新增 /REG/GSREG/ 询价方法 // 2020-12-21新增 /REG/GSREG/ 询价方法
case 'REG': case 'REG':
if(actionBody.city){ if(actionBody.city && actionBody.taxpayerType ){
let str = actionBody.city; let str = actionBody.city + actionBody.taxpayerType;
producesql += ` AND pc.price_desc LIKE '%${str}%'`; producesql += ` AND pc.price_desc LIKE '%${str}%'`;
}
if(actionBody.companyProperties){
producesql += ` AND pc.additions_desc LIKE '%${actionBody.companyProperties}%'`;
}else{ }else{
return system.getResultFail(null,'actionBody.serviceType can not be empty!') return system.getResultFail(null,'actionBody.companyProperties and actionBody.companyProperties can not be empty!')
} }
break; break;
default: default:
...@@ -334,6 +337,7 @@ class ProductService extends ServiceBase { ...@@ -334,6 +337,7 @@ class ProductService extends ServiceBase {
break; break;
} }
var produceinfo = await this.customQuery(producesql); var produceinfo = await this.customQuery(producesql);
if (produceinfo.length != 0) { if (produceinfo.length != 0) {
actionBody.payCode = produceinfo[0].payCode; actionBody.payCode = produceinfo[0].payCode;
actionBody.channelItemCode = produceinfo[0].channelItemCode; actionBody.channelItemCode = produceinfo[0].channelItemCode;
......
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