xiaoyong931011
2020-07-09 cb50c338cd7f482403a341e9d7ef7a6ab03afaea
src/main/java/com/xcong/excoin/modules/member/service/impl/MemberServiceImpl.java
@@ -405,18 +405,14 @@
         memberAccountMoneyChangeMapper.insert(memberAccountMoneyChangeEntity);
      }
      
      MemberAccountMoneyChangeEntity memberAccountMoneyChangeEntity = new MemberAccountMoneyChangeEntity();
      memberAccountMoneyChangeEntity.setContent("提币");
      memberAccountMoneyChangeEntity.setMemberId(memberId);
      memberAccountMoneyChangeEntity.setAmount(selectById.getAmount());
      Map<String, Object> columnMaps = new HashMap<>();
      columnMaps.put("withdraw_id", selectById.getId());
      List<MemberAccountMoneyChangeEntity> selectByMap2 = memberAccountMoneyChangeMapper.selectByMap(columnMaps);
      MemberAccountMoneyChangeEntity memberAccountMoneyChangeEntity = selectByMap2.get(0);
      memberAccountMoneyChangeEntity.setStatus(MemberAccountMoneyChangeEntity.STATUS_SUCCESS_INTEGER);
      memberAccountMoneyChangeEntity.setSymbol(selectById.getSymbol());
      memberAccountMoneyChangeEntity.setType(MemberAccountMoneyChangeEntity.TYPE_WALLET_COIN);
      memberAccountMoneyChangeEntity.setCreateBy(selectById.getCreateBy());
        memberAccountMoneyChangeEntity.setCreateTime(new Date());
        memberAccountMoneyChangeEntity.setUpdateBy(selectById.getCreateBy());
        memberAccountMoneyChangeEntity.setUpdateTime(new Date());
      memberAccountMoneyChangeMapper.insert(memberAccountMoneyChangeEntity);
      memberAccountMoneyChangeEntity.setAmount(selectById.getAmount().negate());
      memberAccountMoneyChangeMapper.updateById(memberAccountMoneyChangeEntity);
      
      selectById.setStatus(MemberCoinWithdrawEntity.IS_STATUS_Y);
      memberCoinWithdrawMapper.updateById(selectById);
@@ -446,7 +442,7 @@
      // 查询币币钱包
      MemberWalletCoinEntity walletCoin = memberWalletCoinMapper.findWalletCoinByMemberIdAndWalletCode(memberId, symbol);
      
      BigDecimal available = walletCoin.getAvailableBalance().add(selectById.getAmount()).add(selectById.getFeeAmount());
      BigDecimal available = walletCoin.getAvailableBalance().add(selectById.getAmount());
      walletCoin.setAvailableBalance(available);
      BigDecimal frozen = walletCoin.getFrozenBalance().subtract(selectById.getAmount());
      walletCoin.setFrozenBalance(frozen);
@@ -454,18 +450,14 @@
      memberWalletCoinMapper.updateById(walletCoin);
      
      // 提币退款记录
      MemberAccountMoneyChangeEntity memberAccountMoneyChangeEntity = new MemberAccountMoneyChangeEntity();
      memberAccountMoneyChangeEntity.setContent("提币");
      memberAccountMoneyChangeEntity.setMemberId(memberId);
      memberAccountMoneyChangeEntity.setAmount(selectById.getAmount());
      Map<String, Object> columnMaps = new HashMap<>();
      columnMaps.put("withdraw_id", selectById.getId());
      List<MemberAccountMoneyChangeEntity> selectByMap2 = memberAccountMoneyChangeMapper.selectByMap(columnMaps);
      MemberAccountMoneyChangeEntity memberAccountMoneyChangeEntity = selectByMap2.get(0);
      memberAccountMoneyChangeEntity.setStatus(MemberAccountMoneyChangeEntity.STATUS_FAIL_INTEGER);
      memberAccountMoneyChangeEntity.setSymbol(selectById.getSymbol());
      memberAccountMoneyChangeEntity.setType(MemberAccountMoneyChangeEntity.TYPE_WALLET_COIN);
      memberAccountMoneyChangeEntity.setCreateBy(selectById.getCreateBy());
        memberAccountMoneyChangeEntity.setCreateTime(new Date());
        memberAccountMoneyChangeEntity.setUpdateBy(selectById.getCreateBy());
        memberAccountMoneyChangeEntity.setUpdateTime(new Date());
      memberAccountMoneyChangeMapper.insert(memberAccountMoneyChangeEntity);
      memberAccountMoneyChangeEntity.setAmount(selectById.getAmount());
      memberAccountMoneyChangeMapper.updateById(memberAccountMoneyChangeEntity);
      
      selectById.setStatus(MemberCoinWithdrawEntity.IS_STATUS_N);
      memberCoinWithdrawMapper.updateById(selectById);