Commit 2f4558e9 by 兰国旗

baiduxunjia

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