| | |
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
| | | import com.baomidou.mybatisplus.core.metadata.IPage;
|
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
| | |
| | | import com.xcong.excoin.common.entity.QueryRequest;
|
| | | import com.xcong.excoin.common.utils.CoinTypeConvert;
|
| | | import com.xcong.excoin.common.utils.RedisUtils;
|
| | | import com.xcong.excoin.modules.documentary.entity.FollowFollowerProfitEntity;
|
| | | import com.xcong.excoin.modules.documentary.mapper.FollowFollowerProfitMapper;
|
| | | import com.xcong.excoin.modules.member.entity.MemberAccountMoneyChangeEntity;
|
| | | import com.xcong.excoin.modules.member.entity.MemberAuthenticationEntity;
|
| | | import com.xcong.excoin.modules.member.entity.MemberEntity;
|
| | |
| | | import com.xcong.excoin.modules.trademanage.vo.PositionSettingVo;
|
| | |
|
| | | import cn.hutool.core.collection.CollUtil;
|
| | | import cn.hutool.core.collection.CollectionUtil;
|
| | | import cn.hutool.core.util.ObjectUtil;
|
| | | import cn.hutool.core.util.StrUtil;
|
| | | import lombok.RequiredArgsConstructor;
|
| | |
| | | private final AgentReturnMapper agentReturnMapper;
|
| | |
|
| | | private final MemberAuthenticationMapper memberAuthenticationMapper;
|
| | | |
| | | private final FollowFollowerProfitMapper followFollowerProfitMapper;
|
| | |
|
| | | private final RedisUtils redisUtils;
|
| | |
|
| | |
| | | String realName = firstName + secondName;
|
| | | holdOrderEntity.setRealName(realName);
|
| | | }
|
| | | |
| | | |
| | | //如果是跟单合约,显示他的交易员的邀请码
|
| | | int contractType = holdOrderEntity.getContractType();
|
| | | Long holdOrderEntityMemberId = holdOrderEntity.getMemberId();
|
| | | MemberEntity holdOrderEntityMember = memberMapper.selectById(holdOrderEntityMemberId);
|
| | | Integer isTrader = holdOrderEntityMember.getIsTrader();
|
| | | if(MemberEntity.ISTRADER_N == isTrader) {
|
| | | if(ContractHoldOrderEntity.CONTRACTTYPE_FOLLOW == contractType) {
|
| | | //获取对应的【follow_follower_profit】跟随者收益关系表
|
| | | QueryWrapper<FollowFollowerProfitEntity> queryWrapper = new QueryWrapper<>();
|
| | | queryWrapper.eq("member_id",holdOrderEntity.getMemberId());
|
| | | FollowFollowerProfitEntity followFollowerProfitEntity = followFollowerProfitMapper.selectOne(queryWrapper);
|
| | | Long tradeMemberId = followFollowerProfitEntity.getTradeMemberId();
|
| | | MemberEntity selectByIdTrader = memberMapper.selectById(tradeMemberId);
|
| | | String inviteId = selectByIdTrader.getInviteId();
|
| | | holdOrderEntity.setInviteIdTrader(inviteId);
|
| | | }
|
| | | }
|
| | | // 获取最新价
|
| | | BigDecimal newPrice = new BigDecimal(redisUtils.getString(CoinTypeConvert.convertToKey(holdOrderEntity.getSymbol())));
|
| | | BigDecimal lotNumber = holdOrderEntity.getSymbolSku();
|
| | |
| | | positionSettingVo.setSumRewardAmount(sumRewardAmount);
|
| | | }
|
| | | //降序
|
| | | Collections.sort(records, new Comparator<PositionSettingVo>() {//调用sort()方法,并实现Comparator接口中的compare()方法 |
| | | |
| | | @Override
|
| | | public int compare(PositionSettingVo lhs, PositionSettingVo rhs) {
|
| | | int value = Integer.valueOf(rhs.getSumRewardAmount().intValue()) |
| | | - Integer.valueOf(lhs.getSumRewardAmount().intValue()); |
| | | return 0;
|
| | | } |
| | | |
| | | }); |
| | | // Collections.sort(records, new Comparator<PositionSettingVo>() {//调用sort()方法,并实现Comparator接口中的compare()方法
|
| | | // @Override
|
| | | // public int compare(PositionSettingVo lhs, PositionSettingVo rhs) {
|
| | | // int value = Integer.valueOf(rhs.getSumRewardAmount().intValue())
|
| | | // - Integer.valueOf(lhs.getSumRewardAmount().intValue());
|
| | | // return value;
|
| | | // }
|
| | | // });
|
| | | //升序
|
| | | //CollUtil.sortByProperty(records, "sumRewardAmount");
|
| | | CollUtil.sortByProperty(records, "sumRewardAmount");
|
| | | //CollUtil.sortByProperty(records, "accountType");
|
| | | }
|
| | | // positionSettingVoIPage.setRecords(records);
|
| | | return positionSettingVoIPage;
|
| | | }
|
| | |
|