Refinitiv股票行情接口修改

This commit is contained in:
zhangjian
2024-04-22 15:15:19 +08:00
parent 662537bcbe
commit 42b9d2917a
4 changed files with 23 additions and 19 deletions

View File

@@ -30,12 +30,12 @@ public class RetifiveStockInfo {
private String stockType;
@ApiModelProperty("当前价格")
private String currentPrice;
private String lastPrice;
@ApiModelProperty("变动百分比")
private String changePercent;
private String perchg;
@ApiModelProperty("变动值")
private String changeValue;
private String change;
@ApiModelProperty("开盘价格")
private String openPrice;

View File

@@ -127,10 +127,10 @@ public class RefinitivUtil {
}
return RetifiveStockInfo.builder()
.stockCode(stockCode).stockName(stockName).symbol(name).status(status)
.openPrice(openPrice).currentPrice(price).highPrice(high).lowPrice(low)
.previousPrice(previousPrice).changePercent(percentChange).volume(volume)
.openPrice(openPrice).lastPrice(price).highPrice(high).lowPrice(low)
.previousPrice(previousPrice).perchg(percentChange).volume(volume)
.week52HighPrice(week52High).week52LowPrice(week52Low).stockType(stockType)
.changeValue(changeValue)
.change(changeValue)
.build();
}
@@ -257,8 +257,8 @@ public class RefinitivUtil {
}
}
RetifiveStockInfo retifiveStockInfo = RetifiveStockInfo.builder().stockCode(stockCode).stockName(stockName).symbol(name).status(status)
.openPrice(openPrice).currentPrice(price).highPrice(high).lowPrice(low).previousPrice(previousPrice).changePercent(percentChange)
.volume(volume).week52HighPrice(week52High).week52LowPrice(week52Low).stockType(stockType).changeValue(changeValue)
.openPrice(openPrice).lastPrice(price).highPrice(high).lowPrice(low).previousPrice(previousPrice).perchg(percentChange)
.volume(volume).week52HighPrice(week52High).week52LowPrice(week52Low).stockType(stockType).change(changeValue)
.build();
return retifiveStockInfo;

View File

@@ -3,19 +3,15 @@ package cn.stock.market.web;
import cn.stock.market.domain.basic.entity.RetifiveStock;
import cn.stock.market.domain.basic.service.RetifiveStockService;
import cn.stock.market.dto.RetifiveStockInfo;
import cn.stock.market.infrastructure.db.po.RetifiveStockPO;
import cn.stock.market.listener.AppClient;
import cn.stock.market.listener.ConcurrentAppClient;
import cn.stock.market.listener.StockInfoRefinitiv;
import cn.stock.market.listener.SymbolRefinitiv;
import cn.stock.market.utils.ServerResponse;
import com.google.common.collect.Lists;
import com.thomsonreuters.ema.access.Data;
import com.thomsonreuters.ema.access.DataType;
import com.thomsonreuters.ema.access.FieldEntry;
import com.thomsonreuters.ema.access.FieldList;
import com.thomsonreuters.ema.access.Map;
import com.thomsonreuters.ema.access.MapEntry;
import com.thomsonreuters.ema.access.RefreshMsg;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@@ -27,14 +23,9 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@@ -661,8 +652,8 @@ public class MessageRetifiveController {
}
}
RetifiveStockInfo retifiveStockInfo = RetifiveStockInfo.builder().stockCode(stockCode).stockName(stockName).symbol(name).status(status)
.openPrice(openPrice).currentPrice(price).highPrice(high).lowPrice(low).previousPrice(previousPrice).changePercent(percentChange)
.volume(volume).week52HighPrice(week52High).week52LowPrice(week52Low).stockType(stockType).changeValue(changeValue)
.openPrice(openPrice).lastPrice(price).highPrice(high).lowPrice(low).previousPrice(previousPrice).perchg(percentChange)
.volume(volume).week52HighPrice(week52High).week52LowPrice(week52Low).stockType(stockType).change(changeValue)
.build();
return retifiveStockInfo;

View File

@@ -1,5 +1,6 @@
package cn.stock.market.web;
import cn.hutool.core.util.StrUtil;
import cn.stock.market.domain.basic.entity.RetifiveStock;
import cn.stock.market.domain.basic.service.RetifiveStockService;
import cn.stock.market.dto.RetifiveStockInfo;
@@ -22,6 +23,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
@@ -94,6 +96,10 @@ public class RefinitivApiController {
@GetMapping("/getTopActives")
@EncryptFilter(decryptRequest = false)
public ServerResponse<?> getTopActives(@RequestParam String stockType) {
if (StrUtil.equalsIgnoreCase(stockType, "nse")) {
return ServerResponse.createBySuccess("操作成功", new ArrayList<>());
}
String name = ".AV.BO";
List<RetifiveStockInfo> list = Lists.newArrayList();
try {
@@ -120,6 +126,9 @@ public class RefinitivApiController {
@GetMapping("/getTopGainers")
@EncryptFilter(decryptRequest = false)
public ServerResponse<?> getTopGainers(@RequestParam String stockType) {
if (StrUtil.equalsIgnoreCase(stockType, "nse")) {
return ServerResponse.createBySuccess("操作成功", new ArrayList<>());
}
String name = ".PG.BO";
List<RetifiveStockInfo> list = Lists.newArrayList();
try {
@@ -146,6 +155,10 @@ public class RefinitivApiController {
@GetMapping("/getTopLosers")
@EncryptFilter(decryptRequest = false)
public ServerResponse<?> getTopLosers(@RequestParam String stockType) {
if (StrUtil.equalsIgnoreCase(stockType, "nse")) {
return ServerResponse.createBySuccess("操作成功", new ArrayList<>());
}
String name = ".PL.BO";
List<RetifiveStockInfo> list = Lists.newArrayList();
try {