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
e9a97813
Commit
e9a97813
authored
Aug 03, 2021
by
周晓航
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
预约单配置校验
Signed-off-by: 周晓航 <xiaohang.zhou@freemud.com>
parent
cd292c3a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
28 deletions
+45
-28
order-application-service/src/main/java/cn/freemud/service/adapter/OrderCheckAdapter.java
+7
-8
order-application-service/src/main/java/cn/freemud/service/impl/CheckOrder.java
+38
-20
No files found.
order-application-service/src/main/java/cn/freemud/service/adapter/OrderCheckAdapter.java
View file @
e9a97813
...
@@ -3,7 +3,6 @@ package cn.freemud.service.adapter;
...
@@ -3,7 +3,6 @@ package cn.freemud.service.adapter;
import
cn.freemud.entities.vo.CreateOrderBaseVo
;
import
cn.freemud.entities.vo.CreateOrderBaseVo
;
import
cn.freemud.entities.vo.CreateOrderVo
;
import
cn.freemud.entities.vo.CreateOrderVo
;
import
com.freemud.application.sdk.api.ordercenter.enums.BizTypeEnum
;
import
cn.freemud.interceptor.ServiceException
;
import
cn.freemud.interceptor.ServiceException
;
import
cn.freemud.utils.AppLogUtil
;
import
cn.freemud.utils.AppLogUtil
;
import
com.freemud.application.sdk.api.storecenter.response.StoreResponse
;
import
com.freemud.application.sdk.api.storecenter.response.StoreResponse
;
...
@@ -26,13 +25,13 @@ public class OrderCheckAdapter {
...
@@ -26,13 +25,13 @@ public class OrderCheckAdapter {
* @throws ServiceException 抛出异常校验异常数据
* @throws ServiceException 抛出异常校验异常数据
*/
*/
public
static
void
check
(
CreateOrderVo
vo
,
StoreResponse
storeResponse
)
throws
ServiceException
{
public
static
void
check
(
CreateOrderVo
vo
,
StoreResponse
storeResponse
)
throws
ServiceException
{
// fisherman-ka 预定单的校验 未完成
// fisherman-ka 预定单的校验 未完成
--> 这里移动了位置
if
(
Objects
.
nonNull
(
vo
.
getBizType
())
//
if (Objects.nonNull(vo.getBizType())
&&
BizTypeEnum
.
ADVANCE_ORDER
.
getBizType
().
compareTo
(
vo
.
getBizType
())
==
0
)
{
//
&& BizTypeEnum.ADVANCE_ORDER.getBizType().compareTo(vo.getBizType()) == 0) {
// 伪代码 判断 门店是否开启了 预定单服务
//
// 伪代码 判断 门店是否开启了 预定单服务
// 开启了预定单服务, 不走下面的检验
//
// 开启了预定单服务, 不走下面的检验
// 没开启 抛出异常
//
// 没开启 抛出异常
}
//
}
//非预约单的过滤
//非预约单的过滤
if
(
Objects
.
isNull
(
vo
.
getOrderType
())
||
if
(
Objects
.
isNull
(
vo
.
getOrderType
())
||
(!
Objects
.
equals
(
vo
.
getTakeMealFlag
(),
"1"
)))
{
(!
Objects
.
equals
(
vo
.
getTakeMealFlag
(),
"1"
)))
{
...
...
order-application-service/src/main/java/cn/freemud/service/impl/CheckOrder.java
View file @
e9a97813
...
@@ -296,28 +296,11 @@ public class CheckOrder {
...
@@ -296,28 +296,11 @@ public class CheckOrder {
checkTakeOutTime
(
storeResponseDto
,
new
Date
(),
new
Date
(),
true
);
checkTakeOutTime
(
storeResponseDto
,
new
Date
(),
new
Date
(),
true
);
}
}
}
}
//有预约时间
if
(
StringUtils
.
isNotBlank
(
takeMealTimes
)
||
StringUtils
.
isNotBlank
(
createOrderVo
.
getExpectTime
()))
{
// 设置预约时间
Date
takeMealDateTime
=
getOrderExpectTime
(
takeMealFlag
,
takeMealTimes
,
createOrderVo
.
getExpectTime
(),
CreateOrderType
.
getByCode
(
createOrderVo
.
getOrderType
()),
storeResponseDto
.
getServiceTime
(),
storeResponseDto
);
if
(
takeMealDateTime
!=
null
)
{
//校验预约时间 -->
if
(!
isAdvanceOrder
)
{
checkOrderExpectTime
(
createOrderVo
,
storeResponseDto
,
takeMealDateTime
);
}
else
{
//fisherman-ka 预定单校验是否在预计开业时间范围内, 2. 校验 营业结束前十分钟,不允许下预约单(上面有代码,可以复用)
// checkAdvanceOrderExpectTime();
}
//重新赋值为yyyy-MM-dd HH:mm:ss格式字符串时间
createOrderVo
.
setExpectTime
(
DateUtil
.
convert2String
(
takeMealDateTime
,
"yyyy-MM-dd HH:mm:ss"
));
}
}
String
appId
=
userLoginInfoDto
.
getWxAppId
();
// 校验小程序是否支持到店或者外卖
// 校验小程序是否支持到店或者外卖
String
appId
=
userLoginInfoDto
.
getWxAppId
();
AssortmentOpenPlatformIappWxappConfig
config
=
openPlatformIappWxappConfigManager
.
selectIappWxappConfigByWxAppId
(
appId
);
AssortmentOpenPlatformIappWxappConfig
config
=
openPlatformIappWxappConfigManager
.
selectIappWxappConfigByWxAppId
(
appId
);
// 自提校验
// 自提校验
BusinessInfoDto
businessInfoDto
=
null
;
if
(
CreateOrderType
.
COLLECT_GOODS
.
getCode
().
equals
(
createOrderVo
.
getOrderType
()))
{
if
(
CreateOrderType
.
COLLECT_GOODS
.
getCode
().
equals
(
createOrderVo
.
getOrderType
()))
{
if
(
config
==
null
||
config
.
getTakeInside
()
==
null
||
config
.
getTakeInside
()
!=
1
)
{
if
(
config
==
null
||
config
.
getTakeInside
()
==
null
||
config
.
getTakeInside
()
!=
1
)
{
throw
new
ServiceException
(
ResponseResult
.
ORDER_WXAPP_NOT_ENABLE_COLLECT_GOODS
);
throw
new
ServiceException
(
ResponseResult
.
ORDER_WXAPP_NOT_ENABLE_COLLECT_GOODS
);
...
@@ -326,7 +309,7 @@ public class CheckOrder {
...
@@ -326,7 +309,7 @@ public class CheckOrder {
throw
new
ServiceException
(
ResponseResult
.
STORE_NOT_ENABLE_COLLECT_GOODS
);
throw
new
ServiceException
(
ResponseResult
.
STORE_NOT_ENABLE_COLLECT_GOODS
);
}
}
//扫桌码下单开关判断
//扫桌码下单开关判断
BusinessInfoDto
businessInfoDto
=
queryBusinessInfoNew
(
createOrderVo
);
businessInfoDto
=
this
.
queryBusinessInfoNew
(
createOrderVo
);
if
(
businessInfoDto
!=
null
&&
businessInfoDto
.
getExpandFields
()
!=
null
if
(
businessInfoDto
!=
null
&&
businessInfoDto
.
getExpandFields
()
!=
null
&&
ScanOrderSwitchEnum
.
TRUE
.
getCode
().
equals
(
businessInfoDto
.
getExpandFields
().
getScanOrderSwitch
())
&&
ScanOrderSwitchEnum
.
TRUE
.
getCode
().
equals
(
businessInfoDto
.
getExpandFields
().
getScanOrderSwitch
())
&&
StringUtils
.
isBlank
(
createOrderVo
.
getTableNumber
())){
&&
StringUtils
.
isBlank
(
createOrderVo
.
getTableNumber
())){
...
@@ -335,6 +318,27 @@ public class CheckOrder {
...
@@ -335,6 +318,27 @@ public class CheckOrder {
createOrderVo
.
setUserName
(
userLoginInfoDto
.
getNickName
());
createOrderVo
.
setUserName
(
userLoginInfoDto
.
getNickName
());
createOrderVo
.
setMobile
(
userLoginInfoDto
.
getMobile
());
createOrderVo
.
setMobile
(
userLoginInfoDto
.
getMobile
());
}
}
//有预约时间
if
(
StringUtils
.
isNotBlank
(
takeMealTimes
)
||
StringUtils
.
isNotBlank
(
createOrderVo
.
getExpectTime
()))
{
// 设置预约时间
Date
takeMealDateTime
=
getOrderExpectTime
(
takeMealFlag
,
takeMealTimes
,
createOrderVo
.
getExpectTime
(),
CreateOrderType
.
getByCode
(
createOrderVo
.
getOrderType
()),
storeResponseDto
.
getServiceTime
(),
storeResponseDto
);
if
(
takeMealDateTime
!=
null
)
{
//校验预约时间 -->
if
(!
isAdvanceOrder
)
{
checkOrderExpectTime
(
createOrderVo
,
storeResponseDto
,
takeMealDateTime
);
}
else
{
//fisherman-ka 预定单校验是否在预计开业时间范围内, 2. 校验 营业结束前十分钟,不允许下预约单(上面有代码,可以复用)
if
(
Objects
.
isNull
(
businessInfoDto
))
{
businessInfoDto
=
this
.
queryBusinessInfoNew
(
createOrderVo
);
}
this
.
checkAdvanceOrderExpectTime
(
businessInfoDto
);
}
//重新赋值为yyyy-MM-dd HH:mm:ss格式字符串时间
createOrderVo
.
setExpectTime
(
DateUtil
.
convert2String
(
takeMealDateTime
,
"yyyy-MM-dd HH:mm:ss"
));
}
}
// 校验外卖信息
// 校验外卖信息
if
(
CreateOrderType
.
TAKE_OUT
.
getCode
().
equals
(
createOrderVo
.
getOrderType
()))
{
if
(
CreateOrderType
.
TAKE_OUT
.
getCode
().
equals
(
createOrderVo
.
getOrderType
()))
{
if
(
config
==
null
||
config
.
getTakeaway
()
==
null
||
config
.
getTakeaway
()
==
0
)
{
if
(
config
==
null
||
config
.
getTakeaway
()
==
null
||
config
.
getTakeaway
()
==
0
)
{
...
@@ -396,6 +400,20 @@ public class CheckOrder {
...
@@ -396,6 +400,20 @@ public class CheckOrder {
}
}
/**
/**
* 预定单的 额外校验:
* 是否支持预定单
* 预定单校验是否在预计开业时间范围内,
* 营业结束前十分钟,不允许下预约单(上面有代码,可以复用)
* @param queryBusinessInfoNew
*/
private
void
checkAdvanceOrderExpectTime
(
BusinessInfoDto
queryBusinessInfoNew
)
{
// fisherman-ka 预定单的校验 未完成
// 伪代码 判断 门店是否开启了 预定单服务
// 开启了预定单服务, 不走下面的检验
// 没开启 抛出异常
}
/**
* 是否是 预定单
* 是否是 预定单
* @param bizType=7 就是预定单
* @param bizType=7 就是预定单
* @return true 预定单
* @return true 预定单
...
...
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