|
|
@@ -1453,6 +1453,7 @@ public class CoinServiceImpl implements CoinService {
|
|
|
}
|
|
|
|
|
|
String[] scoreTitleArr = {"很差", "较差", "还行", "推荐", "力荐"};
|
|
|
+ String regex = "[+-]?\\d*\\.?\\d*[eE][+-]?\\d+"; // 科学计数法正则表达式
|
|
|
for (CoinWatchlist coinWatchlist : watchlistList) {
|
|
|
// 优先级
|
|
|
Integer score = Integer.valueOf(coinWatchlist.getScore());
|
|
|
@@ -1481,10 +1482,15 @@ public class CoinServiceImpl implements CoinService {
|
|
|
// 赛道分类
|
|
|
String[] trackCategoryArr = coinWatchlist.getTrackCategory().split(",");
|
|
|
StringBuffer sb = new StringBuffer();
|
|
|
+ String trackCategoryLength = "";
|
|
|
for (int i = 0; i < trackCategoryArr.length; i++) {
|
|
|
if (i == trackCategoryArr.length - 1) {
|
|
|
+ if (trackCategoryArr.length > 3 && trackCategoryLength.length() > 20) {
|
|
|
+ sb.append("<br>");
|
|
|
+ }
|
|
|
sb.append("<span class=\"selected-value\" style=\"" + trackCategoryMap.get(trackCategoryArr[i]) + " \" >" + trackCategoryArr[i] + " </span>");
|
|
|
} else {
|
|
|
+ trackCategoryLength += trackCategoryArr[i];
|
|
|
sb.append("<span class=\"selected-value\" style=\"margin-right:0.3em;" + trackCategoryMap.get(trackCategoryArr[i]) + " \" >" + trackCategoryArr[i] + " </span>");
|
|
|
}
|
|
|
}
|
|
|
@@ -1499,10 +1505,14 @@ public class CoinServiceImpl implements CoinService {
|
|
|
coinWatchlist.setMarkPrice(new BigDecimal(coinWatchlist.getMarkPrice()).divide(BigDecimal.ONE, new MathContext(3)).toPlainString());
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(coinWatchlist.getHighestHistoricalPrice())) {
|
|
|
- coinWatchlist.setHighestHistoricalPrice(new BigDecimal(coinWatchlist.getHighestHistoricalPrice()).divide(BigDecimal.ONE, new MathContext(3)).toPlainString());
|
|
|
+ if (!coinWatchlist.getHighestHistoricalPrice().matches(regex)) {
|
|
|
+ coinWatchlist.setHighestHistoricalPrice(new BigDecimal(coinWatchlist.getHighestHistoricalPrice()).divide(BigDecimal.ONE, new MathContext(3)).toPlainString());
|
|
|
+ }
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(coinWatchlist.getLowestHistoricalPrice())) {
|
|
|
- coinWatchlist.setLowestHistoricalPrice(new BigDecimal(coinWatchlist.getLowestHistoricalPrice()).divide(BigDecimal.ONE, new MathContext(3)).toPlainString());
|
|
|
+ if (!coinWatchlist.getLowestHistoricalPrice().matches(regex)) {
|
|
|
+ coinWatchlist.setLowestHistoricalPrice(new BigDecimal(coinWatchlist.getLowestHistoricalPrice()).divide(BigDecimal.ONE, new MathContext(3)).toPlainString());
|
|
|
+ }
|
|
|
}
|
|
|
// 24小时价格变化
|
|
|
if (coinWatchlist.getPriceChangePercentage24h() == null) {
|