feat(mall): 为关键操作添加事务管理
- 在 AdminRunVipServiceImpl 中为 sellAgree 方法添加事务注解
- 在 ApiMallMemberServiceImpl 中为 withdrawal 和 commissionChange 方法添加事务注解
- 通过添加 @Transactional 注解,确保这些方法在执行过程中发生异常时能够回滚事务,保证数据一致性
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public FebsResponse sellAgree(Integer state, Long id) { |
| | | MallMemberWithdraw mallMemberWithdraw = mallMemberWithdrawMapper.selectById(id); |
| | | if(ObjectUtil.isEmpty(mallMemberWithdraw)){ |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void withdrawal(WithdrawalDto withdrawalDto) { |
| | | Long memberId = LoginUserUtil.getLoginUser().getId(); |
| | | MallMember loginMember = this.baseMapper.selectById(memberId); |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void commissionChange(CommissionChangeDto commissionChange) { |
| | | Long memberId = LoginUserUtil.getLoginUser().getId(); |
| | | BigDecimal minScore = new BigDecimal( |