Commit f3d0c7ca by 徐康

bug fix 营业时间判断错误

parent b7387336
...@@ -267,7 +267,7 @@ public class CheckMCCafeOrder { ...@@ -267,7 +267,7 @@ public class CheckMCCafeOrder {
//重新赋值为yyyy-MM-dd HH:mm:ss格式字符串时间 //重新赋值为yyyy-MM-dd HH:mm:ss格式字符串时间
createOrderVo.setExpectTime(DateUtil.convert2String(takeMealDateTime, "yyyy-MM-dd HH:mm:ss")); createOrderVo.setExpectTime(DateUtil.convert2String(takeMealDateTime, "yyyy-MM-dd HH:mm:ss"));
} else { } else {
throw new ServiceException(ResponseResult.ORDER_TAKE_MEAL_TIME_ERROR); createOrderVo.setExpectTime(null);
} }
} }
//有预约时间的外卖单 //有预约时间的外卖单
...@@ -300,7 +300,7 @@ public class CheckMCCafeOrder { ...@@ -300,7 +300,7 @@ public class CheckMCCafeOrder {
//重新赋值为yyyy-MM-dd HH:mm:ss格式字符串时间 //重新赋值为yyyy-MM-dd HH:mm:ss格式字符串时间
createOrderVo.setExpectTime(DateUtil.convert2String(takeOutDateTime, "yyyy-MM-dd HH:mm:ss")); createOrderVo.setExpectTime(DateUtil.convert2String(takeOutDateTime, "yyyy-MM-dd HH:mm:ss"));
} else { } else {
throw new ServiceException(ResponseResult.ORDER_TAKE_OUT_TIME_ERROR); createOrderVo.setExpectTime(null);
} }
} else { } else {
throw new ServiceException(ResponseResult.ORDER_MEALTIME_MISSING); throw new ServiceException(ResponseResult.ORDER_MEALTIME_MISSING);
...@@ -378,7 +378,14 @@ public class CheckMCCafeOrder { ...@@ -378,7 +378,14 @@ public class CheckMCCafeOrder {
String startDateTimeStr = DateUtil.convert2String(date, DateUtil.FORMAT_YMD) + " " + businessHours[0] + ":00"; String startDateTimeStr = DateUtil.convert2String(date, DateUtil.FORMAT_YMD) + " " + businessHours[0] + ":00";
String endDateTimeStr = DateUtil.convert2String(date, DateUtil.FORMAT_YMD) + " " + businessHours[1] + ":00"; String endDateTimeStr = DateUtil.convert2String(date, DateUtil.FORMAT_YMD) + " " + businessHours[1] + ":00";
Date startDateTime = DateUtil.convert2Date(startDateTimeStr, DateUtil.FORMAT_YYYY_MM_DD_HHMMSS); Date startDateTime = DateUtil.convert2Date(startDateTimeStr, DateUtil.FORMAT_YYYY_MM_DD_HHMMSS);
Date endDateTime = DateUtil.convert2Date(endDateTimeStr, DateUtil.FORMAT_YYYY_MM_DD_HHMMSS); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
sdf.setLenient(true);
Date endDateTime = null;
try {
endDateTime = sdf.parse(endDateTimeStr);
} catch (ParseException e) {
endDateTime = null;
}
if(null == startDateTime || null == endDateTime) { if(null == startDateTime || null == endDateTime) {
if(1 == dateType) { if(1 == dateType) {
throw new ServiceException(ResponseResult.STORE_BUSINESS_HOUR_ERROR); throw new ServiceException(ResponseResult.STORE_BUSINESS_HOUR_ERROR);
...@@ -526,47 +533,6 @@ public class CheckMCCafeOrder { ...@@ -526,47 +533,6 @@ public class CheckMCCafeOrder {
//加价购商品 校验放购物车校验 //加价购商品 校验放购物车校验
requestDto.setPremiumExchangeActivity(createOrderVo.getPremiumExchangeActivity()); requestDto.setPremiumExchangeActivity(createOrderVo.getPremiumExchangeActivity());
cn.freemud.base.entity.BaseResponse<ShoppingCartGoodsDto> apportionResponse = shoppingCartClient.getMCCafeShoppingCartGoodsApportionNew(requestDto); cn.freemud.base.entity.BaseResponse<ShoppingCartGoodsDto> apportionResponse = shoppingCartClient.getMCCafeShoppingCartGoodsApportionNew(requestDto);
//暂时写死测试数据
// cn.freemud.base.entity.BaseResponse<ShoppingCartGoodsDto> apportionResponse = JSON.parseObject(
// "{\n" +
// " \"code\": \"100\",\n" +
// " \"message\": \"success\",\n" +
// " \"result\": {\n" +
// " \"activityDiscountsDtos\": [],\n" +
// " \"isDiscountDelivery\": false,\n" +
// " \"originalTotalAmount\": 1,\n" +
// " \"products\": [\n" +
// " {\n" +
// " \"activityDiscountsDtos\": [],\n" +
// " \"attributeNames\": \"{\\\"attributeNames\\\":\\\"\\\"}\",\n" +
// " \"categoryName\": \"鞍山市\",\n" +
// " \"classificationId\": \"\",\n" +
// " \"customerCode\": \"4095\",\n" +
// " \"extraList\": [],\n" +
// " \"hasProductCoupon\": false,\n" +
// " \"materialList\": [],\n" +
// " \"originalPrice\": 1,\n" +
// " \"picture\": \"https://img10.sandload.cn/zfd0x0.jpg?timestamp=1593831027040\",\n" +
// " \"qty\": 1,\n" +
// " \"skuId\": \"162535232231270663\",\n" +
// " \"skuName\": \"鱿鱼须把把串\",\n" +
// " \"spuId\": \"162535232231270663\",\n" +
// " \"spuName\": \"鱿鱼须把把串\",\n" +
// " \"stockLimit\": false,\n" +
// " \"totalDiscountAmount\": 0,\n" +
// " \"unit\": \"g\",\n" +
// " \"weight\": 0,\n" +
// " \"tax\": 10\n" +
// " }\n" +
// " ],\n" +
// " \"reduceScore\": 0,\n" +
// " \"scoreReduceAmount\": 0,\n" +
// " \"totalAmount\": 1,\n" +
// " \"totalDiscountAmount\": 0\n" +
// " },\n" +
// " \"ver\": \"1\"\n" +
// "}", new TypeReference<cn.freemud.base.entity.BaseResponse<ShoppingCartGoodsDto>>(){}
// );
if (!ObjectUtils.equals(ResponseCodeConstant.RESPONSE_SUCCESS_STR, apportionResponse.getCode())) { if (!ObjectUtils.equals(ResponseCodeConstant.RESPONSE_SUCCESS_STR, apportionResponse.getCode())) {
ResponseResult responseResult = ResponseResult.getResponseResult(apportionResponse.getCode()); ResponseResult responseResult = ResponseResult.getResponseResult(apportionResponse.getCode());
throw new ServiceException(responseResult != null ? responseResult : ResponseResult.SHOPPING_CART_GETINFO_ERROR ); throw new ServiceException(responseResult != null ? responseResult : ResponseResult.SHOPPING_CART_GETINFO_ERROR );
......
...@@ -633,7 +633,6 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService { ...@@ -633,7 +633,6 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService {
try { try {
UnifiedOrderRequest request = orderAdapter.convent2UnifiedOrderRequest(orderBean, paymentRequest, orderBean.getAmount(), cardAmount, transId); UnifiedOrderRequest request = orderAdapter.convent2UnifiedOrderRequest(orderBean, paymentRequest, orderBean.getAmount(), cardAmount, transId);
com.freemud.application.sdk.api.base.BaseResponse<UnifiedOrderResponse> responseBase = standardPaymentService.unifiedOrder(request, trackingNo); com.freemud.application.sdk.api.base.BaseResponse<UnifiedOrderResponse> responseBase = standardPaymentService.unifiedOrder(request, trackingNo);
log.error("支付SDK返回信息,trackingNo:{} request:{} response:{}", trackingNo, JSONObject.toJSONString(request), JSONObject.toJSONString(responseBase));
if (!ResponseCodeConstant.RESPONSE_SUCCESS_STR.equals(responseBase.getCode())) { if (!ResponseCodeConstant.RESPONSE_SUCCESS_STR.equals(responseBase.getCode())) {
log.error("支付SDK返回信息错误,trackingNo:{} request:{} response:{}", trackingNo, JSONObject.toJSONString(request), JSONObject.toJSONString(responseBase)); log.error("支付SDK返回信息错误,trackingNo:{} request:{} response:{}", trackingNo, JSONObject.toJSONString(request), JSONObject.toJSONString(responseBase));
return null; return null;
......
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