Browse Source

大屏装机容量修改

wangchangsheng 3 years ago
parent
commit
6c221d9309

+ 13 - 9
gradeevaluation/src/main/java/com/gyee/gradeevaluation/service/bigscreen/BigScreenService.java

@@ -16,6 +16,7 @@ import org.springframework.stereotype.Service;
 import javax.annotation.Resource;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
+import java.text.NumberFormat;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -40,21 +41,24 @@ public class BigScreenService {
     public Map<String, Object> list() throws Exception {
         Map<String,Object> map = new HashMap<>();
 
-        int zjrl = 0;
-        int fdzjrl = 0;
-        int gfzjrl = 0;
+        Double zjrl = 0.0;
+        Double fdzjrl = 0.0;
+        Double gfzjrl = 0.0;
         List<Windpowerstation> wplist = CacheContext.wplist;
         for (Windpowerstation wp : wplist) {
-            zjrl += wp.getCapacity().intValue();
+            zjrl += wp.getCapacity().doubleValue();
             if (wp.getId().endsWith("FDC")){
-                fdzjrl += wp.getCapacity().intValue();
+                fdzjrl += wp.getCapacity().doubleValue();
             }else {
-                gfzjrl += wp.getCapacity().intValue();
+                gfzjrl += wp.getCapacity().doubleValue();
             }
         }
-        map.put("zjrl",zjrl);
-        map.put("fdzjrl",fdzjrl);
-        map.put("gfzjrl",gfzjrl);
+        NumberFormat format = NumberFormat.getNumberInstance();
+        format.setMaximumFractionDigits(0);
+
+        map.put("zjrl", Integer.valueOf(format.format(zjrl)));
+        map.put("fdzjrl",Integer.valueOf(format.format(fdzjrl)));
+        map.put("gfzjrl",Integer.valueOf(format.format(gfzjrl)));
         double rfdl = ednaApiUtil.getRealData(MainConstant.JSFW_SSRFDLB).getPointValueInDouble();// 日累计电量
         map.put("rfdl",rfdl);
         double swdl = ednaApiUtil.getRealData(MainConstant.JSFW_SSSWDLB).getPointValueInDouble();// 上网电量