Helius
2020-06-03 4dff18fc545706cc9ea09e0cdf4daeebc16b064f
src/main/java/com/xcong/excoin/modules/contract/service/impl/ContractHoldOrderServiceImpl.java
@@ -43,10 +43,7 @@
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
 * @author wzy
@@ -156,6 +153,7 @@
        holdOrderEntity.setMarkPrice(newPrice);
        holdOrderEntity.setIsCanClosing(ContractHoldOrderEntity.ORDER_CAN_CLOSING_Y);
        holdOrderEntity.setPrePaymentAmount(prePaymentAmount);
        holdOrderEntity.setOpeningTime(new Date());
        holdOrderEntity.setBondAmount(bondAmount.add(openFeePrice));
        ContractOrderEntity contractOrderEntity = ContractHoldOrderEntityMapper.INSTANCE.holdOrderToOrder(holdOrderEntity);
@@ -366,10 +364,10 @@
            if (ContractHoldOrderEntity.OPENING_TYPE_MORE == holdOrderEntity.getOpeningType()) {
                // 开多止盈
                if (ProfitOrLessDto.TYPE_PROFIT == profitOrLessDto.getType()) {
                    model = new OrderModel(holdOrderEntity.getId(), RabbitPriceTypeEnum.CLOSE_MORE_STOP_PROFIT.getValue(), price.toPlainString(), holdOrderEntity.getSymbol());
                    model = new OrderModel(holdOrderEntity.getId(), RabbitPriceTypeEnum.CLOSE_MORE_STOP_PROFIT.getValue(), price.setScale(8, RoundingMode.HALF_UP).toPlainString(), holdOrderEntity.getSymbol());
                    // 开多止损
                } else {
                    model = new OrderModel(holdOrderEntity.getId(), RabbitPriceTypeEnum.CLOSE_MORE_STOP_LESS.getValue(), price.toPlainString(), holdOrderEntity.getSymbol());
                    model = new OrderModel(holdOrderEntity.getId(), RabbitPriceTypeEnum.CLOSE_MORE_STOP_LESS.getValue(), price.setScale(8, RoundingMode.HALF_UP).toPlainString(), holdOrderEntity.getSymbol());
                }
            } else {
                // 开空止盈