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 ea03352a
authored
Jun 17, 2025
by
HlQ
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat: 设备入库时,返回重复的设备序列号
1 parent
6548deb6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
src/main/java/vion/service/impl/IDeviceServiceImpl.java
src/main/java/vion/service/impl/IDeviceServiceImpl.java
View file @
ea03352
...
...
@@ -85,6 +85,17 @@ public class IDeviceServiceImpl extends MPJBaseServiceImpl<DeviceMapper, Device>
return
"该操作仅支持设备入库"
;
}
var
userId
=
dtoList
.
getFirst
().
getUserId
();
// 检查设备序列号是否已存在
var
existDevice
=
this
.
lambdaQuery
()
.
in
(
Device:
:
getSerialNum
,
dtoList
.
stream
().
map
(
DeviceDTO:
:
getSerialNum
).
toList
())
.
list
();
if
(
CollUtil
.
isNotEmpty
(
existDevice
))
{
return
existDevice
.
stream
()
.
map
(
Device:
:
getSerialNum
)
.
collect
(
Collectors
.
joining
(
","
,
"设备序列号已存在:"
,
""
));
}
var
deviceList
=
converter
.
convert
(
dtoList
,
Device
.
class
);
if
(
this
.
saveBatch
(
deviceList
))
{
var
logList
=
deviceList
.
stream
()
...
...
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