Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
order-group
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
order-group-application
order-group
Commits
4b41a4c9
Commit
4b41a4c9
authored
Mar 22, 2021
by
zhiheng.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店返回对象不能为空
parent
84c043b1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
41 deletions
+43
-41
order-application-service/src/main/java/cn/freemud/service/impl/OrderServiceImpl.java
+43
-41
No files found.
order-application-service/src/main/java/cn/freemud/service/impl/OrderServiceImpl.java
View file @
4b41a4c9
...
@@ -932,51 +932,53 @@ public class OrderServiceImpl implements Orderservice {
...
@@ -932,51 +932,53 @@ public class OrderServiceImpl implements Orderservice {
Integer
totalSumTime
=
0
;
Integer
totalSumTime
=
0
;
String
progress
=
"0"
;
//进度
String
progress
=
"0"
;
//进度
Integer
orderProgressBarStatus
=
2
;
Integer
orderProgressBarStatus
=
2
;
StoreResponse
.
Configuration
configuration
=
storeResponseDto
.
getStoreConfig
();
if
(
null
!=
storeResponseDto
){
if
(
null
!=
configuration
)
{
StoreResponse
.
Configuration
configuration
=
storeResponseDto
.
getStoreConfig
();
log
.
info
(
"StoreResponse.Configuration {}"
,
JSONObject
.
toJSONString
(
configuration
));
if
(
null
!=
configuration
)
{
orderProgressBarStatus
=
configuration
.
getOrderProgressBarStatus
();
log
.
info
(
"StoreResponse.Configuration {}"
,
JSONObject
.
toJSONString
(
configuration
));
;
//默认关闭
orderProgressBarStatus
=
configuration
.
getOrderProgressBarStatus
();
//订单状态为已接单并且无售后单展示进度条
;
//默认关闭
if
(
OrderStatus
.
RECEIPT
.
getCode
()
==
orderBean
.
getStatus
()
&&
null
==
orderBean
.
getAfterSalesOrderResp
()
&&
null
!=
orderProgressBarStatus
&&
null
!=
configuration
.
getTurnOnTimeOfMaking
())
{
//订单状态为已接单并且无售后单展示进度条
try
{
if
(
OrderStatus
.
RECEIPT
.
getCode
()
==
orderBean
.
getStatus
()
&&
null
==
orderBean
.
getAfterSalesOrderResp
()
&&
null
!=
orderProgressBarStatus
&&
null
!=
configuration
.
getTurnOnTimeOfMaking
())
{
// 查询订单的排队人数
try
{
QueryLineUpOrderReq
queryLineUpOrderReq
=
new
QueryLineUpOrderReq
();
// 查询订单的排队人数
queryLineUpOrderReq
.
setPartnerId
(
orderBean
.
getCompanyId
());
QueryLineUpOrderReq
queryLineUpOrderReq
=
new
QueryLineUpOrderReq
();
queryLineUpOrderReq
.
setStoreId
(
orderBean
.
getShopId
());
queryLineUpOrderReq
.
setPartnerId
(
orderBean
.
getCompanyId
());
queryLineUpOrderReq
.
setStartTime
(
DateUtil
.
addHours
(
new
Date
(
orderBean
.
getGmtCreate
()),
-
24
).
getTime
());
queryLineUpOrderReq
.
setStoreId
(
orderBean
.
getShopId
());
queryLineUpOrderReq
.
setEndTime
(
orderBean
.
getGmtCreate
());
queryLineUpOrderReq
.
setStartTime
(
DateUtil
.
addHours
(
new
Date
(
orderBean
.
getGmtCreate
()),
-
24
).
getTime
());
// 取餐排队人数查询代码去除
queryLineUpOrderReq
.
setEndTime
(
orderBean
.
getGmtCreate
());
QueryLineUpResponse
response
=
orderCenterSdkService
.
queryLineUpOrder
(
queryLineUpOrderReq
);
// 取餐排队人数查询代码去除
;
QueryLineUpResponse
response
=
orderCenterSdkService
.
queryLineUpOrder
(
queryLineUpOrderReq
);
if
(
RESPONSE_SUCCESS_CODE
.
equals
(
response
.
getErrcode
()))
{
;
if
(
null
==
response
.
getOrderCodes
())
{
if
(
RESPONSE_SUCCESS_CODE
.
equals
(
response
.
getErrcode
()))
{
progress
=
"100"
;
if
(
null
==
response
.
getOrderCodes
())
{
returnWords
=
""
;
progress
=
"100"
;
}
else
{
returnWords
=
""
;
List
<
String
>
orderCodeList
=
response
.
getOrderCodes
();
}
else
{
if
(
null
!=
orderCodeList
&&
orderCodeList
.
size
()
>
0
)
{
List
<
String
>
orderCodeList
=
response
.
getOrderCodes
();
returnWords
+=
"前方还有 "
+
orderCodeList
.
size
()
+
" 单"
;
if
(
null
!=
orderCodeList
&&
orderCodeList
.
size
()
>
0
)
{
//开启制作时间 1 :是 , 2 :否"
returnWords
+=
"前方还有 "
+
orderCodeList
.
size
()
+
" 单"
;
if
(
1
!=
configuration
.
getTurnOnTimeOfMaking
())
{
//开启制作时间 1 :是 , 2 :否"
totalSumTime
=
orderCodeList
.
size
()
*
AutoOrderConfigTime
.
getTime
(
configuration
.
getAutoSelfmentionTakeOrderWorkflowFinishTime
());
//分钟
if
(
1
!=
configuration
.
getTurnOnTimeOfMaking
())
{
}
else
{
totalSumTime
=
orderCodeList
.
size
()
*
AutoOrderConfigTime
.
getTime
(
configuration
.
getAutoSelfmentionTakeOrderWorkflowFinishTime
());
//分钟
Integer
goodsAvgTimeOfMaking
=
(
null
==
configuration
.
getGoodsAvgTimeOfMaking
()
||
0
==
configuration
.
getGoodsAvgTimeOfMaking
())
?
5
:
configuration
.
getGoodsAvgTimeOfMaking
();
}
else
{
productSum
=
orderCodeList
.
stream
().
mapToInt
(
product
->
Integer
.
parseInt
(
product
.
split
(
"-"
)[
1
])).
sum
();
Integer
goodsAvgTimeOfMaking
=
(
null
==
configuration
.
getGoodsAvgTimeOfMaking
()
||
0
==
configuration
.
getGoodsAvgTimeOfMaking
())
?
5
:
configuration
.
getGoodsAvgTimeOfMaking
();
totalSumTime
=
productSum
*
goodsAvgTimeOfMaking
;
productSum
=
orderCodeList
.
stream
().
mapToInt
(
product
->
Integer
.
parseInt
(
product
.
split
(
"-"
)[
1
])).
sum
();
returnWords
+=
" / "
+
productSum
+
" 件"
;
totalSumTime
=
productSum
*
goodsAvgTimeOfMaking
;
returnWords
+=
" / "
+
productSum
+
" 件"
;
}
pickUpTime
=
DateUtil
.
addMinutes
(
new
Date
(
orderBean
.
getGmtAccept
()),
totalSumTime
).
getTime
();
Date
date
=
new
Date
(
pickUpTime
);
returnWords
+=
",预计 "
+
(
String
.
valueOf
(
date
.
getHours
()).
length
()
==
1
?
"0"
+
(
String
.
valueOf
(
date
.
getHours
()))
:
date
.
getHours
())
+
":"
+
(
String
.
valueOf
(
date
.
getMinutes
()).
length
()
==
1
?
"0"
+
(
String
.
valueOf
(
date
.
getMinutes
()))
:
date
.
getMinutes
())
+
" 可取餐"
;
//制餐进度(当前时间-接单时间)/总时长(制餐时长)x100%
BigDecimal
progressB
=
new
BigDecimal
(
DateUtil
.
diffMinute
(
new
Date
(
orderBean
.
getGmtAccept
()),
new
Date
())).
divide
(
new
BigDecimal
(
totalSumTime
),
2
,
BigDecimal
.
ROUND_HALF_UP
);
progress
=
progressB
.
compareTo
(
new
BigDecimal
(
1
))
==
1
?
"100"
:
progressB
.
multiply
(
new
BigDecimal
(
100
)).
toString
();
}
}
pickUpTime
=
DateUtil
.
addMinutes
(
new
Date
(
orderBean
.
getGmtAccept
()),
totalSumTime
).
getTime
();
Date
date
=
new
Date
(
pickUpTime
);
returnWords
+=
",预计 "
+
(
String
.
valueOf
(
date
.
getHours
()).
length
()
==
1
?
"0"
+
(
String
.
valueOf
(
date
.
getHours
()))
:
date
.
getHours
())
+
":"
+
(
String
.
valueOf
(
date
.
getMinutes
()).
length
()
==
1
?
"0"
+
(
String
.
valueOf
(
date
.
getMinutes
()))
:
date
.
getMinutes
())
+
" 可取餐"
;
//制餐进度(当前时间-接单时间)/总时长(制餐时长)x100%
BigDecimal
progressB
=
new
BigDecimal
(
DateUtil
.
diffMinute
(
new
Date
(
orderBean
.
getGmtAccept
()),
new
Date
())).
divide
(
new
BigDecimal
(
totalSumTime
),
2
,
BigDecimal
.
ROUND_HALF_UP
);
progress
=
progressB
.
compareTo
(
new
BigDecimal
(
1
))
==
1
?
"100"
:
progressB
.
multiply
(
new
BigDecimal
(
100
)).
toString
();
}
}
}
}
}
catch
(
Exception
e
)
{
log
.
error
(
"get returnWords error :{},StoreResponse.Configuration:{}"
,
e
.
getMessage
(),
JSONObject
.
toJSONString
(
configuration
));
}
}
}
catch
(
Exception
e
)
{
log
.
error
(
"get returnWords error :{},StoreResponse.Configuration:{}"
,
e
.
getMessage
(),
JSONObject
.
toJSONString
(
configuration
));
}
}
}
}
}
}
...
...
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