Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 4606b554
authored
Jul 12, 2023
by
丁伟峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
地址分单、坐标分单,分别处理
1 parent
1a054066
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderCreateServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/OrderCreateServiceImpl.java
View file @
4606b55
...
...
@@ -42,6 +42,7 @@ import org.springframework.stereotype.Service;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.UUID
;
import
java.util.stream.Collectors
;
import
static
com
.
dituhui
.
pea
.
order
.
config
.
OrderConfig
.
PATTERN_DATE
;
import
static
com
.
dituhui
.
pea
.
order
.
config
.
OrderConfig
.
PATTERN_DATETIME
;
...
...
@@ -122,11 +123,16 @@ public class OrderCreateServiceImpl implements OrderCreateService {
entity
.
setCounty
(
location
.
getDistrict
());
entity
.
setAddress
(
location
.
getFormattedAddress
());
// 根据分单,填写clusterId/branchId/groupId/teamId等
String
loc
=
String
.
format
(
"%f,%f"
,
req
.
getLocation
().
getLng
(),
req
.
getLocation
().
getLat
());
List
<
String
>
blockIds
=
null
;
List
<
String
>
layerIds
=
capacityUtils
.
getLayers
(
req
.
getBrand
(),
req
.
getType
(),
req
.
getSkill
());
List
<
String
>
blockIds
=
saasUtils
.
queryBlockIds
(
loc
,
req
.
getAddress
());
if
(
blockIds
==
null
||
blockIds
.
size
()
==
0
)
{
if
(
req
.
getLocation
()
!=
null
){
String
loc
=
String
.
format
(
"%f,%f"
,
req
.
getLocation
().
getLng
(),
req
.
getLocation
().
getLat
());
blockIds
=
saasUtils
.
queryBlocksByLocation
(
loc
).
stream
().
map
(
SaasUtils
.
BlockInfo
::
getBlockId
).
collect
(
Collectors
.
toList
());
}
else
{
blockIds
=
saasUtils
.
queryBlocksByAddress
(
req
.
getAddress
()).
stream
().
map
(
SaasUtils
.
BlockInfo
::
getBlockId
).
collect
(
Collectors
.
toList
());
}
if
(
blockIds
.
size
()
==
0
)
{
log
.
error
(
"分单接口没有查到对应的结果"
);
Result
.
failed
(
String
.
format
(
"分单接口(address:%s)(location:%s) 没有查到配置区块"
,
req
.
getAddress
(),
req
.
getLocation
()));
}
...
...
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