Commit b7387336 by 徐康

创建订单时间check修改

parent 2b2e8d88
...@@ -98,6 +98,7 @@ public class CreateOrderVo { ...@@ -98,6 +98,7 @@ public class CreateOrderVo {
/** /**
* 预约时间 格式yyyy-MM-dd HH:mm:ss * 预约时间 格式yyyy-MM-dd HH:mm:ss
* 麦咖啡返回的是yyyy-MM-dd HH:mm
*/ */
private String expectTime; private String expectTime;
......
...@@ -230,6 +230,7 @@ public class CheckMCCafeOrder { ...@@ -230,6 +230,7 @@ public class CheckMCCafeOrder {
if (!StoreConstant.BUSINESS.equals(storeResponseDto.getState())) { if (!StoreConstant.BUSINESS.equals(storeResponseDto.getState())) {
throw new ServiceException(ResponseResult.STORE_ITEM_CHECK_CLOSE); throw new ServiceException(ResponseResult.STORE_ITEM_CHECK_CLOSE);
} }
createOrderVo.setExpectTime(null);
// 校验下单时间是否在营业时间内 // 校验下单时间是否在营业时间内
checkOrderExpectTime(storeResponseDto, now); checkOrderExpectTime(storeResponseDto, now);
// 外卖单选择立即送达的话,下单时间必须在店铺外卖时间内 // 外卖单选择立即送达的话,下单时间必须在店铺外卖时间内
...@@ -273,9 +274,13 @@ public class CheckMCCafeOrder { ...@@ -273,9 +274,13 @@ public class CheckMCCafeOrder {
else if(CreateOrderType.TAKE_OUT.getCode().equals(createOrderVo.getOrderType()) && StringUtils.isNotBlank(expectTime)) { else if(CreateOrderType.TAKE_OUT.getCode().equals(createOrderVo.getOrderType()) && StringUtils.isNotBlank(expectTime)) {
Date takeOutDateTime = null; Date takeOutDateTime = null;
try { try {
takeOutDateTime = sdf.parse(createOrderVo.getExpectTime()); takeOutDateTime = sdf.parse(createOrderVo.getExpectTime()+":00");
} catch (ParseException e) { } catch (ParseException e) {
throw new ServiceException(ResponseResult.ORDER_TAKE_OUT_TIME_ERROR); try {
takeOutDateTime = sdf.parse(createOrderVo.getExpectTime());
} catch (ParseException parseException) {
throw new ServiceException(ResponseResult.ORDER_TAKE_OUT_TIME_ERROR);
}
} }
//当顾客指定送达时间小于当前时间,订单记录类型为即时单 //当顾客指定送达时间小于当前时间,订单记录类型为即时单
......
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