|
@@ -40,95 +40,95 @@ public class HisServiceImpl implements HisService {
|
|
|
@Autowired
|
|
|
private NewsService newsService;
|
|
|
|
|
|
- @Override
|
|
|
- public IndustryDetailsInfo hisFind(List<String> ids) {
|
|
|
- IndustryDetailsInfo industryDetailsInfo = new IndustryDetailsInfo();
|
|
|
- List<IndustryDetailsInfo> industryDetailsInfos = new ArrayList<>();
|
|
|
- for (String id : ids) {
|
|
|
- // 新闻数据。
|
|
|
- List<NewsList> newsLists = newsService.newsDetails(SearchInfo.builder().searchParam(id).build());
|
|
|
- QueryWrapper<IndustryInfo> industryInfoQueryWrapper = new QueryWrapper<>();
|
|
|
- industryInfoQueryWrapper.lambda()
|
|
|
- .eq(IndustryInfo::getPlateId,id);
|
|
|
- List<IndustryInfo> industryInfos = industryInfoMapper.selectList(industryInfoQueryWrapper);
|
|
|
- for (IndustryInfo industryInfo : industryInfos) {
|
|
|
- QueryWrapper<IndustryPlate> industryPlateQueryWrapper = new QueryWrapper<>();
|
|
|
- industryPlateQueryWrapper.lambda()
|
|
|
- .eq(IndustryPlate::getPlateId,industryInfo.getPlateId());
|
|
|
- List<IndustryPlate> industryPlates = industryPlateMapper.selectList(industryPlateQueryWrapper);
|
|
|
- IndustryDetail industryDetail;
|
|
|
- List<IndustryDetail> industryDetails = new ArrayList<>();
|
|
|
- for (IndustryPlate industryPlate : industryPlates) {
|
|
|
- // 需要替换成数据库的字段,目前随机生成的。
|
|
|
- industryDetail = TestCommon.toInitIndustryDetail(industryPlate.getPlateId(),industryPlate.getPlateDate(),
|
|
|
- TestCommon.toInitFloat(),TestCommon.toInitFloat());
|
|
|
- industryDetails.add(industryDetail);
|
|
|
- }
|
|
|
- industryDetailsInfo = IndustryDetailsInfo.builder()
|
|
|
- .actuals(industryDetails)
|
|
|
- .news(newsLists)
|
|
|
- .tag(true)
|
|
|
- .build();
|
|
|
- industryDetailsInfos.add(industryDetailsInfo);
|
|
|
- }
|
|
|
- }
|
|
|
- return industryDetailsInfo;
|
|
|
-
|
|
|
- // IndustryInfo industryInfos = new ArrayList<>();
|
|
|
- // IndustryInfo industryInfo;
|
|
|
- // for (String id : ids) {
|
|
|
- // QueryWrapper queryWrapper = new QueryWrapper();
|
|
|
- // queryWrapper.eq("plate_id",id);
|
|
|
- // List<StockInfo> stockInfos = stockInfoMapper.selectList(queryWrapper);
|
|
|
- // for (StockInfo stockInfo : stockInfos) {
|
|
|
- // industryInfo = new IndustryInfo();
|
|
|
- // BeanUtils.copyProperties(stockInfo, industryInfo);
|
|
|
- // industryInfo.setClose(Float.valueOf(stockInfo.getClose()));
|
|
|
- // industryInfo.setPred(Float.valueOf(stockInfo.getPred()));
|
|
|
- // industryInfos.add(industryInfo);
|
|
|
- // }
|
|
|
- //
|
|
|
- //
|
|
|
- // }
|
|
|
- // return industryInfos;
|
|
|
-
|
|
|
-
|
|
|
- // List<IndustryDetail> industryDetails = new ArrayList<>();
|
|
|
- // SearchInfo searchInfo = SearchInfo.builder()
|
|
|
- // .searchParam(ids.get(0))
|
|
|
- // .build();
|
|
|
- // List<NewsList> newsLists = newsService.newsDetails(searchInfo);
|
|
|
- // if (ids.size() > 0){
|
|
|
- //
|
|
|
- // industryDetails.add(TestCommon.toInitIndustryDetail("BK0422","2020-07-10",
|
|
|
- // TestCommon.toInitFloat(),TestCommon.toInitFloat()));
|
|
|
- // industryDetails.add(TestCommon.toInitIndustryDetail("BK0738","2020-06-15",
|
|
|
- // TestCommon.toInitFloat(),TestCommon.toInitFloat()));
|
|
|
- // industryDetails.add(TestCommon.toInitIndustryDetail("BK450","2020-05-15",
|
|
|
- // TestCommon.toInitFloat(),TestCommon.toInitFloat()));
|
|
|
- // industryDetails.add(TestCommon.toInitIndustryDetail("BK0734","2020-04-15",
|
|
|
- // TestCommon.toInitFloat(),TestCommon.toInitFloat()));
|
|
|
- // industryDetails.add(TestCommon.toInitIndustryDetail("BK0471","2020-03-15",
|
|
|
- // TestCommon.toInitFloat(),TestCommon.toInitFloat()));
|
|
|
- // IndustryDetailsInfo industryInfo = IndustryDetailsInfo.builder()
|
|
|
- // .actuals(industryDetails)
|
|
|
- // .news(newsLists)
|
|
|
- // .tag(true)
|
|
|
- // .build();
|
|
|
- // return industryInfo;
|
|
|
- // }else {
|
|
|
- // industryDetails.add(TestCommon.toInitIndustryDetail("BK0422","2020-07-15",
|
|
|
- // TestCommon.toInitFloat(),TestCommon.toInitFloat()));
|
|
|
- // industryDetails.add(TestCommon.toInitIndustryDetail("BK0738","2020-06-24",
|
|
|
- // TestCommon.toInitFloat(),TestCommon.toInitFloat()));
|
|
|
- // IndustryDetailsInfo industryInfo = IndustryDetailsInfo.builder()
|
|
|
- // .actuals(industryDetails)
|
|
|
- // .news(newsLists)
|
|
|
- // .tag(true)
|
|
|
- // .build();
|
|
|
- // return industryInfo;
|
|
|
- // }
|
|
|
- }
|
|
|
+ // @Override
|
|
|
+ // public IndustryDetailsInfo hisFind(List<String> ids) {
|
|
|
+ // IndustryDetailsInfo industryDetailsInfo = new IndustryDetailsInfo();
|
|
|
+ // List<IndustryDetailsInfo> industryDetailsInfos = new ArrayList<>();
|
|
|
+ // for (String id : ids) {
|
|
|
+ // // 新闻数据。
|
|
|
+ // List<NewsList> newsLists = newsService.newsDetails(SearchInfo.builder().searchParam(id).build());
|
|
|
+ // QueryWrapper<IndustryInfo> industryInfoQueryWrapper = new QueryWrapper<>();
|
|
|
+ // industryInfoQueryWrapper.lambda()
|
|
|
+ // .eq(IndustryInfo::getPlateId,id);
|
|
|
+ // List<IndustryInfo> industryInfos = industryInfoMapper.selectList(industryInfoQueryWrapper);
|
|
|
+ // for (IndustryInfo industryInfo : industryInfos) {
|
|
|
+ // QueryWrapper<IndustryPlate> industryPlateQueryWrapper = new QueryWrapper<>();
|
|
|
+ // industryPlateQueryWrapper.lambda()
|
|
|
+ // .eq(IndustryPlate::getPlateId,industryInfo.getPlateId());
|
|
|
+ // List<IndustryPlate> industryPlates = industryPlateMapper.selectList(industryPlateQueryWrapper);
|
|
|
+ // IndustryDetail industryDetail;
|
|
|
+ // List<IndustryDetail> industryDetails = new ArrayList<>();
|
|
|
+ // for (IndustryPlate industryPlate : industryPlates) {
|
|
|
+ // // 需要替换成数据库的字段,目前随机生成的。
|
|
|
+ // industryDetail = TestCommon.toInitIndustryDetail(industryPlate.getPlateId(),industryPlate.getPlateDate(),
|
|
|
+ // TestCommon.toInitFloat(),TestCommon.toInitFloat());
|
|
|
+ // industryDetails.add(industryDetail);
|
|
|
+ // }
|
|
|
+ // industryDetailsInfo = IndustryDetailsInfo.builder()
|
|
|
+ // .actuals(industryDetails)
|
|
|
+ // .news(newsLists)
|
|
|
+ // .tag(true)
|
|
|
+ // .build();
|
|
|
+ // industryDetailsInfos.add(industryDetailsInfo);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // return industryDetailsInfo;
|
|
|
+ //
|
|
|
+ // // IndustryInfo industryInfos = new ArrayList<>();
|
|
|
+ // // IndustryInfo industryInfo;
|
|
|
+ // // for (String id : ids) {
|
|
|
+ // // QueryWrapper queryWrapper = new QueryWrapper();
|
|
|
+ // // queryWrapper.eq("plate_id",id);
|
|
|
+ // // List<StockInfo> stockInfos = stockInfoMapper.selectList(queryWrapper);
|
|
|
+ // // for (StockInfo stockInfo : stockInfos) {
|
|
|
+ // // industryInfo = new IndustryInfo();
|
|
|
+ // // BeanUtils.copyProperties(stockInfo, industryInfo);
|
|
|
+ // // industryInfo.setClose(Float.valueOf(stockInfo.getClose()));
|
|
|
+ // // industryInfo.setPred(Float.valueOf(stockInfo.getPred()));
|
|
|
+ // // industryInfos.add(industryInfo);
|
|
|
+ // // }
|
|
|
+ // //
|
|
|
+ // //
|
|
|
+ // // }
|
|
|
+ // // return industryInfos;
|
|
|
+ //
|
|
|
+ //
|
|
|
+ // // List<IndustryDetail> industryDetails = new ArrayList<>();
|
|
|
+ // // SearchInfo searchInfo = SearchInfo.builder()
|
|
|
+ // // .searchParam(ids.get(0))
|
|
|
+ // // .build();
|
|
|
+ // // List<NewsList> newsLists = newsService.newsDetails(searchInfo);
|
|
|
+ // // if (ids.size() > 0){
|
|
|
+ // //
|
|
|
+ // // industryDetails.add(TestCommon.toInitIndustryDetail("BK0422","2020-07-10",
|
|
|
+ // // TestCommon.toInitFloat(),TestCommon.toInitFloat()));
|
|
|
+ // // industryDetails.add(TestCommon.toInitIndustryDetail("BK0738","2020-06-15",
|
|
|
+ // // TestCommon.toInitFloat(),TestCommon.toInitFloat()));
|
|
|
+ // // industryDetails.add(TestCommon.toInitIndustryDetail("BK450","2020-05-15",
|
|
|
+ // // TestCommon.toInitFloat(),TestCommon.toInitFloat()));
|
|
|
+ // // industryDetails.add(TestCommon.toInitIndustryDetail("BK0734","2020-04-15",
|
|
|
+ // // TestCommon.toInitFloat(),TestCommon.toInitFloat()));
|
|
|
+ // // industryDetails.add(TestCommon.toInitIndustryDetail("BK0471","2020-03-15",
|
|
|
+ // // TestCommon.toInitFloat(),TestCommon.toInitFloat()));
|
|
|
+ // // IndustryDetailsInfo industryInfo = IndustryDetailsInfo.builder()
|
|
|
+ // // .actuals(industryDetails)
|
|
|
+ // // .news(newsLists)
|
|
|
+ // // .tag(true)
|
|
|
+ // // .build();
|
|
|
+ // // return industryInfo;
|
|
|
+ // // }else {
|
|
|
+ // // industryDetails.add(TestCommon.toInitIndustryDetail("BK0422","2020-07-15",
|
|
|
+ // // TestCommon.toInitFloat(),TestCommon.toInitFloat()));
|
|
|
+ // // industryDetails.add(TestCommon.toInitIndustryDetail("BK0738","2020-06-24",
|
|
|
+ // // TestCommon.toInitFloat(),TestCommon.toInitFloat()));
|
|
|
+ // // IndustryDetailsInfo industryInfo = IndustryDetailsInfo.builder()
|
|
|
+ // // .actuals(industryDetails)
|
|
|
+ // // .news(newsLists)
|
|
|
+ // // .tag(true)
|
|
|
+ // // .build();
|
|
|
+ // // return industryInfo;
|
|
|
+ // // }
|
|
|
+ // }
|
|
|
|
|
|
|
|
|
|