|
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.pavis.ai.app.fda.common.config.constants.Constants;
|
|
|
import com.pavis.ai.app.fda.common.utils.GeneralUtils;
|
|
|
import com.pavis.ai.app.fda.form.inc.IncInfo;
|
|
|
import com.pavis.ai.app.fda.form.sel.QueryForm;
|
|
@@ -36,8 +37,9 @@ public class ListServiceImpl implements ListService {
|
|
|
|
|
|
/**
|
|
|
* 涨幅上周实际榜:
|
|
|
- * 1、res表查询条件:plateDate desc、top10。
|
|
|
- * 2、求platecloseup值。
|
|
|
+ * 1、res表查询条件:plateDate desc、top10。
|
|
|
+ * 2、求platecloseup值。
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
@@ -45,10 +47,17 @@ public class ListServiceImpl implements ListService {
|
|
|
return toActual(true);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Map<String, Object> incLastWeekActualByPage(Long currPage) {
|
|
|
+ return toActualByPage(true, currPage);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 跌幅上周实际榜:
|
|
|
- * 1、res表查询条件:plateDate desc、top10。
|
|
|
- * 2、求platecloseup值。
|
|
|
+ * 1、res表查询条件:plateDate desc、top10。
|
|
|
+ * 2、求platecloseup值。
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
@@ -56,6 +65,11 @@ public class ListServiceImpl implements ListService {
|
|
|
return toActual(false);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Map<String, Object> decLastWeekActualByPage(Long currPage) {
|
|
|
+ return toActualByPage(false, currPage);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 涨幅表-上周预测榜
|
|
|
*
|
|
@@ -66,6 +80,11 @@ public class ListServiceImpl implements ListService {
|
|
|
return toLastPred(true);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Map<String, Object> incLastWeekPredByPage(Long currPage) {
|
|
|
+ return toLastPredByPage(true,currPage);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 跌幅表-上周预测榜
|
|
|
*
|
|
@@ -75,6 +94,12 @@ public class ListServiceImpl implements ListService {
|
|
|
public List<IncInfo> decLastWeekPred() {
|
|
|
return toLastPred(false);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Map<String, Object> decLastWeekPredByPage(Long currPage) {
|
|
|
+ return toLastPredByPage(false,currPage);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 涨幅表-下周预测榜
|
|
|
*
|
|
@@ -85,6 +110,11 @@ public class ListServiceImpl implements ListService {
|
|
|
return toNextPred(true);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Map<String, Object> incNextWeekPredByPage(Long currPage) {
|
|
|
+ return toNextPredByPage(true,currPage);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 跌幅表-下周预测榜
|
|
|
*
|
|
@@ -96,95 +126,166 @@ public class ListServiceImpl implements ListService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Map<String, Object> incLastWeekActualByPage(Long currPage) {
|
|
|
- Boolean incOrDec = true;
|
|
|
+ public Map<String, Object> decNextWeekPredByPage(Long currPage) {
|
|
|
+ return toNextPredByPage(false,currPage);
|
|
|
+ }
|
|
|
+
|
|
|
+ // @Override
|
|
|
+ // public Map<String, Object> incLastWeekActualByPage(Long currPage) {
|
|
|
+ // Boolean incOrDec = true;
|
|
|
+ // // 1、获取实际榜数据。
|
|
|
+ // List<IndustryPlateRes> plates = new ArrayList<>();
|
|
|
+ // IPage<IndustryPlateRes> plateIPage = null;
|
|
|
+ // Page<IndustryPlateRes> page = new Page<>();
|
|
|
+ // page.setCurrent(currPage);
|
|
|
+ // page.setSize(10);
|
|
|
+ // QueryForm queryForm = QueryForm.builder()
|
|
|
+ // .plateCloseUpPercent("0.0")
|
|
|
+ // .build();
|
|
|
+ // plateIPage = industryPlateResMapper.pageByIncActualPlate(page,queryForm);
|
|
|
+ // if (incOrDec.equals(true)){
|
|
|
+ // // 涨幅
|
|
|
+ // // plates = toActualByLastWeek(incOrDec,"plate_close_up_percent");
|
|
|
+ // // 2、封装返回数据。
|
|
|
+ // List<IncInfo> incInfos = toBackActualInfos(plateIPage.getRecords());
|
|
|
+ // List<IncInfo> finalIncInfos = incInfos.stream().filter(s -> s.getIndustryValue() > 0.0F)
|
|
|
+ // .collect(Collectors.toList());
|
|
|
+ // IPage<IncInfo> incInfoIPage = new Page<>();
|
|
|
+ // incInfoIPage.setCurrent(plateIPage.getCurrent());
|
|
|
+ // incInfoIPage.setSize(plateIPage.getSize());
|
|
|
+ // incInfoIPage.setPages(plateIPage.getPages());
|
|
|
+ // incInfoIPage.setTotal(plateIPage.getTotal());
|
|
|
+ // incInfoIPage.setRecords(finalIncInfos);
|
|
|
+ // Map<String,Object> pageMap = new HashMap<>();
|
|
|
+ // pageMap.put("current",plateIPage.getCurrent());
|
|
|
+ // pageMap.put("size",plateIPage.getSize());
|
|
|
+ // pageMap.put("pages",plateIPage.getPages());
|
|
|
+ // pageMap.put("total",plateIPage.getTotal());
|
|
|
+ // pageMap.put("incInfos",finalIncInfos);
|
|
|
+ // return pageMap;
|
|
|
+ // }else {
|
|
|
+ // plates = toActualByLastWeek(incOrDec,"plate_close_up_percent");
|
|
|
+ // // 2、封装返回数据。
|
|
|
+ // List<IncInfo> incInfos = toBackActualInfos(plates);
|
|
|
+ // List<IncInfo> finalIncInfos = incInfos.stream().filter(s -> s.getIndustryValue() < 0.0F)
|
|
|
+ // .collect(Collectors.toList());
|
|
|
+ // return null;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 上周实际榜。
|
|
|
+ *
|
|
|
+ * @param incOrDec true=涨幅 false=跌幅。
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<IncInfo> toActual(Boolean incOrDec) {
|
|
|
// 1、获取实际榜数据。
|
|
|
List<IndustryPlateRes> plates = new ArrayList<>();
|
|
|
- IPage<IndustryPlateRes> plateIPage = null;
|
|
|
- Page<IndustryPlateRes> page = new Page<>();
|
|
|
- page.setCurrent(currPage);
|
|
|
- page.setSize(10);
|
|
|
- QueryForm queryForm = QueryForm.builder()
|
|
|
- // .plateId("0.0")
|
|
|
- .plateName("0.0")
|
|
|
- .build();
|
|
|
- plateIPage = industryPlateResMapper.selectActualPlateByPage(page,queryForm);
|
|
|
- if (incOrDec.equals(true)){
|
|
|
+ if (incOrDec.equals(true)) {
|
|
|
// 涨幅
|
|
|
- // plates = toActualByLastWeek(incOrDec,"plate_close_up_percent");
|
|
|
+ plates = toActualByLastWeek(incOrDec, "plate_close_up_percent");
|
|
|
// 2、封装返回数据。
|
|
|
- List<IncInfo> incInfos = toBackActualInfos(plateIPage.getRecords());
|
|
|
+ List<IncInfo> incInfos = toBackActualInfos(plates);
|
|
|
List<IncInfo> finalIncInfos = incInfos.stream().filter(s -> s.getIndustryValue() > 0.0F)
|
|
|
.collect(Collectors.toList());
|
|
|
- IPage<IncInfo> incInfoIPage = new Page<>();
|
|
|
- incInfoIPage.setCurrent(plateIPage.getCurrent());
|
|
|
- incInfoIPage.setSize(plateIPage.getSize());
|
|
|
- incInfoIPage.setPages(plateIPage.getPages());
|
|
|
- incInfoIPage.setTotal(plateIPage.getTotal());
|
|
|
- incInfoIPage.setRecords(finalIncInfos);
|
|
|
- Map<String,Object> pageMap = new HashMap<>();
|
|
|
- pageMap.put("current",plateIPage.getCurrent());
|
|
|
- pageMap.put("size",plateIPage.getSize());
|
|
|
- pageMap.put("pages",plateIPage.getPages());
|
|
|
- pageMap.put("total",plateIPage.getTotal());
|
|
|
- pageMap.put("incInfos",finalIncInfos);
|
|
|
- return pageMap;
|
|
|
- }else {
|
|
|
- plates = toActualByLastWeek(incOrDec,"plate_close_up_percent");
|
|
|
+ return finalIncInfos;
|
|
|
+ } else {
|
|
|
+ plates = toActualByLastWeek(incOrDec, "plate_close_up_percent");
|
|
|
// 2、封装返回数据。
|
|
|
List<IncInfo> incInfos = toBackActualInfos(plates);
|
|
|
List<IncInfo> finalIncInfos = incInfos.stream().filter(s -> s.getIndustryValue() < 0.0F)
|
|
|
.collect(Collectors.toList());
|
|
|
- return null;
|
|
|
+ return finalIncInfos;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 创建分页查询参数。
|
|
|
+ *
|
|
|
+ * @param sqlParam
|
|
|
+ * @param plateId
|
|
|
+ * @param plateName
|
|
|
+ * @param plateCloseUpPercent
|
|
|
+ * @param plateClosePredUpPercent
|
|
|
+ * @param friday
|
|
|
+ * @param lastFriday
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public QueryForm toQueryForm(String sqlParam, String plateId, String plateName,
|
|
|
+ String plateCloseUpPercent, String plateClosePredUpPercent,
|
|
|
+ String friday, String lastFriday) {
|
|
|
+ QueryForm queryForm = QueryForm.builder()
|
|
|
+ .sqlParam(sqlParam)
|
|
|
+ .plateId(plateId)
|
|
|
+ .plateName(plateName)
|
|
|
+ .plateCloseUpPercent(plateCloseUpPercent)
|
|
|
+ .plateClosePredUpPercent(plateClosePredUpPercent)
|
|
|
+ .friday(friday)
|
|
|
+ .lastFriday(lastFriday)
|
|
|
+ .build();
|
|
|
+ return queryForm;
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
- * 上周实际榜。
|
|
|
- * @param incOrDec true=涨幅 false=跌幅。
|
|
|
+ * 上周实际榜分页接口。
|
|
|
+ *
|
|
|
+ * @param incOrDec
|
|
|
+ * @param currPage
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<IncInfo> toActual(Boolean incOrDec){
|
|
|
+ public Map<String, Object> toActualByPage(Boolean incOrDec, Long currPage) {
|
|
|
+ Page<IndustryPlateRes> page = page(currPage);
|
|
|
+ IPage<IndustryPlateRes> plateIPage = null;
|
|
|
// 1、获取实际榜数据。
|
|
|
List<IndustryPlateRes> plates = new ArrayList<>();
|
|
|
- if (incOrDec.equals(true)){
|
|
|
+ if (incOrDec.equals(true)) {
|
|
|
// 涨幅
|
|
|
- plates = toActualByLastWeek(incOrDec,"plate_close_up_percent");
|
|
|
+ // plates = toActualByLastWeek(incOrDec,"plate_close_up_percent");
|
|
|
+ QueryForm queryForm = QueryForm.builder().plateCloseUpPercent("0.0").build();
|
|
|
+ plateIPage = industryPlateResMapper.pageByIncActualPlate(page, queryForm);
|
|
|
// 2、封装返回数据。
|
|
|
- List<IncInfo> incInfos = toBackActualInfos(plates);
|
|
|
+ // 不分页此处需要修改。
|
|
|
+ List<IncInfo> incInfos = toBackActualInfos(plateIPage.getRecords());
|
|
|
List<IncInfo> finalIncInfos = incInfos.stream().filter(s -> s.getIndustryValue() > 0.0F)
|
|
|
.collect(Collectors.toList());
|
|
|
- return finalIncInfos;
|
|
|
- }else {
|
|
|
- plates = toActualByLastWeek(incOrDec,"plate_close_up_percent");
|
|
|
+ // return finalIncInfos;
|
|
|
+ return toPageMap(plateIPage,finalIncInfos);
|
|
|
+ } else {
|
|
|
+ // plates = toActualByLastWeek(incOrDec,"plate_close_up_percent");
|
|
|
+ QueryForm queryForm = QueryForm.builder().plateCloseUpPercent("0.0").build();
|
|
|
+ plateIPage = industryPlateResMapper.pageByDecActualPlate(page, queryForm);
|
|
|
// 2、封装返回数据。
|
|
|
- List<IncInfo> incInfos = toBackActualInfos(plates);
|
|
|
+ // 不分页此处需要修改。
|
|
|
+ List<IncInfo> incInfos = toBackActualInfos(plateIPage.getRecords());
|
|
|
List<IncInfo> finalIncInfos = incInfos.stream().filter(s -> s.getIndustryValue() < 0.0F)
|
|
|
.collect(Collectors.toList());
|
|
|
- return finalIncInfos;
|
|
|
+ // return finalIncInfos;
|
|
|
+ return toPageMap(plateIPage,finalIncInfos);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 上周实际榜函数。
|
|
|
+ *
|
|
|
* @param incOrDec true=涨幅 false=跌幅。
|
|
|
* 日期倒序去最新的上周数据。
|
|
|
* 涨幅 closeup倒序。
|
|
|
* 跌幅 closeup正序。
|
|
|
- * * 求plate_close_up
|
|
|
- * * 上周预测榜函数
|
|
|
- * * 求plate_close_pred_up
|
|
|
+ * * 求plate_close_up
|
|
|
+ * * 上周预测榜函数
|
|
|
+ * * 求plate_close_pred_up
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<IndustryPlateRes> toActualByLastWeek(Boolean incOrDec,String sqlParam){
|
|
|
+ public List<IndustryPlateRes> toActualByLastWeek(Boolean incOrDec, String sqlParam) {
|
|
|
QueryWrapper<IndustryPlateRes> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.orderByDesc("plate_date");
|
|
|
- if (incOrDec.equals(true)){
|
|
|
+ if (incOrDec.equals(true)) {
|
|
|
// 涨福,closeup倒序。
|
|
|
queryWrapper.orderByDesc(sqlParam);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
// 跌幅 closeup正序。
|
|
|
queryWrapper.orderByAsc(sqlParam);
|
|
|
}
|
|
@@ -198,6 +299,7 @@ public class ListServiceImpl implements ListService {
|
|
|
|
|
|
/**
|
|
|
* 实际榜---返回信息创建接口。
|
|
|
+ *
|
|
|
* @param plates 列表。
|
|
|
* @return
|
|
|
*/
|
|
@@ -223,23 +325,24 @@ public class ListServiceImpl implements ListService {
|
|
|
|
|
|
/**
|
|
|
* 上周预测榜数据。
|
|
|
+ *
|
|
|
* @param incOrDec
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<IncInfo> toLastPred(Boolean incOrDec){
|
|
|
+ public List<IncInfo> toLastPred(Boolean incOrDec) {
|
|
|
// 1、先获取数据库最新的日期,然后根据该日期获取上周五的日期。
|
|
|
// 1、获取上周预测数据。
|
|
|
List<IndustryPlateRes> plates = new ArrayList<>();
|
|
|
- if (incOrDec.equals(true)){
|
|
|
+ if (incOrDec.equals(true)) {
|
|
|
// 涨幅
|
|
|
- plates = toActualByLastWeek(incOrDec,"plate_close_pred_up_percent");
|
|
|
+ plates = toActualByLastWeek(incOrDec, "plate_close_pred_up_percent");
|
|
|
// 3、创建返回值。
|
|
|
List<IncInfo> incInfos = toBackPredInfos(plates);
|
|
|
List<IncInfo> finalIncInfos = incInfos.stream().filter(s -> s.getIndustryValue() > 0.0F)
|
|
|
.collect(Collectors.toList());
|
|
|
return finalIncInfos;
|
|
|
- }else {
|
|
|
- plates = toActualByLastWeek(incOrDec,"plate_close_pred_up_percent");
|
|
|
+ } else {
|
|
|
+ plates = toActualByLastWeek(incOrDec, "plate_close_pred_up_percent");
|
|
|
List<IncInfo> incInfos = toBackPredInfos(plates);
|
|
|
List<IncInfo> finalIncInfos = incInfos.stream().filter(s -> s.getIndustryValue() < 0.0F)
|
|
|
.collect(Collectors.toList());
|
|
@@ -247,6 +350,59 @@ public class ListServiceImpl implements ListService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public Page<IndustryPlateRes> page(Long currPage){
|
|
|
+ Page<IndustryPlateRes> page = new Page<>();
|
|
|
+ page.setCurrent(currPage);
|
|
|
+ page.setSize(Constants.PAGES_NUM);
|
|
|
+ return page;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Map<String,Object> toPageMap(IPage<IndustryPlateRes> plateIPage,List<IncInfo> finalIncInfos){
|
|
|
+ Map<String, Object> pageMap = new HashMap<>();
|
|
|
+ pageMap.put("current", plateIPage.getCurrent());
|
|
|
+ pageMap.put("size", plateIPage.getSize());
|
|
|
+ pageMap.put("pages", plateIPage.getPages());
|
|
|
+ pageMap.put("total", plateIPage.getTotal());
|
|
|
+ pageMap.put("incInfos", finalIncInfos);
|
|
|
+ return pageMap;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 上周预测榜数据分页接口。
|
|
|
+ * @param incOrDec
|
|
|
+ * @param currPage
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Map<String, Object> toLastPredByPage(Boolean incOrDec,Long currPage) {
|
|
|
+ IPage<IndustryPlateRes> plateIPage = null;
|
|
|
+ Page<IndustryPlateRes> page = page(currPage);
|
|
|
+ // 1、先获取数据库最新的日期,然后根据该日期获取上周五的日期。
|
|
|
+ // 1.1、获取上周预测数据。
|
|
|
+ List<IndustryPlateRes> plates = new ArrayList<>();
|
|
|
+ if (incOrDec.equals(true)) {
|
|
|
+ // 涨幅
|
|
|
+ // plates = toActualByLastWeek(incOrDec, "plate_close_pred_up_percent");
|
|
|
+ QueryForm queryForm = QueryForm.builder().plateClosePredUpPercent("0.0").build();
|
|
|
+ plateIPage = industryPlateResMapper.pageByIncPredLastPlate(page,queryForm);
|
|
|
+ // 3、创建返回值。
|
|
|
+ // 不分页此处需要修改。
|
|
|
+ List<IncInfo> incInfos = toBackPredInfos(plateIPage.getRecords());
|
|
|
+ List<IncInfo> finalIncInfos = incInfos.stream().filter(s -> s.getIndustryValue() > 0.0F)
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ // return finalIncInfos;
|
|
|
+ return toPageMap(plateIPage,finalIncInfos);
|
|
|
+ } else {
|
|
|
+ QueryForm queryForm = QueryForm.builder().plateClosePredUpPercent("0.0").build();
|
|
|
+ // plates = toActualByLastWeek(incOrDec, "plate_close_pred_up_percent");
|
|
|
+ plateIPage = industryPlateResMapper.pageByDecPredLastPlate(page,queryForm);
|
|
|
+ // 不分页此处需要修改。
|
|
|
+ List<IncInfo> incInfos = toBackPredInfos(plateIPage.getRecords());
|
|
|
+ List<IncInfo> finalIncInfos = incInfos.stream().filter(s -> s.getIndustryValue() < 0.0F)
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ // return finalIncInfos;
|
|
|
+ return toPageMap(plateIPage,finalIncInfos);
|
|
|
+ }
|
|
|
+ }
|
|
|
/**
|
|
|
* 预测榜--返回信息创建接口。
|
|
|
*
|
|
@@ -274,14 +430,15 @@ public class ListServiceImpl implements ListService {
|
|
|
|
|
|
/**
|
|
|
* 下周预测
|
|
|
+ *
|
|
|
* @param incOrDec
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<IncInfo> toNextPred(Boolean incOrDec){
|
|
|
+ public List<IncInfo> toNextPred(Boolean incOrDec) {
|
|
|
// 1、先获取数据库最新的日期,然后根据该日期获取上周五的日期。
|
|
|
// 1、获取上周预测数据。
|
|
|
List<IndustryPlateRes> plates = new ArrayList<>();
|
|
|
- if (incOrDec.equals(true)){
|
|
|
+ if (incOrDec.equals(true)) {
|
|
|
// 涨幅
|
|
|
plates = toPredByNext(incOrDec);
|
|
|
// 3、创建返回值。
|
|
@@ -289,7 +446,7 @@ public class ListServiceImpl implements ListService {
|
|
|
List<IncInfo> finalIncInfos = incInfos.stream().filter(s -> s.getIndustryValue() > 0.0F)
|
|
|
.collect(Collectors.toList());
|
|
|
return finalIncInfos;
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
plates = toPredByNext(incOrDec);
|
|
|
List<IncInfo> incInfos = toBackPredInfos(plates);
|
|
|
List<IncInfo> finalIncInfos = incInfos.stream().filter(s -> s.getIndustryValue() < 0.0F)
|
|
@@ -298,20 +455,59 @@ public class ListServiceImpl implements ListService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 下周预测分页接口。
|
|
|
+ * @param incOrDec
|
|
|
+ * @param currPage
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Map<String, Object> toNextPredByPage(Boolean incOrDec, Long currPage) {
|
|
|
+ Page<IndustryPlateRes> page = page(currPage);
|
|
|
+ IPage<IndustryPlateRes> plateIPage = null;
|
|
|
+ // 1、先获取数据库最新的日期,然后根据该日期获取上周五的日期。
|
|
|
+ // 1、获取上周预测数据。
|
|
|
+ List<IndustryPlateRes> plates = new ArrayList<>();
|
|
|
+ if (incOrDec.equals(true)) {
|
|
|
+ // 涨幅
|
|
|
+ // plates = toPredByNext(incOrDec);
|
|
|
+ QueryForm queryForm = QueryForm.builder().plateClose("true")
|
|
|
+ .plateClosePredUpPercent("0.0").build();
|
|
|
+ plateIPage = industryPlateResMapper.pageByIncPredNextPlate(page,queryForm);
|
|
|
+ // 3、创建返回值。
|
|
|
+ List<IncInfo> incInfos = toBackPredInfos(plateIPage.getRecords());
|
|
|
+ List<IncInfo> finalIncInfos = incInfos.stream().filter(s -> s.getIndustryValue() > 0.0F)
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ // return finalIncInfos;
|
|
|
+ return toPageMap(plateIPage,finalIncInfos);
|
|
|
+ } else {
|
|
|
+ // plates = toPredByNext(incOrDec);
|
|
|
+ QueryForm queryForm = QueryForm.builder().plateClose("true")
|
|
|
+ .plateClosePredUpPercent("0.0").build();
|
|
|
+ plateIPage = industryPlateResMapper.pageByDecPredNextPlate(page,queryForm);
|
|
|
+ // 不分页此处需要修改。
|
|
|
+ List<IncInfo> incInfos = toBackPredInfos(plateIPage.getRecords());
|
|
|
+ List<IncInfo> finalIncInfos = incInfos.stream().filter(s -> s.getIndustryValue() < 0.0F)
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ // return finalIncInfos;
|
|
|
+ return toPageMap(plateIPage,finalIncInfos);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 下周预测榜函数
|
|
|
- * 求plate_close_pred_up满足close为空。
|
|
|
+ * 求plate_close_pred_up满足close为空。
|
|
|
+ *
|
|
|
* @param incOrDec 涨跌幅。
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<IndustryPlateRes> toPredByNext(Boolean incOrDec){
|
|
|
+ public List<IndustryPlateRes> toPredByNext(Boolean incOrDec) {
|
|
|
QueryWrapper<IndustryPlateRes> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.orderByDesc("plate_date");
|
|
|
queryWrapper.isNull("plate_close");
|
|
|
- if (incOrDec.equals(true)){
|
|
|
+ if (incOrDec.equals(true)) {
|
|
|
// 涨福,closeup倒序。
|
|
|
queryWrapper.orderByDesc("plate_close_pred_up_percent");
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
// 跌幅 closeup正序。
|
|
|
queryWrapper.orderByAsc("plate_close_pred_up_percent");
|
|
|
}
|