Helius
2020-08-11 71bc137f5a10f099230cbc0cfb1687ad5fe467fb
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()));
                            }
                        }
                        //回报率
@@ -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()));
                            }
                        }
                        //回报率