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
11a80d74
Commit
11a80d74
authored
May 23, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
b1a0fde1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
94 additions
and
11 deletions
+94
-11
bd-analysis/app/base/controller/impl/report/patentanalysisCtl.js
+49
-7
bd-analysis/app/base/db/models/report/patentanalysis.js
+7
-0
bd-analysis/app/front/entry/public/apidoc/report/patent.md
+38
-4
No files found.
bd-analysis/app/base/controller/impl/report/patentanalysisCtl.js
View file @
11a80d74
var
system
=
require
(
"../../../system"
)
const
http
=
require
(
"http"
)
const
querystring
=
require
(
'querystring'
);
var
settings
=
require
(
"../../../../config/settings"
);
const
system
=
require
(
"../../../system"
)
const
settings
=
require
(
"../../../../config/settings"
);
const
CtlBase
=
require
(
"../../ctl.base"
);
const
logCtl
=
system
.
getObject
(
"web.common.oplogCtl"
);
const
md5
=
require
(
"MD5"
);
const
uuidv4
=
require
(
'uuid/v4'
);
const
moment
=
require
(
'moment'
);
var
cacheBaseComp
=
null
;
class
PatentAnalysisCtl
extends
CtlBase
{
constructor
()
{
super
(
"report"
,
CtlBase
.
getServiceName
(
PatentAnalysisCtl
));
this
.
DOC_DIC
=
{
"100000"
:
"德温特专利数据库"
}
this
.
redisClient
=
system
.
getObject
(
"util.redisClient"
);
}
async
docDic
(
body
,
query
,
req
,
res
)
{
let
dic
=
[];
for
(
let
id
in
this
.
DOC_DIC
)
{
dic
.
push
({
id
:
id
,
name
:
this
.
DOC_DIC
[
id
]});
}
return
system
.
getResultSuccess
(
dic
);
}
async
save
(
body
,
query
,
req
,
res
)
{
let
technology_name
=
this
.
trim
(
body
.
technology_name
);
let
topic_name
=
this
.
trim
(
body
.
topic_name
);
let
topic_doc_id
=
this
.
trim
(
body
.
topic_doc_id
);
let
search_time
=
this
.
trim
(
body
.
search_time
);
let
topic_overview
=
this
.
trim
(
body
.
topic_overview
);
let
data_file
=
this
.
trim
(
body
.
data_file
);
if
(
!
technology_name
)
{
return
system
.
getResult
(
null
,
"请填写技术名称"
);
...
...
@@ -23,6 +33,33 @@ class PatentAnalysisCtl extends CtlBase {
if
(
!
data_file
)
{
return
system
.
getResult
(
null
,
"请上传文件"
);
}
if
(
!
topic_name
)
{
return
system
.
getResult
(
null
,
"请填写课题名称"
);
}
if
(
topic_name
.
length
>
50
)
{
return
system
.
getResult
(
null
,
"课题名称不允许超过50个字"
);
}
if
(
!
topic_doc_id
)
{
return
system
.
getResult
(
null
,
"请选择课题文献"
);
}
let
topic_doc_name
=
this
.
DOC_DIC
[
topic_doc_id
];
if
(
!
topic_doc_name
)
{
return
system
.
getResult
(
null
,
"课题文献选择错误,请刷新重试"
);
}
if
(
!
search_time
)
{
return
system
.
getResult
(
null
,
"请选择检索时间"
);
}
try
{
// search_time = moment(search_time, "YYYY-MM");
}
catch
(
e
)
{
return
system
.
getResult
(
null
,
"时间格式错误"
);
}
if
(
!
topic_overview
)
{
return
system
.
getResult
(
null
,
"请填写发展概况"
);
}
if
(
topic_overview
.
length
>
5000
)
{
return
system
.
getResult
(
null
,
"发展概况不允许超过5000字"
);
}
try
{
// let exists = this.service.findOne({technology_name: technology_name});
...
...
@@ -33,6 +70,11 @@ class PatentAnalysisCtl extends CtlBase {
autoIncrement
:
true
,
technology_name
:
technology_name
,
data_file
:
data_file
,
topic_doc_name
:
topic_doc_name
,
topic_name
:
topic_name
,
topic_doc_id
:
topic_doc_id
,
search_time
:
search_time
,
topic_overview
:
topic_overview
,
status
:
1
,
};
obj
=
await
this
.
service
.
create
(
obj
);
...
...
bd-analysis/app/base/db/models/report/patentanalysis.js
View file @
11a80d74
...
...
@@ -6,6 +6,13 @@ module.exports = (db, DataTypes) => {
user_id
:
DataTypes
.
INTEGER
,
status
:
DataTypes
.
INTEGER
,
technology_name
:
DataTypes
.
STRING
,
topic_name
:
DataTypes
.
STRING
,
topic_doc_id
:
DataTypes
.
STRING
,
topic_doc_name
:
DataTypes
.
STRING
,
search_time
:
DataTypes
.
DATE
,
topic_overview
:
DataTypes
.
STRING
,
data_file
:
DataTypes
.
STRING
,
report_time
:
DataTypes
.
DATE
,
report_file
:
DataTypes
.
STRING
,
...
...
bd-analysis/app/front/entry/public/apidoc/report/patent.md
View file @
11a80d74
<a
name=
"menu"
>
目录
</a>
1.
[
文献字典
](
#docdic
)
1.
[
报告上传
](
#save
)
1.
[
报告列表
](
#list
)
1.
[
报告列表
](
#page
)
## **<a name="docdic"> 文献字典</a>**
[
返回到目录
](
#menu
)
##### URL
[
/web/report/patentanalysisCtl/docdic
]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
```
javascript
{
}
```
#### 返回结果
```
javascript
{
"status"
:
0
,
"msg"
:
"success"
,
"data"
:
[
{
"id"
:
"100000"
,
"name"
:
"德温特专利数据库"
}
]
}
```
## **<a name="save"> 报告上传</a>**
[
返回到目录
](
#menu
)
...
...
@@ -13,7 +43,11 @@
{
"technology_name"
:
"这是名字"
,
// 技术名称
"data_file"
:
"这是文件地址"
// 文件地址
"data_file"
:
"这是文件地址"
,
// 文件地址
"topic_name"
:
"topic_name"
,
// 课题名称
"topic_doc_id"
:
"100000"
,
// 文献id
"search_time"
:
"1992-01"
,
// 课题时间 年-月
"topic_overview"
:
"topic_overview"
// 发展概况
}
```
...
...
@@ -30,10 +64,10 @@
```
## **<a name="
list
"> 报告列表</a>**
## **<a name="
page
"> 报告列表</a>**
[
返回到目录
](
#menu
)
##### URL
[
/web/report/patentanalysisCtl/
list
]
[
/web/report/patentanalysisCtl/
page
]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
...
...
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