Commit 0eb4686a by 宋毅

Merge branch 'center-channel' of gitlab.gongsibao.com:jiangyong/zhichan into center-channel

parents babff4c4 ec726a99
...@@ -60,6 +60,9 @@ class OpNeed extends APIBase { ...@@ -60,6 +60,9 @@ class OpNeed extends APIBase {
case "getStatisticsByProduct": case "getStatisticsByProduct":
opResult = await this.utilsOpNeedSve.getStatisticsByProduct(pobj); opResult = await this.utilsOpNeedSve.getStatisticsByProduct(pobj);
break; break;
case "getNeedProductType":
opResult = await this.utilsOpNeedSve.getNeedProductType(pobj);
break;
case "getStatisticsByArea": case "getStatisticsByArea":
opResult = await this.utilsOpNeedSve.getStatisticsByArea(pobj); opResult = await this.utilsOpNeedSve.getStatisticsByArea(pobj);
break; break;
......
...@@ -245,6 +245,12 @@ class AppServiceBase { ...@@ -245,6 +245,12 @@ class AppServiceBase {
returnType: '1', returnType: '1',
opTitle: opType + "数据推送成功->" + opTitleDesc opTitle: opType + "数据推送成功->" + opTitleDesc
}); });
// TODO 更改需求推送状态
if (opType.indexOf('Need') >=0 && opType.indexOf('Business')>=0){
pobj.actionType = 'updateNeedPushStatus';
let url = settings.centerOrderUrl() + 'action/opNeed/springBoard';
let result = await this.execPostByTimeOut(null,pobj,url,null,null,60);
}
// result.data = null; // result.data = null;
return result; return result;
} }
......
...@@ -75,10 +75,10 @@ class IcbcService extends AppServiceBase { ...@@ -75,10 +75,10 @@ class IcbcService extends AppServiceBase {
if (!queryobj.companyName) { if (!queryobj.companyName) {
return system.getResultFail(-1, 'companyName can not be empty'); return system.getResultFail(-1, 'companyName can not be empty');
} }
// var hashValue = await this.restClient.hget(this.searchCertificationData, queryobj.companyName); var hashValue = await this.restClient.hget(this.searchCertificationData, queryobj.companyName);
// if (hashValue) { if (hashValue) {
// return system.getResultSuccess(JSON.parse(hashValue)); return system.getResultSuccess(JSON.parse(hashValue));
// } }
//获取token //获取token
let url = settings.icNameUrl() + 'openPlatform/platform/getToken'; let url = settings.icNameUrl() + 'openPlatform/platform/getToken';
let params = { let params = {
...@@ -87,36 +87,20 @@ class IcbcService extends AppServiceBase { ...@@ -87,36 +87,20 @@ class IcbcService extends AppServiceBase {
} }
let ret = await this.opReqResult(url, params, req); let ret = await this.opReqResult(url, params, req);
if (ret.status != 1) { if (ret.status != 1) {
system.getResultFail(-1, '获取开放平台token失败'); return system.getResultFail(-1, '获取开放平台token失败');
} }
let token = ret.data; let token = ret.data;
url = settings.icNameUrl() + "openPlatform/busenterprise/cloudapi"; url = settings.icNameUrl() + "openPlatform/busenterprise/cloudapi";
let tmUrl = settings.icNameUrl() + "openPlatform/busservices/cloudApi"
//资质查询 //资质查询
let data = { let data = {
"path": "/apis/dst/patents/certificate", "path": "/apis/dst/patents/certificate",
"name": queryobj.companyName "name": queryobj.companyName
}; };
//商标查询
let tmData = {
"path": "getTrademarkInfo",
"entName": queryobj.companyName,
"pageNo": 1, //页码
"pageSize": 10 //每页显示最大数量,最大100
};
let rtn = await this.execClient.restGetWithHAuthorizationUrl(token, url, data); let rtn = await this.execClient.restGetWithHAuthorizationUrl(token, url, data);
let tmrtn = await this.execClient.restGetWithHAuthorizationUrl(token, tmUrl, tmData);
if (!rtn || !rtn.stdout) { if (!rtn || !rtn.stdout) {
return system.getResult(null, "restPostWithHAuthorizationUrl data is empty"); return system.getResult(null, "restPostWithHAuthorizationUrl data is empty");
}; };
let tmArray = [];
var tmResult = JSON.parse(tmrtn.stdout);
if (tmResult.status == 1 && tmResult.data) {
tmArray = this.utilsResultSve.formulaContinued(tmResult.data);
}
var result = JSON.parse(rtn.stdout); var result = JSON.parse(rtn.stdout);
if (!result) { if (!result) {
return system.getResultFail(-1, '查询失败!!!'); return system.getResultFail(-1, '查询失败!!!');
...@@ -125,17 +109,15 @@ class IcbcService extends AppServiceBase { ...@@ -125,17 +109,15 @@ class IcbcService extends AppServiceBase {
return system.getResultFail(-1, '查询失败'); return system.getResultFail(-1, '查询失败');
} }
let item = result.result.items; let item = result.result.items;
//对结果处理 //对结果处理
// "Tag": 1为qichacha,0为gsb // "Tag": 1为qichacha,0为gsb
var setValue = {}; var setValue = {};
// setValue[queryobj.companyName] = JSON.stringify(item); setValue[queryobj.companyName] = JSON.stringify(item);
// setValue["trademarks"] = JSON.stringify(tmArray);
// if (result.Tag == 1) { // if (result.Tag == 1) {
// this.restClient.hmset(this.disposeCertificationData, setValue); // this.restClient.hmset(this.disposeCertificationData, setValue);
// } // }
this.restClient.hmset(this.searchCertificationData, setValue); this.restClient.hmset(this.searchCertificationData, setValue);
return system.getResult({ "certificates": item, "trademarks": tmArray }); return system.getResult(item);
} }
......
...@@ -407,6 +407,20 @@ class UtilsOpNeedService extends AppServiceBase { ...@@ -407,6 +407,20 @@ class UtilsOpNeedService extends AppServiceBase {
} }
/** /**
* 获取需求 的产品类型
* @param pobj
* @returns {Promise<void>}
*/
async getNeedProductType(pobj){
let url = this.centerOrderUrl + "action/opNeed/springBoard";
let result = await this.restPostUrl(pobj, url);
if(result.status != 0){
return system.getResultFail(-1);
}
return result;
}
/**
* 需求量对比 * 需求量对比
* @param pobj * @param pobj
* @returns {Promise<void>} * @returns {Promise<void>}
......
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