Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-trialdrive-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit d04f9cf8
authored
Sep 03, 2021
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
新增设备验证接口
1 parent
abcaa8c3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
src/main/java/cn/com/glsx/admin/modules/controller/VehicleController.java
src/main/java/cn/com/glsx/admin/modules/service/DeviceService.java
src/main/java/cn/com/glsx/admin/modules/controller/VehicleController.java
View file @
d04f9cf
...
...
@@ -326,6 +326,24 @@ public class VehicleController {
FileIOUtil
.
download
(
inputStream
,
FileIOUtil
.
MimeType
.
EXCEL2007
,
fileName
,
response
);
}
@ApiOperation
(
value
=
"验证试驾设备"
)
@SysLog
(
module
=
"车辆管理"
,
value
=
"验证试驾设备"
,
action
=
OperateType
.
QUERY
)
@GetMapping
(
"/vehicleinfo/verifydevice"
)
public
R
verifydevice
(
@RequestParam
String
sn
)
{
// 校验设备号是否存在
boolean
snExist
=
deviceService
.
checkSnLocalAndRemote
(
sn
);
if
(!
snExist
)
{
return
R
.
error
(
1001
,
sn
+
"该设备不存在"
);
}
// 校验设备号是否已经绑定
boolean
bindSn
=
deviceService
.
checkBindSn
(
sn
);
if
(!
bindSn
)
{
return
R
.
error
(
1001
,
sn
+
"该设备已经绑定"
);
}
return
R
.
ok
(
sn
+
"设备验证通过"
);
}
@ApiOperation
(
value
=
"新增车辆信息"
)
@SysLog
(
module
=
"车辆管理"
,
value
=
"新增试驾车辆"
,
action
=
OperateType
.
ADD
)
@PostMapping
(
"/vehicleinfo/add"
)
...
...
@@ -341,7 +359,7 @@ public class VehicleController {
if
(!
snExist
)
{
noExistSnList
.
add
(
deviceInfoDto
.
getSn
());
}
// 校验设备号是否
存在
// 校验设备号是否
已经绑定
boolean
bindSn
=
deviceService
.
checkBindSn
(
deviceInfoDto
.
getSn
());
if
(!
bindSn
)
{
bindSnList
.
add
(
deviceInfoDto
.
getSn
());
...
...
@@ -377,7 +395,7 @@ public class VehicleController {
if
(!
snExist
)
{
noExistSnList
.
add
(
deviceInfoDto
.
getSn
());
}
// 校验设备号是否
存在
// 校验设备号是否
已经绑定
boolean
bindSn
=
deviceService
.
checkBindSn
(
deviceInfoDto
.
getSn
());
if
(!
bindSn
)
{
bindSnList
.
add
(
deviceInfoDto
.
getSn
());
...
...
src/main/java/cn/com/glsx/admin/modules/service/DeviceService.java
View file @
d04f9cf
...
...
@@ -163,6 +163,7 @@ public class DeviceService {
VehicleDevice
param
=
new
VehicleDevice
();
param
.
setSn
(
sn
);
param
.
setBindStatus
(
ConstantsDevice
.
BIND_VEHICLE_STATUS
);
param
.
setDelFlag
(
ConstantsDevice
.
NOT_DEL_FLAG
);
VehicleDevice
vehicleDevice
=
vehicleDeviceMapper
.
getVehicleDeviceBySnStatus
(
param
);
if
(
vehicleDevice
==
null
)
{
return
true
;
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment