release: 限制抽奖只能关联一个城市

release-2024-04-25
huangyw 1 month ago
parent df5909ba97
commit 00b085b460

@ -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 = "今日已签到";

@ -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);

Loading…
Cancel
Save