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
09434842
Commit
09434842
authored
Aug 15, 2020
by
李宏达
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ipop-web' of gitlab.gongsibao.com:jiangyong/zhichan into ipop-web
parents
fd066b55
f93f43af
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
140 additions
and
6 deletions
+140
-6
ipop-web/app/base/api/impl/cpatentaggregations.js
+60
-0
ipop-web/app/base/controller/impl/patentycCtl.js
+51
-6
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 @
09434842
...
...
@@ -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/controller/impl/patentycCtl.js
View file @
09434842
...
...
@@ -72,6 +72,48 @@ class PatentycCtl extends CtlBase {
}
}
async
competitionAnalysisInfo
(
pobj
,
obj
,
req
){
//竞争分析基本信息
if
(
obj
.
companyname
&&
obj
.
companyname
!=
'undefined'
){
try
{
var
result
=
await
this
.
service
.
competitionAnalysisInfo
(
obj
);
if
(
result
){
return
System
.
getResult2
(
result
);
}
else
{
return
System
.
getErrResult2
(
"结果为空"
);
}
}
catch
(
error
){
return
System
.
getErrResult2
(
error
);
}
}
else
{
return
System
.
getErrResult2
(
"参数companyname不能为空"
);
}
}
async
competitionAnalysisContex
(
pobj
,
obj
,
req
){
//竞争分析详细信息
if
(
obj
.
company1
&&
obj
.
company1
!=
'undefined'
&&
obj
.
company2
&&
obj
.
company2
!=
'undefined'
){
try
{
var
result
=
await
this
.
service
.
competitionAnalysisContex
(
obj
);
if
(
result
){
return
System
.
getResult2
(
result
);
}
else
{
return
System
.
getErrResult2
(
"结果为空"
);
}
}
catch
(
error
){
return
System
.
getErrResult2
(
error
);
}
}
else
{
return
System
.
getErrResult2
(
"参数不能为空"
);
}
}
//智能组合分析-获取报告
async
ezGetReport
(
pobj
,
obj
,
req
){
if
(
obj
.
uid
&&
obj
.
uid
!=
'undefined'
&&
obj
.
type
&&
obj
.
type
!=
'undefined'
){
...
...
@@ -1390,21 +1432,24 @@ module.exports = PatentycCtl;
// var task = new PatentycCtl();
// var obj = {
// "
uid
": "667b8300-c101-11ea-98dd-3142bd90eec4",
// "
type
": "html"
// "
companyname
": "667b8300-c101-11ea-98dd-3142bd90eec4",
// "
company2
": "html"
// };
// var d = task.ezGetReport({},obj,{})
// console.log("dddddd---------" + JSON.stringify(d));
// task.competitionAnalysisInfo({},obj,{}).then(d=>{
// console.log(JSON.stringify(d));
// //console.log(d[0].analyse);
// })
// (async ()=>{
// var task = new PatentycCtl();
// var obj = {
// //"uid": "735f9cd0-c103-11ea-9ecd-1d1c3e85a974", //old
// "uid": "
bb185dd0-c7d1-11ea-b098-d907460e6bad
", //1000
// "uid": "
a0892db0-c7ee-11ea-b890-f1c3c3e4b831
", //1000
// //"uid":"b08b4f30-c7d6-11ea-b0d0-35e49817c337", //100
// "type": "html"
// };
// var d = await task.ReadyReport({},obj,{})
// //var d = await task.ReadyReport({},obj,{})
// var d = await task.ezReportUploadData({},obj,{});
// console.log("dddddd---------" + JSON.stringify(d));
// })()
ipop-web/app/base/service/impl/patentycSve.js
View file @
09434842
This diff is collapsed.
Click to expand it.
ipop-web/app/base/utils/execClient.js
View file @
09434842
...
...
@@ -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