From 1f8e7774f4bc554f788fddae774d72ca24749edf Mon Sep 17 00:00:00 2001 From: Helius <wangdoubleone@gmail.com> Date: Fri, 28 Aug 2020 15:27:52 +0800 Subject: [PATCH] modify --- src/main/java/com/xcong/excoin/utils/CalculateUtil.java | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/xcong/excoin/utils/CalculateUtil.java b/src/main/java/com/xcong/excoin/utils/CalculateUtil.java index ed3f87b..51af5ac 100644 --- a/src/main/java/com/xcong/excoin/utils/CalculateUtil.java +++ b/src/main/java/com/xcong/excoin/utils/CalculateUtil.java @@ -103,10 +103,11 @@ int totalCnt = 0; for (ContractHoldOrderEntity holdOrderEntity : holdOrderEntities) { - BigDecimal forceSetPrice = getForceSetPrice(walletContract.getAvailableBalance().subtract(holdOrderEntity.getOpeningFeeAmount()), holdOrderEntity.getOpeningPrice(), holdOrderEntity.getSymbolCntSale(), holdOrderEntity.getSymbolSku(), holdOrderEntity.getOpeningType(), memberEntity); - log.info("订单强平价 : {}, 订单ID : {}", forceSetPrice, holdOrderEntity.getId()); + BigDecimal forceSetPrice = getForceSetPrice(walletContract.getTotalBalance().subtract(holdOrderEntity.getOpeningFeeAmount()), holdOrderEntity.getOpeningPrice(), holdOrderEntity.getSymbolCntSale(), holdOrderEntity.getSymbolSku(), holdOrderEntity.getOpeningType(), memberEntity); + log.info("订单强平价 : {}, 订单ID : {}, {}", forceSetPrice, holdOrderEntity.getId(), holdOrderEntity.getSymbolCntSale()); totalSetPrice = totalSetPrice.add(forceSetPrice.multiply(BigDecimal.valueOf(holdOrderEntity.getSymbolCntSale()))); totalCnt += holdOrderEntity.getSymbolCntSale(); + log.info("-->{}", totalCnt); } BigDecimal forceSetPrice = totalSetPrice.divide(BigDecimal.valueOf(totalCnt), 8, BigDecimal.ROUND_DOWN); -- Gitblit v1.9.1