瀏覽代碼

指标排行榜添加弹窗返回全部数据

wangchangsheng 2 年之前
父節點
當前提交
53260383fc

+ 3 - 2
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/homepage/EconomyHomePageController.java

@@ -76,12 +76,13 @@ public class EconomyHomePageController {
     public R getEconomyPointRanking(
             @RequestParam(value = "foreignKeyId", required = true) String foreignKeyId,
             @RequestParam(value = "dateType", required = true) String dateType,
-            @RequestParam(value = "pointCode", required = true) String pointCode
+            @RequestParam(value = "pointCode", required = true) String pointCode,
+            @RequestParam(value = "popup", required = false) boolean popup
     )  {
 
         List<ProEconPointCodeDTO> dtos = null;
         try {
-            dtos = economyPointHomePageService.getEconomyPointRanking(foreignKeyId, dateType, pointCode);
+            dtos = economyPointHomePageService.getEconomyPointRanking(foreignKeyId, dateType, pointCode, popup);
         } catch (Exception e) {
             log.error("请求异常", e);
             return R.error(ResultMsg.error());

+ 1 - 1
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/IProEconPointCodeService.java

@@ -23,6 +23,6 @@ public interface IProEconPointCodeService extends IService<ProEconPointCode> {
 
     ProEconPointCode getProEconPointCode(String nemCode);
 
-    List<ProEconPointCodeDTO>  getEconPointRanking(String regionId, String companyId, String pointCode,Date date,String dateType);
+    List<ProEconPointCodeDTO>  getEconPointRanking(String regionId, String companyId, String pointCode,Date date,String dateType,boolean popup);
 
 }

+ 4 - 8
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/impl/ProEconPointCodeServiceImpl.java

@@ -59,13 +59,13 @@ public class ProEconPointCodeServiceImpl extends ServiceImpl<ProEconPointCodeMap
     }
 
     @Override
-    public List<ProEconPointCodeDTO> getEconPointRanking(String regionId, String companyId, String pointCode, Date date, String dateType) {
+    public List<ProEconPointCodeDTO> getEconPointRanking(String regionId, String companyId, String pointCode, Date date, String dateType, boolean popup) {
         List<ProBasicPowerstation> powerstationList = proBasicPowerstationService.getProBasicPowerstationlist(regionId, companyId, "");
 
         ProEconPointCode proEconPointCode = getProEconPointCode(pointCode);
         if (null == proEconPointCode){
-            proEconPointCode = getProEconPointCode("fdl");
-            pointCode = "fdl";
+            proEconPointCode = getProEconPointCode("fnlyl");
+            pointCode = "fnlyl";
         }
         List<ProEconPointCodeDTO> dtos = new ArrayList<>();
 
@@ -125,18 +125,14 @@ public class ProEconPointCodeServiceImpl extends ServiceImpl<ProEconPointCodeMap
         List<String> newsta = powerstationList.stream().map(ProBasicPowerstation::getNemCode).collect(Collectors.toList());
         List<String> reduce1 = newsta.stream().filter(item -> !newsto.contains(item)).collect(Collectors.toList());
         for (String i : reduce1) {
-            if (dtos.size() >= 5) {
-                break;
-            }
             ProEconPointCodeDTO dto = new ProEconPointCodeDTO();
             dto.setDescription(proEconPointCode.getDescription() + "(" + proEconPointCode.getUnit() + ")");
             dto.setStationcode(CacheContext.wpmap.get(i).getNemCode());
             dto.setStationname(CacheContext.wpmap.get(i).getName());
             dtos.add(dto);
-
         }
         dtos.sort(Comparator.comparing(ProEconPointCodeDTO::getValue).reversed());
-        List<ProEconPointCodeDTO> dtoss = dtos.stream().sorted(Comparator.comparing(ProEconPointCodeDTO::getValue)).limit(5).collect(Collectors.toList());
+        List<ProEconPointCodeDTO> dtoss = dtos.stream().sorted(Comparator.comparing(ProEconPointCodeDTO::getValue)).limit(popup ? dtos.size() : 5).collect(Collectors.toList());
         dtoss.sort(Comparator.comparing(ProEconPointCodeDTO::getValue).reversed());
         return dtoss;
     }

+ 1 - 1
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/impl/ProEconPowerstationInfoDay1ServiceImpl.java

@@ -87,7 +87,7 @@ public class ProEconPowerstationInfoDay1ServiceImpl extends ServiceImpl<ProEconP
         }
 
         if (null !=date) {
-            Date bingdate = DateUtils.addDays(date, -4);
+            Date bingdate = DateUtils.addDays(date, -6);
 
             qw.lambda().ge(ProEconPowerstationInfoDay1::getRecordDate, bingdate);
             qw.lambda().le(ProEconPowerstationInfoDay1::getRecordDate, date);

+ 3 - 3
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/homepage/EconomyPointHomePageService.java

@@ -144,7 +144,7 @@ public class EconomyPointHomePageService {
         //三率曲线
         threeRateCurvelist = proEconPowerstationInfoDay4Service.getEconThreeRateCurve(foreignKeyId, staType, dateType, date);
 
-        List<ProEconPointCodeDTO> pointCodeDTO = proEconPointCodeService.getEconPointRanking("", foreignKeyId, pointCode,date,dateType);
+        List<ProEconPointCodeDTO> pointCodeDTO = proEconPointCodeService.getEconPointRanking("", foreignKeyId, pointCode,date,dateType,false);
         powerstationFnlyl(foreignKeyId,staType,date);//地图场站性息
         /**  场站信息 */
         List<ProBasicPowerstation> powerstationList = proBasicPowerstationService.getProBasicPowerstationlist("", foreignKeyId, staType);
@@ -213,11 +213,11 @@ public class EconomyPointHomePageService {
      * @param pointCode
      * @return
      */
-    public List<ProEconPointCodeDTO> getEconomyPointRanking(String foreignKeyId, String dateType,String pointCode){
+    public List<ProEconPointCodeDTO> getEconomyPointRanking(String foreignKeyId, String dateType,String pointCode,boolean popup){
         //获取当前时间
         String strdate = DateUtils.toDate1(new Date());
         Date date = DateUtils.parseDate(strdate);
-        List<ProEconPointCodeDTO> pointCodeDTO = proEconPointCodeService.getEconPointRanking("", foreignKeyId, pointCode,date,dateType);
+        List<ProEconPointCodeDTO> pointCodeDTO = proEconPointCodeService.getEconPointRanking("", foreignKeyId, pointCode,date,dateType,popup);
         return pointCodeDTO;
     }
     /**