Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
e6365357
Commit
e6365357
authored
Aug 11, 2020
by
王勇飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gyq
parent
5ea39fe6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
89 additions
and
0 deletions
+89
-0
ipop-web/app/base/api/impl/cpatentaggregations.js
+60
-0
ipop-web/app/base/service/impl/patentycSve.js
+0
-0
ipop-web/app/base/utils/execClient.js
+29
-0
No files found.
ipop-web/app/base/api/impl/cpatentaggregations.js
View file @
e6365357
...
...
@@ -1225,6 +1225,66 @@ class CPatentAggregationsApi extends ApiBase {
};
async
ApplKeywordAggs
(
obj
)
{
//申请人关键词双重聚合
var
params
=
{
"query"
:
{
"bool"
:
{
"must"
:
[]
}
},
"from"
:
0
,
"size"
:
1
,
"aggregations"
:
{
"group_by_appl"
:
{
"terms"
:
{
"field"
:
"applicant_name.raw"
,
"size"
:
10
,
"order"
:
{
"_count"
:
"desc"
}
},
"aggregations"
:
{
"group_by_keyword"
:
{
"terms"
:
{
"field"
:
"key_word"
,
"size"
:
20
,
"order"
:
{
"_count"
:
"desc"
}
}
}
}
}
}
};
for
(
var
x
in
obj
)
{
params
.
query
.
bool
.
must
.
push
(
obj
[
x
]);
}
var
rc
=
System
.
getObject
(
"util.execClient"
);
var
rtn
=
null
;
var
requrl
=
this
.
patentUrl
;
try
{
rtn
=
await
rc
.
execPost
(
params
,
requrl
);
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
return
rtn
=
{
status
:
0
,
msg
:
"操作成功"
,
data
:
j
.
hits
,
buckets
:
j
.
aggregations
};
}
catch
(
e
)
{
return
rtn
=
{
status
:
-
1
,
msg
:
"操作失败"
,
data
:
null
,
buckets
:
null
};
}
};
async
AppIpclgAggs
(
obj
)
{
//Ipc大组聚合
var
params
=
{
"query"
:
{
...
...
ipop-web/app/base/service/impl/patentycSve.js
View file @
e6365357
This diff is collapsed.
Click to expand it.
ipop-web/app/base/utils/execClient.js
View file @
e6365357
...
...
@@ -6,6 +6,8 @@ class ExecClient {
constructor
()
{
this
.
cmdPostPattern
=
"curl --user admines:adminGSBes. -k -H 'Content-type: application/json' -d '{data}' {url}"
;
this
.
cmdGetPattern
=
"curl -G -X GET '{url}'"
;
this
.
cmdPostPattern2
=
"curl -k -H 'Content-type: application/json' -d '{data}' {url}"
;
this
.
cmdPostPattern3
=
"curl -k -H 'Content-type: application/json' -H 'token: {token}' -d '{data}' {url}"
;
}
async
exec
(
cmd
)
{
...
...
@@ -30,12 +32,39 @@ class ExecClient {
return
cmd
;
}
FetchPostCmd2
(
subData
,
url
)
{
var
data
=
JSON
.
stringify
(
subData
);
var
cmd
=
this
.
cmdPostPattern2
.
replace
(
/
\{
data
\}
/g
,
data
).
replace
(
/
\{
url
\}
/g
,
url
);
console
.
log
(
cmd
);
return
cmd
;
}
FetchPostCmd3
(
token
,
subData
,
url
)
{
var
data
=
JSON
.
stringify
(
subData
);
var
cmd
=
this
.
cmdPostPattern3
.
replace
(
/
\{
token
\}
/g
,
token
).
replace
(
/
\{
data
\}
/g
,
data
).
replace
(
/
\{
url
\}
/g
,
url
);
console
.
log
(
cmd
);
return
cmd
;
}
async
execPost
(
subData
,
url
)
{
let
cmd
=
this
.
FetchPostCmd
(
subData
,
url
);
var
result
=
await
this
.
exec
(
cmd
);
return
result
;
}
async
execPost3
(
subData
,
url
)
{
let
cmd
=
this
.
FetchPostCmd2
(
subData
,
url
);
var
result
=
await
this
.
exec
(
cmd
);
return
result
;
}
async
execPost4
(
token
,
subData
,
url
)
{
let
cmd
=
this
.
FetchPostCmd3
(
token
,
subData
,
url
);
var
result
=
await
this
.
exec
(
cmd
);
return
result
;
}
async
execPost2
(
subData
,
url
)
{
let
cmd
=
this
.
FetchPostCmd
(
subData
,
url
);
var
result
=
await
this
.
exec2
(
cmd
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment