Browse Source

1、分页前的一次提交。

jessie 5 years ago
parent
commit
58e5cd157b

+ 0 - 10
src/main/java/com/pavis/ai/app/fda/common/utils/DateUtils.java

@@ -270,7 +270,6 @@ public class DateUtils {
         DateTimeFormatter pattern = DateTimeFormatter.ofPattern("yyyy-MM-dd");
         DateTimeFormatter pattern = DateTimeFormatter.ofPattern("yyyy-MM-dd");
         LocalDate localDate = LocalDate.parse(friday, pattern);
         LocalDate localDate = LocalDate.parse(friday, pattern);
         LocalDate LastLocalDate = LocalDate.parse(lastFriday, pattern);
         LocalDate LastLocalDate = LocalDate.parse(lastFriday, pattern);
-        System.err.println(localDate.compareTo(LastLocalDate));
         int res = localDate.compareTo(LastLocalDate);
         int res = localDate.compareTo(LastLocalDate);
         return res > 0 ? true : false;
         return res > 0 ? true : false;
     }
     }
@@ -303,21 +302,16 @@ public class DateUtils {
         // distinctFloats = distinctFloats.stream().filter(x -> x!=null).collect(Collectors.toList());
         // distinctFloats = distinctFloats.stream().filter(x -> x!=null).collect(Collectors.toList());
         List<Float> finalFloats = new ArrayList<>();
         List<Float> finalFloats = new ArrayList<>();
         if(distinctFloats.size() > 0){
         if(distinctFloats.size() > 0){
-            System.err.println(JSON.toJSONString(distinctFloats));
             // 排序
             // 排序
             distinctFloats.sort(Comparator.reverseOrder());
             distinctFloats.sort(Comparator.reverseOrder());
-            System.err.println(JSON.toJSONString(distinctFloats));
             // String result = floats.stream().reduce((first, second) -> second).orElse("no last element");
             // String result = floats.stream().reduce((first, second) -> second).orElse("no last element");
             Float firstNum = distinctFloats.stream().findFirst().orElse( 0F );
             Float firstNum = distinctFloats.stream().findFirst().orElse( 0F );
             Float lastNum = distinctFloats.stream().reduce((first, second) -> second).orElse(0F);
             Float lastNum = distinctFloats.stream().reduce((first, second) -> second).orElse(0F);
-            System.err.println(firstNum + " <> " + lastNum);
             // 求各值间隔。 是否应该除以个数 todo 待讨论。
             // 求各值间隔。 是否应该除以个数 todo 待讨论。
             Float num = (firstNum - lastNum) / 10;
             Float num = (firstNum - lastNum) / 10;
-            System.err.println(num);
             for (Float aFloat : distinctFloats) {
             for (Float aFloat : distinctFloats) {
                 finalFloats.add(aFloat / 10);
                 finalFloats.add(aFloat / 10);
             }
             }
-            System.err.println(JSON.toJSONString(finalFloats));
         }else {
         }else {
             finalFloats.add(0.0F);
             finalFloats.add(0.0F);
             return finalFloats;
             return finalFloats;
@@ -340,21 +334,17 @@ public class DateUtils {
         // distinctFloats = distinctFloats.stream().filter(x -> x!=null).collect(Collectors.toList());
         // distinctFloats = distinctFloats.stream().filter(x -> x!=null).collect(Collectors.toList());
         List<Integer> finals = new ArrayList<>();
         List<Integer> finals = new ArrayList<>();
         if(distinctFloats.size() > 0){
         if(distinctFloats.size() > 0){
-            System.err.println(JSON.toJSONString(distinctFloats));
             // 排序
             // 排序
             distinctFloats.sort(Comparator.reverseOrder());
             distinctFloats.sort(Comparator.reverseOrder());
-            System.err.println(JSON.toJSONString(distinctFloats));
             // String result = floats.stream().reduce((first, second) -> second).orElse("no last element");
             // String result = floats.stream().reduce((first, second) -> second).orElse("no last element");
             Integer firstNum = distinctFloats.stream().findFirst().orElse( 0);
             Integer firstNum = distinctFloats.stream().findFirst().orElse( 0);
             Integer lastNum = distinctFloats.stream().reduce((first, second) -> second).orElse(0);
             Integer lastNum = distinctFloats.stream().reduce((first, second) -> second).orElse(0);
-            System.err.println(firstNum + " <> " + lastNum);
             // 求各值间隔。 是否应该除以个数 todo 待讨论。
             // 求各值间隔。 是否应该除以个数 todo 待讨论。
             Integer num = (firstNum - lastNum) / 6;
             Integer num = (firstNum - lastNum) / 6;
             finals.add(lastNum);
             finals.add(lastNum);
             for (int i = 0; i < 7; i++) {
             for (int i = 0; i < 7; i++) {
                 finals.add(lastNum += num);
                 finals.add(lastNum += num);
             }
             }
-            System.err.println(JSON.toJSONString(finals));
         }else {
         }else {
             finals.add(0);
             finals.add(0);
             finals.add(100);
             finals.add(100);

+ 13 - 6
src/main/java/com/pavis/ai/app/fda/service/impl/FollowServiceImpl.java

@@ -9,8 +9,10 @@ import com.pavis.ai.app.fda.form.follow.Follower;
 import com.pavis.ai.app.fda.form.inc.IncInfo;
 import com.pavis.ai.app.fda.form.inc.IncInfo;
 import com.pavis.ai.app.fda.mapper.FollowInfoMapper;
 import com.pavis.ai.app.fda.mapper.FollowInfoMapper;
 import com.pavis.ai.app.fda.mapper.IndustryPlateMapper;
 import com.pavis.ai.app.fda.mapper.IndustryPlateMapper;
+import com.pavis.ai.app.fda.mapper.IndustryPlateResMapper;
 import com.pavis.ai.app.fda.model.FollowInfo;
 import com.pavis.ai.app.fda.model.FollowInfo;
 import com.pavis.ai.app.fda.model.IndustryPlate;
 import com.pavis.ai.app.fda.model.IndustryPlate;
+import com.pavis.ai.app.fda.model.IndustryPlateRes;
 import com.pavis.ai.app.fda.service.FollowService;
 import com.pavis.ai.app.fda.service.FollowService;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.BeanUtils;
@@ -36,6 +38,9 @@ public class FollowServiceImpl implements FollowService {
     @Autowired
     @Autowired
     private IndustryPlateMapper industryPlateMapper;
     private IndustryPlateMapper industryPlateMapper;
 
 
+    @Autowired
+    private IndustryPlateResMapper industryPlateResMapper;
+
     @Override
     @Override
     public int followed(Follower follower) {
     public int followed(Follower follower) {
         return toFollow(follower);
         return toFollow(follower);
@@ -91,13 +96,15 @@ public class FollowServiceImpl implements FollowService {
         IncInfo incInfo;
         IncInfo incInfo;
         List<IncInfo> incInfos = new ArrayList<>();
         List<IncInfo> incInfos = new ArrayList<>();
         for (FollowInfo followInfo : followInfos) {
         for (FollowInfo followInfo : followInfos) {
-            QueryWrapper<IndustryPlate> industryPlateQueryWrapper = new QueryWrapper<>();
-            industryPlateQueryWrapper.lambda()
-                    .eq(IndustryPlate::getPlateId, followInfo.getPlateId())
-                    .orderByDesc(IndustryPlate::getPlateDate);
-            List<IndustryPlate> datePlates = industryPlateMapper.selectList(industryPlateQueryWrapper);
+            QueryWrapper<IndustryPlateRes> industryPlateResQueryWrapper = new QueryWrapper<>();
+            industryPlateResQueryWrapper.lambda()
+                    .eq(IndustryPlateRes::getPlateId, followInfo.getPlateId())
+                    .isNotNull(IndustryPlateRes::getPlateClose)
+                    .orderByDesc(IndustryPlateRes::getPlateDate);
+            List<IndustryPlateRes> datePlates = industryPlateResMapper.selectList(industryPlateResQueryWrapper);
             String date = datePlates.size() > 0 ? datePlates.get(0).getPlateDate() : TestCommon.getWeek();
             String date = datePlates.size() > 0 ? datePlates.get(0).getPlateDate() : TestCommon.getWeek();
-            Float value = calFollowActualValue(date, followInfo.getPlateId());
+            // Float value = calFollowActualValue(date, followInfo.getPlateId());
+            Float value = datePlates.get(0).getPlateCloseUpPercent();
             incInfo = IncInfo.builder()
             incInfo = IncInfo.builder()
                     .industryId(followInfo.getPlateId())
                     .industryId(followInfo.getPlateId())
                     .industryValue(GeneralUtils.toFloatByTwo(value))
                     .industryValue(GeneralUtils.toFloatByTwo(value))

+ 69 - 35
src/main/java/com/pavis/ai/app/fda/service/impl/HisServiceImpl.java

@@ -23,6 +23,7 @@ import org.springframework.stereotype.Component;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 
 /**
 /**
  * @author guanhuijuan
  * @author guanhuijuan
@@ -88,7 +89,7 @@ public class HisServiceImpl implements HisService {
      */
      */
     public IndustryDetailsInfo toDetailsByPlateId(List<FindDetail> findDetails,Boolean isDetailed) {
     public IndustryDetailsInfo toDetailsByPlateId(List<FindDetail> findDetails,Boolean isDetailed) {
         // 1、根据行业id、日期倒序查询,
         // 1、根据行业id、日期倒序查询,
-        String datePlate = getNewestDate(findDetails);
+        String datePlate = getNewestDate(findDetails,isDetailed);
         log.info("实际日期:{}",datePlate);
         log.info("实际日期:{}",datePlate);
         // 2、根据行业id、日期在近7天的,实际榜数据。
         // 2、根据行业id、日期在近7天的,实际榜数据。
         // Map<String, Object> weekMap = DateUtils.getEverydayByActual(datePlate);
         // Map<String, Object> weekMap = DateUtils.getEverydayByActual(datePlate);
@@ -106,7 +107,6 @@ public class HisServiceImpl implements HisService {
             actualPlates = toActualPlates(findDetails.get(0).getPlateId(),
             actualPlates = toActualPlates(findDetails.get(0).getPlateId(),
                     month,nearlyMonth);
                     month,nearlyMonth);
         }
         }
-        log.info("实际:{}", JSON.toJSONString(actualPlates));
 
 
         // 预测数据。
         // 预测数据。
         List<IndustryPlate> nextPlates = new ArrayList<>();
         List<IndustryPlate> nextPlates = new ArrayList<>();
@@ -116,55 +116,70 @@ public class HisServiceImpl implements HisService {
             String nextMonday = nextWeekMap.get("monday").toString();
             String nextMonday = nextWeekMap.get("monday").toString();
             String nextSunday = nextWeekMap.get("sunday").toString();
             String nextSunday = nextWeekMap.get("sunday").toString();
             if (DateUtils.checkDate(nextMonday, nextSunday).equals(true)) {
             if (DateUtils.checkDate(nextMonday, nextSunday).equals(true)) {
-                nextPlates = toActualPlates(findDetails.get(0).getPlateId(),
+                nextPlates = toActualPlates("",
                         nextSunday,nextMonday);
                         nextSunday,nextMonday);
             }else {
             }else {
-                nextPlates = toActualPlates(findDetails.get(0).getPlateId(),
+                nextPlates = toActualPlates("",
                         nextMonday,nextSunday);
                         nextMonday,nextSunday);
             }
             }
+            // nextPlates = actualPlates.stream().filter(s -> s.getPlateClose() == null)
+            //         .collect(Collectors.toList());
             log.info("预测:{}", JSON.toJSONString(nextPlates));
             log.info("预测:{}", JSON.toJSONString(nextPlates));
         }
         }
         // 3、构造实际数据返回。
         // 3、构造实际数据返回。
         List<IndustryDetail> industryDetails = new ArrayList<>();
         List<IndustryDetail> industryDetails = new ArrayList<>();
-        List<Float> floats = new ArrayList<>();
         List<Integer> axisLists = new ArrayList<>();
         List<Integer> axisLists = new ArrayList<>();
-        if (nextPlates.size() > 0 && isDetailed.equals(true)) {
-            // 创建detail列表
+        String plateId = findDetails.get(0).getPlateId();
+        String userId = findDetails.get(0).getUserId();
+        if (isDetailed.equals(false)){
             log.info("实际:{}", JSON.toJSONString(actualPlates));
             log.info("实际:{}", JSON.toJSONString(actualPlates));
+            // 实际数据来的。
             for (IndustryPlate industryPlate : actualPlates) {
             for (IndustryPlate industryPlate : actualPlates) {
-                // 如果是周六周日则不展示。
                 String week = DateUtils.getWeekNameByDate(industryPlate.getPlateDate());
                 String week = DateUtils.getWeekNameByDate(industryPlate.getPlateDate());
                 if (!week.equals("6") && !week.equals("7")){
                 if (!week.equals("6") && !week.equals("7")){
                     industryDetails.add(toIndustryDetail(industryPlate));
                     industryDetails.add(toIndustryDetail(industryPlate));
-                    floats.add(industryPlate.getPlateClose());
-                    floats.add(industryPlate.getPlateClosePred());
                     axisLists.add(null == industryPlate.getPlateClose() ? 0 : Math.round(industryPlate.getPlateClose()));
                     axisLists.add(null == industryPlate.getPlateClose() ? 0 : Math.round(industryPlate.getPlateClose()));
-                    axisLists.add(null == industryPlate.getPlateClosePred() ? 0 : Math.round(industryPlate.getPlateClosePred()));
                 }
                 }
             }
             }
-        }
-        if (isDetailed.equals(false)) {
-            // 创建detail列表
+            return toInitDetails(plateId,userId,axisLists,industryDetails);
+        }else {
+            for (IndustryPlate nextPlate : nextPlates) {
+                String week = DateUtils.getWeekNameByDate(nextPlate.getPlateDate());
+                if (!week.equals("6") && !week.equals("7")){
+                    axisLists.add(null == nextPlate.getPlateClose() ? 0 : Math.round(nextPlate.getPlateClose()));
+                    industryDetails.add(toIndustryDetail(nextPlate));
+                }
+            }
             log.info("实际:{}", JSON.toJSONString(actualPlates));
             log.info("实际:{}", JSON.toJSONString(actualPlates));
             for (IndustryPlate industryPlate : actualPlates) {
             for (IndustryPlate industryPlate : actualPlates) {
+                // 如果是周六周日则不展示。
                 String week = DateUtils.getWeekNameByDate(industryPlate.getPlateDate());
                 String week = DateUtils.getWeekNameByDate(industryPlate.getPlateDate());
                 if (!week.equals("6") && !week.equals("7")){
                 if (!week.equals("6") && !week.equals("7")){
                     industryDetails.add(toIndustryDetail(industryPlate));
                     industryDetails.add(toIndustryDetail(industryPlate));
-                    floats.add(industryPlate.getPlateClose());
-                    floats.add(industryPlate.getPlateClosePred());
-                    axisLists.add(null == industryPlate.getPlateClose() ? 0 : Math.round(industryPlate.getPlateClose()));
                     axisLists.add(null == industryPlate.getPlateClosePred() ? 0 : Math.round(industryPlate.getPlateClosePred()));
                     axisLists.add(null == industryPlate.getPlateClosePred() ? 0 : Math.round(industryPlate.getPlateClosePred()));
                 }
                 }
             }
             }
+            return toInitDetails(plateId,userId,axisLists,industryDetails);
         }
         }
+    }
+
+
+    /**
+     * 初始化详情数据。
+     * @param plateId
+     * @param userId
+     * @param axisLists
+     * @param industryDetails
+     * @return
+     */
+    public IndustryDetailsInfo toInitDetails (String plateId,String userId,List<Integer> axisLists,List<IndustryDetail> industryDetails){
         // 3.1 新闻列表,根据行业id查询
         // 3.1 新闻列表,根据行业id查询
         SearchInfo searchInfo = SearchInfo.builder()
         SearchInfo searchInfo = SearchInfo.builder()
-                .searchParam(findDetails.get(0).getPlateId())
+                .searchParam(plateId)
                 .build();
                 .build();
         List<NewsList> newsLists = newsService.getNewsByPlateId(searchInfo.getSearchParam());
         List<NewsList> newsLists = newsService.getNewsByPlateId(searchInfo.getSearchParam());
-        List<FollowInfo> followInfos = getFollowed(findDetails.get(0).getUserId(), findDetails.get(0).getPlateId());
+        List<FollowInfo> followInfos = getFollowed(userId, plateId);
         Boolean isFollowed = followInfos.size() > 0 ? true : false;
         Boolean isFollowed = followInfos.size() > 0 ? true : false;
-        List<Float> axisByY = DateUtils.getAxisY(floats);
         List<Integer> axisByYs = DateUtils.getAxisList(axisLists);
         List<Integer> axisByYs = DateUtils.getAxisList(axisLists);
         IndustryDetailsInfo industryInfo = IndustryDetailsInfo.builder()
         IndustryDetailsInfo industryInfo = IndustryDetailsInfo.builder()
                 .actuals(industryDetails)
                 .actuals(industryDetails)
@@ -204,11 +219,14 @@ public class HisServiceImpl implements HisService {
         QueryWrapper<IndustryPlate> queryWrapper = new QueryWrapper<>();
         QueryWrapper<IndustryPlate> queryWrapper = new QueryWrapper<>();
         if (plateId.equals("")) {
         if (plateId.equals("")) {
             queryWrapper.lambda()
             queryWrapper.lambda()
+                    .eq(IndustryPlate::getPlateId, plateId)
+                    .isNull(IndustryPlate::getPlateClose)
                     .orderByDesc(IndustryPlate::getPlateDate)
                     .orderByDesc(IndustryPlate::getPlateDate)
                     .between(IndustryPlate::getPlateDate, monday, sunday);
                     .between(IndustryPlate::getPlateDate, monday, sunday);
         }else {
         }else {
             queryWrapper.lambda()
             queryWrapper.lambda()
                     .eq(IndustryPlate::getPlateId, plateId)
                     .eq(IndustryPlate::getPlateId, plateId)
+                    // .isNotNull(IndustryPlate::getPlateClose)
                     .orderByDesc(IndustryPlate::getPlateDate)
                     .orderByDesc(IndustryPlate::getPlateDate)
                     .between(IndustryPlate::getPlateDate, monday, sunday);
                     .between(IndustryPlate::getPlateDate, monday, sunday);
         }
         }
@@ -221,12 +239,20 @@ public class HisServiceImpl implements HisService {
      * @param findDetails
      * @param findDetails
      * @return
      * @return
      */
      */
-    public String getNewestDate(List<FindDetail> findDetails){
+    public String getNewestDate(List<FindDetail> findDetails,Boolean isActualOrPred){
         for (FindDetail findDetail : findDetails) {
         for (FindDetail findDetail : findDetails) {
             QueryWrapper<IndustryPlate> industryPlateQueryWrapper = new QueryWrapper<>();
             QueryWrapper<IndustryPlate> industryPlateQueryWrapper = new QueryWrapper<>();
-            industryPlateQueryWrapper.lambda()
-                    .eq(IndustryPlate::getPlateId, findDetail.getPlateId())
-                    .orderByDesc(IndustryPlate::getPlateDate);
+            if (isActualOrPred.equals(false)){
+                // 实际
+                industryPlateQueryWrapper.lambda()
+                        .eq(IndustryPlate::getPlateId, findDetail.getPlateId())
+                        .isNotNull(IndustryPlate::getPlateClose)
+                        .orderByDesc(IndustryPlate::getPlateDate);
+            }else {
+                industryPlateQueryWrapper.lambda()
+                        .eq(IndustryPlate::getPlateId, findDetail.getPlateId())
+                        .orderByDesc(IndustryPlate::getPlateDate);
+            }
             List<IndustryPlate> plates = industryPlateMapper.selectList(industryPlateQueryWrapper);
             List<IndustryPlate> plates = industryPlateMapper.selectList(industryPlateQueryWrapper);
             String date = plates.size() > 0 ? plates.get(0).getPlateDate() : TestCommon.getWeek();
             String date = plates.size() > 0 ? plates.get(0).getPlateDate() : TestCommon.getWeek();
             return date;
             return date;
@@ -321,15 +347,18 @@ public class HisServiceImpl implements HisService {
         List<IndustryPlateSum> industryPlateSums = industryPlateSumMapper.selectList(industryPlateQueryWrapper);
         List<IndustryPlateSum> industryPlateSums = industryPlateSumMapper.selectList(industryPlateQueryWrapper);
         // 1、获取最新的5个行业的日期。
         // 1、获取最新的5个行业的日期。
         String date = industryPlateSums.size() > 0 ? industryPlateSums.get(0).getPlateDate() : TestCommon.getWeek();
         String date = industryPlateSums.size() > 0 ? industryPlateSums.get(0).getPlateDate() : TestCommon.getWeek();
-        Map<String, Object> weekMap = DateUtils.getEverydayByActual(date);
-        String monday = weekMap.get("MONDAY").toString();
-        String sunday = weekMap.get("SUNDAY").toString();
+        // Map<String, Object> weekMap = DateUtils.getEverydayByActual(date);
+        // String monday = weekMap.get("MONDAY").toString();
+        // String sunday = weekMap.get("SUNDAY").toString();
+        Map<String, Object> weekMap = DateUtils.getMonthByNearly(date);
+        String month = weekMap.get("month").toString();
+        String nearlyMonth = weekMap.get("nearlyMonth").toString();
         // 2。1、沪深实际数据。
         // 2。1、沪深实际数据。
         List<IndustryPlateSum> plateSums = new ArrayList<>();
         List<IndustryPlateSum> plateSums = new ArrayList<>();
-        if (DateUtils.checkDate(monday, sunday).equals(true)) {
-            plateSums = toActualPlateSums(sunday, monday);
+        if (DateUtils.checkDate(month, nearlyMonth).equals(true)) {
+            plateSums = toActualPlateSums(nearlyMonth, month);
         }else {
         }else {
-            plateSums = toActualPlateSums(monday, sunday);
+            plateSums = toActualPlateSums(month, nearlyMonth);
         }
         }
         log.info("沪深 实际:{}", JSON.toJSONString(plateSums));
         log.info("沪深 实际:{}", JSON.toJSONString(plateSums));
         Map<String, Object> nextWeekMap = DateUtils.getEverydayOfNexWeek(date);
         Map<String, Object> nextWeekMap = DateUtils.getEverydayOfNexWeek(date);
@@ -348,11 +377,17 @@ public class HisServiceImpl implements HisService {
         List<IndustryDetail> nextIndustryDetails = new ArrayList<>();
         List<IndustryDetail> nextIndustryDetails = new ArrayList<>();
         for (IndustryPlateSum nextPlatesNum : nextPlatesNums) {
         for (IndustryPlateSum nextPlatesNum : nextPlatesNums) {
             // 预测在上方,实际在下方。
             // 预测在上方,实际在下方。
-            nextIndustryDetails.add(toInitDetail(nextPlatesNum));
+            String week = DateUtils.getWeekNameByDate(nextPlatesNum.getPlateDate());
+            if (!week.equals("6") && !week.equals("7")){
+                nextIndustryDetails.add(toInitDetail(nextPlatesNum));
+            }
         }
         }
         for (IndustryPlateSum industryPlateSum : plateSums) {
         for (IndustryPlateSum industryPlateSum : plateSums) {
             // 预测在上方,实际在下方。
             // 预测在上方,实际在下方。
-            industryDetails.add(toInitDetail(industryPlateSum));
+            String week = DateUtils.getWeekNameByDate(industryPlateSum.getPlateDate());
+            if (!week.equals("6") && !week.equals("7")){
+                industryDetails.add(toInitDetail(industryPlateSum));
+            }
         }
         }
         IndustryDetailsInfo industryInfo = IndustryDetailsInfo.builder()
         IndustryDetailsInfo industryInfo = IndustryDetailsInfo.builder()
                 .actuals(industryDetails)
                 .actuals(industryDetails)
@@ -360,7 +395,6 @@ public class HisServiceImpl implements HisService {
                 // todo 此处是涨还是跌???????????????
                 // todo 此处是涨还是跌???????????????
                 .tag(true)
                 .tag(true)
                 // todo 0723 是否需要增加。
                 // todo 0723 是否需要增加。
-
                 .build();
                 .build();
         return industryInfo;
         return industryInfo;
     }
     }
@@ -376,8 +410,8 @@ public class HisServiceImpl implements HisService {
         QueryWrapper<IndustryPlateSum> industryPlateQueryWrapper = new QueryWrapper<>();
         QueryWrapper<IndustryPlateSum> industryPlateQueryWrapper = new QueryWrapper<>();
         industryPlateQueryWrapper.lambda()
         industryPlateQueryWrapper.lambda()
                 .orderByDesc(IndustryPlateSum::getPlateDate)
                 .orderByDesc(IndustryPlateSum::getPlateDate)
-                .between(IndustryPlateSum::getPlateDate, monday, sunday)
-                .last("limit 0,5");
+                .between(IndustryPlateSum::getPlateDate, monday, sunday);
+                // .last("limit 0,5");
         List<IndustryPlateSum> industryPlateSums = industryPlateSumMapper.selectList(industryPlateQueryWrapper);
         List<IndustryPlateSum> industryPlateSums = industryPlateSumMapper.selectList(industryPlateQueryWrapper);
         return industryPlateSums;
         return industryPlateSums;
     }
     }

+ 2 - 9
src/main/java/com/pavis/ai/app/fda/service/impl/ListServiceImpl.java

@@ -102,8 +102,8 @@ public class ListServiceImpl implements ListService {
         List<IndustryPlateRes> plates = new ArrayList<>();
         List<IndustryPlateRes> plates = new ArrayList<>();
         IPage<IndustryPlateRes> plateIPage = null;
         IPage<IndustryPlateRes> plateIPage = null;
         Page<IndustryPlateRes> page = new Page<>();
         Page<IndustryPlateRes> page = new Page<>();
-        page.setCurrent(0L);
-        page.setSize(currPage);
+        page.setCurrent(currPage);
+        page.setSize(10);
         QueryForm queryForm = QueryForm.builder()
         QueryForm queryForm = QueryForm.builder()
                 // .plateId("0.0")
                 // .plateId("0.0")
                 .plateName("0.0")
                 .plateName("0.0")
@@ -116,9 +116,7 @@ public class ListServiceImpl implements ListService {
             List<IncInfo> incInfos = toBackActualInfos(plateIPage.getRecords());
             List<IncInfo> incInfos = toBackActualInfos(plateIPage.getRecords());
             List<IncInfo> finalIncInfos = incInfos.stream().filter(s -> s.getIndustryValue() > 0.0F)
             List<IncInfo> finalIncInfos = incInfos.stream().filter(s -> s.getIndustryValue() > 0.0F)
                     .collect(Collectors.toList());
                     .collect(Collectors.toList());
-            System.err.println(finalIncInfos.size());
             IPage<IncInfo> incInfoIPage = new Page<>();
             IPage<IncInfo> incInfoIPage = new Page<>();
-            System.err.println(JSON.toJSONString(plateIPage));
             incInfoIPage.setCurrent(plateIPage.getCurrent());
             incInfoIPage.setCurrent(plateIPage.getCurrent());
             incInfoIPage.setSize(plateIPage.getSize());
             incInfoIPage.setSize(plateIPage.getSize());
             incInfoIPage.setPages(plateIPage.getPages());
             incInfoIPage.setPages(plateIPage.getPages());
@@ -204,19 +202,14 @@ public class ListServiceImpl implements ListService {
      * @return
      * @return
      */
      */
     public List<IncInfo> toBackActualInfos(List<IndustryPlateRes> plates) {
     public List<IncInfo> toBackActualInfos(List<IndustryPlateRes> plates) {
-        System.err.println("siz>"+plates.size());
         // 3、返回数据创建。
         // 3、返回数据创建。
         IncInfo incInfo;
         IncInfo incInfo;
         List<IncInfo> incInfos = new ArrayList<>();
         List<IncInfo> incInfos = new ArrayList<>();
         for (IndustryPlateRes industryPlateRes : plates) {
         for (IndustryPlateRes industryPlateRes : plates) {
             Float percent = industryPlateRes.getPlateCloseUpPercent();
             Float percent = industryPlateRes.getPlateCloseUpPercent();
-            System.err.println(percent);
-            System.err.println(null != percent);
             Float actualVal = null != percent ?
             Float actualVal = null != percent ?
                     percent : 0.0F;
                     percent : 0.0F;
             Boolean industryTag = actualVal > 0.0F ? true : false;
             Boolean industryTag = actualVal > 0.0F ? true : false;
-            System.err.println(actualVal);
-            System.out.println(GeneralUtils.toFloatByTwo(actualVal));
             incInfo = IncInfo.builder()
             incInfo = IncInfo.builder()
                     .industryId(industryPlateRes.getPlateId())
                     .industryId(industryPlateRes.getPlateId())
                     .industryName(industryPlateRes.getPlateName())
                     .industryName(industryPlateRes.getPlateName())

+ 0 - 1
src/main/java/com/pavis/ai/app/fda/service/impl/NewsServiceImpl.java

@@ -142,7 +142,6 @@ public class NewsServiceImpl implements NewsService {
             searchCount.setSearchNum("1");
             searchCount.setSearchNum("1");
             searchCountMapper.insert(searchCount);
             searchCountMapper.insert(searchCount);
         }
         }
-
     }
     }
 
 
     @Override
     @Override