From 1b259de8c0a06e6e16941a4ac3189d950fc542ab Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期一, 09 十月 2023 16:26:58 +0800
Subject: [PATCH] 报警统计
---
ard-work/src/main/java/com/ruoyi/statistical/service/impl/StatisticalServiceImpl.java | 45 +++++++++++++++++++++------------------------
1 files changed, 21 insertions(+), 24 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/statistical/service/impl/StatisticalServiceImpl.java b/ard-work/src/main/java/com/ruoyi/statistical/service/impl/StatisticalServiceImpl.java
index 3920294..9f43a69 100644
--- a/ard-work/src/main/java/com/ruoyi/statistical/service/impl/StatisticalServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/statistical/service/impl/StatisticalServiceImpl.java
@@ -374,55 +374,52 @@
}
public List<CountVo> es(List<CountVo> list){
+ List<CountVo> countVoList = new ArrayList<>();
for (int i = 1; i <= 12 ; i++) {
- String month;
- if(i<=10){
- month = "0"+i;
- }else {
- month = String.valueOf(i);
- }
+ CountVo vo = new CountVo();
+ String month = i + "鏈�";
Boolean bo = false;
for (int j = 0; j < list.size(); j++) {
CountVo countVo = list.get(j);
- String mon = countVo.getDate();
+ String mon = Integer.valueOf(countVo.getDate()) + "鏈�";
if(mon.equals(month)){
bo = true;
+ vo.setDate(mon);
+ vo.setCount(countVo.getCount());
}
}
if(!bo){
- CountVo countVo = new CountVo();
- countVo.setDate(month);
- countVo.setCount(0);
- list.add(countVo);
+ vo.setDate(month);
+ vo.setCount(0);
}
+ countVoList.add(vo);
}
- return list;
+ return countVoList;
}
public List<CountVo> esMonth(List<CountVo> list,String end){
+ List<CountVo> countVoList = new ArrayList<>();
Integer day = Integer.valueOf(end.substring(end.length() - 2));
+ String month = end.substring(5,7);
for (int i = 1; i <= day ; i++) {
- String d;
- if(i<=10){
- d = "0"+i;
- }else {
- d = String.valueOf(i);
- }
+ CountVo vo = new CountVo();
+ String d = month + "鏈�" + i + "鏃�";
Boolean bo = false;
for (int j = 0; j < list.size(); j++) {
CountVo countVo = list.get(j);
- String mon = countVo.getDate();
+ String mon = month + "鏈�" + Integer.valueOf(countVo.getDate()) + "鏃�";
if(mon.equals(d)){
bo = true;
+ vo.setDate(mon);
+ vo.setCount(countVo.getCount());
}
}
if(!bo){
- CountVo countVo = new CountVo();
- countVo.setDate(d);
- countVo.setCount(0);
- list.add(countVo);
+ vo.setDate(d);
+ vo.setCount(0);
}
+ countVoList.add(vo);
}
- return list;
+ return countVoList;
}
}
--
Gitblit v1.9.3