From 10817c01a0e600b69c192cb5352c4791834556cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=9D=BE?= <8605635+zhang3064194730@user.noreply.gitee.com> Date: Fri, 12 Sep 2025 13:46:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B6=85=E7=BA=A7=E4=BC=9A=E5=91=98=E8=B4=AD?= =?UTF-8?q?=E4=B9=B0=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/TbMemberConfigServiceImpl.java | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/cash-service/market-service/src/main/java/com/czg/service/market/service/impl/TbMemberConfigServiceImpl.java b/cash-service/market-service/src/main/java/com/czg/service/market/service/impl/TbMemberConfigServiceImpl.java index 320dfb9b..0ef4e817 100644 --- a/cash-service/market-service/src/main/java/com/czg/service/market/service/impl/TbMemberConfigServiceImpl.java +++ b/cash-service/market-service/src/main/java/com/czg/service/market/service/impl/TbMemberConfigServiceImpl.java @@ -7,6 +7,7 @@ import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONObject; import com.czg.constant.TableValueConstant; +import com.czg.exception.ApiNotPrintException; import com.czg.market.dto.MemberConfigDTO; import com.czg.market.dto.MemberLevelDTO; import com.czg.account.entity.*; @@ -16,7 +17,7 @@ import com.czg.market.service.MemberExpFlowService; import com.czg.market.service.MemberOrderService; import com.czg.market.vo.MemberConfigVO; import com.czg.market.vo.MemberLevelVO; -import com.czg.exception.CzgException; +import com.czg.exception.ApiNotPrintException; import com.czg.market.service.MemberLevelConfigService; import com.czg.market.service.TbMemberConfigService; import com.czg.order.service.OrderInfoService; @@ -98,14 +99,14 @@ public class TbMemberConfigServiceImpl extends ServiceImpl { if (item.getReward() == null && (item.getCouponList() == null || item.getCouponList().isEmpty())) { - throw new CzgException("方案列表中赠送成长值和赠送优惠券不能同时为空"); + throw new ApiNotPrintException("方案列表中赠送成长值和赠送优惠券不能同时为空"); } }); memberConfig.setConfigList(JSONObject.toJSONString(memberDTO.getConfigList())); @@ -113,14 +114,14 @@ public class TbMemberConfigServiceImpl extends ServiceImpl conditionList = CollUtil.newArrayList(conditionMap); memberDTO.getConditionList().forEach(item -> { if (!conditionMap.contains(item.getCode())) { - throw new CzgException("条件列表中code值错误"); + throw new ApiNotPrintException("条件列表中code值错误"); } }); // conditionList.forEach(item -> { @@ -139,21 +140,21 @@ public class TbMemberConfigServiceImpl extends ServiceImpl 0) { - throw new CzgException("会员等级名称已存在"); + throw new ApiNotPrintException("会员等级名称已存在"); } MemberLevelConfig lastConfig = levelConfigService.getOne(new QueryWrapper().eq(MemberLevelConfig::getShopId, shopId) .lt(MemberLevelConfig::getId, levelDTO.getId()) .limit(1).orderBy(MemberLevelConfig::getExperienceValue, true).ne(MemberLevelConfig::getId, levelDTO.getId())); if (lastConfig == null && levelDTO.getExperienceValue() > 0) { - throw new CzgException("1级时本字段必须为0"); + throw new ApiNotPrintException("1级时本字段必须为0"); } else if (lastConfig != null && levelDTO.getExperienceValue() <= lastConfig.getExperienceValue()) { - throw new CzgException("会员等级经验值必须大于上一等级经验值"); + throw new ApiNotPrintException("会员等级经验值必须大于上一等级经验值"); } if (levelDTO.getIsCycleReward() == 1) { if (levelDTO.getCycleRewardPoints() == null && (levelDTO.getCycleRewardCouponList() == null || levelDTO.getCycleRewardCouponList().isEmpty())) { - throw new CzgException("周期奖励成长值和优惠券不能同时为空"); + throw new ApiNotPrintException("周期奖励成长值和优惠券不能同时为空"); } ValidatorUtil.validateEntity(levelDTO, MemberLevelCycleRewardGroup.class); @@ -176,7 +177,7 @@ public class TbMemberConfigServiceImpl extends ServiceImpl new CzgException("会员等级不存在")); + Optional.ofNullable(levelConfig).orElseThrow(() -> new ApiNotPrintException("会员等级不存在")); checkLevelDto(shopId, levelDTO); BeanUtil.copyProperties(levelDTO, levelConfig); @@ -318,7 +319,7 @@ public class TbMemberConfigServiceImpl extends ServiceImpl