From 6b057bca919a2ef0b7e9e428f20cd75dc06eb7d5 Mon Sep 17 00:00:00 2001 From: Burce Date: Thu, 12 Sep 2019 14:54:09 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=E4=BC=9A=E5=91=98=E7=94=9F?= =?UTF-8?q?=E6=97=A5=EF=BC=8C=E6=B5=8B=E8=AF=95=E4=BB=BB=E5=8A=A1=E6=89=A7?= =?UTF-8?q?=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/market/WxCouponSendController.java | 12 +++++++++--- .../com/iformall/schedule/CouponSendSchedule.java | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponSendController.java b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponSendController.java index 14f835b34..581116528 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponSendController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponSendController.java @@ -77,11 +77,17 @@ public class WxCouponSendController extends BaseController { @ApiImplicitParam(name = "sendType", value = "注券类型(生日券=8)", dataType = "int", paramType = "query", required = true), }) @SystemControllerLog(description = "注券-添加或更新配置") - public ResultData addConfig(@NotNull Integer beforeDays, @NotNull Integer sendType) { + public ResultData addConfig(Integer beforeDays, Integer sendType) { if(!Objects.equals(sendType,EnumCouponSendSendType.BIRTHDAY.getCode())) { return new ResultData(ErrorCode.COUPON_VALID_NOT_SUPPORTED); } - wxCouponSendService.saveOrUpdateConfig(beforeDays, sendType, getTenantId()); + try { + wxCouponSendService.saveOrUpdateConfig(beforeDays, sendType, getTenantId()); + } catch (MallinkException e) { + return new ResultData(e.getErrorCode(), e.getMessage()); + } catch (Exception e) { + return new ResultData(ErrorCode.SYS_PARAMETER_ERROR, e.getMessage()); + } return new ResultData(); } @@ -90,7 +96,7 @@ public class WxCouponSendController extends BaseController { @ApiImplicitParams({ @ApiImplicitParam(name = "sendType", value = "注券类型(生日券=8)", dataType = "int", paramType = "query", required = true)}) @SystemControllerLog(description = "注券-获取配置") - public ResultData getConfig(@NotNull Integer sendType) { + public ResultData getConfig(Integer sendType) { WxCouponSend wxCouponSend = wxCouponSendService.getConfig(sendType, getTenantId()); return new ResultData(Objects.isNull(wxCouponSend) ? null : wxCouponSend.getConditions()); } diff --git a/mallinkSchedule/src/main/java/com/iformall/schedule/CouponSendSchedule.java b/mallinkSchedule/src/main/java/com/iformall/schedule/CouponSendSchedule.java index 05c4ee3c4..2a5c0a9ff 100644 --- a/mallinkSchedule/src/main/java/com/iformall/schedule/CouponSendSchedule.java +++ b/mallinkSchedule/src/main/java/com/iformall/schedule/CouponSendSchedule.java @@ -211,7 +211,7 @@ public class CouponSendSchedule { /** * 生日券发放 */ - @Scheduled(cron = "0 30 14 * * ?") // 测试每天8:30点发券 + @Scheduled(cron = "0 30 15 * * ?") // 测试每天8:30点发券 public void birthdayCouponSendSchedule() { logger.info("生日发券: 任务开始"); List mallList = wxMallMapper.findList(new WxMall());