Browse Source

#演示平台接口、30天发电量修改

zhongwei
yang_shj 10 months ago
parent
commit
a9c0788343
  1. 17
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/data/vo/ConverElectricityVo.java
  2. 20
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/data/vo/LoadWaterLevelVo.java
  3. 22
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/data/vo/PowerConvertVo.java
  4. 3
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/HydropowerStationVo.java
  5. 2
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java
  6. 19
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/data/controller/HzimsDataController.java
  7. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/data/service/HzimsDataService.java
  8. 211
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/data/service/impl/HzimsDataServiceImpl.java
  9. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/IAnalyseDataService.java
  10. 39
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AnalyseDataServiceImpl.java
  11. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java

17
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/data/vo/ConverElectricityVo.java

@ -0,0 +1,17 @@
package com.hnac.hzims.operational.data.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author ysj
*/
@Data
public class ConverElectricityVo {
@ApiModelProperty("时间")
private String time;
@ApiModelProperty("电量")
private Double electricity;
}

20
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/data/vo/LoadWaterLevelVo.java

@ -0,0 +1,20 @@
package com.hnac.hzims.operational.data.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author ysj
*/
@Data
public class LoadWaterLevelVo {
@ApiModelProperty("时间")
private String time;
@ApiModelProperty("水位")
private Double water;
@ApiModelProperty("功率")
private Double load;
}

22
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/data/vo/PowerConvertVo.java

@ -0,0 +1,22 @@
package com.hnac.hzims.operational.data.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author ysj
*/
@Data
public class PowerConvertVo {
@ApiModelProperty("站点名称")
private String stationName;
@ApiModelProperty("功率/水位")
private List<LoadWaterLevelVo> loadWaters;
@ApiModelProperty("发电量")
private List<ConverElectricityVo> electricitys;
}

3
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/HydropowerStationVo.java

