浏览代码

修正五项损失数据推送

shilin 5 年之前
父节点
当前提交
ef9f2bd3da

+ 24 - 8
src/main/java/com/gyee/frame/service/app/index/IndexDetailService.java

@@ -389,8 +389,12 @@ public class IndexDetailService extends SocketToolService{
                 double temp2 = 0;
                 for (int i = 0; i < vos.size(); i++) {
 
-                    temp1 =gzssls.get(i).getPointValueInDouble();
-                    temp2 =gzslls.get(i).getPointValueInDouble();
+                   // temp1 =gzssls.get(i).getPointValueInDouble();
+                    temp1 =new BigDecimal(gzssls.get(i).getPointValueInDouble()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+
+                    //temp2 =gzslls.get(i).getPointValueInDouble();
+                    temp2 =new BigDecimal(gzslls.get(i).getPointValueInDouble()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+
                     vos.get(i).setValue2(StringUtils.round(temp1+temp2, 2));// 故障损失
 
                 }
@@ -409,8 +413,12 @@ public class IndexDetailService extends SocketToolService{
                 double temp2 = 0;
                 for (int i = 0; i < vos.size(); i++) {
 
-                    temp1 = jxssls.get(i).getPointValueInDouble();
-                    temp2 = jxslls.get(i).getPointValueInDouble();
+                   // temp1 = jxssls.get(i).getPointValueInDouble();
+                    temp1 =new BigDecimal(jxssls.get(i).getPointValueInDouble()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+
+                  //  temp2 = jxslls.get(i).getPointValueInDouble();
+                    temp2 =new BigDecimal(jxslls.get(i).getPointValueInDouble()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+
                     vos.get(i).setValue3(StringUtils.round(temp1+temp2, 2));// 检修损失
 
                 }
@@ -425,7 +433,9 @@ public class IndexDetailService extends SocketToolService{
 
                 double temp = 0;
                 for (int i = 0; i < vos.size(); i++) {
-                    temp = xdssls.get(i).getPointValueInDouble();
+                    //temp = xdssls.get(i).getPointValueInDouble();
+                    temp =new BigDecimal(xdssls.get(i).getPointValueInDouble()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+
                     vos.get(i).setValue4(StringUtils.round(temp, 2));// 限电损失
 
                 }
@@ -439,7 +449,9 @@ public class IndexDetailService extends SocketToolService{
 
                 double temp = 0;
                 for (int i = 0; i < vos.size(); i++) {
-                    temp = xnssls.get(i).getPointValueInDouble();
+                   // temp = xnssls.get(i).getPointValueInDouble();
+                    temp =new BigDecimal(xnssls.get(i).getPointValueInDouble()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+
                     vos.get(i).setValue5(StringUtils.round(temp, 2));// 性能损失
 
                 }
@@ -458,8 +470,12 @@ public class IndexDetailService extends SocketToolService{
                 double temp2 = 0;
                 for (int i = 0; i < vos.size(); i++) {
 
-                    temp1 = slssls.get(i).getPointValueInDouble();
-                    temp2 = slslls.get(i).getPointValueInDouble();
+                   // temp1 = slssls.get(i).getPointValueInDouble();
+                    temp1 =new BigDecimal(slssls.get(i).getPointValueInDouble()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+
+                   // temp2 = slslls.get(i).getPointValueInDouble();
+                    temp2 =new BigDecimal(slslls.get(i).getPointValueInDouble()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+
                     vos.get(i).setValue6(StringUtils.round(temp1+temp2, 2));// 受累损失
 
                 }

+ 9 - 9
src/main/java/com/gyee/frame/service/app/index/IndexService.java

@@ -73,7 +73,7 @@ public class IndexService extends SocketToolService{
 
 	            try {
 	                //安全天数
-	                PointData aqts_real = mongodb.getRealData(stationPointmap.get(windpowerstation.getId()).get(Constant.TPOINT_AQTS).getCode());
+	                PointData aqts_real = mongodb.getRealData(stationPointmap.get(0).get(Constant.TPOINT_AQTS).getCode());
 	                aqts = new BigDecimal(aqts_real.getPointValueInDouble()).setScale(decimal_digit, RoundingMode.HALF_EVEN).doubleValue();
                     pointDataMap.put("aqts_real",aqts_real);
 	            }catch (Exception e){
@@ -330,17 +330,17 @@ public class IndexService extends SocketToolService{
 
                       
             pointDataMap.put("pjfs",pjfs);
-            pointDataMap.put("pjfsMin",pjfsMin);
-            pointDataMap.put("pjfsMax",pjfsMax);
+            pointDataMap.put("pjfsMin",StringUtils.round(pjfsMin,2));
+            pointDataMap.put("pjfsMax",StringUtils.round(pjfsMax,2));
             pointDataMap.put("ycfs",ycfs);
-            pointDataMap.put("ycfsMin",ycfsMin);
-            pointDataMap.put("ycfsMax",ycfsMax);
+            pointDataMap.put("ycfsMin",StringUtils.round(ycfsMin,2));
+            pointDataMap.put("ycfsMax",StringUtils.round(ycfsMax,2));
             pointDataMap.put("sjgl",sjgl);
-            pointDataMap.put("sjglMin",sjglMin);
-            pointDataMap.put("sjglMax",sjglMax);
+            pointDataMap.put("sjglMin",StringUtils.round(sjglMin,2));
+            pointDataMap.put("sjglMax",StringUtils.round(sjglMax,2));
             pointDataMap.put("llgl",llgl);
-            pointDataMap.put("llglMin",llglMin);
-            pointDataMap.put("llglMax",llglMax);
+            pointDataMap.put("llglMin",StringUtils.round(llglMin,2));
+            pointDataMap.put("llglMax",StringUtils.round(llglMax,2));
             windpowerstationpointDataMap.put(windpowerstation.getId(),pointDataMap);
         }
         this.pushToWeb("pageNumber_6","functionNumber_2",windpowerstationpointDataMap, Messagetype.MESSAGE);