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 7ec6ff32
authored
Jun 16, 2023
by
丁伟峰
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat-dingwf-mvp616' into develop
2 parents
3b2ebc45
9f59f41b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
project-order/src/main/java/com/alibaba/cloud/integration/order/service/CommonService.java
project-order/src/main/java/com/alibaba/cloud/integration/order/service/impl/OrderCreateServiceImpl.java
project-order/src/main/java/com/alibaba/cloud/integration/order/service/impl/WorkbenchServiceImpl.java
project-order/src/main/java/com/alibaba/cloud/integration/order/service/CommonService.java
View file @
7ec6ff3
...
...
@@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.JsonNode;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
lombok.experimental.Accessors
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.*
;
import
org.springframework.stereotype.Service
;
...
...
@@ -41,11 +42,11 @@ public class CommonService {
LayerAndArea
layerAndArea
=
layerAndAreas
.
get
(
randomIndex
);
teamId
=
mapBlockInfoDao
.
getTeamIdByBlockIdAndLayer
(
layerAndArea
.
areaId
,
layer
);
}
if
(
teamId
==
null
||
teamId
.
isBlank
(
))
{
if
(
StringUtils
.
isEmpty
(
teamId
))
{
teamId
=
capacityTeamStatDao
.
getRandomTeamId
();
}
log
.
info
(
"teamId ==> {}"
,
teamId
);
assert
(
teamId
!=
null
&&
!
teamId
.
isBlank
(
));
assert
(
StringUtils
.
isNotEmpty
(
teamId
));
return
teamId
;
}
...
...
@@ -72,7 +73,7 @@ public class CommonService {
String
url
;
MultiValueMap
<
String
,
Object
>
params
=
new
LinkedMultiValueMap
<>();
params
.
add
(
"ak"
,
"284c57cbabad4755a9c657885a8df3e2"
);
if
(
location
!=
null
&&
!
location
.
isBlank
(
))
{
if
(
StringUtils
.
isNotEmpty
(
location
))
{
url
=
"https://pea-test.bshg.com.cn/v2/xyfendan"
;
params
.
add
(
"coordinate"
,
location
);
}
else
{
...
...
project-order/src/main/java/com/alibaba/cloud/integration/order/service/impl/OrderCreateServiceImpl.java
View file @
7ec6ff3
...
...
@@ -32,6 +32,7 @@ import com.alibaba.cloud.integration.order.service.CommonService;
import
com.alibaba.cloud.integration.order.service.OrderCreateService
;
import
io.seata.core.context.RootContext
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -83,18 +84,16 @@ public class OrderCreateServiceImpl implements OrderCreateService {
@Override
public
Result
<?>
createOrder
(
OrderCreateReqDTO
req
)
{
log
.
info
(
"[createOrder] current XID: {}"
,
RootContext
.
getXID
());
OrderRequestEntity
entity
=
new
OrderRequestEntity
();
entity
.
setId
(
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
));
String
orderId
=
req
.
getOrderId
();
if
(
orderId
==
null
||
orderId
.
isBlank
(
))
{
if
(
StringUtils
.
isEmpty
(
orderId
))
{
orderId
=
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
);
}
entity
.
setOrderId
(
orderId
);
entity
.
setName
(
req
.
getName
());
entity
.
setPhone
(
req
.
getPhone
());
entity
.
setAddress
(
req
.
getAddress
());
entity
.
setBrand
(
req
.
getBrand
());
entity
.
setType
(
req
.
getType
());
entity
.
setSkill
(
req
.
getSkill
());
...
...
@@ -108,10 +107,9 @@ public class OrderCreateServiceImpl implements OrderCreateService {
LocationDTO
location
=
req
.
getLocation
();
entity
.
setProvince
(
location
.
getProvince
());
entity
.
setCity
(
location
.
getCity
());
entity
.
setCounty
(
location
.
get
Country
());
entity
.
setCounty
(
location
.
get
District
());
entity
.
setAddress
(
location
.
getAddress
());
// 根据分单,填写clusterId/branchId/groupId/teamId等
String
layer
=
productCategoryDao
.
getLayerByBrandAndTypeAndSkill
(
req
.
getBrand
(),
req
.
getType
(),
req
.
getSkill
());
String
loc
=
String
.
format
(
"%f,%f"
,
req
.
getLocation
().
getLng
(),
req
.
getLocation
().
getLat
());
String
teamId
=
commonService
.
getTeamIdByInput
(
loc
,
req
.
getAddress
(),
layer
);
...
...
@@ -128,7 +126,7 @@ public class OrderCreateServiceImpl implements OrderCreateService {
// todo 服务单状态、预约状态等
entity
.
setStatus
(
"OPEN"
);
entity
.
setAppointmentStatus
(
"NOT_ASSIGNED"
);
entity
.
setAppointmentMethod
(
"
IMMEDIATE
"
);
entity
.
setAppointmentMethod
(
"
AUTO_NOW
"
);
ProductCategoryEntity
categoryEntity
=
productCategoryDao
.
getProductCategoryEntityByBrandAndTypeAndSkill
(
req
.
getBrand
(),
req
.
getType
(),
req
.
getSkill
());
if
(
categoryEntity
==
null
)
{
...
...
project-order/src/main/java/com/alibaba/cloud/integration/order/service/impl/WorkbenchServiceImpl.java
View file @
7ec6ff3
...
...
@@ -6,6 +6,7 @@ import com.alibaba.cloud.integration.order.dto.*;
import
com.alibaba.cloud.integration.order.entity.*
;
import
com.alibaba.cloud.integration.order.service.WorkbenchService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
...
...
@@ -140,7 +141,7 @@ public class WorkbenchServiceImpl implements WorkbenchService {
tips
.
add
(
new
LabelValueDTO
().
setLabel
(
"工单号码"
).
setValue
(
orderId
));
tips
.
add
(
new
LabelValueDTO
().
setLabel
(
"类型/品牌"
).
setValue
(
String
.
format
(
"%s %s"
,
order
.
getBrand
(),
order
.
getType
())));
tips
.
add
(
new
LabelValueDTO
().
setLabel
(
"电话/地址"
).
setValue
(
String
.
format
(
"%s %s\n %s"
,
order
.
getName
(),
order
.
getPhone
(),
order
.
getAddress
())));
if
(
order
.
getApplyNote
()
!=
null
&&
!
order
.
getApplyNote
().
isBlank
(
))
{
if
(
StringUtils
.
isNotBlank
(
order
.
getApplyNote
()
))
{
tips
.
add
(
new
LabelValueDTO
().
setLabel
(
"备注"
).
setValue
(
order
.
getApplyNote
()));
}
tips
.
add
(
new
LabelValueDTO
().
setLabel
(
"标签"
).
setValue
(
order
.
getTags
()));
...
...
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