From 9d7cdb2c01a468b7e722912fc0aae1ab5263ca91 Mon Sep 17 00:00:00 2001
From: zj <1772600164@qq.com>
Date: Wed, 22 May 2024 16:49:34 +0800
Subject: [PATCH] 1
---
src/main/java/com/nq/service/impl/StockServiceImpl.java | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/main/java/com/nq/service/impl/StockServiceImpl.java b/src/main/java/com/nq/service/impl/StockServiceImpl.java
index 37428cb..0618ecd 100644
--- a/src/main/java/com/nq/service/impl/StockServiceImpl.java
+++ b/src/main/java/com/nq/service/impl/StockServiceImpl.java
@@ -125,7 +125,10 @@
public ServerResponse getStock(int pageNum, int pageSize, String keyWords, String stockPlate, String stockType, HttpServletRequest request) {
List<Stock> stockList = new ArrayList<>();
- if (stockType.equals("99")) {
+ if(null == stockType){
+ PageHelper.startPage(pageNum, pageSize);
+ stockList.addAll(stockMapper.findStockListByKeyWords(keyWords, stockPlate, stockType, Integer.valueOf(0), pageNum - 1, pageSize));
+ }else if (stockType.equals("99")) {
PageHelper.startPage(pageNum, pageSize);
stockList.addAll(stockMapper.findZtStockListByKeyWords(keyWords, stockPlate, "IN", Integer.valueOf(0)));
} else if (stockType.equals("100")) {
@@ -147,7 +150,7 @@
dzStock.setStockType(stockDz.getStockType());
stockList.add(dzStock);
}
- } else {
+ }else {
PageHelper.startPage(pageNum, pageSize);
stockList.addAll(stockMapper.findStockListByKeyWords(keyWords, stockPlate, stockType, Integer.valueOf(0), pageNum - 1, pageSize));
}
@@ -171,7 +174,7 @@
stockListVOS.addAll(Objects.requireNonNull(StockApi.getStockReailTimes(stockList)));
}
for (int i = 0; i <stockListVOS.size() ; i++) {
- stockListVOS.get(i).setNowPrice(iPriceServices.getNowPrice(stockListVOS.get(i).getCode()).toString());
+ stockListVOS.get(i).setNowPrice(iPriceServices.getNowPrice(stockListVOS.get(i).getCode(),stockType).toString());
}
RPageInfo pageInfo = new RPageInfo();
pageInfo.setList(stockListVOS);
@@ -259,7 +262,7 @@
String introduction = null;
StockVO stockVO = StockApi.assembleInStockVO(stock);
stockVO.setDepositAmt(depositAmt);
- stockVO.setNowPrice(iPriceServices.getNowPrice(stock.getStockCode()).toString());
+ stockVO.setNowPrice(iPriceServices.getNowPrice(stock.getStockCode(),stock.getStockType()).toString());
stockVO.setType(stock.getStockType());
stockVO.setId(stock.getId().intValue());
stockVO.setCode(stock.getStockCode());
--
Gitblit v1.9.3