Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
open-source
/
rpc-openplatform
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 e9e0ccf5
authored
Jan 05, 2021
by
111-PC\111
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]设备导入修改
1 parent
26bd3c72
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
rpc-openplatform-container/src/main/java/cn/com/glsx/openplatform/service/DeviceMgrServiceImpl.java
rpc-openplatform-container/src/main/java/cn/com/glsx/openplatform/service/DeviceMgrServiceImpl.java
View file @
e9e0ccf
...
@@ -24,6 +24,7 @@ import java.util.Date;
...
@@ -24,6 +24,7 @@ import java.util.Date;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.regex.Pattern
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
@Service
@Service
...
@@ -109,10 +110,17 @@ public class DeviceMgrServiceImpl implements DeviceMgrService {
...
@@ -109,10 +110,17 @@ public class DeviceMgrServiceImpl implements DeviceMgrService {
errorMessagelist
.
add
(
"第"
+
rownum
+
"行设备号为空"
);
errorMessagelist
.
add
(
"第"
+
rownum
+
"行设备号为空"
);
continue
;
continue
;
}
else
{
}
else
{
PlatformDevice
platformDevice
=
deviceMapper
.
findBySn
(
deviceSn
);
String
regex
=
"^(10|20|31|32|33|34)([0-9]{10,10})"
;
if
(
platformDevice
!=
null
){
Pattern
compile
=
Pattern
.
compile
(
regex
);
errorMessagelist
.
add
(
"设备号"
+
deviceSn
+
"已经在库里面存在"
);
if
(!
compile
.
matcher
(
deviceSn
).
matches
()){
errorMessagelist
.
add
(
"设备号"
+
deviceSn
+
"校验不通过"
);
continue
;
continue
;
}
else
{
PlatformDevice
platformDevice
=
deviceMapper
.
findBySn
(
deviceSn
);
if
(
platformDevice
!=
null
)
{
errorMessagelist
.
add
(
"设备号"
+
deviceSn
+
"已经在库里面存在"
);
continue
;
}
}
}
}
}
if
(
StringUtils
.
isNullOrEmpty
(
deviceType
))
{
if
(
StringUtils
.
isNullOrEmpty
(
deviceType
))
{
...
@@ -154,4 +162,5 @@ public class DeviceMgrServiceImpl implements DeviceMgrService {
...
@@ -154,4 +162,5 @@ public class DeviceMgrServiceImpl implements DeviceMgrService {
private
Date
getStatisticEndTime
()
{
private
Date
getStatisticEndTime
()
{
return
DateUtil
.
beginOfDay
(
new
Date
());
return
DateUtil
.
beginOfDay
(
new
Date
());
}
}
}
}
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