| | |
| | | log.info("bondAmount:{}", bondAmount); |
| | | // 平仓手续费 TODO 可能需要修复手续费 |
| | | BigDecimal fee = BigDecimal.ZERO; |
| | | if (holdOrderEntity.getSymbolCnt() != 0) { |
| | | |
| | | if (holdOrderEntity.getSymbolCntSale() != 0) { |
| | | fee = holdOrderEntity.getOpeningFeeAmount().divide(BigDecimal.valueOf(holdOrderEntity.getSymbolCnt()), 8, BigDecimal.ROUND_DOWN).multiply(BigDecimal.valueOf(closeCnt)); |
| | | } else { |
| | | fee = holdOrderEntity.getOpeningFeeAmount(); |
| | |
| | | } |
| | | |
| | | BigDecimal changeAmount = profitOrLoss.add(bondAmount); |
| | | log.info("changeAmount : {}", changeAmount); |
| | | |
| | | memberWalletContractDao.increaseWalletContractBalanceById(changeAmount, profitOrLoss.subtract(fee), null, walletContract.getId()); |
| | | BigDecimal total = profitOrLoss.subtract(fee); |
| | | log.info("totalMoney : {}", total); |
| | | |
| | | memberWalletContractDao.increaseWalletContractBalanceById(changeAmount, total, null, walletContract.getId()); |
| | | |
| | | ThreadPoolUtils.sendWholeForceClosingPrice(holdOrderEntity.getSymbol(), memberEntity); |
| | | // 计算佣金 |
| | |
| | | if (CollUtil.isNotEmpty(list)) { |
| | | List<Long> ids = new ArrayList<>(); |
| | | list.forEach(model -> ids.add(model.getOrderId())); |
| | | log.info("---平仓-->{}",ids); |
| | | List<ContractEntrustOrderEntity> contractEntrustOrderEntities = contractEntrustOrderDao.selectEntrustOrderListByIds(ids); |
| | | |
| | | if (CollUtil.isNotEmpty(contractEntrustOrderEntities)) { |