|  |  |  | 
|---|
|  |  |  | import lombok.RequiredArgsConstructor; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  | import org.springframework.transaction.annotation.Transactional; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.math.BigDecimal; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | private final DataDictionaryCustomMapper dataDictionaryCustomMapper; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | @Transactional(rollbackFor = Exception.class) | 
|---|
|  |  |  | public void withdrawal(WithdrawalDto withdrawalDto) { | 
|---|
|  |  |  | Long memberId = LoginUserUtil.getLoginUser().getId(); | 
|---|
|  |  |  | MallMember mallMember = mallMemberService.getById(memberId); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | walletService.reduce(withdrawalDto.getAmount(), memberId, "balance"); | 
|---|
|  |  |  | String withdrawalNo = "TX_"+MallUtils.getOrderNum(); | 
|---|
|  |  |  | //        String withdrawalNo = "TX_"+MallUtils.getOrderNum(); | 
|---|
|  |  |  | MallMemberWithdraw withdraw = new MallMemberWithdraw(); | 
|---|
|  |  |  | withdraw.setWithdrawNo(withdrawalNo); | 
|---|
|  |  |  | //        withdraw.setWithdrawNo(withdrawalNo); | 
|---|
|  |  |  | withdraw.setMemberId(memberId); | 
|---|
|  |  |  | withdraw.setAmount(withdrawalDto.getAmount()); | 
|---|
|  |  |  | withdraw.setStatus(1); | 
|---|
|  |  |  | this.baseMapper.insert(withdraw); | 
|---|
|  |  |  | String withdrawalNo = "TX_"+withdraw.getId().toString(); | 
|---|
|  |  |  | withdraw.setWithdrawNo(withdrawalNo); | 
|---|
|  |  |  | this.baseMapper.updateById(withdraw); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | mallMemberService.addMoneyFlow(memberId, withdrawalDto.getAmount().negate(), MoneyFlowTypeEnum.WITHDRAWAL.getValue(), withdrawalNo, null, null, null, 1, FlowTypeEnum.BALANCE.getValue()); | 
|---|
|  |  |  | } | 
|---|