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
669d0eca440e65717e13b9e3bdf77c2accc5c604
1 parent
4a88c2de
master
...
addDataShare
addHttps
fixDB
fixbug
register
reportStructure
zhaoyue-dev4
Fix little bug
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
12 deletions
src/main/java/com/xkl/controller/uploadsoft/UpSoftAccountController.java
src/main/java/com/xkl/controller/uploadsoft/UpSoftReportController.java
src/main/java/com/xkl/controller/uspih/AdminAccountController.java
src/main/java/com/xkl/service/ReportService.java
src/main/java/com/xkl/controller/uploadsoft/UpSoftAccountController.java
View file @
669d0ec
...
...
@@ -55,13 +55,13 @@ public class UpSoftAccountController {
// if (ampMachine == null ||// 未找到密钥所对应的机器
// !ampMachine.getAMPSerial().equals(ampserial) ||//amp序号不符合
// ampMachine.getStatus() != 1) {//用户无效
// return new ResponseEntity<>(ResultModel.error(ResultStatus.AMP_KEY_ERROR),
HttpStatus.NOT_FOUND
);
// return new ResponseEntity<>(ResultModel.error(ResultStatus.AMP_KEY_ERROR),
HttpStatus.OK
);
// }
XklAdminEntity
admin
=
adminRepository
.
findByAccountAndStatus
(
account
,
Constants
.
STATUS_OK
);
//未注册
if
(
admin
==
null
)
{
//提示用户名或密码错误
return
new
ResponseEntity
<>(
ResultModel
.
error
(
ResultStatus
.
USERNAME_OR_PASSWORD_ERROR
),
HttpStatus
.
NOT_FOUND
);
return
new
ResponseEntity
<>(
ResultModel
.
error
(
ResultStatus
.
USERNAME_OR_PASSWORD_ERROR
),
HttpStatus
.
OK
);
}
String
salt
=
admin
.
getSalt
();
String
pass_in_db
=
admin
.
getPwd
();
...
...
@@ -69,7 +69,7 @@ public class UpSoftAccountController {
if
(!
calcuPass
.
equals
(
pass_in_db
)
||
//密码错误
admin
.
getStatus
()
!=
1
)
{
//用户无效
//提示用户名或密码错误
return
new
ResponseEntity
<>(
ResultModel
.
error
(
ResultStatus
.
USERNAME_OR_PASSWORD_ERROR
),
HttpStatus
.
NOT_FOUND
);
return
new
ResponseEntity
<>(
ResultModel
.
error
(
ResultStatus
.
USERNAME_OR_PASSWORD_ERROR
),
HttpStatus
.
OK
);
}
//生成一个token,保存用户登录状态
...
...
src/main/java/com/xkl/controller/uploadsoft/UpSoftReportController.java
View file @
669d0ec
...
...
@@ -53,7 +53,6 @@ public class UpSoftReportController {
})
public
ResponseEntity
<
ResultModel
>
save
(
@CurrentAdmin
XklAdminEntity
admin
,
@RequestParam
String
json_report
)
{
// 其中json_report格式为上传软件上传上来的原始report格式。
System
.
out
.
println
(
"$$$$$$$$$"
+
json_report
);
return
reportService
.
save
(
admin
,
json_report
);
}
...
...
src/main/java/com/xkl/controller/uspih/AdminAccountController.java
View file @
669d0ec
...
...
@@ -55,7 +55,7 @@ public class AdminAccountController {
//未注册
if
(
admin
==
null
)
{
//提示用户名或密码错误
return
new
ResponseEntity
<>(
ResultModel
.
error
(
ResultStatus
.
USERNAME_OR_PASSWORD_ERROR
),
HttpStatus
.
NOT_FOUND
);
return
new
ResponseEntity
<>(
ResultModel
.
error
(
ResultStatus
.
USERNAME_OR_PASSWORD_ERROR
),
HttpStatus
.
OK
);
}
String
salt
=
admin
.
getSalt
();
String
pass_in_db
=
admin
.
getPwd
();
...
...
@@ -63,7 +63,7 @@ public class AdminAccountController {
if
(!
calcuPass
.
equals
(
pass_in_db
)
||
//密码错误
admin
.
getStatus
()
!=
1
)
{
//用户无效
//提示用户名或密码错误
return
new
ResponseEntity
<>(
ResultModel
.
error
(
ResultStatus
.
USERNAME_OR_PASSWORD_ERROR
),
HttpStatus
.
NOT_FOUND
);
return
new
ResponseEntity
<>(
ResultModel
.
error
(
ResultStatus
.
USERNAME_OR_PASSWORD_ERROR
),
HttpStatus
.
OK
);
}
//生成一个token,保存用户登录状态
...
...
src/main/java/com/xkl/service/ReportService.java
View file @
669d0ec
...
...
@@ -70,10 +70,10 @@ public class ReportService implements IReportService {
return
new
ResponseEntity
<>(
ResultModel
.
ok
(
new
ReportIdModel
(
report
.
getId
())),
HttpStatus
.
OK
);
}
else
if
(
redis
.
hasKey
(
reportWithNoUser
))
{
// 返回,报告对应会员不存在。
return
new
ResponseEntity
<>(
ResultModel
.
error
(
ResultStatus
.
INVALID_USER_ERROR
),
HttpStatus
.
NOT_FOUND
);
return
new
ResponseEntity
<>(
ResultModel
.
error
(
ResultStatus
.
INVALID_USER_ERROR
),
HttpStatus
.
OK
);
}
else
if
(
redis
.
hasKey
(
reportWrongFormat
))
{
// 返回,报告格式有问题。
return
new
ResponseEntity
<>(
ResultModel
.
error
(
ResultStatus
.
REPORT_FORMAT_ERROR
),
HttpStatus
.
NOT_FOUND
);
return
new
ResponseEntity
<>(
ResultModel
.
error
(
ResultStatus
.
REPORT_FORMAT_ERROR
),
HttpStatus
.
OK
);
}
/*
* 解析报告数据
...
...
@@ -85,7 +85,7 @@ public class ReportService implements IReportService {
if
(
reportData
==
null
)
{
redis
.
boundValueOps
(
reportWrongFormat
).
set
(
""
);
// 返回,报告格式有问题。
return
new
ResponseEntity
<>(
ResultModel
.
error
(
ResultStatus
.
REPORT_FORMAT_ERROR
),
HttpStatus
.
NOT_FOUND
);
return
new
ResponseEntity
<>(
ResultModel
.
error
(
ResultStatus
.
REPORT_FORMAT_ERROR
),
HttpStatus
.
OK
);
}
/*
* 检验会员存在性
...
...
@@ -94,7 +94,7 @@ public class ReportService implements IReportService {
if
(
user
==
null
)
{
redis
.
boundValueOps
(
reportWithNoUser
).
set
(
""
);
// 返回,报告对应会员不存在。
return
new
ResponseEntity
<>(
ResultModel
.
error
(
ResultStatus
.
INVALID_USER_ERROR
),
HttpStatus
.
NOT_FOUND
);
return
new
ResponseEntity
<>(
ResultModel
.
error
(
ResultStatus
.
INVALID_USER_ERROR
),
HttpStatus
.
OK
);
}
/*
...
...
@@ -106,7 +106,7 @@ public class ReportService implements IReportService {
return
new
ResponseEntity
<>(
ResultModel
.
ok
(
new
ReportIdModel
(
reportId
)),
HttpStatus
.
OK
);
}
else
{
// 返回,服务器存储问题。
return
new
ResponseEntity
<>(
ResultModel
.
error
(
ResultStatus
.
DB_ERROR
),
HttpStatus
.
NOT_FOUND
);
return
new
ResponseEntity
<>(
ResultModel
.
error
(
ResultStatus
.
DB_ERROR
),
HttpStatus
.
OK
);
}
}
...
...
@@ -124,7 +124,7 @@ public class ReportService implements IReportService {
// 2. 验证admin
if
(
report
.
getCreateBy
()
!=
admin
.
getId
())
{
// 非此admin创建,不能删除,返回
return
new
ResponseEntity
<>(
ResultModel
.
error
(
ResultStatus
.
INVALID_ADMIN_RPDEL_ERROR
),
HttpStatus
.
NOT_FOUND
);
return
new
ResponseEntity
<>(
ResultModel
.
error
(
ResultStatus
.
INVALID_ADMIN_RPDEL_ERROR
),
HttpStatus
.
OK
);
}
// 3. 删除report和detail,返回ok
reportRepository
.
delete
(
report
);
...
...
Please
register
or
login
to post a comment