Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
李苗
/
Vion-DevOps
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 f06bbe17
authored
Jun 24, 2025
by
HlQ
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat: 设备流转,返回给前端的消息体修改
1 parent
0d552aa7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
11 deletions
src/main/java/vion/controller/DeviceController.java
src/main/java/vion/service/IDeviceService.java
src/main/java/vion/service/impl/IDeviceServiceImpl.java
src/main/java/vion/controller/DeviceController.java
View file @
f06bbe1
...
...
@@ -42,13 +42,13 @@ public class DeviceController {
@PostMapping
(
"/record"
)
@SaCheckPermission
(
value
=
"device:record"
,
orRole
=
"admin"
)
public
String
circulate
(
@RequestBody
List
<
DeviceDTO
>
dtoList
)
{
public
Object
circulate
(
@RequestBody
List
<
DeviceDTO
>
dtoList
)
{
return
deviceService
.
recordDevice
(
dtoList
);
}
@PostMapping
(
"/circulate"
)
@SaCheckPermission
(
value
=
"device:circulate"
,
orRole
=
"admin"
)
public
String
circulateBatch
(
@RequestBody
List
<
DeviceDTO
>
dtoList
)
{
public
Object
circulateBatch
(
@RequestBody
List
<
DeviceDTO
>
dtoList
)
{
return
deviceService
.
circulateBatch
(
dtoList
);
}
...
...
src/main/java/vion/service/IDeviceService.java
View file @
f06bbe1
...
...
@@ -20,7 +20,7 @@ public interface IDeviceService extends MPJBaseService<Device> {
String
update
(
List
<
DeviceDTO
>
dtoList
);
String
recordDevice
(
List
<
DeviceDTO
>
dtoList
);
Object
recordDevice
(
List
<
DeviceDTO
>
dtoList
);
String
circulateBatch
(
List
<
DeviceDTO
>
dtoList
);
Object
circulateBatch
(
List
<
DeviceDTO
>
dtoList
);
}
src/main/java/vion/service/impl/IDeviceServiceImpl.java
View file @
f06bbe1
...
...
@@ -16,6 +16,7 @@ import vion.model.Device;
import
vion.model.DeviceLog
;
import
vion.service.IDeviceLogService
;
import
vion.service.IDeviceService
;
import
vion.utils.ResultUtil
;
import
vion.vo.DeviceVO
;
import
java.util.List
;
...
...
@@ -76,13 +77,13 @@ public class IDeviceServiceImpl extends MPJBaseServiceImpl<DeviceMapper, Device>
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
String
recordDevice
(
List
<
DeviceDTO
>
dtoList
)
{
public
Object
recordDevice
(
List
<
DeviceDTO
>
dtoList
)
{
if
(
CollUtil
.
isEmpty
(
dtoList
))
{
return
"设备为空"
;
return
ResultUtil
.
error
(
"设备为空"
)
;
}
var
statusSet
=
dtoList
.
stream
().
map
(
DeviceDTO:
:
getStatus
).
collect
(
Collectors
.
toSet
());
if
(
statusSet
.
size
()
>
1
||
!
statusSet
.
contains
(
1
))
{
return
"该操作仅支持设备入库"
;
return
ResultUtil
.
error
(
"该操作仅支持设备入库"
)
;
}
var
userId
=
dtoList
.
getFirst
().
getUserId
();
...
...
@@ -91,9 +92,10 @@ public class IDeviceServiceImpl extends MPJBaseServiceImpl<DeviceMapper, Device>
.
in
(
Device:
:
getSerialNum
,
dtoList
.
stream
().
map
(
DeviceDTO:
:
getSerialNum
).
toList
())
.
list
();
if
(
CollUtil
.
isNotEmpty
(
existDevice
))
{
return
existDevice
.
stream
()
var
deviceStr
=
existDevice
.
stream
()
.
map
(
Device:
:
getSerialNum
)
.
collect
(
Collectors
.
joining
(
","
,
"设备序列号已存在:"
,
""
));
return
ResultUtil
.
error
(
deviceStr
);
}
var
deviceList
=
converter
.
convert
(
dtoList
,
Device
.
class
);
...
...
@@ -114,13 +116,13 @@ public class IDeviceServiceImpl extends MPJBaseServiceImpl<DeviceMapper, Device>
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
String
circulateBatch
(
List
<
DeviceDTO
>
dtoList
)
{
public
Object
circulateBatch
(
List
<
DeviceDTO
>
dtoList
)
{
if
(
CollUtil
.
isEmpty
(
dtoList
))
{
return
"设备为空"
;
return
ResultUtil
.
error
(
"设备为空"
)
;
}
var
statusSet
=
dtoList
.
stream
().
map
(
DeviceDTO:
:
getStatus
).
collect
(
Collectors
.
toSet
());
if
(
statusSet
.
size
()
>
1
)
{
return
"该操作不允许对设备进行不同处理"
;
return
ResultUtil
.
error
(
"该操作不允许对设备进行不同处理"
)
;
}
var
userId
=
dtoList
.
getFirst
().
getUserId
();
...
...
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