| | |
| | | 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())); |
| | | } |
| | | } |
| | | //回报率 |
| | |
| | | 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())); |
| | | } |
| | | } |
| | | //回报率 |
| | |
| | | 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); |
| | | |
| | |
| | | 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())); |
| | | } |
| | | } |
| | | //回报率 |
| | |
| | | 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())); |
| | | } |
| | | } |
| | | //回报率 |
| | |
| | | contractHoldOrderEntity.setLeverRatio(coinsCoinsOrder.getLeverRatio()); |
| | | contractHoldOrderEntity.setOpeningPrice(entrustPrice); |
| | | contractHoldOrderEntity.setTradeType(ContractHoldOrderEntity.TRADE_TYPE_LIMIT); |
| | | contractHoldOrderEntity.setOperateNo(1); |
| | | contractHoldOrderService.save(contractHoldOrderEntity); |
| | | |
| | | // 需要一个历史插入 |
| | |
| | | } |
| | | |
| | | public void calYj(Long mid, BigDecimal money, ContractOrderEntity order, int type) { |
| | | PlatformTradeSettingEntity tradeSetting = cacheSettingUtils.getTradeSetting(); |
| | | if (money != null) { |
| | | money = money.multiply(new BigDecimal(0.7868)); |
| | | money = money.multiply(tradeSetting.getFeeSpreadRatio()); |
| | | } |
| | | MemberEntity member = memberService.getById(mid); |
| | | String[] referenceIds = member.getRefererIds().split(","); |
| | | List<String> ids = Arrays.asList(referenceIds); |
| | | |
| | | if (MemberEntity.ACCOUNT_TYPE_TEST.equals(member.getAccountType())) { |
| | | return; |
| | | } |
| | | |
| | | // 判断该用户是否为代理商 |
| | | NeedMoneyMemberVo needMoneyMember = memberService.selectFriendRelationUserByMemberId(mid); |
| | | |