zainali5120
2021-01-11 acf0e1696da79bc7fd73f6356182a172a0adaad8
src/main/java/com/xcong/excoin/modules/blackchain/service/Impl/BlockSeriveImpl.java
@@ -6,6 +6,7 @@
import javax.annotation.Resource;
import com.xcong.excoin.modules.blackchain.service.*;
import com.xcong.excoin.rabbit.producer.UsdtUpdateProducer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@@ -30,6 +31,9 @@
    @Resource
    MemberCoinAddressDao memberMapper;
    @Resource
    private UsdtUpdateProducer usdtUpdateProducer;
    @Override
    public Result findBlockAddress(String symbol) {
        //获取用户ID
@@ -49,7 +53,7 @@
            } else {
                memberCoinAddress = memberMapper.selectBlockAddress(Long.parseLong(mId), symbol);
            }
            log.info("--->{}", memberCoinAddress);
            //log.info("--->{}", memberCoinAddress);
            if (memberCoinAddress != null) {
                map.put("address", memberCoinAddress.getAddress());
                map.put("lable", memberCoinAddress.getLabel());
@@ -157,7 +161,7 @@
                                memberMapper.insert(coinAddress);
                            }
                        } else {
                        } else if ("ERC20".equals(lable)) {
                            MemberCoinAddressEntity ethAddress2 = memberMapper.selectBlockAddress(Long.parseLong(mId), "ETH");
                            if (ethAddress2 != null) {
                                address = ethAddress2.getAddress();
@@ -178,6 +182,15 @@
                                coinAddress.setLabel(uuid);
                                memberMapper.insert(coinAddress);
                            }
                            // 发送新增的地址到监听集合
                            usdtUpdateProducer.sendAddressMsg(address+","+"ERC20");
                        } else if ("TRC20".equals(lable)) {
                            Map<String, String> usdtMap = Trc20Service.createAddress();
                            address = usdtMap.get("address");
                            key = usdtMap.get("privateKey");
                            map.put("address", address);
                            // 发送新增的地址到监听集合
                            usdtUpdateProducer.sendAddressMsg(address+","+"TRC20");
                        }
                        break;
                    case "ROC":
@@ -208,4 +221,8 @@
        return result;
    }
    public static void main(String[] args) {
        String wallet = RocService.createWallet();
        System.out.println(wallet);
    }
}