Browse Source

首页年月日加参数

wangb 1 month ago
parent
commit
c1ef66fb8d

File diff suppressed because it is too large
+ 1 - 1
generationXK-service/src/main/resources/application-nxf.yml


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

@@ -135,9 +135,10 @@ public class EconomyHomePageController {
 
     @GetMapping(value = "/home-right")
     @ApiOperation(value = "首页-右侧模块", notes = "首页-右侧模块")
-    public ResultMsg getHomeRight(@RequestParam(value = "companyId", required = false) String companyId) throws Exception {
+    public ResultMsg getHomeRight(@RequestParam(value = "companyId", required = false) String companyId,
+                                  @RequestParam(value = "periodType", required = false) String periodType) throws Exception {
         economyPointHomePageService.calFdl();
-        Map<String, Object> map = economyPointHomePageService.getHomeRight(companyId);
+        Map<String, Object> map = economyPointHomePageService.getHomeRight(companyId,periodType);
         if (null != map) {
             return ResultMsg.ok(map);
         } else {

+ 1 - 1
runeconomy-xk/src/main/java/com/gyee/runeconomy/init/CacheContext.java

@@ -764,7 +764,7 @@ public class CacheContext implements CommandLineRunner {
             temperatureInfos = new ArrayList<>(tis.values());
             temperatureInfos.sort((x, y) -> {
                 if (x.getStationId().equals(y.getStationId())) {
-                    return x.getWindturbineIndex() - y.getWindturbineIndex();
+                    return Integer.parseInt(x.getCode()) - Integer.parseInt(y.getCode());
                 }
                 return x.getStationId().compareTo(y.getStationId());
             });

+ 46 - 1
runeconomy-xk/src/main/java/com/gyee/runeconomy/model/TemperatureInfo.java

@@ -23,6 +23,8 @@ public class TemperatureInfo implements Serializable {
     private List<TemperatureComponentInfo> temperatureComponentInfos;
     private int windturbineIndex;
 
+    private final List<String> order = Arrays.asList("风机信息", "主轴", "发电机", "齿轮箱", "变桨", "液压", "其他");
+
     /**
      * 是否排序
      */
@@ -144,9 +146,52 @@ public class TemperatureInfo implements Serializable {
             temperatureComponentInfos.add(ntci);
         }
         tcim.get(ti.getComponent()).addTemperaturePoint(ti);
-        isSorted = false;
+        isSorted = true;
     }
 
+//    Comparator<TemperatureComponentInfo> comparator = new Comparator<TemperatureComponentInfo>() {
+//        @Override
+//        public int compare(TemperatureComponentInfo t1, TemperatureComponentInfo t2) {
+//            String name1 = t1.getName();
+//            String name2 = t2.getName();
+//
+//            int index1 = order.indexOf(name1);
+//            int index2 = order.indexOf(name2);
+//
+//            if (index1 == -1) {
+//                return index2 == -1 ? 0 : 1;
+//            } else if (index2 == -1) {
+//                return -1;
+//            } else {
+//                return Integer.compare(index1, index2);
+//            }
+//        }
+//    };
+
+
+
+
+//    Comparator<Map<String, TemperatureComponentInfo>> comparator = new Comparator<Map<String, TemperatureComponentInfo>>() {
+//        @Override
+//        public int compare(Map<String, TemperatureComponentInfo> o1, Map<String, TemperatureComponentInfo> o2) {
+//            String name1 = (String) o1.get("name");
+//            Set<String> strings = o1.keySet();
+//            String name2 = (String) o2.get("name");
+//
+//            int index1 = order.indexOf(name1);
+//            int index2 = order.indexOf(name2);
+//
+//            // 如果某个名称不在顺序列表中,则将其放在最后
+//            if (index1 == -1) {
+//                return index2 == -1 ? 0 : 1;
+//            } else if (index2 == -1) {
+//                return -1;
+//            } else {
+//                return Integer.compare(index1, index2);
+//            }
+//        }
+//    };
+
     public List<TemperatureComponentInfo> getTemperatureComponentInfos() {
         if (temperatureComponentInfos == null) {
             temperatureComponentInfos = new ArrayList<>();

+ 0 - 10
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/homepage/EconomyPointHomePageService.java

@@ -1848,21 +1848,12 @@ public class EconomyPointHomePageService {
                 String text = year1 + "-" + mon2;
                 for (ValueVo vv : vxdl2) {
                     if (vv.getText().equals(text)) {
-                        //BigDecimal bxdl2 = day1s4.stream().map(TurbineInfoDay::getXdss).reduce(BigDecimal.ZERO, BigDecimal::add);
                         double bxdl2 = day1s4.stream().mapToDouble(TurbineInfoDay::getXdss).sum();
                         vv.setValue(BigDecimal.valueOf(bxdl2 / 1000));
                     }
                 }
                 for (ValueVo vv : vssdl2) {
                     if (vv.getText().equals(text)) {
-                        //BigDecimal bssl2 = day1s4.stream().map(TurbineInfoDay::getXdss).reduce(BigDecimal.ZERO, BigDecimal::add)
-                        //        .add(day1s4.stream().map(TurbineInfoDay::getJhjxss).reduce(BigDecimal.ZERO, BigDecimal::add)
-                        //                .add(day1s4.stream().map(TurbineInfoDay::getFjhjxss).reduce(BigDecimal.ZERO, BigDecimal::add)
-                        //                        .add(day1s4.stream().map(TurbineInfoDay::getSlss).reduce(BigDecimal.ZERO, BigDecimal::add))
-                        //                        .add(day1s4.stream().map(TurbineInfoDay::getXnss).reduce(BigDecimal.ZERO, BigDecimal::add))
-                        //                        .add(day1s4.stream().map(TurbineInfoDay::getDjss).reduce(BigDecimal.ZERO, BigDecimal::add))
-                        //                        .add(day1s4.stream().map(TurbineInfoDay::getGzss).reduce(BigDecimal.ZERO, BigDecimal::add))));
-
                         double xd = day1s4.stream().mapToDouble(TurbineInfoDay::getXdss).sum();
                         double fjh = day1s4.stream().mapToDouble(TurbineInfoDay::getFjhjxss).sum();
                         double jh = day1s4.stream().mapToDouble(TurbineInfoDay::getJhjxss).sum();
@@ -1872,7 +1863,6 @@ public class EconomyPointHomePageService {
                 }
                 for (ValueVo vv : vfdl2) {
                     if (vv.getText().equals(text)) {
-                        //BigDecimal bfl2 = day1s4.stream().map(TurbineInfoDay::getRfdl).reduce(BigDecimal.ZERO, BigDecimal::add);
                         double bfl2 = day1s4.stream().mapToDouble(TurbineInfoDay::getXdss).sum();
                         vv.setValue(BigDecimal.valueOf(bfl2 / 1000));
                     }