| | |
| | | // Date now = new Date(); |
| | | RechargeBlockchainOrder recharge = getById(id); |
| | | if (recharge == null) { |
| | | throw new YamiShopBindException("参数错误!"); |
| | | recharge = findByOrderNo(id); |
| | | if (recharge == null) { |
| | | throw new YamiShopBindException("参数错误!"); |
| | | } |
| | | } |
| | | User party = userService.getById(recharge.getPartyId()); |
| | | if (party == null) { |
| | |
| | | * 如果是usdt则加入wallet,否则寻找walletExtend里相同币种 |
| | | */ |
| | | Syspara user_recom_bonus_open = sysparaService.find("user_recom_bonus_open"); |
| | | if ("usdt".equals(recharge.getSymbol())) { |
| | | if ("usdt".equals(recharge.getSymbol()) || "usdc".equals(recharge.getSymbol())) { |
| | | double amount1 = recharge.getVolume(); |
| | | if ("usdc".equals(recharge.getSymbol())) { |
| | | List<Realtime> realtime_list = this.dataService.realtime(recharge.getSymbol()); |
| | | log.info("充值usdc转为usdt::" + realtime_list); |
| | | Realtime realtime = null; |
| | | if (realtime_list.size() > 0) { |
| | | realtime = realtime_list.get(0); |
| | | } else { |
| | | throw new YamiShopBindException("系统错误,请稍后重试"); |
| | | } |
| | | // 对应usdt价格 |
| | | double transfer_usdt = realtime.getClose(); |
| | | double volume = recharge.getVolume(); |
| | | |
| | | // 币种usdt价格= 币种价格×充值数量 |
| | | amount1 = Arith.mul(recharge.getVolume(), transfer_usdt); |
| | | log.info("充值usdc转为usdt::" + amount1); |
| | | } |
| | | Wallet wallet = new Wallet(); |
| | | wallet = walletService.saveWalletByPartyId(recharge.getPartyId()); |
| | | double amount_before = wallet.getMoney().doubleValue(); |
| | |
| | | double baseAmount = Double.parseDouble(recharges[1]); |
| | | // 用户已完成USDT订单 |
| | | long number = moneyLogService.getMoneyLogByFirstRecharge(recharge.getPartyId()) == null ? 0 : 1; |
| | | //this.findByPartyIdAndLargerVolume(recharge.getPartyId(), 1,baseAmount); |
| | | //this.findByPartyIdAndLargerVolume(recharge.getPartyId(), 1,baseAmount); |
| | | rechargeBonusService.saveFirstUsdtBounsHandle(recharge,transfer_usdt,number,recharges); |
| | | } |
| | | /** |
| | |
| | | if ("".equals(recharge.getOrderNo()) || recharge.getOrderNo() == null) { |
| | | recharge.setOrderNo(DateUtil.getToday("yyMMddHHmmss") + RandomUtil.getRandomNum(8)); |
| | | } |
| | | save(recharge); |
| | | saveOrUpdate(recharge); |
| | | // 保存资金日志 |
| | | WalletLog walletLog = new WalletLog(); |
| | | walletLog.setCategory(Constants.MONEYLOG_CATEGORY_RECHARGE); |