From 62c6b0957893db705f1d39e1d1fcaf7d2548569d Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Mon, 27 May 2024 14:18:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hfkj/service/user/impl/UserIntegralServiceImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/service/src/main/java/com/hfkj/service/user/impl/UserIntegralServiceImpl.java b/service/src/main/java/com/hfkj/service/user/impl/UserIntegralServiceImpl.java index c718cfb..5822b14 100644 --- a/service/src/main/java/com/hfkj/service/user/impl/UserIntegralServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/user/impl/UserIntegralServiceImpl.java @@ -1,5 +1,6 @@ package com.hfkj.service.user.impl; +import com.hfkj.common.exception.BaseException; import com.hfkj.common.exception.ErrorCode; import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.SysCode; @@ -118,7 +119,7 @@ public class UserIntegralServiceImpl implements UserIntegralService { if (user == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的账户"); } - if (user.getIntegral() > integralNum) { + if (user.getIntegral() < integralNum) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "积分数量不足"); } // 变更前积分数 @@ -147,6 +148,8 @@ public class UserIntegralServiceImpl implements UserIntegralService { record.setOpUserPhone(MapUtils.getString(source, "opUserPhone")); userIntegralRecordService.create(record); + } catch (BaseException e) { + throw e; } catch (Exception e) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "积分交易异常"); } finally {