Helius
2021-04-06 834d43a199755d286e68817998cba1d4c069d214
modify
2 files modified
9 ■■■■■ changed files
src/main/java/com/xcong/excoin/modules/documentary/service/impl/FollowOrderOperationServiceImpl.java 7 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/rabbit/consumer/FollowConsumer.java 2 ●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/documentary/service/impl/FollowOrderOperationServiceImpl.java
@@ -387,6 +387,9 @@
        List<FollowFollowerOrderRelationEntity> relations = followFollowerOrderRelationDao.selectFollowHoldOrderByTradeOrderNo(contractHoldOrderEntity.getOrderNo());
        if (CollUtil.isNotEmpty(relations)) {
            for (FollowFollowerOrderRelationEntity relation : relations) {
                if (contractHoldOrderEntity.getId().equals(relation.getOrderId())) {
                    continue;
                }
                ContractHoldOrderEntity followHoldOrder = contractHoldOrderDao.selectById(relation.getOrderId());
                MemberEntity memberEntity = memberDao.selectById(relation.getMemberId());
                MemberWalletContractEntity wallet = memberWalletContractDao.findWalletContractByMemberIdAndSymbol(memberEntity.getId(), CoinTypeEnum.USDT.name());
@@ -405,7 +408,7 @@
                } else {
                    if (followHoldOrder.getBondAmount().subtract(followHoldOrder.getPrePaymentAmount()).subtract(bond).compareTo(BigDecimal.ZERO) < 0) {
                        log.info("超出保证金最大减少金额-1");
                        LogRecordUtils.insertFollowerNotice(memberEntity.getId(), NoticeConstant.CHANGE_BOND_TITLE, NoticeConstant.CHANGE_BOND_ADD_CONTENT_FAIL);
                        LogRecordUtils.insertFollowerNotice(memberEntity.getId(), NoticeConstant.CHANGE_BOND_TITLE, NoticeConstant.CHANGE_BOND_REDUCE_CONTENT_FAIL);
                        continue;
                    }
@@ -414,7 +417,7 @@
                        BigDecimal canReduceMax = followHoldOrder.getBondAmount().subtract(followHoldOrder.getPrePaymentAmount()).add(profitOrLoss);
                        if (canReduceMax.subtract(bond).compareTo(BigDecimal.ZERO) < 0) {
                            log.info("超出保证金最大减少金额-2");
                            LogRecordUtils.insertFollowerNotice(memberEntity.getId(), NoticeConstant.CHANGE_BOND_TITLE, NoticeConstant.CHANGE_BOND_ADD_CONTENT_FAIL);
                            LogRecordUtils.insertFollowerNotice(memberEntity.getId(), NoticeConstant.CHANGE_BOND_TITLE, NoticeConstant.CHANGE_BOND_REDUCE_CONTENT_FAIL);
                            continue;
                        }
                    }
src/main/java/com/xcong/excoin/rabbit/consumer/FollowConsumer.java
@@ -36,7 +36,7 @@
        followOrderOperationService.addFollowerOrder(Long.parseLong(content));
    }
//    @RabbitListener(queues = RabbitMqConfig.QUEUE_FOLLOW_CHANGE_BOND)
    @RabbitListener(queues = RabbitMqConfig.QUEUE_FOLLOW_CHANGE_BOND)
    public void changeFollowOrderBond(Message message, Channel channel) {
        String content = new String(message.getBody());
        log.info("==收到跟单保证金调整消息 : {}", content);