| | |
| | | package com.yami.trading.api.controller.exchange; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.extra.qrcode.QrCodeUtil; |
| | | import cn.hutool.extra.qrcode.QrConfig; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.yami.trading.UD.*; |
| | | import com.yami.trading.UD.Address; |
| | |
| | | //缓存订单 |
| | | RechargeBlockchainOrder recharge = new RechargeBlockchainOrder(); |
| | | recharge.setBlockchainName(currencyEnum.getChain()); |
| | | recharge.setSymbol(currencyEnum.getSymbol()); |
| | | recharge.setSymbol(currencyEnum.getCoin()); |
| | | recharge.setPartyId(partyId); |
| | | redisTemplate.opsForValue().set(rechargeAddressVo.getAddress(), recharge); |
| | | |
| | |
| | | double success_amount = amounts / Math.pow(10, decimals); |
| | | String address = map.get("address").toString(); |
| | | Integer status = Integer.valueOf(map.get("status").toString()); |
| | | /*RechargeBlockchainOrder blockchainOrder = rechargeBlockchainOrderService.getOne(new LambdaQueryWrapper<>(RechargeBlockchainOrder.class) |
| | | RechargeBlockchainOrder blockchainOrder = rechargeBlockchainOrderService.getOne(new LambdaQueryWrapper<>(RechargeBlockchainOrder.class) |
| | | .eq(RechargeBlockchainOrder::getSucceeded, 0) |
| | | .eq(RechargeBlockchainOrder::getChannelAddress, address).last(" limit 1 ")); |
| | | if(ObjectUtil.isEmpty(blockchainOrder)) { |
| | | resultMsg.setCode(200); |
| | | return resultMsg; |
| | | }*/ |
| | | |
| | | //查询地址订单 |
| | | RechargeBlockchainOrder blockchainOrder = (RechargeBlockchainOrder)redisTemplate.opsForValue().get(address); |
| | | //未提交订单取缓存订单 |
| | | blockchainOrder = (RechargeBlockchainOrder)redisTemplate.opsForValue().get(address); |
| | | } |
| | | if (blockchainOrder == null){ |
| | | resultMsg.setCode(200); |
| | | return resultMsg; |