From 346465630ccb49a8be798e2df3782784cc85b417 Mon Sep 17 00:00:00 2001 From: lifenlong Date: Wed, 30 Jun 2021 15:45:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0ResultCode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../passport/MemberBuyerController.java | 2 +- .../impl/order/OrderEveryDayTaskExecute.java | 3 +- .../java/cn/lili/common/enums/ResultCode.java | 52 ++++++++++++++++++- .../sms/impl/SmsUtilAliImplService.java | 5 +- .../base/generate/StoreTokenGenerate.java | 4 +- .../serviceimpl/ConnectServiceImpl.java | 4 +- .../goods/serviceimpl/BrandServiceImpl.java | 9 ++-- .../serviceimpl/GoodsSkuServiceImpl.java | 4 +- .../message/util/WechatAccessTokenUtil.java | 3 +- .../order/serviceimpl/OrderServiceImpl.java | 6 +-- .../modules/payment/kit/CashierSupport.java | 2 +- .../kit/plugin/alipay/AliPayPlugin.java | 2 +- .../kit/plugin/wechat/WechatPlugin.java | 2 +- .../CouponActivityServiceImpl.java | 3 +- .../serviceimpl/FullDiscountServiceImpl.java | 3 +- .../serviceimpl/MemberCouponServiceImpl.java | 6 +-- .../serviceimpl/SeckillApplyServiceImpl.java | 3 +- .../serviceimpl/LogisticsServiceImpl.java | 3 +- 18 files changed, 87 insertions(+), 29 deletions(-) diff --git a/buyer-api/src/main/java/cn/lili/controller/passport/MemberBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/passport/MemberBuyerController.java index a9981b3d..aeae60d6 100644 --- a/buyer-api/src/main/java/cn/lili/controller/passport/MemberBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/passport/MemberBuyerController.java @@ -66,7 +66,7 @@ public class MemberBuyerController { if (smsUtil.verifyCode(mobile, VerificationEnums.LOGIN, uuid, code)) { return ResultUtil.data(memberService.mobilePhoneLogin(mobile)); } else { - throw new ServiceException("验证码错误"); + throw new ServiceException(ResultCode.VERIFICATION_SMS_ERROR); } } diff --git a/consumer/src/main/java/cn/lili/timetask/handler/impl/order/OrderEveryDayTaskExecute.java b/consumer/src/main/java/cn/lili/timetask/handler/impl/order/OrderEveryDayTaskExecute.java index 223489e3..84c0cabc 100644 --- a/consumer/src/main/java/cn/lili/timetask/handler/impl/order/OrderEveryDayTaskExecute.java +++ b/consumer/src/main/java/cn/lili/timetask/handler/impl/order/OrderEveryDayTaskExecute.java @@ -3,6 +3,7 @@ package cn.lili.timetask.handler.impl.order; import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUtil; import cn.hutool.json.JSONUtil; +import cn.lili.common.enums.ResultCode; import cn.lili.common.exception.ServiceException; import cn.lili.modules.member.entity.dto.MemberEvaluationDTO; import cn.lili.modules.member.entity.enums.EvaluationGradeEnum; @@ -58,7 +59,7 @@ public class OrderEveryDayTaskExecute implements EveryDayExecute { //自动确认收货 OrderSetting orderSetting = JSONUtil.toBean(setting.getSettingValue(), OrderSetting.class); if (orderSetting == null) { - throw new ServiceException("系统配置异常"); + throw new ServiceException(ResultCode.ORDER_SETTING_ERROR); } //自动确认收货 diff --git a/framework/src/main/java/cn/lili/common/enums/ResultCode.java b/framework/src/main/java/cn/lili/common/enums/ResultCode.java index 26490d88..d0dec479 100644 --- a/framework/src/main/java/cn/lili/common/enums/ResultCode.java +++ b/framework/src/main/java/cn/lili/common/enums/ResultCode.java @@ -64,6 +64,7 @@ public enum ResultCode { GOODS_SKU_WEIGHT_ERROR(11010, "商品重量不能为负数"), GOODS_SKU_QUANTITY_ERROR(11011, "商品库存数量不能为负数"), GOODS_SKU_QUANTITY_NOT_ENOUGH(11011, "商品库存不足"), + MUST_HAVE_GOODS_SKU(11012,"规格必须要有一个!"), /** * 参数 @@ -92,6 +93,12 @@ public enum ResultCode { BRAND_DELETE_ERROR(14004, "品牌删除失败"), + BRAND_NAME_EXIST_ERROR(20002, "品牌名称重复!"), + + BRAND_USE_DISABLE_ERROR(20003, "当前品牌下存在分类不可禁用"), + + BRAND_NOT_EXIST(20004, "品牌不存在"), + /** * 用户 */ @@ -131,7 +138,9 @@ public enum ResultCode { USER_GRADE_IS_DEFAULT(20018, "会员等级为默认会员等级"), - DELETE_EXIST(2001, "无法重复收藏"), + DELETE_EXIST(20019, "无法重复收藏"), + + NOT_BINDING_USER(20020,"未绑定用户"), /** * 权限 @@ -201,6 +210,9 @@ public enum ResultCode { ORDER_CAN_NOT_CANCEL(31012, "当前订单状态不可取消"), + BATCH_DELIVER_ERROR(31013, "批量发货,文件读取失败"), + + /** * 支付 */ @@ -230,6 +242,7 @@ public enum ResultCode { CAN_NOT_RECHARGE_WALLET(32012, "不能使用余额进行充值"), + /** * 售后 */ @@ -290,6 +303,12 @@ public enum ResultCode { COUPON_EDIT_STATUS_ERROR(41004, "优惠券修改状态失败!"), + COUPON_RECEIVE_ERROR(41005, "当前优惠券状态不可领取"), + + COUPON_NUM_INSUFFICIENT_ERROR(41006, "优惠券剩余领取数量不足"), + + COUPON_NOT_EXIST(41007, "当前优惠券不存在"), + /** * 拼团 */ @@ -313,6 +332,10 @@ public enum ResultCode { PINTUAN_DELETE_ERROR(42010, "删除拼团活动失败"), + PINTUAN_JOIN_ERROR(42011, "不能参与自己发起的拼团活动!"), + + PINTUAN_LIMIT_NUM_ERROR(42012, "购买数量超过拼团活动限制数量!"), + /** * 满额活动 */ @@ -320,20 +343,35 @@ public enum ResultCode { FULL_DISCOUNT_EDIT_DELETE(43002, "删除满优惠活动成功"), + FULL_DISCOUNT_MODIFY_ERROR(43003,"当前编辑的满优惠活动已经开始或者已经结束,无法修改"), + /** * 直播 */ STODIO_GOODS_EXIST_ERROR(44001,"直播商品已存在"), + /** + * 秒杀 + */ + SECKILL_NOT_EXIST(45001,"当前参与的秒杀活动不存在!"), + + /** + * 优惠券活动 + */ + COUPON_ACTIVITY_START_TIME_ERROR(46001,"活动时间小于当前时间,不能进行编辑删除操作"), + /** * 店铺 */ + STORE_NOT_EXIST(50001, "此店铺不存在"), STORE_NAME_EXIST_ERROR(50002, "店铺名称已存在!"), STORE_APPLY_DOUBLE_ERROR(50003, "已有店铺,无需重复申请!"), + STORE_NOT_OPEN(50004, "该会员未开通店铺"), + /** * 结算单 */ @@ -380,6 +418,7 @@ public enum ResultCode { */ SMS_SIGN_EXIST_ERROR(80001, "短信签名已存在"), + /** * 站内信 */ @@ -414,6 +453,13 @@ public enum ResultCode { ALIPAY_PARAMS_EXCEPTION(80403, "支付宝参数异常"), + LOGISTICS_NOT_SETTING(80404,"您还未配置快递查询"), + + ORDER_SETTING_ERROR(80405,"系统订单配置异常"), + + ALI_SMS_SETTING_ERROR(80406,"您还未配置阿里云短信"), + + /** * 微信相关异常 */ @@ -425,6 +471,10 @@ public enum ResultCode { WECHAT_MP_MESSAGE_ERROR(80503, "微信小程序小消息订阅异常"), + WECHAT_JSAPI_SIGN_ERROR(80504,"微信JsApi签名异常"), + + WECHAT_CERT_ERROR(80505,"证书获取失败"), + APP_VERSION_EXIST(80600, "APP版本已存在"); private final Integer code; diff --git a/framework/src/main/java/cn/lili/common/sms/impl/SmsUtilAliImplService.java b/framework/src/main/java/cn/lili/common/sms/impl/SmsUtilAliImplService.java index 70bef42a..2b9bf7d1 100644 --- a/framework/src/main/java/cn/lili/common/sms/impl/SmsUtilAliImplService.java +++ b/framework/src/main/java/cn/lili/common/sms/impl/SmsUtilAliImplService.java @@ -4,6 +4,7 @@ import cn.hutool.core.util.StrUtil; import cn.hutool.json.JSONUtil; import cn.lili.common.cache.Cache; import cn.lili.common.cache.CachePrefix; +import cn.lili.common.enums.ResultCode; import cn.lili.common.exception.ServiceException; import cn.lili.common.security.context.UserContext; import cn.lili.common.sms.AliSmsUtil; @@ -64,7 +65,7 @@ public class SmsUtilAliImplService implements SmsUtil, AliSmsUtil { //获取短信配置 Setting setting = settingService.get(SettingEnum.SMS_SETTING.name()); if (StrUtil.isBlank(setting.getSettingValue())) { - throw new ServiceException("您还未配置阿里云短信"); + throw new ServiceException(ResultCode.ALI_SMS_SETTING_ERROR); } SmsSetting smsSetting = new Gson().fromJson(setting.getSettingValue(), SmsSetting.class); @@ -351,7 +352,7 @@ public class SmsUtilAliImplService implements SmsUtil, AliSmsUtil { try { Setting setting = settingService.get(SettingEnum.SMS_SETTING.name()); if (StrUtil.isBlank(setting.getSettingValue())) { - throw new ServiceException("您还未配置阿里云短信"); + throw new ServiceException(ResultCode.ALI_SMS_SETTING_ERROR); } SmsSetting smsSetting = new Gson().fromJson(setting.getSettingValue(), SmsSetting.class); diff --git a/framework/src/main/java/cn/lili/common/token/base/generate/StoreTokenGenerate.java b/framework/src/main/java/cn/lili/common/token/base/generate/StoreTokenGenerate.java index cf1a45f6..28b94c86 100644 --- a/framework/src/main/java/cn/lili/common/token/base/generate/StoreTokenGenerate.java +++ b/framework/src/main/java/cn/lili/common/token/base/generate/StoreTokenGenerate.java @@ -1,5 +1,6 @@ package cn.lili.common.token.base.generate; +import cn.lili.common.enums.ResultCode; import cn.lili.common.exception.ServiceException; import cn.lili.common.security.AuthUser; import cn.lili.common.security.enums.UserEnums; @@ -19,7 +20,6 @@ import org.springframework.stereotype.Component; * * @author Chopper * @version v4.0 - * @Description: * @since 2020/11/16 10:51 */ @Component @@ -36,7 +36,7 @@ public class StoreTokenGenerate extends AbstractTokenGenerate { //生成token Member member = memberService.findByUsername(username); if (!member.getHaveStore()) { - throw new ServiceException("该会员未开通店铺"); + throw new ServiceException(ResultCode.STORE_NOT_OPEN); } AuthUser user = new AuthUser(member.getUsername(), member.getId(), member.getNickName(), UserEnums.STORE); LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); diff --git a/framework/src/main/java/cn/lili/modules/connect/serviceimpl/ConnectServiceImpl.java b/framework/src/main/java/cn/lili/modules/connect/serviceimpl/ConnectServiceImpl.java index e56dae7a..4976dafe 100644 --- a/framework/src/main/java/cn/lili/modules/connect/serviceimpl/ConnectServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/connect/serviceimpl/ConnectServiceImpl.java @@ -108,11 +108,11 @@ public class ConnectServiceImpl extends ServiceImpl impl CookieUtil.addCookie(CONNECT_TYPE, type, 1800, ThreadContextHolder.getHttpResponse()); //自动登录失败,则把信息缓存起来 cache.put(ConnectService.cacheKey(type, uuid), authUser, 30L, TimeUnit.MINUTES); - throw new ServiceException("未绑定用户"); + throw new ServiceException(ResultCode.NOT_BINDING_USER); } } catch (Exception e) { log.error("联合登陆异常:", e); - throw new ServiceException("未知错误,请稍后重试"); + throw new ServiceException(ResultCode.ERROR); } return token; } diff --git a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/BrandServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/BrandServiceImpl.java index ebff552a..0a6f394a 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/BrandServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/BrandServiceImpl.java @@ -1,5 +1,6 @@ package cn.lili.modules.goods.serviceimpl; +import cn.lili.common.enums.ResultCode; import cn.lili.common.exception.ServiceException; import cn.lili.common.utils.PageUtil; import cn.lili.modules.goods.entity.dos.Brand; @@ -62,7 +63,7 @@ public class BrandServiceImpl extends ServiceImpl implements public boolean addBrand(BrandVO brandVO) { if (getOne(new LambdaQueryWrapper().eq(Brand::getName, brandVO.getName())) != null) { - throw new ServiceException("品牌名称重复!"); + throw new ServiceException(ResultCode.BRAND_NAME_EXIST_ERROR); } return this.save(brandVO); } @@ -71,7 +72,7 @@ public class BrandServiceImpl extends ServiceImpl implements public boolean updateBrand(BrandVO brandVO) { this.checkExist(brandVO.getId()); if (getOne(new LambdaQueryWrapper().eq(Brand::getName, brandVO.getName()).ne(Brand::getId, brandVO.getId())) != null) { - throw new ServiceException("品牌名称重复!"); + throw new ServiceException(ResultCode.BRAND_NAME_EXIST_ERROR); } return this.updateById(brandVO); } @@ -80,7 +81,7 @@ public class BrandServiceImpl extends ServiceImpl implements public boolean brandDisable(String brandId, boolean disable) { Brand brand = this.checkExist(brandId); if (Boolean.TRUE.equals(disable) && !categoryBrandService.getCategoryBrandListByBrandId(brandId).isEmpty()) { - throw new ServiceException("当前品牌下存在分类不可禁用"); + throw new ServiceException(ResultCode.BRAND_USE_DISABLE_ERROR); } brand.setDeleteFlag(disable); return updateById(brand); @@ -90,7 +91,7 @@ public class BrandServiceImpl extends ServiceImpl implements Brand brand = getById(brandId); if (brand == null) { log.error("品牌ID为" + brandId + "的品牌不存在"); - throw new ServiceException(); + throw new ServiceException(ResultCode.BRAND_NOT_EXIST); } return brand; } diff --git a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java index adfcb2c9..78ee307f 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java @@ -96,7 +96,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl i // 添加商品sku newSkuList = this.addGoodsSku(skuList, goods); } else { - throw new ServiceException("规格必须要有一个!"); + throw new ServiceException(ResultCode.MUST_HAVE_GOODS_SKU); } this.updateStock(newSkuList); @@ -107,7 +107,7 @@ public class GoodsSkuServiceImpl extends ServiceImpl i public void update(List> skuList, Goods goods, Boolean regeneratorSkuFlag) { // 是否存在规格 if (skuList == null || skuList.isEmpty()) { - throw new ServiceException("规格必须要有一个!"); + throw new ServiceException(ResultCode.MUST_HAVE_GOODS_SKU); } List newSkuList; //删除旧的sku信息 diff --git a/framework/src/main/java/cn/lili/modules/message/util/WechatAccessTokenUtil.java b/framework/src/main/java/cn/lili/modules/message/util/WechatAccessTokenUtil.java index 0ec1b8e5..36fa901d 100644 --- a/framework/src/main/java/cn/lili/modules/message/util/WechatAccessTokenUtil.java +++ b/framework/src/main/java/cn/lili/modules/message/util/WechatAccessTokenUtil.java @@ -4,6 +4,7 @@ import cn.hutool.http.HttpUtil; import cn.hutool.json.JSONObject; import cn.lili.common.cache.Cache; import cn.lili.common.cache.CachePrefix; +import cn.lili.common.enums.ResultCode; import cn.lili.common.exception.ServiceException; import cn.lili.modules.base.entity.enums.ClientTypeEnum; import cn.lili.modules.connect.util.HttpUtils; @@ -105,7 +106,7 @@ public class WechatAccessTokenUtil { return ticket; } catch (Exception e) { log.error("微信JsApi签名异常", e); - throw new ServiceException("微信JsApi签名异常"); + throw new ServiceException(ResultCode.WECHAT_JSAPI_SIGN_ERROR); } } diff --git a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/OrderServiceImpl.java b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/OrderServiceImpl.java index f423e6ea..729f3e8f 100644 --- a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/OrderServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/OrderServiceImpl.java @@ -544,7 +544,7 @@ public class OrderServiceImpl extends ServiceImpl implements orderBatchDeliverDTOList.add(orderBatchDeliverDTO); } } catch (Exception e) { - throw new ServiceException("文件读取失败"); + throw new ServiceException(ResultCode.BATCH_DELIVER_ERROR); } //循环检查是否符合规范 checkBatchDeliver(orderBatchDeliverDTOList); @@ -778,7 +778,7 @@ public class OrderServiceImpl extends ServiceImpl implements //判断用户不能参与自己发起的拼团活动 Order parentOrder = this.getBySn(tradeDTO.getParentOrderSn()); if (parentOrder.getMemberId().equals(UserContext.getCurrentUser().getId())) { - throw new ServiceException("不能参与自己发起的拼团活动!"); + throw new ServiceException(ResultCode.PINTUAN_JOIN_ERROR); } } } @@ -794,7 +794,7 @@ public class OrderServiceImpl extends ServiceImpl implements Pintuan pintuan = pintuanService.getPintuanById(order.getPromotionId()); Integer limitNum = pintuan.getLimitNum(); if (limitNum != 0 && order.getGoodsNum() > limitNum) { - throw new ServiceException("购买数量超过拼团活动限制数量"); + throw new ServiceException(ResultCode.PINTUAN_LIMIT_NUM_ERROR); } } } diff --git a/framework/src/main/java/cn/lili/modules/payment/kit/CashierSupport.java b/framework/src/main/java/cn/lili/modules/payment/kit/CashierSupport.java index 062ff3ed..0bb79bb7 100644 --- a/framework/src/main/java/cn/lili/modules/payment/kit/CashierSupport.java +++ b/framework/src/main/java/cn/lili/modules/payment/kit/CashierSupport.java @@ -57,7 +57,7 @@ public class CashierSupport { HttpServletRequest request, HttpServletResponse response, PayParam payParam) { if (paymentClientEnum == null || paymentMethodEnum == null) { - throw new ServiceException("未知的支付方式"); + throw new ServiceException(ResultCode.PAY_NOT_SUPPORT); } //获取支付插件 Payment payment = (Payment) SpringContextUtil.getBean(paymentMethodEnum.getPlugin()); diff --git a/framework/src/main/java/cn/lili/modules/payment/kit/plugin/alipay/AliPayPlugin.java b/framework/src/main/java/cn/lili/modules/payment/kit/plugin/alipay/AliPayPlugin.java index 75df6f37..b40406b8 100644 --- a/framework/src/main/java/cn/lili/modules/payment/kit/plugin/alipay/AliPayPlugin.java +++ b/framework/src/main/java/cn/lili/modules/payment/kit/plugin/alipay/AliPayPlugin.java @@ -95,7 +95,7 @@ public class AliPayPlugin implements Payment { @Override public ResultMessage JSApiPay(HttpServletRequest request, PayParam payParam) { - throw new ServiceException("当前支付通道暂不支持"); + throw new ServiceException(ResultCode.PAY_NOT_SUPPORT); } @Override diff --git a/framework/src/main/java/cn/lili/modules/payment/kit/plugin/wechat/WechatPlugin.java b/framework/src/main/java/cn/lili/modules/payment/kit/plugin/wechat/WechatPlugin.java index 5dc658ec..efad42a2 100644 --- a/framework/src/main/java/cn/lili/modules/payment/kit/plugin/wechat/WechatPlugin.java +++ b/framework/src/main/java/cn/lili/modules/payment/kit/plugin/wechat/WechatPlugin.java @@ -620,7 +620,7 @@ public class WechatPlugin implements Payment { cache.put(CachePrefix.WECHAT_PLAT_FORM_CERT.getPrefix(), publicCert, second); } else { log.error("证书获取失败:{}" + body); - throw new ServiceException("证书获取失败:" + body); + throw new ServiceException(ResultCode.WECHAT_CERT_ERROR); } return PayKit.getCertificate(publicCert); } catch (Exception e) { diff --git a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/CouponActivityServiceImpl.java b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/CouponActivityServiceImpl.java index 9fbd6e88..3f14f82c 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/CouponActivityServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/CouponActivityServiceImpl.java @@ -1,6 +1,7 @@ package cn.lili.modules.promotion.serviceimpl; import cn.hutool.json.JSONUtil; +import cn.lili.common.enums.ResultCode; import cn.lili.common.exception.ServiceException; import cn.lili.common.trigger.enums.DelayTypeEnums; import cn.lili.common.trigger.interfaces.TimeTrigger; @@ -208,7 +209,7 @@ public class CouponActivityServiceImpl extends ServiceImpl nowTime) { - throw new ServiceException("活动时间小于当前时间,不能进行编辑删除操作"); + throw new ServiceException(ResultCode.COUPON_ACTIVITY_START_TIME_ERROR); } //活动时间需超过当前时间 PromotionTools.checkPromotionTime(couponActivity.getStartTime().getTime(), couponActivity.getEndTime().getTime()); diff --git a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/FullDiscountServiceImpl.java b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/FullDiscountServiceImpl.java index ff22d6f9..f60682df 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/FullDiscountServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/FullDiscountServiceImpl.java @@ -1,5 +1,6 @@ package cn.lili.modules.promotion.serviceimpl; +import cn.lili.common.enums.ResultCode; import cn.lili.common.trigger.util.DelayQueueTools; import cn.lili.common.trigger.enums.DelayTypeEnums; import cn.lili.common.trigger.message.PromotionMessage; @@ -135,7 +136,7 @@ public class FullDiscountServiceImpl extends ServiceImpl= coupon.getPublishNum()) { - throw new ServiceException("优惠券剩余领取数量不足"); + throw new ServiceException(ResultCode.COUPON_NUM_INSUFFICIENT_ERROR); } if (haveCoupons >= coupon.getCouponLimitNum()) { throw new ServiceException("此优惠券最多领取" + coupon.getCouponLimitNum() + "张"); @@ -76,7 +76,7 @@ public class MemberCouponServiceImpl extends ServiceImpl seckillApplyList) { SeckillVO seckill = mongoTemplate.findById(seckillId, SeckillVO.class); if (seckill == null) { - throw new ServiceException("当前参与的秒杀活动不存在!"); + throw new ServiceException(ResultCode.SECKILL_NOT_EXIST); } //检查秒杀活动申请是否合法 checkSeckillApplyList(seckill.getHours(), seckillApplyList, storeId); diff --git a/framework/src/main/java/cn/lili/modules/system/serviceimpl/LogisticsServiceImpl.java b/framework/src/main/java/cn/lili/modules/system/serviceimpl/LogisticsServiceImpl.java index 62af53e7..7c33e996 100644 --- a/framework/src/main/java/cn/lili/modules/system/serviceimpl/LogisticsServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/system/serviceimpl/LogisticsServiceImpl.java @@ -1,6 +1,7 @@ package cn.lili.modules.system.serviceimpl; import cn.hutool.core.util.StrUtil; +import cn.lili.common.enums.ResultCode; import cn.lili.common.enums.SwitchEnum; import cn.lili.common.exception.ServiceException; import cn.lili.modules.system.entity.dos.Logistics; @@ -72,7 +73,7 @@ public class LogisticsServiceImpl extends ServiceImpl