From 868617d892d9254100a5704e8eafa50e2363447c Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Mon, 03 Aug 2020 16:07:36 +0800
Subject: [PATCH] modify
---
src/main/java/com/xcong/excoin/modules/documentary/entity/FollowFollowerOrderRelationEntity.java | 11 +++++++++++
src/main/java/com/xcong/excoin/modules/documentary/service/impl/FollowOrderOperationServiceImpl.java | 18 +++++++++++++++---
2 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/xcong/excoin/modules/documentary/entity/FollowFollowerOrderRelationEntity.java b/src/main/java/com/xcong/excoin/modules/documentary/entity/FollowFollowerOrderRelationEntity.java
index 880ab03..1c7a446 100644
--- a/src/main/java/com/xcong/excoin/modules/documentary/entity/FollowFollowerOrderRelationEntity.java
+++ b/src/main/java/com/xcong/excoin/modules/documentary/entity/FollowFollowerOrderRelationEntity.java
@@ -39,6 +39,17 @@
* 交易员ID
*/
private Long tradeId;
+
+ /**
+ * 跟单订单ID
+ */
+ private Long tradeOrderId;
+
+ /**
+ * 交易员用户ID
+ */
+ private Long tradeMemberId;
+
/**
* 订单ID
*/
diff --git a/src/main/java/com/xcong/excoin/modules/documentary/service/impl/FollowOrderOperationServiceImpl.java b/src/main/java/com/xcong/excoin/modules/documentary/service/impl/FollowOrderOperationServiceImpl.java
index 8f7b81f..40f1d2c 100644
--- a/src/main/java/com/xcong/excoin/modules/documentary/service/impl/FollowOrderOperationServiceImpl.java
+++ b/src/main/java/com/xcong/excoin/modules/documentary/service/impl/FollowOrderOperationServiceImpl.java
@@ -18,6 +18,7 @@
import com.xcong.excoin.modules.documentary.dao.FollowFollowerProfitDao;
import com.xcong.excoin.modules.documentary.dao.FollowFollowerSettingDao;
import com.xcong.excoin.modules.documentary.dao.FollowTraderInfoDao;
+import com.xcong.excoin.modules.documentary.entity.FollowFollowerOrderRelationEntity;
import com.xcong.excoin.modules.documentary.entity.FollowFollowerProfitEntity;
import com.xcong.excoin.modules.documentary.entity.FollowFollowerSettingEntity;
import com.xcong.excoin.modules.documentary.entity.FollowTraderInfoEntity;
@@ -70,6 +71,7 @@
private OrderProducer producer;
@Resource
private FollowTraderInfoDao followTraderInfoDao;
+
@Override
public void addFollowerOrder(Long id) {
@@ -162,14 +164,24 @@
// 设置合约类型
holdOrderEntity.setContractType(ContractOrderEntity.CONTRACTTYPE_DOCUMENTARY);
- ContractOrderEntity contractOrderEntity = ContractHoldOrderEntityMapper.INSTANCE.holdOrderToOrder(holdOrderEntity);
+ ContractOrderEntity contractOrderEntity = ContractHoldOrderEntityMapper.INSTANCE.holdOrderToOrder(followHoldOrder);
contractOrderEntity.setOpeningTime(new Date());
- contractHoldOrderDao.insert(holdOrderEntity);
+ contractHoldOrderDao.insert(followHoldOrder);
int i = contractOrderDao.insert(contractOrderEntity);
-
+ log.info("----->{}", i);
if (i > 0) {
memberWalletContractDao.increaseWalletContractBalanceById(prePaymentAmount.negate(), openFeePrice.negate(), null, walletContract.getId());
+ FollowFollowerOrderRelationEntity relationEntity = new FollowFollowerOrderRelationEntity();
+ relationEntity.setIsShow(FollowFollowerOrderRelationEntity.IS_SHOW_Y);
+ relationEntity.setMemberId(followHoldOrder.getMemberId());
+ relationEntity.setOrderId(followHoldOrder.getId());
+ relationEntity.setOrderType(FollowFollowerOrderRelationEntity.ORDER_TYPE_HOLD);
+ relationEntity.setTradeId(followTraderInfoEntity.getId());
+ relationEntity.setTradeMemberId(followTraderInfoEntity.getMemberId());
+ relationEntity.setTradeOrderId(id);
+ followFollowerOrderRelationDao.insert(relationEntity);
+
// 发送爆仓消息
sendOrderBombMsg(holdOrderEntity.getId(), holdOrderEntity.getOpeningType(), forceClosingPrice, holdOrderEntity.getSymbol(), holdOrderEntity.getOperateNo());
--
Gitblit v1.9.1