Browse Source

首页中间保留两位小数

wangb 1 month ago
parent
commit
00ee64d725

+ 2 - 2
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/auto/impl/ProEconEquipmentInfoDayTopServiceImpl.java

@@ -71,7 +71,7 @@ public class ProEconEquipmentInfoDayTopServiceImpl extends ServiceImpl<ProEconEq
             //                    "daydxkyxs": 100.0,等效可用系数
             peeidt.setDayyxfss(day.getYxfss());
             peeidt.setDayjfpl(day.getJfpl());
-            peeidt.setDayglyzxxs(day.getGlyzxxs());
+//            peeidt.setDayglyzxxs(day.getGlyzxxs());
         });
         return peeidtRecords;
     }
@@ -210,7 +210,7 @@ public class ProEconEquipmentInfoDayTopServiceImpl extends ServiceImpl<ProEconEq
             //                    "daydxkyxs": 100.0,等效可用系数
             peeidt.setDayyxfss(day.getYxfss());
             peeidt.setDayjfpl(day.getJfpl());
-            peeidt.setDayglyzxxs(day.getGlyzxxs());
+//            peeidt.setDayglyzxxs(day.getGlyzxxs());
         });
         return peeidtRecords;
     }

+ 12 - 16
runeconomy-xk/src/main/java/com/gyee/runeconomy/service/homepage/EconomyPointHomePageService.java

@@ -1783,33 +1783,26 @@ public class EconomyPointHomePageService {
             String text = year1 + "-" + mon;
             for (ValueVo vv : vexdl) {
                 if (vv.getText().equals(text)) {
-                    //BigDecimal bxdl = day1s2.stream().map(TurbineInfoDay::getXdss).reduce(BigDecimal.ZERO, BigDecimal::add);
                     double bxdl = day1s2.stream().mapToDouble(TurbineInfoDay::getXdss).sum();
-                    vv.setValue(BigDecimal.valueOf(bxdl / 1000));
+                    String format = String.format("%.2f", bxdl / 1000);
+                    vv.setValue(new BigDecimal(format));
                 }
             }
             for (ValueVo vv : vessdl) {
                 if (vv.getText().equals(text)) {
-                    //BigDecimal bssdl = day1s2.stream().map(TurbineInfoDay::getXdss).reduce(BigDecimal.ZERO, BigDecimal::add)
-                    //        .add(day1s2.stream().map(TurbineInfoDay::getJhjxss).reduce(BigDecimal.ZERO, BigDecimal::add)
-                    //                .add(day1s2.stream().map(TurbineInfoDay::getFjhjxss).reduce(BigDecimal.ZERO, BigDecimal::add)
-                    //                        .add(day1s2.stream().map(TurbineInfoDay::getSlss).reduce(BigDecimal.ZERO, BigDecimal::add))
-                    //                        .add(day1s2.stream().map(TurbineInfoDay::getXnss).reduce(BigDecimal.ZERO, BigDecimal::add))
-                    //                        .add(day1s2.stream().map(TurbineInfoDay::getDjss).reduce(BigDecimal.ZERO, BigDecimal::add))
-                    //                        .add(day1s2.stream().map(TurbineInfoDay::getGzss).reduce(BigDecimal.ZERO, BigDecimal::add))));
                     double xd = day1s2.stream().mapToDouble(TurbineInfoDay::getXdss).sum();
                     double fjh = day1s2.stream().mapToDouble(TurbineInfoDay::getFjhjxss).sum();
                     double jh = day1s2.stream().mapToDouble(TurbineInfoDay::getJhjxss).sum();
                     double xn = day1s2.stream().mapToDouble(TurbineInfoDay::getXnss).sum();
-
-                    vv.setValue(BigDecimal.valueOf((xd + fjh + jh + xn) / 1000));
+                    String format = String.format("%.2f", (xd + fjh + jh + xn) / 1000);
+                    vv.setValue(new BigDecimal(format));
                 }
             }
             for (ValueVo vv : vefdl) {
                 if (vv.getText().equals(text)) {
-                    //BigDecimal bfdl = day1s2.stream().map(TurbineInfoDay::getRfdl).reduce(BigDecimal.ZERO, BigDecimal::add);
                     double bfdl = day1s2.stream().mapToDouble(TurbineInfoDay::getXdss).sum();
-                    vv.setValue(BigDecimal.valueOf(bfdl / 1000));
+                    String format = String.format("%.2f", bfdl / 1000);
+                    vv.setValue(new BigDecimal(format));
                 }
             }
 
@@ -1849,7 +1842,8 @@ public class EconomyPointHomePageService {
                 for (ValueVo vv : vxdl2) {
                     if (vv.getText().equals(text)) {
                         double bxdl2 = day1s4.stream().mapToDouble(TurbineInfoDay::getXdss).sum();
-                        vv.setValue(BigDecimal.valueOf(bxdl2 / 1000));
+                        String format = String.format("%.2f", bxdl2 / 1000);
+                        vv.setValue(new BigDecimal(format));
                     }
                 }
                 for (ValueVo vv : vssdl2) {
@@ -1858,13 +1852,15 @@ public class EconomyPointHomePageService {
                         double fjh = day1s4.stream().mapToDouble(TurbineInfoDay::getFjhjxss).sum();
                         double jh = day1s4.stream().mapToDouble(TurbineInfoDay::getJhjxss).sum();
                         double xn = day1s4.stream().mapToDouble(TurbineInfoDay::getXnss).sum();
-                        vv.setValue(BigDecimal.valueOf((xd + fjh + jh + xn) / 1000));
+                        String format = String.format("%.2f", (xd + fjh + jh + xn) / 1000);
+                        vv.setValue(new BigDecimal(format));
                     }
                 }
                 for (ValueVo vv : vfdl2) {
                     if (vv.getText().equals(text)) {
                         double bfl2 = day1s4.stream().mapToDouble(TurbineInfoDay::getXdss).sum();
-                        vv.setValue(BigDecimal.valueOf(bfl2 / 1000));
+                        String format = String.format("%.2f", bfl2 / 1000);
+                        vv.setValue(new BigDecimal(format));
                     }
                 }
             }