From ded93a205fc7176b98c24c6e56ad76e9db998b02 Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Fri, 10 Jul 2020 11:40:11 +0800
Subject: [PATCH] modify
---
src/main/java/com/xcong/excoin/modules/contract/service/impl/ContractHoldOrderServiceImpl.java | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/main/java/com/xcong/excoin/modules/contract/service/impl/ContractHoldOrderServiceImpl.java b/src/main/java/com/xcong/excoin/modules/contract/service/impl/ContractHoldOrderServiceImpl.java
index 423001b..b9267f3 100644
--- a/src/main/java/com/xcong/excoin/modules/contract/service/impl/ContractHoldOrderServiceImpl.java
+++ b/src/main/java/com/xcong/excoin/modules/contract/service/impl/ContractHoldOrderServiceImpl.java
@@ -266,7 +266,7 @@
Map<String, Object> result = new HashMap<>();
result.put("hold", resultList);
- result.put("totalProfitOrLoss", totalProfitOrLoss);
+ result.put("totalProfitOrLoss", totalProfitOrLoss.setScale(4, BigDecimal.ROUND_DOWN).toPlainString());
return Result.ok(result);
}
return Result.ok("success");
@@ -430,14 +430,14 @@
if (changeBondDto.getAmount().compareTo(walletContract.getAvailableBalance()) > 0) {
return Result.fail("可用余额不足");
}
- memberWalletContractDao.increaseWalletContractBalanceById(changeBondDto.getAmount().negate(), null, changeBondDto.getAmount(), walletContract.getId());
+ memberWalletContractDao.increaseWalletContractBalanceById(changeBondDto.getAmount().negate(), null, null, walletContract.getId());
holdOrderEntity.setBondAmount(holdOrderEntity.getBondAmount().add(changeBondDto.getAmount()));
// 减少保证金
} else {
if (holdOrderEntity.getBondAmount().subtract(holdOrderEntity.getPrePaymentAmount()).subtract(changeBondDto.getAmount()).compareTo(BigDecimal.ZERO) < 0) {
return Result.fail("超出保证金最大减少金额");
}
- memberWalletContractDao.increaseWalletContractBalanceById(changeBondDto.getAmount(), null, changeBondDto.getAmount().negate(), walletContract.getId());
+ memberWalletContractDao.increaseWalletContractBalanceById(changeBondDto.getAmount(), null, null, walletContract.getId());
holdOrderEntity.setBondAmount(holdOrderEntity.getBondAmount().subtract(changeBondDto.getAmount()));
}
@@ -633,10 +633,10 @@
OrderModel model = null;
// 开多
if (ContractHoldOrderEntity.OPENING_TYPE_MORE == type) {
- model = new OrderModel(id, RabbitPriceTypeEnum.CLOSE_MORE_BOMB.getValue(), forceClosingPrice.setScale(8, RoundingMode.HALF_UP).toPlainString(), symbol);
+ model = new OrderModel(id, RabbitPriceTypeEnum.CLOSE_MORE_BOMB.getValue(), forceClosingPrice.setScale(8, RoundingMode.HALF_UP).toPlainString(), symbol, 1);
// 开空
} else {
- model = new OrderModel(id, RabbitPriceTypeEnum.CLOSE_LESS_BOMB.getValue(), forceClosingPrice.setScale(8, RoundingMode.HALF_UP).toPlainString(), symbol);
+ model = new OrderModel(id, RabbitPriceTypeEnum.CLOSE_LESS_BOMB.getValue(), forceClosingPrice.setScale(8, RoundingMode.HALF_UP).toPlainString(), symbol, 1);
}
producer.sendPriceOperate(JSONObject.toJSONString(model));
}
--
Gitblit v1.9.1