| | |
| | | package com.xcong.excoin.modules.member.service.impl; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.RandomUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xcong.excoin.common.entity.FebsResponse; |
| | | import com.xcong.excoin.common.entity.QueryRequest; |
| | | import com.xcong.excoin.common.utils.RedisUtils; |
| | | import com.xcong.excoin.common.utils.TRC20ApiUtils; |
| | | import com.xcong.excoin.modules.Sms106Send; |
| | | import com.xcong.excoin.modules.member.dto.MemberDetailConfirmDto; |
| | | import com.xcong.excoin.modules.member.entity.*; |
| | |
| | | private final AgentFriendRelationMapper agentFriendRelationMapper; |
| | | |
| | | private final TdFinancialReordDao tdFinancialReordDao; |
| | | |
| | | private final RedisUtils redisUtils; |
| | | |
| | | @Override |
| | | public IPage<AgentFriendRelationEntity> findAgentInfoListInPage(AgentFriendRelationEntity agentFriendRelationEntity, |
| | |
| | | |
| | | selectById.setStatus(MemberCoinWithdrawEntity.IS_STATUS_Y); |
| | | memberCoinWithdrawMapper.updateById(selectById); |
| | | |
| | | if ("TRC20".equals(selectById.getLabel())) { |
| | | Thread thread = new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | log.info("远程调用TRC执行:{}", selectById.getId()); |
| | | String orderNo = generateOrderNo(memberId); |
| | | TRC20ApiUtils.coinApply(orderNo, memberId.toString(), selectById.getSymbol(), selectById.getAmount().toPlainString(), selectById.getAddress()); |
| | | selectById.setTag(orderNo); |
| | | memberCoinWithdrawMapper.updateById(selectById); |
| | | } |
| | | }); |
| | | thread.start(); |
| | | } |
| | | |
| | | MemberEntity memberEntity = memberMapper.selectById(memberId); |
| | | String phone = memberEntity.getPhone(); |
| | | //String email = memberEntity.getEmail(); |
| | |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | public String generateOrderNo(Long mid) { |
| | | StringBuilder orderNo = new StringBuilder(); |
| | | String date = DateUtil.format(new Date(), "yyyyMMdd"); |
| | | orderNo.append(date); |
| | | orderNo.append(mid); |
| | | orderNo.append(RandomUtil.randomNumbers(2)); |
| | | |
| | | Object countObj = redisUtils.get(date); |
| | | if (countObj == null) { |
| | | countObj = 0; |
| | | } |
| | | int count = (int) countObj; |
| | | count++; |
| | | redisUtils.set(date, count, 24 * 60 * 60); |
| | | |
| | | int size = 4; |
| | | for (int i = 0; i < size - String.valueOf(count).length(); i++) { |
| | | orderNo.append("0"); |
| | | } |
| | | orderNo.append(count); |
| | | return orderNo.toString(); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public FebsResponse memberWithdrawCoinCancel(@NotNull(message = "{required}") Long id) { |