| | |
| | | |
| | | |
| | | MarketVO marketVO = querySingleIndex(stockIndex.getIndexGid()); |
| | | |
| | | if(null != marketVO){ |
| | | stockIndexVO.setCurrentPoint(marketVO.getNowPrice()); |
| | | stockIndexVO.setFloatPoint(marketVO.getIncrease()); |
| | | stockIndexVO.setFloatRate(marketVO.getIncreaseRate()); |
| | | stockIndexVO.setType(marketVO.getType()); |
| | | } |
| | | |
| | | return stockIndexVO; |
| | | } |
| | | |
| | |
| | | public MarketVO querySingleIndex(String indexCode) { |
| | | MarketVO marketVO = null; |
| | | if (indexCode.contains("hk")||indexCode.contains("us")){ |
| | | String index = RedisShardedPoolUtils.get(indexCode, 3); |
| | | JSONObject jsonObject = JSONObject.parseObject(index); |
| | | marketVO = new MarketVO(); |
| | | marketVO.setName(jsonObject.getString("f14")); |
| | | marketVO.setNowPrice(jsonObject.getString("f2")); |
| | | marketVO.setIncrease(jsonObject.getString("f4")); |
| | | marketVO.setIncreaseRate(jsonObject.getString("f3")); |
| | | marketVO.setType(jsonObject.getString("f13")); |
| | | // String index = RedisShardedPoolUtils.get(indexCode, 3); |
| | | // JSONObject jsonObject = JSONObject.parseObject(index); |
| | | // marketVO = new MarketVO(); |
| | | // if(jsonObject.containsKey("f14") && |
| | | // jsonObject.containsKey("f2") && |
| | | // jsonObject.containsKey("f4") && |
| | | // jsonObject.containsKey("f3") && |
| | | // jsonObject.containsKey("f13")){ |
| | | // marketVO.setName(jsonObject.getString("f14")); |
| | | // marketVO.setNowPrice(jsonObject.getString("f2")); |
| | | // marketVO.setIncrease(jsonObject.getString("f4")); |
| | | // marketVO.setIncreaseRate(jsonObject.getString("f3")); |
| | | // marketVO.setType(jsonObject.getString("f13")); |
| | | // } |
| | | |
| | | }else { |
| | | String market_url = PropertiesUtil.getProperty("sina.single.market.url"); |
| | | |