Ver código fonte

Dashboard: 对数据进行时间排序

wangPH 2 anos atrás
pai
commit
d4f9e3c126

+ 1 - 1
background-user/src/main/java/cn/kdan/compdf/entity/dto/AnalysisDataDTO.java

@@ -33,7 +33,7 @@ public class AnalysisDataDTO implements Serializable {
     /**
      * 失败率
      */
-    private BigDecimal errorRatio;
+    private String errorRatio;
     /**
      * 平均处理时长
      */

+ 16 - 2
background-user/src/main/java/cn/kdan/compdf/service/impl/BackgroundConvertDataServiceImpl.java

@@ -84,7 +84,7 @@ public class BackgroundConvertDataServiceImpl extends ServiceImpl<BackgroundConv
                     .fileTotal(fileTotal)
                     .successfulRequest(successfulRequest)
                     .errorRequest(errorRequest)
-                    .errorRatio(errorRatio)
+                    .errorRatio(errorRatio.toString() + "%")
                     .averageProcessTime(averageProcessTime + "ms")
                     .build();
         }
@@ -101,7 +101,7 @@ public class BackgroundConvertDataServiceImpl extends ServiceImpl<BackgroundConv
                 .fileTotal(fileTotal)
                 .successfulRequest(successfulRequest)
                 .errorRequest(errorRequest)
-                .errorRatio(new BigDecimal(String.format("%.2f", errorRequest * 100.00 / fileTotal)))
+                .errorRatio(new BigDecimal(String.format("%.2f", errorRequest * 100.00 / fileTotal)).toString() + "%")
                 .averageProcessTime(TimeConvert(averageProcessTime1, null))
                 .build();
     }
@@ -218,6 +218,7 @@ public class BackgroundConvertDataServiceImpl extends ServiceImpl<BackgroundConv
             default:
                 throw new CommonException(ResponseEnum.SYSTEM_ERROR);
         }
+        Collections.reverse(dataDTOS);
         return dataDTOS;
     }
 
@@ -303,6 +304,7 @@ public class BackgroundConvertDataServiceImpl extends ServiceImpl<BackgroundConv
             default:
                 throw new CommonException(ResponseEnum.SYSTEM_ERROR);
         }
+        Collections.reverse(dataDTOS);
         return dataDTOS;
     }
 
@@ -322,6 +324,7 @@ public class BackgroundConvertDataServiceImpl extends ServiceImpl<BackgroundConv
                             / fileTotal)).toString() + "%")
                     .build());
         }
+        Collections.reverse(dataDTOS);
         return dataDTOS;
     }
 
@@ -459,6 +462,7 @@ public class BackgroundConvertDataServiceImpl extends ServiceImpl<BackgroundConv
                 dataDTO.setYData(dataDTO.getYData() + "ms");
             }
         }
+        Collections.reverse(dataDTOS);
         return dataDTOS;
     }
 
@@ -645,4 +649,14 @@ public class BackgroundConvertDataServiceImpl extends ServiceImpl<BackgroundConv
         return dateTime1.compareTo(dateTime2) >= 0;
     }
 
+
+    public static void main(String[] args) {
+        List<Integer> list= new ArrayList<>();
+        list.add(1);
+        list.add(5);
+        list.add(3);
+        System.out.println(list.toString());
+        Collections.reverse(list);
+        System.out.println(list.toString());
+    }
 }