Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fangyeqing
/
xkl-interface
·
Commits
Go to a project
GitLab
Go to dashboard
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
zhaoyue
8 years ago
Commit
118cfb36e1c1e1831035b7130b52f75aed57851e
1 parent
2a4eb23e
add report infomation
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
4 deletions
push.sh
src/main/java/com/xkl/config/ResultStatus.java
src/main/java/com/xkl/model/ResultModel.java
src/main/java/com/xkl/service/ReportService.java
push.sh
View file @
118cfb3
...
...
@@ -2,7 +2,7 @@ git pull
git add --all src/
*
git add push.sh
git add pom.xml
git commit -m
"add
log
"
git commit -m
"add
report infomation
"
git push origin zhaoyue-dev
git status
git pull
...
...
src/main/java/com/xkl/config/ResultStatus.java
View file @
118cfb3
...
...
@@ -25,7 +25,7 @@ public enum ResultStatus {
AMP_KEY_ERROR
(-
11100
,
"AMP密钥不匹配"
),
REPORT_FORMAT_ERROR
(-
11140
,
"报告格式错误/Report json format error"
),
REPORT_EXISTED_ERROR
(-
11141
,
"报告重复上传/Report is already exist"
),
REPORT_INVALID_
_
ERROR
(-
11142
,
"报告在数据库中不存在/Report is not exist in the DB"
),
REPORT_INVALID_ERROR
(-
11142
,
"报告在数据库中不存在/Report is not exist in the DB"
),
INVALID_USER_ERROR
(-
11150
,
"报告所属用户未注册/Report user's account is not exist"
),
INVALID_ADMIN_RPDEL_ERROR
(-
11151
,
"报告非此操作员创建,无权删除!/Operator can not delete the report which is not create by him"
),
...
...
src/main/java/com/xkl/model/ResultModel.java
View file @
118cfb3
...
...
@@ -73,4 +73,9 @@ public class ResultModel {
public
static
ResultModel
error
(
ResultStatus
error
)
{
return
new
ResultModel
(
error
);
}
public
static
ResultModel
error
(
ResultStatus
error
,
Object
content
)
{
return
new
ResultModel
(
error
,
content
);
}
}
...
...
src/main/java/com/xkl/service/ReportService.java
View file @
118cfb3
...
...
@@ -69,7 +69,7 @@ public class ReportService implements IReportService {
XklAmpReportEntity
report
=
reportRepository
.
findByMd5AndStatus
(
reportMd5
,
Constants
.
STATUS_OK
);
if
(
report
!=
null
&&
report
.
getStatus
()
>
0
)
{
// 返回,报告已存在。
return
new
ResponseEntity
<>(
ResultModel
.
ok
(
new
ReportIdModel
(
report
.
getId
())),
HttpStatus
.
OK
);
return
new
ResponseEntity
<>(
ResultModel
.
error
(
ResultStatus
.
REPORT_EXISTED_ERROR
,
new
ReportIdModel
(
report
.
getId
())),
HttpStatus
.
OK
);
}
else
if
(
redis
.
hasKey
(
reportWithNoUser
))
{
// 返回,报告对应会员不存在。
return
new
ResponseEntity
<>(
ResultModel
.
error
(
ResultStatus
.
INVALID_USER_ERROR
),
HttpStatus
.
OK
);
...
...
@@ -120,7 +120,7 @@ public class ReportService implements IReportService {
XklAmpReportEntity
report
=
reportRepository
.
findById
(
report_id
);
if
(
report
==
null
||
report
.
getStatus
()
==
0
)
{
// 报告不存在,返回
return
new
ResponseEntity
<>(
ResultModel
.
error
(
ResultStatus
.
REPORT_INVALID_
_
ERROR
),
HttpStatus
.
OK
);
return
new
ResponseEntity
<>(
ResultModel
.
error
(
ResultStatus
.
REPORT_INVALID_ERROR
),
HttpStatus
.
OK
);
}
// 2. 验证admin
...
...
Please
register
or
login
to post a comment