| | |
| | | import com.xcong.excoin.common.configure.FebsConfigure; |
| | | import com.xcong.excoin.common.entity.FebsResponse; |
| | | import com.xcong.excoin.common.entity.QueryRequest; |
| | | import com.xcong.excoin.common.exception.GlobalException; |
| | | import com.xcong.excoin.modules.Sms106Send; |
| | | import com.xcong.excoin.modules.member.dto.MemberDetailConfirmDto; |
| | | import com.xcong.excoin.modules.member.entity.ActivityReceiveRecord; |
| | | import com.xcong.excoin.modules.member.entity.AgentFriendRelationEntity; |
| | | import com.xcong.excoin.modules.member.entity.MemberAccountMoneyChangeEntity; |
| | | import com.xcong.excoin.modules.member.entity.MemberAuthenticationEntity; |
| | |
| | | import com.xcong.excoin.modules.member.mapper.MemberQuickBuySaleMapper; |
| | | import com.xcong.excoin.modules.member.mapper.MemberWalletCoinMapper; |
| | | import com.xcong.excoin.modules.member.service.IMemberService; |
| | | import com.xcong.excoin.modules.member.vo.MemberActivityReceiveVo; |
| | | import com.xcong.excoin.modules.member.vo.MemberAuthenticationVo; |
| | | import com.xcong.excoin.modules.member.vo.MemberCoinChargeVo; |
| | | import com.xcong.excoin.modules.member.vo.MemberCoinWithdrawVo; |
| | |
| | | import com.xcong.excoin.modules.member.vo.MemberQuickBuySaleVo; |
| | | import com.xcong.excoin.modules.member.vo.MemberQuickSaleVo; |
| | | |
| | | import com.xcong.excoin.modules.yunding.entity.BasicLevelSettingEntity; |
| | | import com.xcong.excoin.modules.yunding.mapper.BasicLevelSettingMapper; |
| | | import lombok.RequiredArgsConstructor; |
| | | import java.math.BigDecimal; |
| | | import java.text.DecimalFormat; |
| | |
| | | private final MemberAuthenticationMapper memberAuthenticationMapper; |
| | | |
| | | private final AgentFriendRelationMapper agentFriendRelationMapper; |
| | | |
| | | private final BasicLevelSettingMapper basicLevelSettingMapper; |
| | | |
| | | @Override |
| | | public IPage<AgentFriendRelationEntity> findAgentInfoListInPage(AgentFriendRelationEntity agentFriendRelationEntity, |
| | |
| | | String firstName = (memberEntitys.getFirstName() == null ? "" : memberEntitys.getFirstName()); |
| | | String secondName = (memberEntitys.getSecondName() == null ? "" : memberEntitys.getSecondName()); |
| | | memberEntitys.setRealName(firstName+secondName); |
| | | if (memberEntitys.getAgentLevel() != null) { |
| | | BasicLevelSettingEntity agent = basicLevelSettingMapper.selectById(memberEntitys.getAgentLevel().longValue()); |
| | | memberEntitys.setAgentName(agent.getName()); |
| | | } |
| | | } |
| | | } |
| | | return selectMemberListInPage; |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public FebsResponse memberWithdrawCoinConfirm(@NotNull(message = "{required}") Long id) { |
| | | |
| | | MemberCoinWithdrawEntity selectById = memberCoinWithdrawMapper.selectById(id); |
| | |
| | | String address = selectById.getAddress(); |
| | | int status = selectById.getStatus(); |
| | | if(status != 1) { |
| | | return new FebsResponse().fail().message("只有等待审核的状态才能确认!"); |
| | | return new FebsResponse().message("只有等待审核的状态才能确认!"); |
| | | } |
| | | |
| | | // 查询币币钱包 |
| | |
| | | memberWalletCoinMapper.updateById(walletCoin); |
| | | |
| | | if ("Y".equals(selectById.getIsInside())) { |
| | | Map<String, Object> columnMap = new HashMap<>(); |
| | | columnMap.put("symbol", symbol); |
| | | columnMap.put("address", address); |
| | | // 如果是内部转账 则需要将币加到内部地址 |
| | | List<MemberCoinAddressEntity> selectByMap = memberCoinAddressMapper.selectByMap(columnMap); |
| | | if(selectByMap == null || selectByMap.isEmpty()) { |
| | | return new FebsResponse().fail().message("地址有误,请拒绝!"); |
| | | |
| | | Long aimMemberId = null; |
| | | if(symbol.equals("XCH")){ |
| | | MemberEntity memberEntity = memberMapper.selectMemberByInviteId(address); |
| | | if (memberEntity == null) { |
| | | throw new GlobalException("地址有误或用户不存在,请拒绝!"); |
| | | } |
| | | aimMemberId = memberEntity.getId(); |
| | | }else{ |
| | | Map<String, Object> columnMap = new HashMap<>(); |
| | | columnMap.put("symbol", symbol); |
| | | columnMap.put("address", address); |
| | | // 如果是内部转账 则需要将币加到内部地址 |
| | | List<MemberCoinAddressEntity> selectByMap = memberCoinAddressMapper.selectByMap(columnMap); |
| | | if(CollUtil.isEmpty(selectByMap)) { |
| | | // return new FebsResponse().message("地址有误,请拒绝!"); |
| | | // throw new GlobalException("地址有误,请拒绝!"); |
| | | MemberEntity memberEntity = memberMapper.selectMemberInfoByQueryKey(address); |
| | | if (memberEntity == null) { |
| | | throw new GlobalException("地址有误或用户不存在,请拒绝!"); |
| | | } |
| | | |
| | | aimMemberId = memberEntity.getId(); |
| | | } else { |
| | | aimMemberId = selectByMap.get(0).getMemberId(); |
| | | } |
| | | } |
| | | Long aimMemberId = selectByMap.get(0).getMemberId(); |
| | | MemberWalletCoinEntity aimWalletCoin = memberWalletCoinMapper.findWalletCoinByMemberIdAndWalletCode(aimMemberId, symbol); |
| | | |
| | | BigDecimal addTotal = aimWalletCoin.getTotalBalance().add(selectById.getAmount()); |
| | |
| | | return selectMemberListInPage; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public IPage<MemberActivityReceiveVo> memberActivityReceive(ActivityReceiveRecord activityReceiveRecord, |
| | | QueryRequest request) { |
| | | |
| | | Page<ActivityReceiveRecord> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | return memberMapper.memberActivityReceive(page, activityReceiveRecord); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public IPage<ActivityReceiveRecord> seeReceiveInfo(QueryRequest request, |
| | | ActivityReceiveRecord activityReceiveRecord) { |
| | | Page<ActivityReceiveRecord> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | return memberMapper.seeReceiveInfo(page, activityReceiveRecord); |
| | | } |
| | | |
| | | } |