From 0d03d3fe08f4ca6865adf4147dbbc4830e231837 Mon Sep 17 00:00:00 2001 From: xiaoyong931011 <15274802129@163.com> Date: Fri, 08 Jan 2021 11:40:22 +0800 Subject: [PATCH] 20210108 --- src/main/java/com/xcong/excoin/modules/dataMonitoring/service/impl/DataMonitoringServiceImpl.java | 34 ++++++++++++++++++++++++++++------ 1 files changed, 28 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/xcong/excoin/modules/dataMonitoring/service/impl/DataMonitoringServiceImpl.java b/src/main/java/com/xcong/excoin/modules/dataMonitoring/service/impl/DataMonitoringServiceImpl.java index 11a2cfd..a30ca48 100644 --- a/src/main/java/com/xcong/excoin/modules/dataMonitoring/service/impl/DataMonitoringServiceImpl.java +++ b/src/main/java/com/xcong/excoin/modules/dataMonitoring/service/impl/DataMonitoringServiceImpl.java @@ -21,7 +21,9 @@ import com.xcong.excoin.modules.dataMonitoring.entity.DataMonitoringEntity; import com.xcong.excoin.modules.dataMonitoring.mapper.DataMonitoringMapper; import com.xcong.excoin.modules.dataMonitoring.service.DataMonitoringService; +import com.xcong.excoin.modules.member.entity.MemberAuthenticationEntity; import com.xcong.excoin.modules.member.entity.MemberEntity; +import com.xcong.excoin.modules.member.mapper.MemberAuthenticationMapper; import com.xcong.excoin.modules.member.mapper.MemberMapper; import com.xcong.excoin.modules.trademanage.entity.ContractHoldOrderEntity; import com.xcong.excoin.modules.trademanage.entity.ContractOrderEntity; @@ -39,12 +41,31 @@ private final DataMonitoringMapper dataMonitoringMapper; private final MemberMapper memberMapper; + + private final MemberAuthenticationMapper memberAuthenticationMapper; @Override public IPage<DataMonitoringEntity> findDataMonitoringListInPage(DataMonitoringEntity dataMonitoringEntity, QueryRequest request) { Page<DataMonitoringEntity> page = new Page<>(request.getPageNum(), request.getPageSize()); IPage<DataMonitoringEntity> DataMonitoringEntitys = dataMonitoringMapper.findDataMonitoringListInPage(page, dataMonitoringEntity); + List<DataMonitoringEntity> records = DataMonitoringEntitys.getRecords(); + if(CollUtil.isNotEmpty(records)) { + for(DataMonitoringEntity DataMonitoringEntity :records) { + Long memberId = DataMonitoringEntity.getMemberId(); + Map<String, Object> columnMap = new HashMap<>(); + columnMap.put("member_id", memberId); + List<MemberAuthenticationEntity> selectByMap = memberAuthenticationMapper.selectByMap(columnMap ); + if(selectByMap != null && selectByMap.size() > 0) { + MemberAuthenticationEntity memberAuthenticationEntity = selectByMap.get(0); + String firstName = memberAuthenticationEntity.getFirstName(); + String secondName = memberAuthenticationEntity.getSecondName(); + String realName = firstName + secondName; + DataMonitoringEntity.setRealName(realName); + } + } + } + return DataMonitoringEntitys; } @@ -98,13 +119,14 @@ dataMonitoringOne.setCount(allOrder); dataMonitoringOne.setCreateTime(new Date()); dataMonitoringMapper.updateById(dataMonitoringOne); + }else { + DataMonitoringEntity dataMonitoring = new DataMonitoringEntity(); + dataMonitoring.setMemberId(memberIdString); + dataMonitoring.setCount(allOrder); + dataMonitoring.setType(1); + dataMonitoring.setCreateTime(new Date()); + dataMonitoringMapper.insert(dataMonitoring); } - DataMonitoringEntity dataMonitoring = new DataMonitoringEntity(); - dataMonitoring.setMemberId(memberIdString); - dataMonitoring.setCount(allOrder); - dataMonitoring.setType(1); - dataMonitoring.setCreateTime(new Date()); - dataMonitoringMapper.insert(dataMonitoring); } } } -- Gitblit v1.9.1