Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-store
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
base_platform_enterprise
gic-store
Commits
54362f20
Commit
54362f20
authored
Nov 09, 2020
by
陶光胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
经纬度校验
parent
2fd81dab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
StoreApiServiceImpl.java
...com/gic/store/service/outer/impl/StoreApiServiceImpl.java
+13
-0
No files found.
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreApiServiceImpl.java
View file @
54362f20
...
...
@@ -52,6 +52,8 @@ import java.text.SimpleDateFormat;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.TimeUnit
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
...
...
@@ -64,6 +66,7 @@ import java.util.stream.Stream;
public
class
StoreApiServiceImpl
implements
StoreApiService
{
private
static
final
Logger
logger
=
LogManager
.
getLogger
(
StoreApiServiceImpl
.
class
);
private
Long
storeExpiredTime
=
1L
;
private
static
Pattern
NUMBER_PATTERN
=
Pattern
.
compile
(
"\\d+\\.\\d+$|-\\d+\\.\\d+$"
);
@Autowired
private
StoreService
storeService
;
@Autowired
...
...
@@ -260,6 +263,16 @@ public class StoreApiServiceImpl implements StoreApiService {
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"门店分组必须为叶子节点"
);
}
}
if
(
org
.
apache
.
commons
.
lang
.
StringUtils
.
isNotBlank
(
storeDTO
.
getLatitude
())
||
org
.
apache
.
commons
.
lang
.
StringUtils
.
isNotBlank
(
storeDTO
.
getLongitude
())){
Matcher
matcher
=
NUMBER_PATTERN
.
matcher
(
storeDTO
.
getLatitude
());
if
(!
matcher
.
matches
()){
storeDTO
.
setLatitude
(
null
);
}
matcher
=
NUMBER_PATTERN
.
matcher
(
storeDTO
.
getLongitude
());
if
(!
matcher
.
matches
()){
storeDTO
.
setLongitude
(
null
);
}
}
return
null
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment