fanxiaoyu 7 mesi fa
parent
commit
b1cc12c18c

+ 2 - 1
cpp-admin/src/main/java/com/cpp/web/service/accuracy/impl/AccuracyPassRateServiceImpl.java

@@ -60,7 +60,8 @@ public class AccuracyPassRateServiceImpl extends ServiceImpl<AccuracyPassRateMap
         List<AccuracyPassRate> list = list(wrapper);
         // 根据要求进行调整,过滤脏数据,如果所查天数为空,则显示"",而不是直接就是不展示了
         // 过滤掉单点平均偏差大于100的
-        List<AccuracyPassRate> filterList = list.stream().filter(f -> null != f.getDeviationSum() && Double.valueOf(f.getDeviationSum().replace("%","")) <=100).collect(Collectors.toList());
+        List<AccuracyPassRate> glList = list.stream().filter(f -> !"无可用数据计算".equals(f.getDeviationSum()) && !"无计算公式".equals(f.getDeviationSum())).collect(Collectors.toList());
+        List<AccuracyPassRate> filterList = glList.stream().filter(f -> null != f.getDeviationSum() && Double.valueOf(f.getDeviationSum().replace("%","")) <=100 && !"无可用数据计算".equals(f.getDeviationSum()) && !"无计算公式".equals(f.getDeviationSum())).collect(Collectors.toList());
         List<String> timeList = DateTimeUtil.getDatesInRange(startTime,endTime);
         try {
             for (String s : timeList) {

+ 26 - 18
cpp-admin/src/main/java/com/cpp/web/service/accuracy/impl/ShortTermSinglePointDeviationServiceImpl.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.cpp.web.domain.accuracy.ShortTermSinglePointDeviation;
 import com.cpp.web.mapper.accuracy.ShortTermSinglePointDeviationMapper;
 import com.cpp.web.service.accuracy.ShortTermSinglePointDeviationService;
+import com.cpp.web.utils.DateTimeUtil;
 import org.springframework.security.core.parameters.P;
 import org.springframework.stereotype.Service;
 
@@ -44,31 +45,38 @@ public class ShortTermSinglePointDeviationServiceImpl extends ServiceImpl<ShortT
                         Collectors.mapping(std -> std.getDeviation().doubleValue(), Collectors.toList())
                 ));
 
+        // 获取每一天,因为有没有数据都要展示出来
+        List<String> dateList = DateTimeUtil.getDatesInRange(startTime, endTime);
 
         List dataList = new ArrayList<>();
         List timeList = new ArrayList<>();
         List abnormalList = new ArrayList<>();
-        for (Map.Entry<String, List<Double>> listMap : groupedByDate.entrySet()) {
-
-            timeList.add(listMap.getKey());
-            // 转数组
-            double[] array = listMap.getValue().stream().mapToDouble(Double::doubleValue).toArray();
-            // 所需盒须值
-            double[] result = plot(array);
-            dataList.add(result);
-            double max = result[result.length - 1];double min = result[0];
-
-            List<Double> doubleList = listMap.getValue().stream().filter(f -> f < min && f > max).collect(Collectors.toList());
-            if (doubleList.size() > 0) {
-                for (Double v : doubleList) {
-                    List ceShiList = new ArrayList<>();
-                    ceShiList.add(listMap.getKey());
-                    ceShiList.add(v);
-                    abnormalList.add(ceShiList);
+
+        for (String s : dateList) {
+            timeList.add(s);
+            if (groupedByDate.get(s) != null) {
+                // 转换为数组
+                double[] array = groupedByDate.get(s).stream().mapToDouble(Double::doubleValue).toArray();
+                // 所需盒须值
+                double[] result = plot(array);
+                dataList.add(result);
+
+                double max = result[result.length - 1];double min = result[0];
+                // 获取异常值
+                List<Double> doubleList = groupedByDate.get(s).stream().filter(f -> f < min && f > max).collect(Collectors.toList());
+                List ycDataList = new ArrayList<>();
+                if (doubleList.size() > 0) {
+                    for (Double v : doubleList) {
+                        ycDataList.add(s);
+                        ycDataList.add(v);
+                        abnormalList.add(ycDataList);
+                    }
                 }
+            } else {
+                dataList.add("");
             }
-
         }
+
         Map<String, Object> map = new HashMap<>();
         map.put("result", dataList);
         map.put("time", timeList);

+ 6 - 0
cpp-ui/src/views/statistics/stationAccuracy/index.vue

@@ -507,6 +507,12 @@ export default {
         xAxis: {
           type: 'category',
           axisTick: {show: true},
+          axisLine: {
+            onZero: false,
+            // lineStyle: {
+            //   color: '#5fbbeb'
+            // }
+          },
           data: xData
         },
         yAxis: {