Browse Source

#bug修改

zhongwei
yang_shj 2 years ago
parent
commit
cc512058eb
  1. 1
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java
  2. 7
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/PlanGenerationServiceImpl.java
  3. 5
      hzims-service/equipment/src/main/java/com/hnac/hzims/monitor/server/impl/RealTimeDataServerImpl.java
  4. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AlarmHandleServiceImpl.java
  5. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java
  6. 25
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/scheduled/ScheduledCreateTask.java
  7. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomeServiceImpl.java
  8. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/PhotovoltaicServiceImpl.java
  9. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WaterServiceImpl.java
  10. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/controller/DeptController.java
  11. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java

1
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.apache.commons.collections4.MapUtils;
import org.springblade.core.log.exception.ServiceException; import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl; 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.api.R;
import org.springblade.core.tool.utils.*; import org.springblade.core.tool.utils.*;
import org.springblade.system.vo.CreateTableVO; import org.springblade.system.vo.CreateTableVO;

7
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 com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeDataConditionVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.CollectionUtil;
@ -164,7 +163,7 @@ public class PlanGenerationServiceImpl extends BaseServiceImpl<PlanGenerationMap
public R doSaveOrUpdateBatch(List<PlanGenerationEntity> list) { public R doSaveOrUpdateBatch(List<PlanGenerationEntity> list) {
List<String> dateList = this.baseMapper.selectByStationAndDateTime(list); List<String> dateList = this.baseMapper.selectByStationAndDateTime(list);
if (CollectionUtil.isNotEmpty(dateList)) { if (CollectionUtil.isNotEmpty(dateList)) {
return R.fail("该站点中" + StringUtils.join(dateList, ",") + "日期已存在!"); return R.fail("该站点中" + StringUtil.join(dateList, ",") + "日期已存在!");
} }
return R.status(this.saveOrUpdateBatch(list)); return R.status(this.saveOrUpdateBatch(list));
} }
@ -306,13 +305,13 @@ public class PlanGenerationServiceImpl extends BaseServiceImpl<PlanGenerationMap
/** /**
* 年计划/实际发电量 * 年计划/实际发电量
* @param stationIds * @param stationIdList
* @param date * @param date
* @return * @return
*/ */
@Override @Override
public Double getPlanPowerYear(List<String> stationIdList, String date) { public Double getPlanPowerYear(List<String> stationIdList, String date) {
if(CollectionUtil.isEmpty(stationIdList) || StringUtils.isEmpty(date)){ if(CollectionUtil.isEmpty(stationIdList) || StringUtil.isEmpty(date)){
return 0.0; return 0.0;
} }
return this.baseMapper.getPlanPowerYear(stationIdList,date); return this.baseMapper.getPlanPowerYear(stationIdList,date);

5
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.equipment.mapper.EmInfoMapper;
import com.hnac.hzims.monitor.server.RealTimeDataServer; import com.hnac.hzims.monitor.server.RealTimeDataServer;
import com.hnac.hzinfo.dataconfig.entity.*; import com.hnac.hzinfo.dataconfig.entity.*;
import com.hnac.hzinfo.datasearch.analyse.IAnalyseDataSearchClient; import com.hnac.hzinfo.datasearch.analyse.IAnalyseDataSearchClient;
import com.hnac.hzinfo.datasearch.analyse.IAnalyseInstanceClient; import com.hnac.hzinfo.datasearch.analyse.IAnalyseInstanceClient;
import com.hnac.hzinfo.datasearch.analyse.domain.FieldsData; import com.hnac.hzinfo.datasearch.analyse.domain.FieldsData;
import com.hnac.hzinfo.datasearch.device.IDeviceClient; import com.hnac.hzinfo.datasearch.device.IDeviceClient;
import com.hnac.hzinfo.datasearch.real.IRealDataSearchClient;
import com.hnac.hzinfo.datasearch.real.po.RealDataSearchPO; import com.hnac.hzinfo.datasearch.real.po.RealDataSearchPO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -25,8 +22,6 @@ import org.springframework.stereotype.Service;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Slf4j @Slf4j

2
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.AlarmHandleVo;
import com.hnac.hzims.operational.alert.vo.HandleQueryVo; import com.hnac.hzims.operational.alert.vo.HandleQueryVo;
import com.hnac.hzims.operational.alert.wrapper.HandleWrapper; import com.hnac.hzims.operational.alert.wrapper.HandleWrapper;
import com.hnac.hzims.operational.main.constant.HomePageConstant;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.jsoup.helper.DataUtil;
import org.springblade.core.log.exception.ServiceException; import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;

2
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.HzPage;
import com.hnac.hzinfo.sdk.core.response.Result; import com.hnac.hzinfo.sdk.core.response.Result;
import com.hnac.hzinfo.sdk.v5.soe.SoeClient; 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.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.logstash.logback.encoder.org.apache.commons.lang3.ObjectUtils; import net.logstash.logback.encoder.org.apache.commons.lang3.ObjectUtils;

25
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.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.validation.constraints.NotNull;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -183,7 +182,7 @@ public class ScheduledCreateTask {
* @return ReturnT<String> * @return ReturnT<String>
*/ */
@XxlJob(REGIONAL_DUTY_INFO) @XxlJob(REGIONAL_DUTY_INFO)
//@Scheduled(cron = "0/10 * * * * ? ") //@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> loadDutyInfo(String param) throws Exception { public ReturnT<String> loadDutyInfo(String param) throws Exception {
if (Func.isBlank(param)) { if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"); param = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss");
@ -221,33 +220,35 @@ public class ScheduledCreateTask {
} }
/** /**
* 水利-泵组实时加载 * 首页-指标数据加载
* @return ReturnT<String> * @return ReturnT<String>
*/ */
@XxlJob(LOAD_WATER_PUMP_REAL) @XxlJob(LOAD_HOME_TARGET)
//@Scheduled(cron = "0/10 * * * * ? ") //@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> loadWaterPumpReal(String param) throws Exception { public ReturnT<String> loadHomeTarget(String param) throws Exception {
if (Func.isBlank(param)) { if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM"); param = DateUtil.format(new Date(), "yyyy-MM");
} }
waterService.loadWaterPumpReal(param); homeService.loadHomeTarget(param);
return new ReturnT<>("SUCCESS"); return new ReturnT<>("SUCCESS");
} }
/** /**
* 首页-指标数据加载 * 水利-泵组实时加载
* @return ReturnT<String> * @return ReturnT<String>
*/ */
@XxlJob(LOAD_HOME_TARGET) //@XxlJob(LOAD_WATER_PUMP_REAL)
//@Scheduled(cron = "0/40 * * * * ? ") @Scheduled(cron = "0/10 * * * * ? ")
public ReturnT<String> loadHomeTarget(String param) throws Exception { public ReturnT<String> loadWaterPumpReal() throws Exception {
String param = "";
if (Func.isBlank(param)) { if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM"); param = DateUtil.format(new Date(), "yyyy-MM");
} }
homeService.loadHomeTarget(param); waterService.loadWaterPumpReal(param);
return new ReturnT<>("SUCCESS"); return new ReturnT<>("SUCCESS");
} }
/** /**
* 水利-泵组指标加载 * 水利-泵组指标加载
* @return ReturnT<String> * @return ReturnT<String>

2
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)){ if(ObjectUtil.isNotEmpty(target)){
count.setCount(Long.valueOf(Optional.ofNullable(target.getCharge()).orElse(0))); 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{ }else{
count.setCount(stations.stream().filter(station->serve.equals(station.getServeType()) && type.equals(station.getType())).count()); count.setCount(stations.stream().filter(station->serve.equals(station.getServeType()) && type.equals(station.getType())).count());
} }

1
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 org.springframework.stereotype.Service;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.time.Duration; import java.time.Duration;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;

4
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 * @return
*/ */
private List<UsrPowerVo> getUsrPowerVoList(EminfoAndEmParamVo device) { private List<UsrPowerVo> 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 calendar = Calendar.getInstance();
calendar.add(Calendar.DAY_OF_MONTH,-29); 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<AnalyseDataTaosVO> records = analyseDataService.periodTargetData(start,end,EquipmentConstants.CycleTypeEnum.DAY_CYCLE.getType(),5,device.getEmCode(),HomePageConstant.ELECTRICITY_CONSUMPTION); List<AnalyseDataTaosVO> records = analyseDataService.periodTargetData(start,end,EquipmentConstants.CycleTypeEnum.DAY_CYCLE.getType(),5,device.getEmCode(),HomePageConstant.ELECTRICITY_CONSUMPTION);
if(CollectionUtil.isEmpty(records)){ if(CollectionUtil.isEmpty(records)){
return new ArrayList<>(); return new ArrayList<>();

4
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; 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.main.constant.HomePageConstant;
import com.hnac.hzims.operational.report.service.IDeptService; import com.hnac.hzims.operational.report.service.IDeptService;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;

1
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.core.response.Result;
import com.hnac.hzinfo.sdk.v5.project.ProjectClient; import com.hnac.hzinfo.sdk.v5.project.ProjectClient;
import com.hnac.hzinfo.sdk.v5.project.dto.ProjectDTO; import com.hnac.hzinfo.sdk.v5.project.dto.ProjectDTO;
import com.hnac.hzinfo.sdk.v5.project.vo.ProjectVO;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;

Loading…
Cancel
Save