Commit 940986df authored by 张森's avatar 张森

稳压泵统计改为近三天

parent 8593722a
......@@ -2,6 +2,9 @@ package com.yeejoin.equipmanage.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.equipmanage.common.dto.OrgUsrDto;
......@@ -136,8 +139,8 @@ public class PressurePumpServiceImpl implements IPressurePumpService {
String time = split.length > 0 ? (split[split.length - 1]) : "";
try {
Date date = DateUtils.convertStrToDate(time, DateUtils.DATE_PATTERN);
// 结束日期不包含今天,获取3天前数据
if (DateUtils.dateCompare(date, startDate) >= 0 && DateUtils.dateCompare(endDate, date) > 0) {
// 结束日期不包含今天,获取3天前数据 改为统计近三天 包含当天
if (DateUtils.dateCompare(date, startDate) >= 0 && DateUtils.dateCompare(endDate, date) >= 0) {
list.add(JSON.parseObject(redisUtils.get(x).toString(), PressurePumpCountVo.class));
}
} catch (ParseException e) {
......
......@@ -129,7 +129,7 @@ public class SupervisionVideoServiceImpl extends ServiceImpl<SupervisionVideoMap
// 近3天启动平均值,四合五入
AtomicInteger dayAvgFrequency = new AtomicInteger();
try {
Date startDate = com.yeejoin.amos.boot.biz.common.utils.DateUtils.dateAddDays(dateNow, Integer.parseInt(PressurePumpRelateEnum.DAY_AVG.getValue()));
Date startDate = com.yeejoin.amos.boot.biz.common.utils.DateUtils.dateAddDays(dateNow, Integer.parseInt(PressurePumpRelateEnum.DAY_AVG.getValue()) + 1);
String startTime = String.join(" ", com.yeejoin.amos.boot.biz.common.utils.DateUtils.dateFormat(startDate, com.yeejoin.amos.boot.biz.common.utils.DateUtils.DATE_PATTERN), "00:00:00");
String endTime = String.join(" ", com.yeejoin.amos.boot.biz.common.utils.DateUtils.dateFormat(dateNow, com.yeejoin.amos.boot.biz.common.utils.DateUtils.DATE_PATTERN), "23:59:59");
Map<String, List<PressurePumpCountVo>> dayAvgDataMap = pressurePumpService.getDateRangeCountList(pumpInfoList, startTime,endTime, PressurePumpRelateEnum.PRESSURE_PUMP.getValue(), countRedisKey, equipmentCode, pressurePumpStart, countExpire, bizOrgCode);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment