From b9c9cfff20129a4cb787b752c900da2d7fe7c4eb Mon Sep 17 00:00:00 2001
From: ‘liusuyi’ <1951119284@qq.com>
Date: 星期日, 08 十月 2023 11:48:22 +0800
Subject: [PATCH] 增加同步设备状态任务
---
ard-work/src/main/java/com/ruoyi/statistical/service/impl/StatisticalServiceImpl.java | 94 +++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 91 insertions(+), 3 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 45ac8cc..ae8e724 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
@@ -24,6 +24,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import java.util.Calendar;
import java.util.List;
import java.util.Map;
@@ -185,9 +186,69 @@
return es(list);
}
+ @Override
+ public List<CountVo> stealelecMonth(ESParam esParam) {
+ List<CountVo> list = stealelecMapper.stealelecMonth(esParam);
+ return esMonth(list,esParam.getEnd());
+ }
+
+ @Override
+ public List<CountVo> cameraMonth(ESParam esParam) {
+ List<CountVo> list = cameraMapper.cameraMonth(esParam);
+ return esMonth(list,esParam.getEnd());
+ }
+
+ @Override
+ public List<CountVo> moveMonth(ESParam esParam) {
+ List<CountVo> list = moveMapper.moveMonth(esParam);
+ return esMonth(list,esParam.getEnd());
+ }
+
+ @Override
+ public List<CountVo> fireMonth(ESParam esParam) {
+ List<CountVo> list = fireMapper.fileMonth(esParam);
+ return esMonth(list,esParam.getEnd());
+ }
+
+ @Override
+ public List<CountVo> externalMonth(ESParam esParam) {
+ List<CountVo> list = externalMapper.externalMonth(esParam);
+ return esMonth(list,esParam.getEnd());
+ }
+
+ @Override
+ public List<CountVo> accessMonth(ESParam esParam) {
+ List<CountVo> list = accessMapper.accessMonth(esParam);
+ return esMonth(list,esParam.getEnd());
+ }
+
+ @Override
+ public List<CountVo> apponekeyMonth(ESParam esParam) {
+ List<CountVo> list = apponekeyMapper.apponekeyMonth(esParam);
+ return esMonth(list,esParam.getEnd());
+ }
+
+ @Override
+ public List<CountVo> wallMonth(ESParam esParam) {
+ List<CountVo> list = wallMapper.wallMonth(esParam);
+ return esMonth(list,esParam.getEnd());
+ }
+
+ @Override
+ public List<CountVo> digitizationMonth(ESParam esParam) {
+ List<CountVo> list = digitization3Mapper.digitizationMonth(esParam);
+ return esMonth(list,esParam.getEnd());
+ }
+
+ @Override
+ public List<CountVo> tubeMonth(ESParam esParam) {
+ List<CountVo> list = tubeMapper.tubeMonth(esParam);
+ return esMonth(list,esParam.getEnd());
+ }
+
public List<CountVo> es(List<CountVo> list){
for (int i = 1; i <= 12 ; i++) {
- String month = null;
+ String month;
if(i<=10){
month = "0"+i;
}else {
@@ -196,14 +257,41 @@
Boolean bo = false;
for (int j = 0; j < list.size(); j++) {
CountVo countVo = list.get(j);
- String mon = countVo.getMonth();
+ String mon = countVo.getDate();
if(mon.equals(month)){
bo = true;
}
}
if(!bo){
CountVo countVo = new CountVo();
- countVo.setMonth(month);
+ countVo.setDate(month);
+ countVo.setCount(0);
+ list.add(countVo);
+ }
+ }
+ return list;
+ }
+
+ public List<CountVo> esMonth(List<CountVo> list,String end){
+ Integer day = Integer.valueOf(end.substring(end.length() - 2));
+ for (int i = 1; i <= day ; i++) {
+ String d;
+ if(i<=10){
+ d = "0"+i;
+ }else {
+ d = String.valueOf(i);
+ }
+ Boolean bo = false;
+ for (int j = 0; j < list.size(); j++) {
+ CountVo countVo = list.get(j);
+ String mon = countVo.getDate();
+ if(mon.equals(d)){
+ bo = true;
+ }
+ }
+ if(!bo){
+ CountVo countVo = new CountVo();
+ countVo.setDate(d);
countVo.setCount(0);
list.add(countVo);
}
--
Gitblit v1.9.3