From ec7480312a1d80354e695eab72eaa8b8fbc46dc4 Mon Sep 17 00:00:00 2001 From: xiaoyong931011 <15274802129@163.com> Date: Wed, 12 Aug 2020 17:55:22 +0800 Subject: [PATCH] 20200812 帮助中心接口 --- src/main/java/com/xcong/excoin/modules/contract/service/impl/OrderWebsocketServiceImpl.java | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/xcong/excoin/modules/contract/service/impl/OrderWebsocketServiceImpl.java b/src/main/java/com/xcong/excoin/modules/contract/service/impl/OrderWebsocketServiceImpl.java index af2b247..c86ac4f 100644 --- a/src/main/java/com/xcong/excoin/modules/contract/service/impl/OrderWebsocketServiceImpl.java +++ b/src/main/java/com/xcong/excoin/modules/contract/service/impl/OrderWebsocketServiceImpl.java @@ -172,13 +172,15 @@ .multiply(new BigDecimal(currentFlat)) .multiply(symbolSku).setScale(8, BigDecimal.ROUND_DOWN); MemberEntity memberEntity = memberService.getById(memberId); - + log.info("划点前:{}", profitLossPrice); + profitLossPrice = profitLossPrice.multiply(BigDecimal.ONE.subtract(memberEntity.getClosingSpread().divide(BigDecimal.valueOf(100), 4, BigDecimal.ROUND_DOWN))); + log.info("划点后:{}", profitLossPrice); if (memberEntity.getIsProfit() == 1) { PlatformTradeSettingEntity tradeSetting = cacheSettingUtils.getTradeSetting(); if (profitLossPrice.compareTo(BigDecimal.ZERO) > 0) { profitLossPrice = profitLossPrice.multiply(BigDecimal.ONE.subtract(tradeSetting.getProfitParam())); } else { - profitLossPrice = profitLossPrice.multiply(BigDecimal.ONE.add(tradeSetting.getProfitParam())); +// profitLossPrice = profitLossPrice.multiply(BigDecimal.ONE.add(tradeSetting.getProfitParam())); } } //回报率 @@ -263,12 +265,15 @@ .multiply(symbolSku).setScale(8, BigDecimal.ROUND_DOWN); MemberEntity memberEntity = memberService.getById(memberId); + log.info("划点前:{}", profitLossPrice); + profitLossPrice = profitLossPrice.multiply(BigDecimal.ONE.subtract(memberEntity.getClosingSpread().divide(BigDecimal.valueOf(100), 4, BigDecimal.ROUND_DOWN))); + log.info("划点后:{}", profitLossPrice); if (memberEntity.getIsProfit() == 1) { PlatformTradeSettingEntity tradeSetting = cacheSettingUtils.getTradeSetting(); if (profitLossPrice.compareTo(BigDecimal.ZERO) > 0) { profitLossPrice = profitLossPrice.multiply(BigDecimal.ONE.subtract(tradeSetting.getProfitParam())); } else { - profitLossPrice = profitLossPrice.multiply(BigDecimal.ONE.add(tradeSetting.getProfitParam())); +// profitLossPrice = profitLossPrice.multiply(BigDecimal.ONE.add(tradeSetting.getProfitParam())); } } //回报率 @@ -278,7 +283,7 @@ contractOrderEntity.setClosingFeeAmount(order.getOpeningFeeAmount()); contractOrderEntity.setClosingPrice(closePrice); contractOrderEntity.setClosingType(7); - contractOrderEntity.setOrderType(ContractOrderEntity.ORDER_TYPE_CLOSE_MORE); + contractOrderEntity.setOrderType(ContractOrderEntity.ORDER_TYPE_CLOSE_LESS); BigDecimal totalReturn = BigDecimal.ZERO; contractOrderService.save(contractOrderEntity); @@ -360,7 +365,7 @@ if (profitLossPrice.compareTo(BigDecimal.ZERO) > 0) { profitLossPrice = profitLossPrice.multiply(BigDecimal.ONE.subtract(tradeSetting.getProfitParam())); } else { - profitLossPrice = profitLossPrice.multiply(BigDecimal.ONE.add(tradeSetting.getProfitParam())); +// profitLossPrice = profitLossPrice.multiply(BigDecimal.ONE.add(tradeSetting.getProfitParam())); } } //回报率 @@ -451,7 +456,7 @@ if (profitLossPrice.compareTo(BigDecimal.ZERO) > 0) { profitLossPrice = profitLossPrice.multiply(BigDecimal.ONE.subtract(tradeSetting.getProfitParam())); } else { - profitLossPrice = profitLossPrice.multiply(BigDecimal.ONE.add(tradeSetting.getProfitParam())); +// profitLossPrice = profitLossPrice.multiply(BigDecimal.ONE.add(tradeSetting.getProfitParam())); } } //回报率 -- Gitblit v1.9.1