Parcourir la source

经济运行首页代码优化

wangchangsheng il y a 2 ans
Parent
commit
e0385bc275

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

@@ -115,8 +115,24 @@ public class ProEconPointCodeServiceImpl extends ServiceImpl<ProEconPointCodeMap
                 break;
         }
 
-        List<ProEconPointCodeDTO> dtoss = dtos.stream().sorted(Comparator.comparing(ProEconPointCodeDTO::getValue)).limit(10).collect(Collectors.toList());
 
+        List<String> newsto = dtos.stream().map(ProEconPointCodeDTO::getStationcode).collect(Collectors.toList());
+        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() >= 10) {
+                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(10).collect(Collectors.toList());
+        dtoss.sort(Comparator.comparing(ProEconPointCodeDTO::getValue).reversed());
         return dtoss;
     }
 

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

@@ -94,6 +94,8 @@ public class ProEconPowerstationInfoDay1ServiceImpl extends ServiceImpl<ProEconP
 
         }
 
+        qw.lambda().orderByAsc(ProEconPowerstationInfoDay1::getRecordDate);
+
         List<ProEconPowerstationInfoDay1> list = baseMapper.selectList(qw);
 
         return list;

+ 2 - 0
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/impl/ProEconPowerstationInfoDay4ServiceImpl.java

@@ -86,6 +86,8 @@ public class ProEconPowerstationInfoDay4ServiceImpl extends ServiceImpl<ProEconP
             qw.lambda().le(ProEconPowerstationInfoDay4::getRecordDate, date);
         }
 
+        qw.lambda().orderByAsc(ProEconPowerstationInfoDay4::getRecordDate);
+
         List<ProEconPowerstationInfoDay4> list = baseMapper.selectList(qw);
 
         return list;

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

@@ -81,7 +81,7 @@ public class ProEconPowerstationInfoDay5ServiceImpl extends ServiceImpl<ProEconP
             qw.lambda().le(ProEconPowerstationInfoDay5::getRecordDate, date);
 
         }
-
+        qw.lambda().orderByAsc(ProEconPowerstationInfoDay5::getRecordDate);
         List<ProEconPowerstationInfoDay5> list = baseMapper.selectList(qw);
 
         return list;