| | |
| | | import com.xcong.excoin.common.enumerates.CoinTypeEnum; |
| | | import com.xcong.excoin.common.enumerates.OrderClosingTypeEnum; |
| | | import com.xcong.excoin.common.system.service.CommonService; |
| | | import com.xcong.excoin.modules.contract.dao.ContractEntrustOrderDao; |
| | | import com.xcong.excoin.modules.contract.dao.ContractHoldOrderDao; |
| | | import com.xcong.excoin.modules.contract.dao.ContractOrderDao; |
| | | import com.xcong.excoin.modules.contract.entity.ContractEntrustOrderEntity; |
| | |
| | | import com.xcong.excoin.modules.member.entity.MemberSettingEntity; |
| | | import com.xcong.excoin.modules.member.entity.MemberWalletContractEntity; |
| | | import com.xcong.excoin.modules.platform.entity.PlatformTradeSettingEntity; |
| | | import com.xcong.excoin.rabbit.pricequeue.OrderModel; |
| | | import com.xcong.excoin.utils.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private MemberDao memberDao; |
| | | |
| | | @Resource |
| | | private OrderWebsocketServiceImpl orderWebsocketService; |
| | | |
| | | @Resource |
| | | private ContractHoldOrderDao contractHoldOrderDao; |
| | | |
| | | @Resource |
| | | private ContractOrderDao contractOrderDao; |
| | | |
| | | @Resource |
| | | private CommonService commonService; |
| | | |
| | | @Resource |
| | | private MemberWalletContractDao memberWalletContractDao; |
| | | |
| | | @Resource |
| | | private CacheSettingUtils cacheSettingUtils; |
| | | |
| | | @Resource |
| | | private RedisUtils redisUtils; |
| | | @Resource |
| | | private MemberSettingDao memberSettingDao; |
| | | |
| | | @Resource |
| | | private FollowFollowerOrderRelationDao followFollowerOrderRelationDao; |
| | | @Resource |
| | |
| | | private FollowTraderProfitDetailDao followTraderProfitDetailDao; |
| | | @Resource |
| | | private FollowFollowerProfitDao followFollowerProfitDao; |
| | | @Resource |
| | | private ContractEntrustOrderDao contractEntrustOrderDao; |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void entrustCloseOrder(List<OrderModel> list) { |
| | | if (CollUtil.isNotEmpty(list)) { |
| | | List<Long> ids = new ArrayList<>(); |
| | | list.forEach(model -> ids.add(model.getOrderId())); |
| | | List<ContractEntrustOrderEntity> contractEntrustOrderEntities = contractEntrustOrderDao.selectEntrustOrderListByIds(ids); |
| | | |
| | | if (CollUtil.isNotEmpty(contractEntrustOrderEntities)) { |
| | | for (ContractEntrustOrderEntity entrustOrderEntity : contractEntrustOrderEntities) { |
| | | closeOrder(entrustOrderEntity); |
| | | } |
| | | } else { |
| | | log.info("平仓委托单未找到"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void closeOrder(ContractEntrustOrderEntity entrustOrder) { |
| | | log.info("执行平仓委托"); |
| | | } |
| | | } |