Commit 5399ea51 by 张云飞

zyf

parent c6773883
...@@ -419,6 +419,21 @@ class ToolApi extends ApiBase { ...@@ -419,6 +419,21 @@ class ToolApi extends ApiBase {
return {}; return {};
} }
} }
//商标尼斯小项查询过滤
async getTmNclFilterSearch(pobj,o, req) {
var appkey = this.appKeyStr;
var data = {
appKey: appkey,
nclOneCodes: pobj.nclOneCodes,
nclSmallCodes: pobj.nclSmallCodes,
};
var ncllist = await this.gsbSearchApi.tmnclfiltersearch(data);
if (ncllist.status == 0) {
return ncllist;
} else {
return {};
}
}
async getCropperPic(qobj, obj, req) { async getCropperPic(qobj, obj, req) {
var that = this; var that = this;
......
...@@ -1806,6 +1806,76 @@ class GsbTmSearchApi extends ApiBase { ...@@ -1806,6 +1806,76 @@ class GsbTmSearchApi extends ApiBase {
return rtn = System.getResult2(null, null); return rtn = System.getResult2(null, null);
} }
} }
//商标尼斯小项查询过滤
async tmnclfiltersearch(obj) {
var nclOneCodes = obj.nclOneCodes == null ? "" : obj.nclOneCodes;
var nclSmallCodes = obj.nclSmallCodes == [] ? "" : obj.nclSmallCodes;
var reqUrl = this.nclUrl;
var params = {
"query": {
"bool": {
"must": [
{
"term": {
"belong_to_onecode": nclOneCodes
}
},
{
"term": {
"level": 3
}
}
]
}
},
"size": 300,
"_source": [
"code",
"level",
"description",
"name",
"pid",
"belong_to_onecode"
]
};
if (nclSmallCodes.length > 0) {
var namelist = []
for (var k = 0; k < nclSmallCodes.length; k++) {
var c = nclSmallCodes[k];
namelist.push(c.name);
}
var dsl = {
"terms": {
"name.raw": namelist
}
}
params.query.bool.must.push(dsl);
}
var rc = System.getObject("util.execClient");
var rtn = null;
try {
rtn = await rc.execPost(params, reqUrl);
var j = JSON.parse(rtn.stdout);
var sources = [];
var data = {
"nclOneCodes": nclOneCodes,
"nclSmallCodes": sources
};
j.hits.hits.forEach(function (c) {
var source = {
code: c._source.code,
name: c._source.name,
pcode: c._source.pcode
};
sources.push(source);
});
var a = { status: 0, msg: "操作成功", data: data };
return a;
} catch (e) {
return { status: -1, msg: "操作失败", data: null };
}
}
async getConvertSemiangleStr(str) { async getConvertSemiangleStr(str) {
var result = ""; var result = "";
......
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