| | |
| | | import com.google.common.base.Splitter; |
| | | import com.google.common.collect.Lists; |
| | | import com.yami.trading.api.dto.RelatedStocksDto; |
| | | import com.yami.trading.bean.data.domain.Kline; |
| | | import com.yami.trading.bean.data.domain.Realtime; |
| | | import com.yami.trading.bean.data.dto.StocksDto; |
| | | import com.yami.trading.bean.item.domain.Item; |
| | |
| | | import com.yami.trading.common.lang.LangUtils; |
| | | import com.yami.trading.common.util.MarketOpenChecker; |
| | | import com.yami.trading.common.util.StringUtils; |
| | | import com.yami.trading.huobi.data.internal.KlineConstant; |
| | | import com.yami.trading.huobi.data.internal.KlineService; |
| | | import com.yami.trading.service.data.DataService; |
| | | import com.yami.trading.service.item.ItemService; |
| | | import com.yami.trading.service.syspara.LocalSysparaService; |
| | |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | |
| | | @Autowired |
| | | @Qualifier("dataService") |
| | | private DataService dataService; |
| | | @Autowired |
| | | private KlineService klineService; |
| | | |
| | | /** |
| | | * 产品列表数据 |
| | |
| | | queryWrapper.in(CollectionUtil.isNotEmpty(symbols), "symbol", symbols); |
| | | String name = itemQuery.getName(); |
| | | queryWrapper.and(StringUtils.isNotEmpty(name), itemWrapper->itemWrapper.like("name",name).or().like("symbol", name)); |
| | | queryWrapper.eq(StrUtil.isNotBlank(type), "type", type); |
| | | queryWrapper.like(StrUtil.isNotBlank(category), "category", category); |
| | | queryWrapper.eq(StrUtil.isNotBlank(type), "type", "forex"); |
| | | queryWrapper.like(StrUtil.isNotBlank(category), "category", "forex"); |
| | | queryWrapper.orderByDesc("sorted"); |
| | | Page<Item> page = new Page<>(1, 1000); |
| | | IPage<Item> result = itemService.page(page, queryWrapper); |
| | |
| | | |
| | | if (CollectionUtil.isNotEmpty(realtimes)) { |
| | | Realtime realtime = realtimes.get(0); |
| | | // if("forex".equals(type)){ |
| | | // symbolDTO.setChangeRatio(realtime.getChangeRatioStr()); |
| | | // }else{ |
| | | // |
| | | // } |
| | | symbolDTO.setChangeRatio(realtime.getChangeRatio()); |
| | | symbolDTO.setAmount(realtime.getAmount()); |
| | | symbolDTO.setVolume(realtime.getVolume()); |
| | |
| | | symbolDTO.setTs(realtime.getTs()); |
| | | symbolDTO.setCurrent_time(realtime.getTs()); |
| | | symbolDTO.setChg(realtime.getClose().subtract(realtime.getOpen())); |
| | | |
| | | } |
| | | dtos.add(symbolDTO); |
| | | } |