|
|
@@ -1446,9 +1446,9 @@ public class CoinServiceImpl implements CoinService {
|
|
|
if (null != coinWatchlist.getTotalMarketValue()) {
|
|
|
BigDecimal divide = coinWatchlist.getTotalMarketValue().divide(bigDecimal10000, 8, RoundingMode.HALF_UP);
|
|
|
if (divide.compareTo(bigDecimal10000) <= 0) {
|
|
|
- coinWatchlist.setTotalMarketValueStr(divide.setScale(4, RoundingMode.HALF_UP) + "万");
|
|
|
+ coinWatchlist.setTotalMarketValueStr(divide.setScale(2, RoundingMode.HALF_UP) + "万");
|
|
|
} else {
|
|
|
- divide = divide.divide(bigDecimal10000, 4, RoundingMode.HALF_UP);
|
|
|
+ divide = divide.divide(bigDecimal10000, 2, RoundingMode.HALF_UP);
|
|
|
coinWatchlist.setTotalMarketValueStr(divide + "亿");
|
|
|
}
|
|
|
|
|
|
@@ -1472,6 +1472,15 @@ public class CoinServiceImpl implements CoinService {
|
|
|
coinWatchlist.setSymbolStyle(" style=\"background-color:rgba(70,169,244,.72);font-weight: bold;\"");
|
|
|
// 市场价格
|
|
|
coinWatchlist.setMarkPriceStyle(" style=\"color:#252B31;background-color:#C4ADE9;\"");
|
|
|
+ if (StringUtils.isNotEmpty(coinWatchlist.getMarkPrice())) {
|
|
|
+ coinWatchlist.setMarkPrice(new BigDecimal(coinWatchlist.getMarkPrice()).divide(BigDecimal.ONE, new MathContext(2)).toPlainString());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(coinWatchlist.getHighestHistoricalPrice())) {
|
|
|
+ coinWatchlist.setHighestHistoricalPrice(new BigDecimal(coinWatchlist.getHighestHistoricalPrice()).divide(BigDecimal.ONE, new MathContext(2)).toPlainString());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(coinWatchlist.getLowestHistoricalPrice())) {
|
|
|
+ coinWatchlist.setLowestHistoricalPrice(new BigDecimal(coinWatchlist.getLowestHistoricalPrice()).divide(BigDecimal.ONE, new MathContext(2)).toPlainString());
|
|
|
+ }
|
|
|
// 24小时价格变化
|
|
|
if (coinWatchlist.getPriceChangePercentage24h() == null) {
|
|
|
} else if (coinWatchlist.getPriceChangePercentage24h().compareTo(BigDecimal.ZERO) < 0) {
|
|
|
@@ -1919,7 +1928,7 @@ public class CoinServiceImpl implements CoinService {
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
log.error("getMonitorJobConfig Exception", e);
|
|
|
- return null;
|
|
|
+ return InitRunner.monitorJobConfigMap;
|
|
|
} finally {
|
|
|
if (lock.isLocked() && lock.isHeldByCurrentThread()) {
|
|
|
lock.unlock();
|
|
|
@@ -1947,4 +1956,18 @@ public class CoinServiceImpl implements CoinService {
|
|
|
|
|
|
return null;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void debugTest() {
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+ params.put("sortField", "create_time");
|
|
|
+ params.put("sort", "desc");
|
|
|
+ List<CoinWatchlist> watchlistList = coinMapper.findWatchlistList(params);
|
|
|
+
|
|
|
+ Map<String, CoinWatchlist> coinWatchlistMap4CoingeckoId = watchlistList.stream().collect(Collectors.toMap(CoinWatchlist::getCoingeckoId, coinWatchlist -> coinWatchlist));
|
|
|
+ parseWatchlistMap4Coingecko(coinWatchlistMap4CoingeckoId);
|
|
|
+
|
|
|
+ Map<Long, CoinWatchlist> coinWatchlistMap4CmcId = coinWatchlistMap4CoingeckoId.values().stream().collect(Collectors.toMap(CoinWatchlist::getCmcId, coinWatchlist -> coinWatchlist));
|
|
|
+ parseWatchlistMap4CmC(coinWatchlistMap4CmcId);
|
|
|
+ }
|
|
|
}
|