From 00b085b460c04b88158b08f5de229c0d7d6f360e Mon Sep 17 00:00:00 2001 From: huangyw <1207046171@qq.com> Date: Tue, 15 Oct 2024 11:16:07 +0800 Subject: [PATCH] =?UTF-8?q?release:=20=20=E9=99=90=E5=88=B6=E6=8A=BD?= =?UTF-8?q?=E5=A5=96=E5=8F=AA=E8=83=BD=E5=85=B3=E8=81=94=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E5=9F=8E=E5=B8=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/constants/ErrorConstants.java | 1 + .../java/com/luoo/user/service/LotteryService.java | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/luoo_common/src/main/java/constants/ErrorConstants.java b/luoo_common/src/main/java/constants/ErrorConstants.java index 2dd893a..269cb6c 100644 --- a/luoo_common/src/main/java/constants/ErrorConstants.java +++ b/luoo_common/src/main/java/constants/ErrorConstants.java @@ -61,6 +61,7 @@ public class ErrorConstants { public static final String DRAW_TIME_CANNOT_BE_BEFORE_APPLY_END_TIME = "开奖时间不能在报名结束时间之前"; public static final String APPLY_END_TIME_CANNOT_BE_BEFORE_APPLY_START_TIME = "报名结束时间不能在报名开始时间之前"; public static final String POINT_NOT_ENOUGH = "积分不足"; + public static final String ONLY_ONE_CITY = "只能填写一个城市"; // 积分部分 public static final String DAILY_SIGN_ALREADY = "今日已签到"; diff --git a/luoo_user/src/main/java/com/luoo/user/service/LotteryService.java b/luoo_user/src/main/java/com/luoo/user/service/LotteryService.java index b8805be..94895ab 100644 --- a/luoo_user/src/main/java/com/luoo/user/service/LotteryService.java +++ b/luoo_user/src/main/java/com/luoo/user/service/LotteryService.java @@ -136,6 +136,11 @@ public class LotteryService { throw new BizException(ErrorConstants.TICKET_CITY_IS_REQUIRED); } + // 只能填写一个城市 + if (lotteryRegionList.size() > 1) { + throw new BizException(ErrorConstants.ONLY_ONE_CITY); + } + Integer num = 0; for (LotteryRegion lotteryRegion : lotteryRegionList) { Region regionById = regionService.getRegionById(lotteryRegion.getRegionId()); @@ -207,6 +212,11 @@ public class LotteryService { throw new BizException(ErrorConstants.TICKET_CITY_IS_REQUIRED); } + // 只能填写一个城市 + if (lotteryRegionList.size() > 1) { + throw new BizException(ErrorConstants.ONLY_ONE_CITY); + } + Integer num = 0; lotteryRegionDao.deleteByLotteryId(id);