From 0405d15e79bcb62cfe737e5f3f618f7aa34855f0 Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期二, 10 十月 2023 14:57:30 +0800
Subject: [PATCH] 报警
---
ard-work/src/main/java/com/ruoyi/statistical/param/ESParam.java | 1 +
ard-work/src/main/java/com/ruoyi/statistical/controller/StatisticalController.java | 5 +++--
ard-work/src/main/java/com/ruoyi/statistical/service/impl/StatisticalServiceImpl.java | 28 ++++++++++++++--------------
3 files changed, 18 insertions(+), 16 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/statistical/controller/StatisticalController.java b/ard-work/src/main/java/com/ruoyi/statistical/controller/StatisticalController.java
index 2ab4bf3..5aea884 100644
--- a/ard-work/src/main/java/com/ruoyi/statistical/controller/StatisticalController.java
+++ b/ard-work/src/main/java/com/ruoyi/statistical/controller/StatisticalController.java
@@ -98,13 +98,14 @@
*/
@ApiOperation("鎶ヨ鏁伴噺鍒嗘瀽鏈�")
@GetMapping("alarm/month")
- public Results alarmMonth(String month,String type){
+ public Results alarmMonth(Integer month,String type){
LocalDate today = LocalDate.now();
int year = today.getYear();
- int day = getDaysInMonth(Integer.valueOf(month));
+ int day = getDaysInMonth(month);
ESParam esParam = new ESParam();
esParam.setStart(year+"-"+month+"-01");
esParam.setEnd(year+"-"+month+"-"+day);
+ esParam.setMonth(month);
if("1001".equals(type)){
//鐩楃數鎶ヨ
return Results.succeed(statisticalService.stealelecMonth(esParam));
diff --git a/ard-work/src/main/java/com/ruoyi/statistical/param/ESParam.java b/ard-work/src/main/java/com/ruoyi/statistical/param/ESParam.java
index 6ac3022..8bef90f 100644
--- a/ard-work/src/main/java/com/ruoyi/statistical/param/ESParam.java
+++ b/ard-work/src/main/java/com/ruoyi/statistical/param/ESParam.java
@@ -6,4 +6,5 @@
public class ESParam {
private String start;
private String end;
+ private Integer month;
}
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 b2f51a8..2275bda 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
@@ -212,67 +212,67 @@
@Override
public List<CountVo> stealelecMonth(ESParam esParam) {
List<CountVo> list = stealelecMapper.stealelecMonth(esParam);
- return esMonth(list,esParam.getEnd());
+ return esMonth(list,esParam);
}
@Override
public List<CountVo> cameraMonth(ESParam esParam) {
List<CountVo> list = cameraMapper.cameraMonth(esParam);
- return esMonth(list,esParam.getEnd());
+ return esMonth(list,esParam);
}
@Override
public List<CountVo> moveMonth(ESParam esParam) {
List<CountVo> list = moveMapper.moveMonth(esParam);
- return esMonth(list,esParam.getEnd());
+ return esMonth(list,esParam);
}
@Override
public List<CountVo> fireMonth(ESParam esParam) {
List<CountVo> list = fireMapper.fileMonth(esParam);
- return esMonth(list,esParam.getEnd());
+ return esMonth(list,esParam);
}
@Override
public List<CountVo> externalMonth(ESParam esParam) {
List<CountVo> list = externalMapper.externalMonth(esParam);
- return esMonth(list,esParam.getEnd());
+ return esMonth(list,esParam);
}
@Override
public List<CountVo> accessMonth(ESParam esParam) {
List<CountVo> list = accessMapper.accessMonth(esParam);
- return esMonth(list,esParam.getEnd());
+ return esMonth(list,esParam);
}
@Override
public List<CountVo> apponekeyMonth(ESParam esParam) {
List<CountVo> list = apponekeyMapper.apponekeyMonth(esParam);
- return esMonth(list,esParam.getEnd());
+ return esMonth(list,esParam);
}
@Override
public List<CountVo> pumpMonth(ESParam esParam) {
List<CountVo> list = pumpMapper.pumpMonth(esParam);
- return esMonth(list,esParam.getEnd());
+ return esMonth(list,esParam);
}
@Override
public List<CountVo> wallMonth(ESParam esParam) {
List<CountVo> list = wallMapper.wallMonth(esParam);
- return esMonth(list,esParam.getEnd());
+ return esMonth(list,esParam);
}
@Override
public List<CountVo> digitizationMonth(ESParam esParam) {
List<CountVo> list = digitization3Mapper.digitizationMonth(esParam);
- return esMonth(list,esParam.getEnd());
+ return esMonth(list,esParam);
}
@Override
public List<CountVo> tubeMonth(ESParam esParam) {
List<CountVo> list = tubeMapper.tubeMonth(esParam);
- return esMonth(list,esParam.getEnd());
+ return esMonth(list,esParam);
}
@Override
@@ -421,10 +421,10 @@
return countVoList;
}
- public List<CountVo> esMonth(List<CountVo> list,String end){
+ public List<CountVo> esMonth(List<CountVo> list,ESParam esParam){
List<CountVo> countVoList = new ArrayList<>();
- Integer day = Integer.valueOf(end.substring(end.length() - 2));
- String month = end.substring(5,7);
+ Integer day = Integer.valueOf(esParam.getEnd().substring(esParam.getEnd().length() - 2));
+ Integer month = esParam.getMonth();
for (int i = 1; i <= day ; i++) {
CountVo vo = new CountVo();
String d = month + "-" + i ;
--
Gitblit v1.9.3