@ -54,6 +54,9 @@ public class HydropowerStationVo {
@ApiModelProperty(value = "月发电量") @ApiModelProperty(value = "月发电量")
private Float powerMon; private Float powerMon;
@ApiModelProperty(value = "月发电量完成率")
private Double powerRateMon;
@ApiModelProperty(value = "年发电量") @ApiModelProperty(value = "年发电量")
private Float powerYear; private Float powerYear;

2
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java

@ -1006,7 +1006,7 @@ public class RealTargetServiceImpl implements RealTargetService {
private List<HzimsAnalyzeModelStationEntity> getModelStationList() { private List<HzimsAnalyzeModelStationEntity> getModelStationList() {
// 水利站点(All) // 水利站点(All)
List<StationEntity> stations = stationService.list(new LambdaQueryWrapper<StationEntity>() {{ List<StationEntity> stations = stationService.list(new LambdaQueryWrapper<StationEntity>() {{
eq(StationEntity::getServeType, HomePageConstant.HYDROPOWER_SERVETYPE); eq(StationEntity::getDataOrigin, "0");
}}); }});
if(CollectionUtil.isEmpty(stations)){ if(CollectionUtil.isEmpty(stations)){
return new ArrayList<>(); return new ArrayList<>();

19
hzims-service/operational/src/main/java/com/hnac/hzims/operational/data/controller/HzimsDataController.java

@ -26,9 +26,6 @@ public class HzimsDataController {
private final HzimsDataService service; private final HzimsDataService service;
/**
* 获取区域列表数据
*/
@ApiLog @ApiLog
@GetMapping("/saveArea") @GetMapping("/saveArea")
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
@ -37,12 +34,9 @@ public class HzimsDataController {
return R.data(service.saveArea()); return R.data(service.saveArea());
} }
/**
* 获取区域列表数据
*/
@ApiLog @ApiLog
@GetMapping("/saveStation") @GetMapping("/saveStation")
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 2)
@ApiOperation(value = "获取站点统计数据", notes = "无需传入参数") @ApiOperation(value = "获取站点统计数据", notes = "无需传入参数")
public R saveStation() { public R saveStation() {
return R.data(service.saveStation()); return R.data(service.saveStation());
@ -50,9 +44,18 @@ public class HzimsDataController {
@ApiLog @ApiLog
@GetMapping("/station") @GetMapping("/station")
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 3)
@ApiOperation(value = "站点数据获取", notes = "传入站点code") @ApiOperation(value = "站点数据获取", notes = "传入站点code")
public R station(@RequestParam("stationCode") String stationCode) { public R station(@RequestParam("stationCode") String stationCode) {
return R.data(service.station(stationCode)); return R.data(service.station(stationCode));
} }
@ApiLog
@GetMapping("/power")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "站点功率换算电量", notes = "传入站点code")
public R power(@RequestParam("stationCode") String stationCode) {
return R.data(service.power(stationCode));
}
} }

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/data/service/HzimsDataService.java

@ -1,5 +1,6 @@
package com.hnac.hzims.operational.data.service; package com.hnac.hzims.operational.data.service;
import com.hnac.hzims.operational.data.vo.PowerConvertVo;
import com.hnac.hzims.operational.main.vo.HydropowerStationVo; import com.hnac.hzims.operational.main.vo.HydropowerStationVo;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
@ -20,4 +21,6 @@ public interface HzimsDataService {
boolean saveStation(); boolean saveStation();
HydropowerStationVo station(String stationCode); HydropowerStationVo station(String stationCode);
PowerConvertVo power(String stationCode);
} }

211
hzims-service/operational/src/main/java/com/hnac/hzims/operational/data/service/impl/HzimsDataServiceImpl.java

@ -3,17 +3,26 @@ package com.hnac.hzims.operational.data.service.impl;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hnac.hzims.equipment.entity.PlanGenerationEntity; import com.hnac.hzims.equipment.entity.PlanGenerationEntity;
import com.hnac.hzims.equipment.feign.IEmInfoClient;
import com.hnac.hzims.equipment.feign.IPlanGenertionClient; import com.hnac.hzims.equipment.feign.IPlanGenertionClient;
import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo; import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo;
import com.hnac.hzims.operational.data.service.HzimsDataService; import com.hnac.hzims.operational.data.service.HzimsDataService;
import com.hnac.hzims.operational.data.vo.AreaVo; import com.hnac.hzims.operational.data.vo.AreaVo;
import com.hnac.hzims.operational.data.vo.ConverElectricityVo;
import com.hnac.hzims.operational.data.vo.LoadWaterLevelVo;
import com.hnac.hzims.operational.data.vo.PowerConvertVo;
import com.hnac.hzims.operational.main.constant.HomePageConstant; import com.hnac.hzims.operational.main.constant.HomePageConstant;
import com.hnac.hzims.operational.main.service.AreaService; import com.hnac.hzims.operational.main.service.AreaService;
import com.hnac.hzims.operational.main.service.IAnalyseDataService;
import com.hnac.hzims.operational.main.service.IMainSystemMonitoringService; import com.hnac.hzims.operational.main.service.IMainSystemMonitoringService;
import com.hnac.hzims.operational.main.vo.*; import com.hnac.hzims.operational.main.vo.*;
import com.hnac.hzims.operational.station.entity.HzimsAnalyzeModelStationEntity;
import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.service.IHzimsAnalyzeModelStationService;
import com.hnac.hzims.operational.station.service.IStationService; import com.hnac.hzims.operational.station.service.IStationService;
import com.hnac.hzims.operational.station.vo.HzimsStationCountVo; import com.hnac.hzims.operational.station.vo.HzimsStationCountVo;
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyseDataTaosVO;
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeDataConditionVO;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
@ -40,6 +49,7 @@ import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -57,8 +67,14 @@ public class HzimsDataServiceImpl implements HzimsDataService {
private final IStationService stationService; private final IStationService stationService;
private final IAnalyseDataService dataService;
private final IHzimsAnalyzeModelStationService modelStationService;
private final IMainSystemMonitoringService maintenanceTaskService; private final IMainSystemMonitoringService maintenanceTaskService;
private final IEmInfoClient deviceClient;
private final ISysClient sysClient; private final ISysClient sysClient;
private final IPlanGenertionClient planGenertionClient; private final IPlanGenertionClient planGenertionClient;
@ -70,6 +86,8 @@ public class HzimsDataServiceImpl implements HzimsDataService {
@Value("${hzims.operation.save.station.url}") @Value("${hzims.operation.save.station.url}")
public String STATION_URL; public String STATION_URL;
private final static String conver_power_key = "hzims:operation:conver:power:";
private final static String recent_year_power_data = "hzims:operation:key:power:data"; private final static String recent_year_power_data = "hzims:operation:key:power:data";
private final static String loadwater_level_key = "hzims:operation:loadwater:level:key"; private final static String loadwater_level_key = "hzims:operation:loadwater:level:key";
@ -217,6 +235,189 @@ public class HzimsDataServiceImpl implements HzimsDataService {
} }
/** /**
* 站点功率换算电量
* @param stationCode
* @return
*/
@Override
public PowerConvertVo power(String stationCode) {
PowerConvertVo redisCache = (PowerConvertVo) redisTemplate.opsForValue().get(conver_power_key + stationCode);
if(!ObjectUtil.isEmpty(redisCache)){
return redisCache;
}
// 查询站点
StationEntity station = stationService.getOne(Wrappers.<StationEntity>lambdaQuery().
eq(StationEntity::getCode,stationCode)
);
if(ObjectUtil.isEmpty(station)){
return new PowerConvertVo();
}
PowerConvertVo convert = new PowerConvertVo();
convert.setStationName(station.getName());
// 查询近30天发电量
convert.setElectricitys(this.poweyBy30Day(station.getRefDept()));
// 查询24小时水位、功率
convert.setLoadWaters(this.loadWaterBy24Hour(station.getRefDept(),station.getCode()));
redisTemplate.opsForValue().set(conver_power_key + stationCode,convert);
redisTemplate.expire(conver_power_key + stationCode,30, TimeUnit.MINUTES);
return convert;
}
/**
* 查询近30天发电量
* @param deptId
* @return
*/
private List<ConverElectricityVo> poweyBy30Day(Long deptId) {
// 查询设备
R<List<String>> result = deviceClient.getEmCodeByDeptId(deptId);
if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){
return new ArrayList<>();
}
Calendar calendar = Calendar.getInstance();
String endTime = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME);
calendar.add(Calendar.HOUR_OF_DAY,-calendar.get(Calendar.HOUR_OF_DAY));
calendar.add(Calendar.MINUTE,-calendar.get(Calendar.MINUTE));
calendar.add(Calendar.SECOND,-calendar.get(Calendar.SECOND));
calendar.add(Calendar.DAY_OF_MONTH,-30);
String startTime = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME);
// 功率查询
List<AnalyzeDataConditionVO> datas = dataService.periodTargetDatas(startTime,endTime,3,2,result.getData(),HomePageConstant.ACTIVE_POWER);
if(CollectionUtil.isEmpty(datas)){
return new ArrayList<>();
}
List<ConverElectricityVo> electricitys = new ArrayList<>();
// 数据累计
datas.forEach(item->{
if(CollectionUtil.isEmpty(item.getList())){
return;
}
item.getList().forEach(data->{
ConverElectricityVo electricity = new ConverElectricityVo();
Date date = DateUtil.parse(data.getTs(), "yyyy-MM-dd HH:mm:ss.s");
electricity.setTime(DateUtil.format(date,DateUtil.PATTERN_DATE));
if(StringUtil.isEmpty(data.getVal())){
electricity.setElectricity(0.0);
}else{
electricity.setElectricity(Double.parseDouble(data.getVal()));
}
electricitys.add(electricity);
});
});
if(CollectionUtil.isEmpty(electricitys)){
return new ArrayList<>();
}
// 进行time分组
return electricitys.stream().collect(Collectors.groupingBy(ConverElectricityVo::getTime)).entrySet().stream().map(entry->{
ConverElectricityVo electricity = new ConverElectricityVo();
electricity.setTime(entry.getKey());
electricity.setElectricity(entry.getValue().stream().mapToDouble(ConverElectricityVo::getElectricity).sum());
return electricity;
}).sorted(Comparator.comparing(ConverElectricityVo::getTime)).collect(Collectors.toList());
}
/**
* 查询24小时水位功率
* @param stationCode
* @return
*/
private List<LoadWaterLevelVo> loadWaterBy24Hour(Long deptId,String stationCode) {
Calendar calendar = Calendar.getInstance();
String endTime = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME);
calendar.add(Calendar.HOUR_OF_DAY,-24);
String startTime = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME);
List<String> hours = this.get24Hours();
// 查询功率数据
List<AnalyseDataTaosVO> loads = this.loads(startTime,endTime,deptId);
// 查询水位数据
List<AnalyseDataTaosVO> waters = this.water(startTime,endTime,stationCode);
return hours.stream().map(hour ->{
LoadWaterLevelVo loadWater = new LoadWaterLevelVo();
Date time = DateUtil.parse(hour,"yyyy-MM-dd HH");
loadWater.setTime(String.valueOf(time.getHours()));
if(CollectionUtil.isEmpty(loads)){
loadWater.setLoad(0.0);
}else{
loadWater.setLoad(loads.stream().filter(o->o.getTs().contains(hour)).mapToDouble(load->{
if(StringUtil.isEmpty(load.getVal())){
return 0.0;
}
return Double.parseDouble(load.getVal());
}).sum());
}
if(CollectionUtil.isEmpty(waters)){
loadWater.setWater(0.0);
}else{
loadWater.setWater(waters.stream().filter(o->o.getTs().contains(hour)).mapToDouble(load->{
if(StringUtil.isEmpty(load.getVal())){
return 0.0;
}
return Double.parseDouble(load.getVal());
}).sum());
}
return loadWater;
}).collect(Collectors.toList());
}
/**
* 查询24小时水位数据
* @param startTime
* @param endTime
* @param stationCode
* @return
*/
private List<AnalyseDataTaosVO> water(String startTime, String endTime, String stationCode) {
// 查询模型站点
HzimsAnalyzeModelStationEntity model = modelStationService.getOne(Wrappers.<HzimsAnalyzeModelStationEntity>lambdaQuery()
.eq(HzimsAnalyzeModelStationEntity::getStationId,stationCode)
);
if(ObjectUtil.isEmpty(model)){
return new ArrayList<>();
}
// 水位查询
return dataService.periodTargetData(startTime,endTime,3,2,model.getInstanceCode(),HomePageConstant.FRONT_WATER_LEVEL);
}
/**
* 获取24小时功率
* @param refDept
*/
private List<AnalyseDataTaosVO> loads(String start,String end,Long refDept) {
List<AnalyseDataTaosVO> datas = new ArrayList<>();
R<List<String>> result = deviceClient.getEmCodeByDeptId(refDept);
if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){
return datas;
}
// 功率查询
List<AnalyzeDataConditionVO> loads = dataService.periodTargetDatas(start,end,3,2,result.getData(),HomePageConstant.ACTIVE_POWER);
if(!CollectionUtil.isEmpty(loads)){
loads.forEach(load->{
datas.addAll(load.getList());
});
}
return datas;
}
/**
* 获取24小时
* @return
*/
private List<String> get24Hours() {
Calendar calendar = Calendar.getInstance();
Date end = calendar.getTime();
calendar.add(Calendar.HOUR_OF_DAY,-24);
Date start = calendar.getTime();
List<String> times = new ArrayList<>();
while (start.compareTo(end) < 0) {
times.add(DateUtil.format(calendar.getTime(),"yyyy-MM-dd HH"));
calendar.add(Calendar.HOUR_OF_DAY,1);
start = calendar.getTime();
}
return times;
}
/**
* 获取站点运行天数 * 获取站点运行天数
* @param station * @param station
* @return * @return
@ -308,6 +509,14 @@ public class HzimsDataServiceImpl implements HzimsDataService {
// 月发电量 // 月发电量
float powerMont = (float) targetList.stream().filter(o-> deptId.equals(o.getDeptId())).mapToDouble(HydropowerUnitTargetVo::getPowerMon).sum(); float powerMont = (float) targetList.stream().filter(o-> deptId.equals(o.getDeptId())).mapToDouble(HydropowerUnitTargetVo::getPowerMon).sum();
response.setPowerMon(powerMont); response.setPowerMon(powerMont);
// 月发电完成率
float planPowerMon = response.getPlanPowerMon();
if(Math.abs(planPowerMon) <= 0){
response.setPowerRateMon(0.0);
} else {
double powerRateYear = BigDecimal.valueOf(powerMont / (double) planPowerMon * 100).setScale(2, RoundingMode.HALF_UP).doubleValue();
response.setPowerRateMon(powerRateYear);
}
// 年发电量 // 年发电量
float powerYear = (float) targetList.stream().filter(o-> deptId.equals(o.getDeptId())).mapToDouble(HydropowerUnitTargetVo::getPowerYear).sum(); float powerYear = (float) targetList.stream().filter(o-> deptId.equals(o.getDeptId())).mapToDouble(HydropowerUnitTargetVo::getPowerYear).sum();
response.setPowerYear(powerYear); response.setPowerYear(powerYear);
@ -316,7 +525,7 @@ public class HzimsDataServiceImpl implements HzimsDataService {
if(Math.abs(planPowerYear) <= 0){ if(Math.abs(planPowerYear) <= 0){
response.setPowerRateYear(0.0); response.setPowerRateYear(0.0);
} else { } else {
double powerRateYear = BigDecimal.valueOf(powerYear / planPowerYear * 100).setScale(2, RoundingMode.HALF_UP).doubleValue(); double powerRateYear = BigDecimal.valueOf(powerYear / (double) planPowerYear * 100).setScale(2, RoundingMode.HALF_UP).doubleValue();
response.setPowerRateYear(powerRateYear); response.setPowerRateYear(powerRateYear);
} }
} }

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/IAnalyseDataService.java

@ -18,5 +18,7 @@ public interface IAnalyseDataService {
List<AnalyseDataTaosVO> periodTargetData(String startTime, String endTime, Integer accessRules, Integer cycleType, String deviceCode, String signages); List<AnalyseDataTaosVO> periodTargetData(String startTime, String endTime, Integer accessRules, Integer cycleType, String deviceCode, String signages);
List<AnalyzeDataConditionVO> periodTargetDatas(String startTime, String endTime, Integer accessRules, Integer cycleType, List<String> deviceCodes, String signages);
Float periodTargetFloat(String startTime, String endTime, Integer accessRules, Integer cycleType, String deviceCode, Integer ride ,String signages); Float periodTargetFloat(String startTime, String endTime, Integer accessRules, Integer cycleType, String deviceCode, Integer ride ,String signages);
} }

39
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AnalyseDataServiceImpl.java

@ -89,6 +89,45 @@ public class AnalyseDataServiceImpl implements IAnalyseDataService {
* @param endTime 结束时间 * @param endTime 结束时间
* @param accessRules 取数规则 : 0=最早值 1=最大值 2=最小值 3=平均值 4=和值 5=差值 6=最新值 * @param accessRules 取数规则 : 0=最早值 1=最大值 2=最小值 3=平均值 4=和值 5=差值 6=最新值
* @param cycleType 间隔周期 : 0-> 1-> 2-> 小时 3-> 4-> 5-> 6-> * @param cycleType 间隔周期 : 0-> 1-> 2-> 小时 3-> 4-> 5-> 6->
* @param deviceCodes 设备编号集合
* @param signages 指标
* @return
*/
@Override
public List<AnalyzeDataConditionVO> periodTargetDatas(String startTime, String endTime, Integer accessRules, Integer cycleType, List<String> deviceCodes, String signages) {
AnalyseCodeByAnalyseDataPO po = new AnalyseCodeByAnalyseDataPO();
List<AnalyzeDataConditionPO> signboardConditions = new ArrayList<>();
deviceCodes.forEach(deviceCode->{
AnalyzeDataConditionPO analyzeDataConditionPO = new AnalyzeDataConditionPO();
analyzeDataConditionPO.setFull(1);
po.setDeviceCode(deviceCode);
analyzeDataConditionPO.setSignages(signages);
analyzeDataConditionPO.setKeepFigures(2);
analyzeDataConditionPO.setAccessRules(accessRules);
analyzeDataConditionPO.setSaveTimeType(cycleType);
// 间隔
analyzeDataConditionPO.setTimeInterval(1);
analyzeDataConditionPO.setBeginTime(LocalDateTime.parse(DateUtil.format(new Date(), startTime), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME)));
analyzeDataConditionPO.setEndTime(LocalDateTime.parse(DateUtil.format(new Date(), endTime), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME)));
signboardConditions.add(analyzeDataConditionPO);
});
po.setSignboardConditions(signboardConditions);
log.error("period_target_data_request {}",po);
R<List<AnalyzeDataConditionVO>> result = analyseDataSearchClient.getAnalyzeDataByAnalyzeCodeAndSignages(po);
if (!result.isSuccess() || CollectionUtil.isEmpty(result.getData())) {
return new ArrayList<>();
}
log.error("period_target_data_resp {}",result);
return result.getData();
}
/***
* 指标数据列表查询
* @param startTime 开始时间
* @param endTime 结束时间
* @param accessRules 取数规则 : 0=最早值 1=最大值 2=最小值 3=平均值 4=和值 5=差值 6=最新值
* @param cycleType 间隔周期 : 0-> 1-> 2-> 小时 3-> 4-> 5-> 6->
* @param deviceCode 设备编号 * @param deviceCode 设备编号
* @param ride 配电比 * @param ride 配电比
* @param signages 指标 * @param signages 指标

6
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java

@ -528,8 +528,10 @@ public class HydropowerServiceImpl implements HydropowerService {
* @return * @return
*/ */
private List<GenerationPowerVo> getGenerationPowerList(EminfoAndEmParamVo device) { private List<GenerationPowerVo> getGenerationPowerList(EminfoAndEmParamVo device) {
String start = DateUtil.format(new Date(), "yyyy-MM") + "-01 00:00:00"; Calendar calendar = Calendar.getInstance();
String end = DateUtil.format(new Date(), DateUtil.PATTERN_DATETIME); String end = DateUtil.format(calendar.getTime(), DateUtil.PATTERN_DATETIME);
calendar.set(Calendar.DAY_OF_MONTH,-29);
String start = DateUtil.format(calendar.getTime(), DateUtil.PATTERN_DATETIME);
List<AnalyseDataTaosVO> records = analyseDataService.periodTargetData(start,end,5,EquipmentConstants.CycleTypeEnum.DAY_CYCLE.getType(),device.getEmCode(),HomePageConstant.HYDROPOWER_GENERATE_POWER); List<AnalyseDataTaosVO> records = analyseDataService.periodTargetData(start,end,5,EquipmentConstants.CycleTypeEnum.DAY_CYCLE.getType(),device.getEmCode(),HomePageConstant.HYDROPOWER_GENERATE_POWER);
if(CollectionUtil.isEmpty(records)){ if(CollectionUtil.isEmpty(records)){
return new ArrayList<>(); return new ArrayList<>();

Loading…
Cancel
Save