Commit 41d2f408 by 宋毅

tj

parent e17a44f3
...@@ -7,33 +7,42 @@ class icName extends APIBase { ...@@ -7,33 +7,42 @@ class icName extends APIBase {
this.utilsIcNameSve = system.getObject("service.utilsSve.utilsIcNameSve"); this.utilsIcNameSve = system.getObject("service.utilsSve.utilsIcNameSve");
this.orderproductSve = system.getObject("service.order.orderproductSve"); this.orderproductSve = system.getObject("service.order.orderproductSve");
} }
async getVat(pobj, qobj, req) { async getProductUsageInfo(pobj, qobj, req) {
if(!pobj){ if(!pobj){
return system.getConsoleResultFail(-100, "参数异常"); return system.getConsoleResultFail(-100, "parameter exception");
} }
var userId = null; if(!pobj.interface){
userId=pobj.openId || pobj.uin; return system.getConsoleResultFail(-101, "interface can not be empty");
if(!userId){
return system.getConsoleResultFail(-100, "用户id不能为空");
} }
var count = await this.orderproductSve.dao.findCount({ where: {user_id: userId, product_type: { [this.db.Op.like]: "%/qcfw/%" } } });//增值电信产品数量 if(!pobj.interface.para){
var resData = { return system.getConsoleResultFail(-102, "para can not be empty");
"nums": count, // 产品使用数量 }
"isOpen": 1, // 0未开通此产品;1已开通此产品 if(!pobj.interface.interfaceName){
"unit": "次" // 产品使用数量单位 return system.getConsoleResultFail(-103, "interfaceName can not be empty");
}; }
return system.getConsoleResultSuccess(resData); var productType = null;
} if(pobj.interface.interfaceName=="getVatProductUsageInfo"){
async getBusinessRegistration(pobj, qobj, req) { productType="qcfw";
if(!pobj){
return system.getConsoleResultFail(-100, "参数异常");
} }
if(pobj.interface.interfaceName=="getBusinessRegistrationProductUsageInfo"){
productType="ic";
}
if(!productType){
return system.getConsoleResultFail(-104, "invalid interfaceName");
}
var para = pobj.interface.para;
var userId = null; var userId = null;
userId=pobj.openId || pobj.uin; userId=para.openId || para.uin;
if(!userId){ if(!userId){
return system.getConsoleResultFail(-100, "用户id不能为空"); return system.getConsoleResultFail(-105, "unknown user account");
}
if(!para.hasOwnProperty("appId")){
return system.getConsoleResultFail(-106, "appId can not be empty");
}
if(!para.hasOwnProperty("projectId")){
return system.getConsoleResultFail(-107, "projectId can not be empty");
} }
var count = await this.orderproductSve.dao.findCount({ where: {user_id: userId, product_type: { [this.db.Op.like]: "%/ic/%" } } });//增值电信产品数量 var count = await this.orderproductSve.dao.findCount({ where: {user_id: userId, product_type: { [this.orderproductSve.db.Op.like]: "%/"+productType+"/%" } } });//增值电信产品数量
var resData = { var resData = {
"nums": count, // 产品使用数量 "nums": count, // 产品使用数量
"isOpen": 1, // 0未开通此产品;1已开通此产品 "isOpen": 1, // 0未开通此产品;1已开通此产品
...@@ -41,5 +50,59 @@ class icName extends APIBase { ...@@ -41,5 +50,59 @@ class icName extends APIBase {
}; };
return system.getConsoleResultSuccess(resData); return system.getConsoleResultSuccess(resData);
} }
// async getVat(pobj, qobj, req) {
// if(!pobj){
// return system.getConsoleResultFail(-100, "参数异常");
// }
// if(!pobj.interface){
// return system.getConsoleResultFail(-101, "interface can not be empty!");
// }
// if(!pobj.interface.para){
// return system.getConsoleResultFail(-102, "para can not be empty!");
// }
// if(!pobj.interface.interfaceName){
// return system.getConsoleResultFail(-103, "interfaceName can not be empty!");
// }
// var para = pobj.interface.para;
// var userId = null;
// userId=para.openId || para.uin;
// if(!userId){
// return system.getConsoleResultFail(-104, "用户id不能为空");
// }
// var count = await this.orderproductSve.dao.findCount({ where: {user_id: userId, product_type: { [this.orderproductSve.db.Op.like]: "%/qcfw/%" } } });//增值电信产品数量
// var resData = {
// "nums": count, // 产品使用数量
// "isOpen": 1, // 0未开通此产品;1已开通此产品
// "unit": "次" // 产品使用数量单位
// };
// return system.getConsoleResultSuccess(resData);
// }
// async getBusinessRegistration(pobj, qobj, req) {
// if(!pobj){
// return system.getConsoleResultFail(-100, "参数异常");
// }
// if(!pobj.interface){
// return system.getConsoleResultFail(-101, "interface can not be empty!");
// }
// if(!pobj.interface.para){
// return system.getConsoleResultFail(-102, "para can not be empty!");
// }
// if(!pobj.interface.interfaceName){
// return system.getConsoleResultFail(-103, "interfaceName can not be empty!");
// }
// var para = pobj.interface.para;
// var userId = null;
// userId=para.openId || para.uin;
// if(!userId){
// return system.getConsoleResultFail(-104, "用户id不能为空");
// }
// var count = await this.orderproductSve.dao.findCount({ where: {user_id: userId, product_type: { [this.orderproductSve.db.Op.like]: "%/ic/%" } } });//增值电信产品数量
// var resData = {
// "nums": count, // 产品使用数量
// "isOpen": 1, // 0未开通此产品;1已开通此产品
// "unit": "次" // 产品使用数量单位
// };
// return system.getConsoleResultSuccess(resData);
// }
} }
module.exports = icName; module.exports = icName;
...@@ -12,7 +12,15 @@ class UtilsIcNameService extends AppServiceBase { ...@@ -12,7 +12,15 @@ class UtilsIcNameService extends AppServiceBase {
* @param {*} * @param {*}
*/ */
async checkBusinessNameList(params, req) { async checkBusinessNameList(params, req) {
var result = await this.execPostByTimeOut(req, params, settings.hemingUrl()); var obj = {
cityname: params.CityName,
keyword: params.KeyWord,
btname: params.IndustryType,
orgname: params.OrganizationType,
searchtype: params.SearchType ||"",
sitcity: params.SitCity ||""
}
var result = await this.execPostByTimeOut(req, obj, settings.checkIcNameUrl());
return result; return result;
} }
......
...@@ -37,11 +37,11 @@ var settings = { ...@@ -37,11 +37,11 @@ var settings = {
return "http://tx.brg.tencentyun.com"; return "http://tx.brg.tencentyun.com";
} }
}, },
hemingUrl: function () { checkIcNameUrl: function () {
if (this.env == "dev" || this.env == "test") { if (this.env == "dev" || this.env == "test") {
return "http://192.168.1.131:15502/gsb/heming"; return "http://127.0.0.1:35502//IcName/CheckName";
} else { } else {
return "http://ic-name-service/gsb/heming"; return "http://ic-name-service//IcName/CheckName";
} }
}, },
redis: function () { redis: function () {
......
...@@ -8,4 +8,6 @@ ...@@ -8,4 +8,6 @@
## 3. 用户控制台 ## 3. 用户控制台
  1 [用户订单接口](doc/api/customer/order.md)   1 [用户订单接口](doc/api/customer/order.md)
## 4. 消息中心 ## 4. 消息中心
  1 [消息中心接口](doc/api/platform/commonMsg.md)   1 [消息中心接口](doc/api/platform/commonMsg.md)
\ No newline at end of file ## 5. 工商核名相关接口
  1 [工商核名相关接口](doc/api/customer/ICName.md)
\ No newline at end of file
...@@ -13,17 +13,14 @@ ...@@ -13,17 +13,14 @@
``` javascript ``` javascript
{ {
"Action": "CheckBusinessNameList", "Action": "CheckBusinessNameList",
"ActionBody": { "CityName": "北京", // Y 注册城市地区
"CityName": "北京", // Y 注册城市地区 "KeyWord": "天达11",// Y 公司字号
"KeyWord": "天达11",// Y 公司字号 "IndustryType": "文化",// Y 行业类型
"BtName": "文化",// Y 行业类型 "OrganizationType": "",// Y 组织类型
"OrgName": "",// Y 组织类型 "SearchType": 1,// N 检索方式:1.公司宝ES查询 2.企查查数据接口Appkey,查询数据库 3.混合两种查询
"SearchType": 1,// N 检索方式:1.公司宝ES查询 2.企查查数据接口Appkey,查询数据库 3.混合两种查询 "SitCity": ""// N 1: CityName + KeyWord + IndustryType + OrganizationType
"SitCity": ""// N 1: cityname + keyword + btname + orgname 2: KeyWord + CityName + IndustryType + OrganizationType
2: keyword + cityname + btname + orgname 3: KeyWord + IndustryType + CityName +OrganizationType
3: keyword + btname + cityname +orgname
}
} }
``` ```
......
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