| | |
| | | walletExtend.setAmount(Double.valueOf(df2.format(walletExtend.getAmount()))); |
| | | walletExtend.setLockAmount(Double.valueOf(df2.format(walletExtend.getLockAmount()))); |
| | | walletExtend.setFreezeAmount(Double.valueOf(df2.format(walletExtend.getFreezeAmount()))); |
| | | walletExtend.setName(itemMap.get(list_symbol.get(i)).getName()); |
| | | walletExtendsRet.add(walletExtend); |
| | | temp = 1; |
| | | } |
| | |
| | | mapUsdt.put("frozenAmount", 0); |
| | | extendsList.add(0, mapUsdt); |
| | | } |
| | | mapRet.put("extends", extendsList); |
| | | |
| | | // 分离 USDC 和 USDT,并保留其他数据 |
| | | Map<String, Object> usdcEntry = null; |
| | | Map<String, Object> usdtEntry = null; |
| | | List<Map<String, Object>> otherEntries = new ArrayList<>(); |
| | | |
| | | for (Map<String, Object> entry : extendsList) { |
| | | String symbolData = (String) entry.get("symbol_data"); |
| | | if ("usdc".equals(symbolData)) { |
| | | usdcEntry = entry; |
| | | } else if ("usdt".equals(symbolData)) { |
| | | usdtEntry = entry; |
| | | } else { |
| | | otherEntries.add(entry); |
| | | } |
| | | } |
| | | |
| | | // 重新组合,USDC 第一,USDT 第二,其他保持原顺序 |
| | | List<Map<String, Object>> newExtendsList = new ArrayList<>(); |
| | | if (usdcEntry != null) newExtendsList.add(usdcEntry); |
| | | if (usdtEntry != null) newExtendsList.add(usdtEntry); |
| | | newExtendsList.addAll(otherEntries); |
| | | |
| | | mapRet.put("extends", newExtendsList); |
| | | |
| | | return Result.succeed(mapRet); |
| | | } |
| | | |
| | |
| | | public Result getPairs(@RequestParam String pairs, String symbolType) throws IOException { |
| | | HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); |
| | | if (StringUtils.isEmptyString(pairs) || !pairs.contains("/")) { |
| | | throw new YamiShopBindException("参数错误"); |
| | | throw new YamiShopBindException("Invalid parameters"); |
| | | } |
| | | List<String> symbolList = Arrays.asList(pairs.split("/")); |
| | | if (null == symbolList || 2 != symbolList.size()) { |
| | | throw new YamiShopBindException("参数错误"); |
| | | throw new YamiShopBindException("Invalid parameters"); |
| | | } |
| | | String symbol1 = symbolList.get(0).toLowerCase(); |
| | | String symbol2 = symbolList.get(1).toLowerCase(); |
| | |
| | | status_int = null; |
| | | } else { |
| | | if (!StringUtils.isInteger(status)) { |
| | | throw new YamiShopBindException("状态不是整数"); |
| | | throw new YamiShopBindException("Status must be an integer"); |
| | | } |
| | | if (Integer.valueOf(status).intValue() < 0) { |
| | | throw new YamiShopBindException("状态不能小于0"); |
| | | throw new YamiShopBindException("Status cannot be less than 0"); |
| | | } |
| | | status_int = Integer.valueOf(status); |
| | | } |
| | |
| | | page_no = "1"; |
| | | } |
| | | if (!StringUtils.isInteger(page_no)) { |
| | | throw new YamiShopBindException("页码不是整数"); |
| | | throw new YamiShopBindException("Page number must be an integer"); |
| | | } |
| | | if (Integer.valueOf(page_no).intValue() <= 0) { |
| | | throw new YamiShopBindException("页码不能小于等于0"); |
| | | throw new YamiShopBindException("Page number must be greater than 0"); |
| | | } |
| | | int page_no_int = Integer.valueOf(page_no).intValue(); |
| | | List<Map<String, Object>> data = this.walletLogService.pagedQueryRecords(page_no_int, 10, SecurityUtils.getUser().getUserId(), category, start_time, end_time, wallet_type, status_int).getRecords(); |