【缺陷修复】商城: 订单支付后记录 log error 日志,保证订单最大化可推导。

This commit is contained in:
YunaiV
2024-12-11 12:59:10 +08:00
parent 01fca4e9c7
commit 6ffb4ed116
6 changed files with 17 additions and 24 deletions

View File

@@ -9,6 +9,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.EXPERIENCE_BIZ_NOT_SUPPORT;
/**
@@ -33,9 +34,7 @@ public class MemberLevelApiImpl implements MemberLevelApi {
public void addExperience(Long userId, Integer experience, Integer bizType, String bizId) {
MemberExperienceBizTypeEnum bizTypeEnum = MemberExperienceBizTypeEnum.getByType(bizType);
if (bizTypeEnum == null) {
log.error("[addExperience][userId({}) experience({}) bizType({}) bizId({}) {}]", userId, experience, bizType,
bizId, EXPERIENCE_BIZ_NOT_SUPPORT);
return;
throw exception(EXPERIENCE_BIZ_NOT_SUPPORT);
}
memberLevelService.addExperience(userId, experience, bizTypeEnum, bizId);
}

View File

@@ -41,9 +41,7 @@ public class MemberPointApiImpl implements MemberPointApi {
Assert.isTrue(point > 0);
MemberPointBizTypeEnum bizTypeEnum = MemberPointBizTypeEnum.getByType(bizType);
if (bizTypeEnum == null) {
log.error("[addPoint][userId({}) point({}) bizType({}) bizId({}) {}]", userId, point, bizType, bizId,
POINT_RECORD_BIZ_NOT_SUPPORT);
return;
throw exception(POINT_RECORD_BIZ_NOT_SUPPORT);
}
memberPointRecordService.createPointRecord(userId, -point, bizTypeEnum, bizId);
}

View File

@@ -82,9 +82,7 @@ public class MemberPointRecordServiceImpl implements MemberPointRecordService {
// 2. 更新用户积分
boolean success = memberUserService.updateUserPoint(userId, point);
if (!success) {
log.error("[createPointRecord][userId({}) point({}) bizType({}) bizId({}) {}]", userId, point, bizType, bizId,
USER_POINT_NOT_ENOUGH);
return;
throw exception(USER_POINT_NOT_ENOUGH);
}
// 3. 增加积分记录