From cc512058eb471e217a46808bcdc1e1af0ceccf10 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Fri, 5 May 2023 20:15:22 +0800 Subject: [PATCH] =?UTF-8?q?#bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../equipment/service/impl/EmInfoServiceImpl.java | 1 - .../service/impl/PlanGenerationServiceImpl.java | 7 +++--- .../server/impl/RealTimeDataServerImpl.java | 5 ----- .../alert/service/impl/AlarmHandleServiceImpl.java | 2 -- .../impl/HistoryAbnormalAlarmServiceImpl.java | 2 -- .../main/scheduled/ScheduledCreateTask.java | 25 +++++++++++----------- .../main/service/impl/HomeServiceImpl.java | 2 ++ .../main/service/impl/PhotovoltaicServiceImpl.java | 1 - .../main/service/impl/WaterServiceImpl.java | 4 ++-- .../report/controller/DeptController.java | 4 ---- .../station/service/impl/StationServiceImpl.java | 1 - 11 files changed, 20 insertions(+), 34 deletions(-) diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java index df84d16..1328a1d 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java @@ -24,7 +24,6 @@ import com.hnac.hzinfo.sdk.v5.device.client.DeviceClient; import org.apache.commons.collections4.MapUtils; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.base.BaseServiceImpl; -import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.*; import org.springblade.system.vo.CreateTableVO; diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/PlanGenerationServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/PlanGenerationServiceImpl.java index 00614f5..c515ca8 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/PlanGenerationServiceImpl.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/PlanGenerationServiceImpl.java @@ -22,7 +22,6 @@ import com.hnac.hzinfo.datasearch.analyse.vo.AnalyseDataTaosVO; import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeDataConditionVO; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang.StringUtils; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.CollectionUtil; @@ -164,7 +163,7 @@ public class PlanGenerationServiceImpl extends BaseServiceImpl list) { List dateList = this.baseMapper.selectByStationAndDateTime(list); if (CollectionUtil.isNotEmpty(dateList)) { - return R.fail("该站点中" + StringUtils.join(dateList, ",") + "日期已存在!"); + return R.fail("该站点中" + StringUtil.join(dateList, ",") + "日期已存在!"); } return R.status(this.saveOrUpdateBatch(list)); } @@ -306,13 +305,13 @@ public class PlanGenerationServiceImpl extends BaseServiceImpl stationIdList, String date) { - if(CollectionUtil.isEmpty(stationIdList) || StringUtils.isEmpty(date)){ + if(CollectionUtil.isEmpty(stationIdList) || StringUtil.isEmpty(date)){ return 0.0; } return this.baseMapper.getPlanPowerYear(stationIdList,date); diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/monitor/server/impl/RealTimeDataServerImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/monitor/server/impl/RealTimeDataServerImpl.java index 0e80d73..515693c 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/monitor/server/impl/RealTimeDataServerImpl.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/monitor/server/impl/RealTimeDataServerImpl.java @@ -5,13 +5,10 @@ import com.hnac.hzims.equipment.entity.EmInfoEntity; import com.hnac.hzims.equipment.mapper.EmInfoMapper; import com.hnac.hzims.monitor.server.RealTimeDataServer; import com.hnac.hzinfo.dataconfig.entity.*; - import com.hnac.hzinfo.datasearch.analyse.IAnalyseDataSearchClient; import com.hnac.hzinfo.datasearch.analyse.IAnalyseInstanceClient; import com.hnac.hzinfo.datasearch.analyse.domain.FieldsData; - import com.hnac.hzinfo.datasearch.device.IDeviceClient; -import com.hnac.hzinfo.datasearch.real.IRealDataSearchClient; import com.hnac.hzinfo.datasearch.real.po.RealDataSearchPO; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -25,8 +22,6 @@ import org.springframework.stereotype.Service; import java.util.HashSet; import java.util.List; import java.util.Set; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeoutException; import java.util.stream.Collectors; @Slf4j diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AlarmHandleServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AlarmHandleServiceImpl.java index efe61eb..ebd3780 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AlarmHandleServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AlarmHandleServiceImpl.java @@ -12,10 +12,8 @@ import com.hnac.hzims.operational.alert.service.AlarmHandleService; import com.hnac.hzims.operational.alert.vo.AlarmHandleVo; import com.hnac.hzims.operational.alert.vo.HandleQueryVo; import com.hnac.hzims.operational.alert.wrapper.HandleWrapper; -import com.hnac.hzims.operational.main.constant.HomePageConstant; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.jsoup.helper.DataUtil; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.support.Condition; diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java index 1e8a190..e3b5372 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java @@ -24,8 +24,6 @@ import com.hnac.hzinfo.datasearch.soe.domian.SoeQueryConditionByStation; import com.hnac.hzinfo.sdk.core.response.HzPage; import com.hnac.hzinfo.sdk.core.response.Result; import com.hnac.hzinfo.sdk.v5.soe.SoeClient; -import com.hnac.hzinfo.sdk.v5.soe.dto.SoeDTO; -import com.hnac.hzinfo.sdk.v5.soe.vo.SoeVO; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import net.logstash.logback.encoder.org.apache.commons.lang3.ObjectUtils; diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/scheduled/ScheduledCreateTask.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/scheduled/ScheduledCreateTask.java index b5bdff8..93f8261 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/scheduled/ScheduledCreateTask.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/scheduled/ScheduledCreateTask.java @@ -16,7 +16,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; -import javax.validation.constraints.NotNull; import java.util.Arrays; import java.util.Date; import java.util.List; @@ -183,7 +182,7 @@ public class ScheduledCreateTask { * @return ReturnT */ @XxlJob(REGIONAL_DUTY_INFO) - //@Scheduled(cron = "0/10 * * * * ? ") + //@Scheduled(cron = "0/40 * * * * ? ") public ReturnT loadDutyInfo(String param) throws Exception { if (Func.isBlank(param)) { param = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"); @@ -221,33 +220,35 @@ public class ScheduledCreateTask { } /** - * 水利-泵组实时加载 + * 首页-指标数据加载 * @return ReturnT */ - @XxlJob(LOAD_WATER_PUMP_REAL) - //@Scheduled(cron = "0/10 * * * * ? ") - public ReturnT loadWaterPumpReal(String param) throws Exception { + @XxlJob(LOAD_HOME_TARGET) + //@Scheduled(cron = "0/40 * * * * ? ") + public ReturnT loadHomeTarget(String param) throws Exception { if (Func.isBlank(param)) { param = DateUtil.format(new Date(), "yyyy-MM"); } - waterService.loadWaterPumpReal(param); + homeService.loadHomeTarget(param); return new ReturnT<>("SUCCESS"); } /** - * 首页-指标数据加载 + * 水利-泵组实时加载 * @return ReturnT */ - @XxlJob(LOAD_HOME_TARGET) - //@Scheduled(cron = "0/40 * * * * ? ") - public ReturnT loadHomeTarget(String param) throws Exception { + //@XxlJob(LOAD_WATER_PUMP_REAL) + @Scheduled(cron = "0/10 * * * * ? ") + public ReturnT loadWaterPumpReal() throws Exception { + String param = ""; if (Func.isBlank(param)) { param = DateUtil.format(new Date(), "yyyy-MM"); } - homeService.loadHomeTarget(param); + waterService.loadWaterPumpReal(param); return new ReturnT<>("SUCCESS"); } + /** * 水利-泵组指标加载 * @return ReturnT diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomeServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomeServiceImpl.java index afadb2e..8373e6d 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomeServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomeServiceImpl.java @@ -143,6 +143,8 @@ public class HomeServiceImpl implements HomeService { if(ObjectUtil.isNotEmpty(target)){ count.setCount(Long.valueOf(Optional.ofNullable(target.getCharge()).orElse(0))); } + }else if(HomePageConstant.WATER_CONSERVANCY.equals(type) && "2".equals(serve)){ + count.setCount(stations.stream().filter(station->serve.equals(station.getServeType()) && HomePageConstant.waterList.contains(station.getType())).count()); }else{ count.setCount(stations.stream().filter(station->serve.equals(station.getServeType()) && type.equals(station.getType())).count()); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/PhotovoltaicServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/PhotovoltaicServiceImpl.java index 0b96f20..70846ce 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/PhotovoltaicServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/PhotovoltaicServiceImpl.java @@ -38,7 +38,6 @@ import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; import java.math.BigDecimal; -import java.text.SimpleDateFormat; import java.time.Duration; import java.time.LocalDate; import java.time.LocalDateTime; diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WaterServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WaterServiceImpl.java index a8d255e..13ceb92 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WaterServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WaterServiceImpl.java @@ -733,10 +733,10 @@ public class WaterServiceImpl implements IWaterService { * @return */ private List getUsrPowerVoList(EminfoAndEmParamVo device) { - String start = DateUtil.format(new Date(),DateUtil.PATTERN_DATE); + String start = DateUtil.format(new Date(),DateUtil.PATTERN_DATE) + " 00:00:00"; Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.DAY_OF_MONTH,-29); - String end = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE); + String end = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME); List records = analyseDataService.periodTargetData(start,end,EquipmentConstants.CycleTypeEnum.DAY_CYCLE.getType(),5,device.getEmCode(),HomePageConstant.ELECTRICITY_CONSUMPTION); if(CollectionUtil.isEmpty(records)){ return new ArrayList<>(); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/controller/DeptController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/controller/DeptController.java index 83036bc..293d49b 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/controller/DeptController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/controller/DeptController.java @@ -1,12 +1,8 @@ package com.hnac.hzims.operational.report.controller; -import com.hnac.hzims.common.logs.annotation.OperationAnnotation; -import com.hnac.hzims.common.logs.enums.BusinessType; -import com.hnac.hzims.common.logs.enums.OperatorType; import com.hnac.hzims.operational.main.constant.HomePageConstant; import com.hnac.hzims.operational.report.service.IDeptService; import io.swagger.annotations.ApiOperation; -import io.swagger.models.auth.In; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.boot.ctrl.BladeController; diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java index 8986d08..3322ece 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java @@ -26,7 +26,6 @@ import com.hnac.hzinfo.sdk.v5.project.vo.ProjectVO;*/ import com.hnac.hzinfo.sdk.core.response.Result; import com.hnac.hzinfo.sdk.v5.project.ProjectClient; import com.hnac.hzinfo.sdk.v5.project.dto.ProjectDTO; -import com.hnac.hzinfo.sdk.v5.project.vo.ProjectVO; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils;