| | |
| | | * 根据区块地址获取充值订单 |
| | | */ |
| | | public RechargeBlockchain getAddress(String address) { |
| | | List<RechargeBlockchain> list = jdbcTemplate.query("SELECT * FROM T_RECHARGE_BLOCKCHAIN_ORDER WHERE blockchain_name=?", RecordObjectMapper.newInstance(RechargeBlockchain.class), address); |
| | | List<RechargeBlockchain> list = jdbcTemplate.query("SELECT * FROM T_RECHARGE_BLOCKCHAIN_ORDER WHERE CHANNEL_ADDRESS=?", RecordObjectMapper.newInstance(RechargeBlockchain.class), address); |
| | | if (null != list && list.size() > 0) { |
| | | return list.get(0); |
| | | } |
| | |
| | | try { |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | Map<String, Object> map = objectMapper.readValue(body, HashMap.class); |
| | | double amounts = Double.parseDouble(map.get("fee").toString()); // 假设 amount 的值为 1000 |
| | | double amounts = Double.parseDouble(map.get("amount").toString()); // 假设 amount 的值为 1000 |
| | | double decimals = Double.parseDouble(map.get("decimals").toString()); |
| | | double success_amount = amounts / Math.pow(10, decimals); |
| | | RechargeBlockchain recharge = this.getAddress(map.get("address").toString()); |