!809 修复BUG, 会员当前有等级的时候下订单会把当前等级给清空了。

Merge pull request !809 from 云扬四海/fix-member-level-bug-0102
This commit is contained in:
芋道源码 2024-01-07 12:47:46 +00:00 committed by Gitee
commit 761ab8a0e5
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -27,6 +27,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Optional;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*;
@ -259,7 +260,7 @@ public class MemberLevelServiceImpl implements MemberLevelService {
}
// 3. 更新会员表上的等级编号经验值
memberUserService.updateUserLevel(user.getId(), levelRecord.getLevelId(), userExperience);
memberUserService.updateUserLevel(user.getId(), Optional.ofNullable(levelRecord.getLevelId()).orElse(user.getLevelId()), userExperience);
}
/**