提交代码

dev
胡锐 5 months ago
parent d49ec20032
commit 62c6b09578
  1. 5
      service/src/main/java/com/hfkj/service/user/impl/UserIntegralServiceImpl.java

@ -1,5 +1,6 @@
package com.hfkj.service.user.impl; package com.hfkj.service.user.impl;
import com.hfkj.common.exception.BaseException;
import com.hfkj.common.exception.ErrorCode; import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode; import com.hfkj.common.exception.SysCode;
@ -118,7 +119,7 @@ public class UserIntegralServiceImpl implements UserIntegralService {
if (user == null) { if (user == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的账户"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的账户");
} }
if (user.getIntegral() > integralNum) { if (user.getIntegral() < integralNum) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "积分数量不足"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "积分数量不足");
} }
// 变更前积分数 // 变更前积分数
@ -147,6 +148,8 @@ public class UserIntegralServiceImpl implements UserIntegralService {
record.setOpUserPhone(MapUtils.getString(source, "opUserPhone")); record.setOpUserPhone(MapUtils.getString(source, "opUserPhone"));
userIntegralRecordService.create(record); userIntegralRecordService.create(record);
} catch (BaseException e) {
throw e;
} catch (Exception e) { } catch (Exception e) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "积分交易异常"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "积分交易异常");
} finally { } finally {

Loading…
Cancel
Save