| | |
| | | log.setContentType(type2 + Constants.MONEYLOG_CONTENT_CANCEL); |
| | | moneyLogService.save(log); |
| | | } |
| | | double sub = Arith.sub(realValue, order.getFee()); |
| | | double amount = Arith.mul(sub, orderPrice); |
| | | double amount = Arith.mul(realValue, orderPrice) + order.getFee(); |
| | | Wallet wallet = this.walletService.saveWalletByPartyId(order.getPartyId()); |
| | | double amountBefore = wallet.getMoney().doubleValue(); |
| | | String type = itemService.findBySymbol(order.getSymbol()).getType(); |
| | |
| | | String type2 = Constants.MONEYLOG_MAP_TYPE.get(type); |
| | | log.setAmountBefore(new BigDecimal(amountBefore)); |
| | | log.setAmount(new BigDecimal(amount)); |
| | | log.setAmountAfter(wallet.getMoney().add(BigDecimal.valueOf(amount))); |
| | | log.setAmountAfter(BigDecimal.valueOf(amountBefore + amount)); |
| | | log.setLog(name + type2 + "现货交易卖出委托单成交,订单号[" + order.getOrderNo() + "]"); |
| | | log.setUserId(order.getPartyId()); |
| | | log.setWalletType(Constants.WALLET); |
| | |
| | | moneyLogService.save(log); |
| | | order.setCloseTime(new Date()); |
| | | order.setClosePrice(orderPrice); |
| | | order.setWalletFee(Arith.mul(order.getFee(), orderPrice)); |
| | | order.setWalletFee(order.getFee()); |
| | | order.setState(ExchangeApplyOrder.STATE_CREATED); |
| | | updateById(order); |
| | | } |