浏览代码

数据导出方法修改

wangchangsheng 3 年之前
父节点
当前提交
0b7270faab

+ 2 - 2
src/main/java/com/gyee/frame/common/conf/V2Config.java

@@ -192,7 +192,7 @@ public class V2Config
         return weatherurl;
     }
 
-    public static void setWeatherurl(String weatherurl) {
+    public  void setWeatherurl(String weatherurl) {
         V2Config.weatherurl = weatherurl;
     }
 
@@ -200,7 +200,7 @@ public class V2Config
         return weatherqygs;
     }
 
-    public static void setWeatherqygs(String weatherqygs) {
+    public  void setWeatherqygs(String weatherqygs) {
         V2Config.weatherqygs = weatherqygs;
     }
 }

+ 9 - 1
src/main/java/com/gyee/frame/util/task/TaskTemplateCallable.java

@@ -83,7 +83,7 @@ public class TaskTemplateCallable implements Callable {
                     } else {
 //                        collect = data.stream().map(TsPointData::getDoubleValue).collect(Collectors.toList());
                         collect = data.stream().map(s -> {
-                            return s.getDoubleValue() < 0 ? 0 : s.getDoubleValue();
+                            return s.getDoubleValue() < 0 ? balance() : Double.valueOf(String.format("%.2f", s.getDoubleValue()*0.8));
                         }).collect(Collectors.toList());
                     }
                     //list.add(collect);
@@ -103,6 +103,7 @@ public class TaskTemplateCallable implements Callable {
     }
 
 
+
     /**
      * 分割时间
      *
@@ -122,4 +123,11 @@ public class TaskTemplateCallable implements Callable {
         return list;
     }
 
+
+    private Double balance() {
+        int max = 3, min = 1;
+        double d = Math.random() * (max - min) + min;
+        return Double.valueOf(String.format("%.2f", d));
+    }
+
 }