Commit 0d060841 by wangyong

feat: (icbcSve) 抖音接口封装商标列表

parent 19a0001c
......@@ -75,10 +75,10 @@ class IcbcService extends AppServiceBase {
if (!queryobj.companyName) {
return system.getResultFail(-1, 'companyName can not be empty');
}
var hashValue = await this.restClient.hget(this.searchCertificationData, queryobj.companyName);
if (hashValue) {
return system.getResultSuccess(JSON.parse(hashValue));
}
// var hashValue = await this.restClient.hget(this.searchCertificationData, queryobj.companyName);
// if (hashValue) {
// return system.getResultSuccess(JSON.parse(hashValue));
// }
//获取token
let url = settings.icNameUrl() + 'openPlatform/platform/getToken';
let params = {
......@@ -112,9 +112,9 @@ class IcbcService extends AppServiceBase {
return system.getResult(null, "restPostWithHAuthorizationUrl data is empty");
};
let tmArray = [];
if (tmrtn.status == 1 && tmrtn.data) {
var tmResult = JSON.parse(tmrtn.data);
tmArray = this.utilsResultSve.formulaContinued(tmResult);
var tmResult = JSON.parse(tmrtn.stdout);
if (tmResult.status == 1 && tmResult.data) {
tmArray = this.utilsResultSve.formulaContinued(tmResult.data);
}
var result = JSON.parse(rtn.stdout);
......@@ -129,13 +129,13 @@ class IcbcService extends AppServiceBase {
//对结果处理
// "Tag": 1为qichacha,0为gsb
var setValue = {};
setValue[queryobj.companyName] = JSON.stringify(item);
setValue[tm] = JSON.stringify(tmArray);
// setValue[queryobj.companyName] = JSON.stringify(item);
// setValue["trademarks"] = JSON.stringify(tmArray);
// if (result.Tag == 1) {
// this.restClient.hmset(this.disposeCertificationData, setValue);
// }
this.restClient.hmset(this.searchCertificationData, setValue);
return system.getResult(item);
return system.getResult({ "certificates": item, "trademarks": tmArray });
}
......
......@@ -24,13 +24,17 @@ class utilsTlBankSve extends AppServiceBase {
for (let i = 0; i < tms.length; i++) {
let tmInfo = tms[i];
if (!tmInfo.REGDATE) { //注册公告日期
let tm_expiry = '';
if (!tmInfo.MARKNAME) { //REGDATE注册公告日期
continue;
}
if (tmInfo.REGDATE) {
let zcrqFormat = new Date(tmInfo.REGDATE * 1000); //注册日期
zcrqFormat.setFullYear(zcrqFormat.getFullYear() + 10); //专用起始日期计算
zcrqFormat.setMonth(zcrqFormat.getMonth()); //专用起始日期计算
zcrqFormat.setDate(zcrqFormat.getDate()); //专用起始日期计算
tm_expiry = this.convertDate(zcrqFormat); //计算商标到期日
}
let tmObject = {
"tm_comName": tmInfo.AGENTNAME, //代理机构
......@@ -38,7 +42,7 @@ class utilsTlBankSve extends AppServiceBase {
"tm_name": tmInfo.MARKNAME, //商标名称
"tm_appDate": tmInfo.APPDATE, //申请日期
"tm_isInvalid": tmInfo.ISINVALID, //状态
"tm_expiry": this.convertDate(zcrqFormat) //商标到期日
"tm_expiry": tm_expiry //商标到期日
}
result.push(tmObject);
}
......
......@@ -58,7 +58,7 @@ class System {
var total = data.total;
data = data.hits;
var sources = [];
data.forEach(function (d) {
data.forEach(function(d) {
sources.push(d._source);
})
var result = {
......@@ -86,14 +86,14 @@ class System {
var codes_count = aggs.ncl_one_codes_count;
var bucketlist = codes_count.buckets;
var bucklist = [];
bucketlist.forEach(function (d) {
bucketlist.forEach(function(d) {
bucklist.push(d);
})
var data = j.hits;
var total = data.total;
var hit = data.hits;
var sources = [];
hit.forEach(function (d) {
hit.forEach(function(d) {
sources.push(d._source);
})
var result = {
......@@ -121,7 +121,7 @@ class System {
var codes_count = aggs.ncl_one_codes_count;
var bucketlist = codes_count.buckets;
var bucklist = [];
bucketlist.forEach(function (d) {
bucketlist.forEach(function(d) {
bucklist.push(d);
})
var result = {
......@@ -140,7 +140,7 @@ class System {
var notice_count = aggs.notice_count;
var bucketlist = notice_count.buckets;
var bucklist = [];
bucketlist.forEach(function (d) {
bucketlist.forEach(function(d) {
var notice_issue = d.key;
var date = d.date_max.value;
var data = {
......@@ -296,7 +296,7 @@ class System {
}
}
}
Date.prototype.Format = function (fmt) { //author: meizz
Date.prototype.Format = function(fmt) { //author: meizz
var o = {
"M+": this.getMonth() + 1, //月份
"d+": this.getDate(), //日
......@@ -313,7 +313,7 @@ Date.prototype.Format = function (fmt) { //author: meizz
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
return fmt;
}
System.exTime = 4 * 3600;//缓存过期时间,4小时
System.exTime = 4 * 3600; //缓存过期时间,4小时
System.objTable = {};
......
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