From d867037369ed9b569df3d1f2f70b8cd5c64c2e68 Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Wed, 26 Jun 2019 16:51:53 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=88=B8=E6=8A=95=E6=94=BE][=E4=BF=AE?= =?UTF-8?q?=E6=94=B9]:=E4=BF=AE=E6=94=B9=E6=8F=90=E7=A4=BA=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/iformall/controller/WxOrderController.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxOrderController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxOrderController.java index 5e2586286..8102b3f55 100644 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxOrderController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxOrderController.java @@ -57,6 +57,10 @@ public class WxOrderController extends BaseController { return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId不能为空"); } WxCouponChannel wxCouponChannel = wxCouponChannelService.getById(orderSaveDto.getCouponChannelId()); + if (wxCouponChannel == null) { + logger.error("couponChannelId find error, " + orderSaveDto.getCouponChannelId()); + return new ResultData(ErrorCode.COUPON_CHANNEL_IS_TAKE_OFF); + } ResultData resultData = couponChannelCheck(orderSaveDto, wxCouponChannel); if (resultData != null) return resultData; @@ -122,11 +126,6 @@ public class WxOrderController extends BaseController { } private ResultData couponChannelCheck(@RequestBody OrderSaveDto orderSaveDto, WxCouponChannel wxCouponChannel) { - if (wxCouponChannel == null) { - logger.error("couponChannelId convert error, " + orderSaveDto.getCouponChannelId()); - return new ResultData(ErrorCode.SYS_PARAMETER_CAST_ERROR); - } - if (wxCouponChannel.getTargetAd().equals(EnumCouponChannelType.COUPON_CHANNEL_ID_TIMED.getCode())) { Date now = new Date(); if (wxCouponChannel.getBeginTime().getTime() > now.getTime()) {