xiaoyong931011
2021-03-25 349589ac13f62c44ceb7638adf16973cc5fb07d5
20210325  跟随者的历史订单显示爆仓,爆仓算入跟随者收益
2 files modified
23 ■■■■■ changed files
src/main/java/com/xcong/excoin/modules/contract/service/impl/OrderWebsocketServiceImpl.java 22 ●●●●● patch | view | raw | blame | history
src/main/resources/mapper/documentary/FollowFollowerProfitDao.xml 1 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/contract/service/impl/OrderWebsocketServiceImpl.java
@@ -1,7 +1,9 @@
package com.xcong.excoin.modules.contract.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xcong.excoin.common.contants.AppContants;
import com.xcong.excoin.common.enumerates.CoinTypeEnum;
import com.xcong.excoin.modules.coin.dao.MemberAccountFlowEntityDao;
@@ -16,6 +18,9 @@
import com.xcong.excoin.modules.contract.service.ContractEntrustOrderService;
import com.xcong.excoin.modules.contract.service.ContractHoldOrderService;
import com.xcong.excoin.modules.contract.service.ContractOrderService;
import com.xcong.excoin.modules.documentary.dao.FollowFollowerProfitDao;
import com.xcong.excoin.modules.documentary.dao.FollowFollowerSettingDao;
import com.xcong.excoin.modules.documentary.entity.FollowFollowerSettingEntity;
import com.xcong.excoin.modules.documentary.service.FollowOrderOperationService;
import com.xcong.excoin.modules.member.dao.AgentReturnDao;
import com.xcong.excoin.modules.member.dao.MemberSettingDao;
@@ -58,6 +63,12 @@
    @Resource
    MemberWalletContractService memberWalletContractService;
    @Resource
    FollowFollowerProfitDao followFollowerProfitDao;
    @Resource
    FollowFollowerSettingDao followFollowerSettingDao;
    @Resource
    CacheSettingUtils cacheSettingUtils;
@@ -889,6 +900,17 @@
                if (ContractOrderEntity.CONTRACTTYPE_DOCUMENTARY == coinsOrder.getContractType() && MemberEntity.IS_TRADER_Y.equals(memberEntity.getIsTrader())) {
                    followOrderOperationService.closingFollowOrders(coinsOrder.getOrderNo());
                }
                // 如果不是交易员,那么需要更新他的个人跟随者收益记录
                if (ContractOrderEntity.CONTRACTTYPE_DOCUMENTARY == coinsOrder.getContractType() && !MemberEntity.IS_TRADER_Y.equals(memberEntity.getIsTrader())) {
                    //获取当前的跟单设置(一次只允许跟单一个人),获取交易员MemberId
                    QueryWrapper<FollowFollowerSettingEntity> queryWrapper = new QueryWrapper<>();
                    queryWrapper.eq("member_id",coinsOrder.getMemberId());
                    FollowFollowerSettingEntity followFollowerSettingEntity = followFollowerSettingDao.selectOne(queryWrapper);
                    if(ObjectUtil.isNotEmpty(followFollowerSettingEntity)){
                        Long traderMemberId = followFollowerSettingEntity.getTraderMemberId();
                        followFollowerProfitDao.updateFollowerProfitByTradeMemberId(coinsOrder.getBondAmount().negate(), coinsOrder.getBondAmount().negate(), traderMemberId, memberEntity.getId());
                    }
                }
            } else {
                MemberWalletContractEntity wallet = memberWalletContractService.findWalletContractByMemberIdAndSymbol(memId, "USDT");
src/main/resources/mapper/documentary/FollowFollowerProfitDao.xml
@@ -60,7 +60,6 @@
            member_id = #{memberId} 
            and contract_type = 2
            and order_type in (3,4)
            and closing_type not in (4,5)
        order by create_time desc
    </select>
    <select id="getMyFollowOrderNowRecords" resultType="com.xcong.excoin.modules.contract.entity.ContractHoldOrderEntity">