| | |
| | | if (C2cOrder.DIRECTION_BUY.equals(c2cOrder.getDirection())) { |
| | | // 买币 |
| | | // 给用户账户添加相应的币种数量 |
| | | double amountBefore = 0d; |
| | | double amountAfter = 0d; |
| | | double amountBefore; |
| | | double amountAfter; |
| | | if ("usdt".equalsIgnoreCase(c2cOrder.getSymbol())) { |
| | | Wallet wallet = this.walletService.saveWalletByPartyId(c2cOrder.getPartyId()); |
| | | amountBefore = wallet.getMoney().doubleValue(); |
| | |
| | | // 保存资金日志 |
| | | MoneyLog moneyLog = new MoneyLog(); |
| | | moneyLog.setCategory(Constants.MONEYLOG_CATEGORY_C2C); |
| | | moneyLog.setAmount_before(new BigDecimal(amountBefore)); |
| | | moneyLog.setAmountBefore(new BigDecimal(amountBefore)); |
| | | moneyLog.setAmount(new BigDecimal(c2cOrder.getCoinAmount())); |
| | | moneyLog.setAmount_after(new BigDecimal(amountAfter)); |
| | | moneyLog.setAmountAfter(new BigDecimal(amountAfter)); |
| | | moneyLog.setLog("c2c订单购买放行,订单号[" + c2cOrder.getOrderNo() + "]"); |
| | | moneyLog.setUserId(c2cOrder.getPartyId()); |
| | | moneyLog.setWallet_type(c2cOrder.getSymbol()); |
| | |
| | | throw new YamiShopBindException("金额不在购买区间"); |
| | | } |
| | | |
| | | double amountBefore = 0d; |
| | | double amountAfter = 0d; |
| | | double amountBefore ; |
| | | double amountAfter ; |
| | | |
| | | if ("usdt".equalsIgnoreCase(c2cAdvert.getSymbol())) { |
| | | |
| | |
| | | // 保存资金日志 |
| | | MoneyLog moneylog = new MoneyLog(); |
| | | moneylog.setCategory(Constants.MONEYLOG_CATEGORY_C2C); |
| | | moneylog.setAmount_before(new BigDecimal(amountBefore)); |
| | | moneylog.setAmountBefore(new BigDecimal(amountBefore)); |
| | | moneylog.setAmount(new BigDecimal(Arith.sub(0, c2cOrder.getCoinAmount()))); |
| | | moneylog.setAmount_after(new BigDecimal(amountAfter)); |
| | | moneylog.setAmountAfter(new BigDecimal(amountAfter)); |
| | | moneylog.setLog("c2c卖币,币种[" + c2cOrder.getSymbol() + "],订单号[" + c2cOrder.getOrderNo() + "]"); |
| | | moneylog.setUserId(c2cOrder.getPartyId()); |
| | | moneylog.setWalletType(c2cOrder.getSymbol()); |