| | |
| | | package com.nq.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.http.HttpUtil; |
| | | import cn.hutool.json.JSONUtil; |
| | |
| | | import com.nq.utils.stock.pinyin.GetPyByChinese; |
| | | import com.nq.utils.stock.qq.QqStockApi; |
| | | import com.nq.utils.stock.sina.StockApi; |
| | | import com.nq.utils.timeutil.TimeUtil; |
| | | import com.nq.utils.translate.GoogleTranslateUtil; |
| | | import com.nq.vo.stock.*; |
| | | import com.nq.vo.stock.k.MinDataVO; |
| | |
| | | import java.net.HttpURLConnection; |
| | | import java.net.URL; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.util.*; |
| | | import java.util.concurrent.CompletableFuture; |
| | | import java.util.stream.Collectors; |
| | |
| | | @Autowired |
| | | ISiteSettingService iSiteSettingService; |
| | | |
| | | @Resource |
| | | StockTimeSettingMapper stockTimeSettingMapper; |
| | | |
| | | |
| | | @Autowired |
| | | InStockMapper inStockMapper; |
| | |
| | | |
| | | @Autowired |
| | | IPriceServices iPriceServices; |
| | | @Autowired |
| | | ITradingHourService tradingHourService; |
| | | |
| | | |
| | | |
| | | public ServerResponse getMarket() { |
| | |
| | | // return ServerResponse.createBySuccess(pageInfo); |
| | | // } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public ServerResponse getStockByType(int pageNum, int pageSize, String orderBy, String keyWords, String stockType, HttpServletRequest request) { |
| | | // 启动分页 |
| | |
| | | if(null != cacheBaseStock){ |
| | | stockVO.setOpen_px(cacheBaseStock.getOpen()); |
| | | stockVO.setPreclose_px(cacheBaseStock.getPrevClose()); |
| | | } |
| | | if(tradingHourService.isPreMarket(stock.getStockCode())){ |
| | | stockVO.setPreMarket(1); |
| | | }else { |
| | | stockVO.setPreMarket(0); |
| | | } |
| | | Map map = Maps.newHashMap(); |
| | | map.put("introduction", introduction); |
| | |
| | | return ServerResponse.createBySuccess(filteredList); |
| | | } |
| | | |
| | | @Override |
| | | public ServerResponse getExchange() { |
| | | StockTimeSetting stockTimeSetting = stockTimeSettingMapper.selectOne(new QueryWrapper<StockTimeSetting>().eq("accets_type","US")); |
| | | if(stockTimeSetting == null){ |
| | | return ServerResponse.createBySuccess(false); |
| | | } |
| | | if(!stockTimeSetting.getWeekDay().contains(String.valueOf(LocalDate.now().getDayOfWeek().getValue()))){ |
| | | return ServerResponse.createBySuccess(false); |
| | | } |
| | | return ServerResponse.createBySuccess(TimeUtil.isTradingHour(stockTimeSetting.getAmStartTime(),stockTimeSetting.getAmEndTime(),stockTimeSetting.getPmStartTime(),stockTimeSetting.getPmEndTime())); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public ServerResponse getOptionStock(HttpServletRequest request) { |