| | |
| | | import com.xcong.excoin.modules.member.entity.*; |
| | | import com.xcong.excoin.modules.platform.entity.PlatformTradeSettingEntity; |
| | | import com.xcong.excoin.rabbit.pricequeue.OrderModel; |
| | | import com.xcong.excoin.rabbit.producer.FollowProducer; |
| | | import com.xcong.excoin.rabbit.producer.OrderProducer; |
| | | import com.xcong.excoin.utils.CacheSettingUtils; |
| | | import com.xcong.excoin.utils.CalculateUtil; |
| | | import com.xcong.excoin.utils.LogRecordUtils; |
| | | import com.xcong.excoin.utils.ThreadPoolUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | @Resource |
| | | private MemberSettingDao memberSettingDao; |
| | | |
| | | @Autowired |
| | | private FollowProducer followProducer; |
| | | |
| | | |
| | | @Override |
| | | // @Transactional(rollbackFor = Exception.class) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void addFollowerOrder(Long id) { |
| | | log.info("进入跟单处理逻辑 : {}", id); |
| | | // 查询交易员订单 |
| | | ContractHoldOrderEntity holdOrderEntity = contractHoldOrderDao.selectById(id); |
| | | |
| | | while (holdOrderEntity == null) { |
| | | if (holdOrderEntity == null) { |
| | | try { |
| | | log.info("等待事务提交:{}", id); |
| | | Thread.sleep(200); |
| | | holdOrderEntity = contractHoldOrderDao.selectById(id); |
| | | followProducer.sendAddFollowOrder(id); |
| | | return; |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |