|
|
|
@ -60,8 +60,6 @@ public class BtcWalletTransferServiceImpl implements BtcWalletTransferService, I |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private UserServerFegin userServerFegin; |
|
|
|
|
@Autowired |
|
|
|
|
private WalletInitConfigMapper walletInitConfigMapper; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private BtcWalletTransferService btcWalletTransferService; |
|
|
|
@ -340,32 +338,4 @@ public class BtcWalletTransferServiceImpl implements BtcWalletTransferService, I |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public BtcWalletDTO resetWallet(String userOpenId, String addr, Integer tokenId, String walletType) { |
|
|
|
|
//校验钱包类型
|
|
|
|
|
btcApplicationService.checkWalletType(walletType); |
|
|
|
|
//校验币种id
|
|
|
|
|
String tokenSymbol = btcTokenService.getAndVerifyTokenNameById(tokenId); |
|
|
|
|
WalletInitConfig walletInitConfig = new WalletInitConfig(); |
|
|
|
|
walletInitConfig.setCoin(tokenSymbol); |
|
|
|
|
walletInitConfig.setWalletType(walletType); |
|
|
|
|
WalletInitConfig config = walletInitConfigMapper.selectOne(walletInitConfig); |
|
|
|
|
//修改该钱包余额,并插入一条充值记录
|
|
|
|
|
BtcWalletTransfer btcWalletTransfer = new BtcWalletTransfer(); |
|
|
|
|
btcWalletTransfer.setId(UUID.randomUUID().toString()); |
|
|
|
|
btcWalletTransfer.setHash("zhixinlianResetWallet"); |
|
|
|
|
btcWalletTransfer.setFromAddr("zhixinlianResetWallet"); |
|
|
|
|
btcWalletTransfer.setToAddr(addr); |
|
|
|
|
btcWalletTransfer.setAmount(config.getBalance().doubleValue()); |
|
|
|
|
btcWalletTransfer.setGasPrice(0d); |
|
|
|
|
btcWalletTransfer.setTokenId(tokenId); |
|
|
|
|
btcWalletTransfer.setTokenSymbol(tokenSymbol); |
|
|
|
|
btcWalletTransfer.setTransferType(BtcTransferConstans.TYPE_IN); |
|
|
|
|
btcWalletTransfer.setStatus(BtcTransferConstans.STATUS_SUCCESS); |
|
|
|
|
btcWalletTransfer.setCreateTime(new Date()); |
|
|
|
|
btcWalletTransfer.setUpdateTime(btcWalletTransfer.getCreateTime()); |
|
|
|
|
btcWalletTransferService.handleBlockRecharge(btcWalletTransfer); |
|
|
|
|
//返回加减余额后的数据
|
|
|
|
|
return btcWalletService.selectByAddr(addr, tokenId, walletType); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|