|
@@ -312,10 +312,11 @@ public class CoinServiceImpl implements CoinService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public Object watchlistUpdate(String symbol, String remark) {
|
|
|
|
|
|
|
+ public Object watchlistUpdate(String symbol, String remark, String score) {
|
|
|
CoinWatchlist coinWatchlist = new CoinWatchlist();
|
|
CoinWatchlist coinWatchlist = new CoinWatchlist();
|
|
|
coinWatchlist.setSymbol(symbol);
|
|
coinWatchlist.setSymbol(symbol);
|
|
|
coinWatchlist.setRemark(remark);
|
|
coinWatchlist.setRemark(remark);
|
|
|
|
|
+ coinWatchlist.setScore(score);
|
|
|
int num = coinMapper.updateCoinWatchlistRemark(coinWatchlist);
|
|
int num = coinMapper.updateCoinWatchlistRemark(coinWatchlist);
|
|
|
return num;
|
|
return num;
|
|
|
}
|
|
}
|
|
@@ -1402,7 +1403,19 @@ public class CoinServiceImpl implements CoinService {
|
|
|
j++;
|
|
j++;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ String[] scoreTitleArr = {"很差", "较差", "还行", "推荐", "力荐"};
|
|
|
for (CoinWatchlist coinWatchlist : watchlistList) {
|
|
for (CoinWatchlist coinWatchlist : watchlistList) {
|
|
|
|
|
+ // 优先级
|
|
|
|
|
+ Integer score = Integer.valueOf(coinWatchlist.getScore());
|
|
|
|
|
+ score = score > 5 ? 5 : score;
|
|
|
|
|
+ StringBuffer scoreSB = new StringBuffer("<ul class=\"rating\">");
|
|
|
|
|
+ for (int i = 0; i < scoreTitleArr.length; i++) {
|
|
|
|
|
+ String style = (i + 1) <= score ? "fa-star" : "fa-star-o";
|
|
|
|
|
+ scoreSB.append("<li id=\"" + coinWatchlist.getSymbol() + "\" title=\"" + scoreTitleArr[i] + "\" val=\"" + (i + 1) + "\"><i class=\"fa " + style + "\"></i></li>");
|
|
|
|
|
+ }
|
|
|
|
|
+ scoreSB.append("</ul>");
|
|
|
|
|
+ coinWatchlist.setScore(scoreSB.toString());
|
|
|
|
|
+
|
|
|
// 流通市值
|
|
// 流通市值
|
|
|
if (null != coinWatchlist.getTotalMarketValue()) {
|
|
if (null != coinWatchlist.getTotalMarketValue()) {
|
|
|
BigDecimal divide = coinWatchlist.getTotalMarketValue().divide(bigDecimal10000, 8, RoundingMode.HALF_UP);
|
|
BigDecimal divide = coinWatchlist.getTotalMarketValue().divide(bigDecimal10000, 8, RoundingMode.HALF_UP);
|