From 58686a85bdfa549ac87f4dfd34a472ddc22a5667 Mon Sep 17 00:00:00 2001 From: xiaoyong931011 <15274802129@163.com> Date: Wed, 05 Aug 2020 15:08:53 +0800 Subject: [PATCH] 20200805 代码提交 --- src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java | 40 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 40 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java b/src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java index 189ff0c..afd020e 100644 --- a/src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java +++ b/src/main/java/com/xcong/excoin/modules/documentary/service/impl/DocumentaryServiceImpl.java @@ -35,6 +35,7 @@ import com.xcong.excoin.modules.documentary.dto.HistoryOrderRecordsDto; import com.xcong.excoin.modules.documentary.dto.MyFollowOrderDto; import com.xcong.excoin.modules.documentary.dto.MyFollowTraderInfoDto; +import com.xcong.excoin.modules.documentary.dto.TradeFollowInfoDto; import com.xcong.excoin.modules.documentary.dto.TradeOrderInfoDto; import com.xcong.excoin.modules.documentary.dto.UpdateDocumentaryOrderSetDto; import com.xcong.excoin.modules.documentary.dto.UpdateTradeSetInfoDto; @@ -53,6 +54,7 @@ import com.xcong.excoin.modules.documentary.vo.MemberIsTradeVo; import com.xcong.excoin.modules.documentary.vo.MyFollowOrderVo; import com.xcong.excoin.modules.documentary.vo.MyFollowTraderInfoVo; +import com.xcong.excoin.modules.documentary.vo.TradeFollowInfoVo; import com.xcong.excoin.modules.documentary.vo.TradeHistoryOrderInfoVo; import com.xcong.excoin.modules.documentary.vo.TradeOrderInfoVo; import com.xcong.excoin.modules.documentary.vo.TradeProfitInfoVo; @@ -852,6 +854,44 @@ } return Result.ok(myFollowOrderVos); } + + @Override + public Result getTradeFollowInfo(@Valid TradeFollowInfoDto tradeFollowInfoDto) { + //获取用户ID + Long memberId = LoginUserUtils.getAppLoginUser().getId(); + List<TradeFollowInfoVo> myFollowOrderVos = new ArrayList<>(); + + Page<FollowFollowerProfitEntity> page = new Page<>(tradeFollowInfoDto.getPageNum(), tradeFollowInfoDto.getPageSize()); + IPage<FollowFollowerProfitEntity> followFollowerProfitEntitys = followFollowerProfitDao.selectTradeFollowerProfitEntitys(page, memberId); + List<FollowFollowerProfitEntity> records = followFollowerProfitEntitys.getRecords(); + if(CollUtil.isNotEmpty(records)) { + for(FollowFollowerProfitEntity followFollowerProfitEntity : records) { + TradeFollowInfoVo myFollowTraderInfoVo = new TradeFollowInfoVo(); + + Long followMemberId = followFollowerProfitEntity.getMemberId(); + MemberEntity memberEntity = memberDao.selectById(followMemberId); + if(ObjectUtil.isNotEmpty(memberEntity)) { + String phone = memberEntity.getPhone(); + String email = memberEntity.getEmail(); + if(StrUtil.isNotEmpty(phone)) { + myFollowTraderInfoVo.setAccount(phone); + }else { + myFollowTraderInfoVo.setAccount(email); + } + } + + Long id = followFollowerProfitEntity.getId(); + myFollowTraderInfoVo.setId(id); + BigDecimal totalPrincipal = followFollowerProfitEntity.getTotalPrincipal(); + myFollowTraderInfoVo.setTotalPrincipal(totalPrincipal); + BigDecimal totalProfit = followFollowerProfitEntity.getTotalProfit(); + myFollowTraderInfoVo.setTotalProfit(totalProfit.setScale(2, BigDecimal.ROUND_DOWN)); + + myFollowOrderVos.add(myFollowTraderInfoVo); + } + } + return Result.ok(myFollowOrderVos); + } -- Gitblit v1.9.1