wangchangsheng 2 gadi atpakaļ
vecāks
revīzija
7b09084002

+ 7 - 5
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/performacompare/EquipmentPerformaCompareController.java

@@ -69,14 +69,16 @@ public class EquipmentPerformaCompareController {
     public R getWtPowerCurveFittingList(
             @RequestParam(value = "windturbineIds", required = true) String windturbineIds ){
 
-        Map<String, List<ProEconWtPowerCurveFitting>> map =  equipmentPerformaCompareService.getgroupProEconWtPowerCurveFittingList(windturbineIds);
-
-
-        if (null != map) {
+        Map<String, List<ProEconWtPowerCurveFitting>> map = null;
+        try {
+            map = equipmentPerformaCompareService.getgroupProEconWtPowerCurveFittingList(windturbineIds);
             return R.data(ResultMsg.ok(map));
-        } else {
+        } catch (Exception e) {
+            e.printStackTrace();
             return R.error(ResultMsg.error());
         }
+
+
     }
 
 

+ 6 - 4
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/performance/PerformanceCurvefittingController.java

@@ -43,12 +43,14 @@ public class PerformanceCurvefittingController {
                           @RequestParam(value = "type", required = true) String type,
                           @RequestParam(value = "dateType", required = true) String dateType
     ) {
-        Map<String, List<CurveVo>> curvefitting = performanceCurvefittingService.curvefitting(windturbineIds, type, dateType);
-
-        if (null != curvefitting) {
+        Map<String, List<CurveVo>> curvefitting = null;
+        try {
+            curvefitting = performanceCurvefittingService.curvefitting(windturbineIds, type, dateType);
             return R.data(ResultMsg.ok(curvefitting));
-        } else {
+        } catch (Exception e) {
+            e.printStackTrace();
             return R.data(ResultMsg.error());
         }
+
     }
 }

+ 0 - 1
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/dto/response/EconHomePagePointRateDTO.java

@@ -360,7 +360,6 @@ public class EconHomePagePointRateDTO {
         BigDecimal b = new BigDecimal(100);
         if (b.compareTo(a) == -1) {
             a = new BigDecimal(100);
-            ;
         }
 
         if (a.compareTo(BigDecimal.ZERO) == -1) {

+ 4 - 4
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/dto/response/ProEconPointCodeDTO.java

@@ -19,10 +19,10 @@ public class ProEconPointCodeDTO {
 
 
     private BigDecimal compare100(BigDecimal a) {
-        BigDecimal b = new BigDecimal(100);
-        if (b.compareTo(a) == -1) {
-            a = new BigDecimal(100);
-            ;
+
+        if (null == a) {
+            a = new BigDecimal(0);
+
         }
 
         if (a.compareTo(BigDecimal.ZERO) == -1) {

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

@@ -405,13 +405,13 @@ public class ProEconPointCodeServiceImpl extends ServiceImpl<ProEconPointCodeMap
             dto.setStationname(CacheContext.wpmap.get(i.getForeignKeyId()).getName());
             switch (dateType) {
                 case "r":
-                    dto.setValue(i.getRfwjsl().divide(new BigDecimal(pointCode.getRatio())));
+                    dto.setValue(compare100(i.getRfwjsl().divide(new BigDecimal(pointCode.getRatio()))));
                     break;
                 case "y":
-                    dto.setValue(i.getYfwjsl().divide(new BigDecimal(pointCode.getRatio())));
+                    dto.setValue(compare100(i.getYfwjsl().divide(new BigDecimal(pointCode.getRatio()))));
                     break;
                 case "n":
-                    dto.setValue(i.getNfwjsl().divide(new BigDecimal(pointCode.getRatio())));
+                    dto.setValue(compare100(i.getNfwjsl().divide(new BigDecimal(pointCode.getRatio()))));
                     break;
             }
             dtos.add(dto);
@@ -434,13 +434,13 @@ public class ProEconPointCodeServiceImpl extends ServiceImpl<ProEconPointCodeMap
             dto.setStationname(CacheContext.wpmap.get(i.getForeignKeyId()).getName());
             switch (dateType) {
                 case "r":
-                    dto.setValue(i.getRztzhjsl().divide(new BigDecimal(pointCode.getRatio())));
+                    dto.setValue(compare100(i.getRztzhjsl().divide(new BigDecimal(pointCode.getRatio()))));
                     break;
                 case "y":
-                    dto.setValue(i.getYztzhjsl().divide(new BigDecimal(pointCode.getRatio())));
+                    dto.setValue(compare100(i.getYztzhjsl().divide(new BigDecimal(pointCode.getRatio()))));
                     break;
                 case "n":
-                    dto.setValue(i.getNztzhjsl().divide(new BigDecimal(pointCode.getRatio())));
+                    dto.setValue(compare100(i.getNztzhjsl().divide(new BigDecimal(pointCode.getRatio()))));
                     break;
             }
             dtos.add(dto);
@@ -463,13 +463,13 @@ public class ProEconPointCodeServiceImpl extends ServiceImpl<ProEconPointCodeMap
             dto.setStationname(CacheContext.wpmap.get(i.getForeignKeyId()).getName());
             switch (dateType) {
                 case "r":
-                    dto.setValue(i.getRgzxqjsl().divide(new BigDecimal(pointCode.getRatio())));
+                    dto.setValue(compare100(i.getRgzxqjsl().divide(new BigDecimal(pointCode.getRatio()))));
                     break;
                 case "y":
-                    dto.setValue(i.getYgzxqjsl().divide(new BigDecimal(pointCode.getRatio())));
+                    dto.setValue(compare100(i.getYgzxqjsl().divide(new BigDecimal(pointCode.getRatio()))));
                     break;
                 case "n":
-                    dto.setValue(i.getNgzxqjsl().divide(new BigDecimal(pointCode.getRatio())));
+                    dto.setValue(compare100(i.getNgzxqjsl().divide(new BigDecimal(pointCode.getRatio()))));
                     break;
             }
             dtos.add(dto);
@@ -633,11 +633,21 @@ public class ProEconPointCodeServiceImpl extends ServiceImpl<ProEconPointCodeMap
     }
 
 
+
     private BigDecimal compare100(BigDecimal a) {
         BigDecimal b = new BigDecimal(100);
+
+        if (null == a) {
+            a = new BigDecimal(0);
+
+        }
         if (b.compareTo(a) == -1) {
             a = new BigDecimal(100);
-            ;
+
+        }
+
+        if (a.compareTo(BigDecimal.ZERO) == -1) {
+            a = new BigDecimal(0);
         }
         return a;