Commit de2348b5 by 徐康

Merge branch 'feature/20200727_麦咖啡p1v2支付券码路由' into qa

parents 375645d5 b7387336
......@@ -98,6 +98,7 @@ public class CreateOrderVo {
/**
* 预约时间 格式yyyy-MM-dd HH:mm:ss
* 麦咖啡返回的是yyyy-MM-dd HH:mm
*/
private String expectTime;
......
......@@ -230,6 +230,7 @@ public class CheckMCCafeOrder {
if (!StoreConstant.BUSINESS.equals(storeResponseDto.getState())) {
throw new ServiceException(ResponseResult.STORE_ITEM_CHECK_CLOSE);
}
createOrderVo.setExpectTime(null);
// 校验下单时间是否在营业时间内
checkOrderExpectTime(storeResponseDto, now);
// 外卖单选择立即送达的话,下单时间必须在店铺外卖时间内
......@@ -273,10 +274,14 @@ public class CheckMCCafeOrder {
else if(CreateOrderType.TAKE_OUT.getCode().equals(createOrderVo.getOrderType()) && StringUtils.isNotBlank(expectTime)) {
Date takeOutDateTime = null;
try {
takeOutDateTime = sdf.parse(createOrderVo.getExpectTime());
takeOutDateTime = sdf.parse(createOrderVo.getExpectTime()+":00");
} catch (ParseException e) {
try {
takeOutDateTime = sdf.parse(createOrderVo.getExpectTime());
} catch (ParseException parseException) {
throw new ServiceException(ResponseResult.ORDER_TAKE_OUT_TIME_ERROR);
}
}
//当顾客指定送达时间小于当前时间,订单记录类型为即时单
if (takeOutDateTime != null && takeOutDateTime.before(now)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment