Browse Source

#光伏站点指标增加

zhongwei
yang_shj 2 years ago
parent
commit
d55729d474
  1. 3
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/GenerateEntity.java
  2. 3
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/UseEntity.java
  3. 454
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/HomePageConstant.java
  4. 11
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicDeviceVo.java
  5. 196
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicRealVo.java
  6. 21
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicStationVo.java
  7. 8
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java
  8. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/scheduled/StAlamRecordTask.java
  9. 7
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/scheduled/ScheduledCreateTask.java
  10. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/IHomePageService.java
  11. 7
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AnalyseDataServiceImpl.java
  12. 158
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomePageServiceImpl.java
  13. 2936
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/PhotovoltaicServiceImpl.java
  14. 27
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/SideHustleServiceImpl.java
  15. 82
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WaterServiceImpl.java
  16. 83
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WebHomeServiceImpl.java

3
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/GenerateEntity.java

@ -22,6 +22,9 @@ public class GenerateEntity extends TenantEntity implements Serializable {
@ApiModelProperty("站点名称")
private String stationName;
@ApiModelProperty("站点来源类型: 0 - 数据采集 1 - 数据填报")
private String dataOrigin;
@ApiModelProperty("发电量")
private BigDecimal generate;

3
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/fill/entity/UseEntity.java

@ -22,6 +22,9 @@ public class UseEntity extends TenantEntity implements Serializable {
@ApiModelProperty("站点名称")
private String stationName;
@ApiModelProperty("站点数据类型: 0 - 接入站点 1 - 未接入站点")
private String dataOrigin;
@ApiModelProperty("发电量")
private BigDecimal use;

454
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/HomePageConstant.java

@ -1,200 +1,298 @@
package com.hnac.hzims.operational.main.constant;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import io.swagger.annotations.ApiModelProperty;
import java.util.Arrays;
import java.util.List;
/**
* 首页-常量
*
* @author 11423
*/
public interface HomePageConstant {
/**
* 水电站
*/
Integer HYDROPOWER = 0;
/**
* 风电站
*/
Integer WIND_POWER = 1;
/**
* 水利
*/
Integer WATER_CONSERVANCY = 2;
/**
* 储能站
*/
Integer ENERGY_STORAGE = 3;
/**
* 配网
*/
Integer DISTRIBUTION_NETWORK = 4;
/**
* 光伏
*/
Integer PHOTOVOLTAIC = 5;
/**
* 水务
*/
Integer WATER_AFFAIRS = 6;
/**
* 充电站
*/
Integer CHARGE = 7;
/**
* 泵站
*/
Integer PUMPING = 8;
/**
* 闸门
*/
Integer GATE = 9;
/**
* 水利集合
*/
List<Integer> waterList = Arrays.asList(HomePageConstant.WATER_CONSERVANCY, HomePageConstant.PUMPING, HomePageConstant.GATE);
List<Integer> types = Arrays.asList(HomePageConstant.HYDROPOWER, HomePageConstant.WIND_POWER, HomePageConstant.WATER_CONSERVANCY, HomePageConstant.ENERGY_STORAGE,
HomePageConstant.DISTRIBUTION_NETWORK, HomePageConstant.PHOTOVOLTAIC, HomePageConstant.WATER_AFFAIRS, HomePageConstant.CHARGE, HomePageConstant.PUMPING,
HomePageConstant.GATE);
/**
* 水电站
*/
Integer HYDROPOWER = 0;
/**
* 风电站
*/
Integer WIND_POWER = 1;
/**
* 水利
*/
Integer WATER_CONSERVANCY = 2;
/**
* 储能站
*/
Integer ENERGY_STORAGE = 3;
/**
* 配网
*/
Integer DISTRIBUTION_NETWORK = 4;
/**
* 光伏
*/
Integer PHOTOVOLTAIC = 5;
/**
* 水务
*/
Integer WATER_AFFAIRS = 6;
/**
* 充电站
*/
Integer CHARGE = 7;
/**
* 泵站
*/
Integer PUMPING = 8;
/**
* 闸门
*/
Integer GATE = 9;
/**
* 水利集合
* 实时指标
*/
List<Integer> waterList = Arrays.asList(HomePageConstant.WATER_CONSERVANCY,HomePageConstant.PUMPING,HomePageConstant.GATE);
List<String> SIGNAGES = Arrays.asList(
// 泵站、水电站
HomePageConstant.JOINT_RELAY, HomePageConstant.SWITCH_ON_OFF, HomePageConstant.ELECTRICITY_CONSUMPTION,
HomePageConstant.ACTIVE_POWER, HomePageConstant.REACTIVE_POWER, HomePageConstant.POWER_FACTOR, HomePageConstant.VOLTAGE, HomePageConstant.CURRENT,
HomePageConstant.HYDROPOWER_GENERATE_POWER, HomePageConstant.HYDROPOWER_POWERFACTOR, HomePageConstant.HYDROPOWER_FREQUENCY, HomePageConstant.HYDROPOWER_GUIDEOPEN,
HomePageConstant.HYDROPOWER_VOLTAGE, HomePageConstant.HYDROPOWER_CURRENT, HomePageConstant.UNIT_SPEED, HomePageConstant.ACTIVE_POWER_GIVEN, HomePageConstant.REACTIVE_POWER_GIVEN,
// 光伏
HomePageConstant.PV_GENERATION_DAY,
HomePageConstant.DIRECT_ONE, HomePageConstant.DIRECT_TWO, HomePageConstant.DIRECT_THREE, HomePageConstant.DIRECT_FOUR, HomePageConstant.DIRECT_FIVE, HomePageConstant.DIRECT_SIX,
HomePageConstant.DIRECT_SEVEN, HomePageConstant.DIRECT_EIGHT, HomePageConstant.DIRECT_NINE, HomePageConstant.DIRECT_TEN, HomePageConstant.DIRECT_ELEVEN, HomePageConstant.DIRECT_TWELVE,
HomePageConstant.DC_VOLTAGE_ONE, HomePageConstant.DC_VOLTAGE_TWO, HomePageConstant.DC_VOLTAGE_THREE, HomePageConstant.DC_VOLTAGE_FOUR, HomePageConstant.DC_VOLTAGE_FIVE, HomePageConstant.DC_VOLTAGE_SIX,
HomePageConstant.DC_VOLTAGE_SEVEN, HomePageConstant.DC_VOLTAGE_EIGHT, HomePageConstant.DC_VOLTAGE_NINE, HomePageConstant.DC_VOLTAGE_TEN, HomePageConstant.DC_VOLTAGE_ELEVEN, HomePageConstant.DC_VOLTAGE_TWELVE,
HomePageConstant.SERIES_ONE, HomePageConstant.SERIES_TWO, HomePageConstant.SERIES_THREE, HomePageConstant.SERIES_FOUR, HomePageConstant.SERIES_FIVE, HomePageConstant.SERIES_SIX,
HomePageConstant.SERIES_SEVEN, HomePageConstant.SERIES_EIGHT, HomePageConstant.SERIES_NINE, HomePageConstant.SERIES_TEN, HomePageConstant.SERIES_ELEVEN, HomePageConstant.SERIES_TWELVE, HomePageConstant.SE_VOLTAGE_ONE,
HomePageConstant.SE_VOLTAGE_TWO, HomePageConstant.SE_VOLTAGE_THREE, HomePageConstant.SE_VOLTAGE_FOUR, HomePageConstant.SE_VOLTAGE_FIVE, HomePageConstant.SE_VOLTAGE_SIX,
HomePageConstant.SE_VOLTAGE_SEVEN, HomePageConstant.SE_VOLTAGE_EIGHT, HomePageConstant.SE_VOLTAGE_NINE, HomePageConstant.SE_VOLTAGE_TEN, HomePageConstant.SE_VOLTAGE_ELEVEN, HomePageConstant.SE_VOLTAGE_TWELVE
);
List<Integer> types = Arrays.asList(HomePageConstant.HYDROPOWER,HomePageConstant.WIND_POWER,HomePageConstant.WATER_CONSERVANCY,HomePageConstant.ENERGY_STORAGE,
HomePageConstant.DISTRIBUTION_NETWORK,HomePageConstant.PHOTOVOLTAIC,HomePageConstant.WATER_AFFAIRS,HomePageConstant.CHARGE,HomePageConstant.PUMPING,
HomePageConstant.GATE);
/**
* 站点类型 运维服务
*/
Integer HYDROPOWER_SERVETYPE = 2;
List<String> SIGNAGES = Arrays.asList(HomePageConstant.JOINT_RELAY,HomePageConstant.SWITCH_ON_OFF,HomePageConstant.ELECTRICITY_CONSUMPTION,
HomePageConstant.ACTIVE_POWER,HomePageConstant.REACTIVE_POWER,HomePageConstant.POWER_FACTOR,HomePageConstant.VOLTAGE,HomePageConstant.CURRENT,
HomePageConstant.HYDROPOWER_GENERATE_POWER,HomePageConstant.HYDROPOWER_POWERFACTOR,HomePageConstant.HYDROPOWER_FREQUENCY,HomePageConstant.HYDROPOWER_GUIDEOPEN,
HomePageConstant.HYDROPOWER_VOLTAGE,HomePageConstant.HYDROPOWER_CURRENT,HomePageConstant.UNIT_SPEED,HomePageConstant.ACTIVE_POWER_GIVEN,HomePageConstant.REACTIVE_POWER_GIVEN,
HomePageConstant.PV_GENERATION_DAY);
/**
* 站点类型 云服务
*/
Integer CLOUD_SERVETYPE = 1;
/**
* 站点类型 运维服务
*/
Integer HYDROPOWER_SERVETYPE = 2;
/**
* 0-风电
*/
Integer WIND_POWER_TYPE = 0;
/**
* 1-光伏
*/
Integer PHOTOVOLTAIC_TYPE = 1;
/**
* 站点类型 云服务
*/
Integer CLOUD_SERVETYPE = 1;
/**
* 故障
*/
String FAULT = "fault";
/**
* 保养
*/
String MAINTAIN = "maintain";
/**
* 检修
*/
String OVERHAUL = "overhaul";
/**
* 运行
*/
String RUN = "run";
/**
* 备用
*/
String SPARE = "spare";
/**
* 0-风电
*/
Integer WIND_POWER_TYPE = 0;
/**
* 1-光伏
*/
Integer PHOTOVOLTAIC_TYPE = 1;
/**
* 集团
*/
Integer GROUP = 1;
/**
* 区域
*/
Integer AREA = 3;
/**
* 站点
*/
Integer STATION = 4;
/**
* 故障
*/
String FAULT = "fault";
/**
* 保养
*/
String MAINTAIN = "maintain";
/**
* 检修
*/
String OVERHAUL = "overhaul";
/**
* 运行
*/
String RUN = "run";
/**
* 备用
*/
String SPARE = "spare";
/**
* 有功功率
*/
List<String> powerList = Arrays.asList("p", "P");
/**
* 集团
*/
Integer GROUP = 1;
/**
* 区域
*/
Integer AREA = 3;
/**
* 站点
*/
Integer STATION = 4;
// 水利-泵组实时属性名称
String JOINT_RELAY = "joint_relay"; // 开机状态
String SWITCH_ON_OFF = "switch_on_off"; // 开机状态
String OFF = "1"; // 开机
/**
* 有功功率
*/
List<String> powerList = Arrays.asList("p","P");
// 水利-泵组实时属性名称
String JOINT_RELAY = "joint_relay"; // 开机状态
String SWITCH_ON_OFF = "switch_on_off"; // 开机状态
String OFF = "1"; // 开机
String ON = "0"; // 关机
String ELECTRICITY_CONSUMPTION = "electricity_consumption"; // 用电量
String ACTIVE_POWER = "active_power"; // 有功功率
String REACTIVE_POWER = "reactive_power"; // 无功功率
String POWER_FACTOR = "power_factor"; // 功率因数
String VOLTAGE = "voltage"; // 电压
String CURRENT = "current"; // 电流
String UNIT_SPEED = "index_jzzs"; // 机组转速
String ACTIVE_POWER_GIVEN = "index_ygtzgd"; // 有功调整给定
String REACTIVE_POWER_GIVEN = "index_wgtzgd"; // 无功调整给定
// 水利-站点实时属性名称
String FRONT_WATER_LEVEL = "front_water_level"; // 前水位
String REAR_WATER_LEVEL = "rear_water_level"; // 后水位
// 水电站实时属性名称
String HYDROPOWER_GENERATE_POWER = "generation_capacity"; // 发电量
String HYDROPOWER_ACTIVE_POWER = "active_power"; // 有功功率
String HYDROPOWER_REACTIVE_POWER = "reactive_power"; // 有功功率
String HYDROPOWER_POWERFACTOR = "index_jz_cos"; // 功率因数
String HYDROPOWER_FREQUENCY = "index_jz_f"; // 机组频率
String HYDROPOWER_GUIDEOPEN = "index_dykd"; // 导叶开度
String HYDROPOWER_VOLTAGE = "stator_voltage"; // 定子电压
String HYDROPOWER_CURRENT = "stator_current"; // 定子电流
// 单位设置
String CONCAT_P = "-P"; // 有功功率单位拼接值
String CONCAT_Q = "-Q"; // 有功功率单位拼接值
String CONCAT_UAB = "-UAB"; // 有功功率单位拼接值
String CONCAT_IA = "-IA"; // 有功功率单位拼接值
/*==========================================================================================*/
// 设备/厂房参数
/**ct**/
String CT = "ct";
/**pt**/
String PT = "pt";
/**装机容量**/
String INSTALLED_CAPACITY = "installedCapacity";
/*==========================================================================================*/
/**站点数据配置-有功功率**/
String P_ATTRIBUTES = "P";
/*==========================================================================================*/
// 光伏电站-电表-物模型监测点标识
/**开关机状态**/
String PV_JOINT_RELAY = "joint_relay";
/**总有功电度**/
String PV_GENERATION_CAPACITY = "generation_capacity";
/**日发电量**/
String PV_GENERATION_DAY = "generate_day";
/**有功功率**/
String PV_LOAD = "active_power";
/**正向无功**/
String PV_REACTIVE_POWER = "reactive_power";
/**电压**/
String PV_VOLTAGE = "voltage";
/**电流**/
String PV_CURRENT = "current";
/*==========================================================================================*/
// 光伏指标属性
String PHOTOVOLTAIC_OFF = "1.0"; // 开机
String PHOTOVOLTAIC_LOAD_TARGET = "0";
/*==========================================================================================*/
// 水电集团、区域指标关联
/**功率**/
Integer POWER = 0;
/*==========================================================================================*/
// 水利集团、区域指标关联
/**功率**/
Integer LOADING = 0;
String ON = "0"; // 关机
String ELECTRICITY_CONSUMPTION = "electricity_consumption"; // 用电量
String ACTIVE_POWER = "active_power"; // 有功功率
String REACTIVE_POWER = "reactive_power"; // 无功功率
String POWER_FACTOR = "power_factor"; // 功率因数
String VOLTAGE = "voltage"; // 电压
String CURRENT = "current"; // 电流
String UNIT_SPEED = "index_jzzs"; // 机组转速
String ACTIVE_POWER_GIVEN = "index_ygtzgd"; // 有功调整给定
String REACTIVE_POWER_GIVEN = "index_wgtzgd"; // 无功调整给定
// 水利-站点实时属性名称
String FRONT_WATER_LEVEL = "front_water_level"; // 前水位
String REAR_WATER_LEVEL = "rear_water_level"; // 后水位
// 水电站实时属性名称
String HYDROPOWER_GENERATE_POWER = "generation_capacity"; // 发电量
String HYDROPOWER_ACTIVE_POWER = "active_power"; // 有功功率
String HYDROPOWER_REACTIVE_POWER = "reactive_power"; // 有功功率
String HYDROPOWER_POWERFACTOR = "index_jz_cos"; // 功率因数
String HYDROPOWER_FREQUENCY = "index_jz_f"; // 机组频率
String HYDROPOWER_GUIDEOPEN = "index_dykd"; // 导叶开度
String HYDROPOWER_VOLTAGE = "stator_voltage"; // 定子电压
String HYDROPOWER_CURRENT = "stator_current"; // 定子电流
// 单位设置
String CONCAT_P = "-P"; // 有功功率单位拼接值
String CONCAT_Q = "-Q"; // 有功功率单位拼接值
String CONCAT_UAB = "-UAB"; // 有功功率单位拼接值
String CONCAT_IA = "-IA"; // 有功功率单位拼接值
// 光伏
String DIRECT_ONE = "direct_one"; // 直流电流1
String DIRECT_TWO = "direct_two"; // 直流电流2
String DIRECT_THREE = "direct_three"; // 直流电流3
String DIRECT_FOUR = "direct_four"; // 直流电流4
String DIRECT_FIVE = "direct_five"; // 直流电流5
String DIRECT_SIX = "direct_six"; // 直流电流6
String DIRECT_SEVEN = "direct_seven"; // 直流电流7
String DIRECT_EIGHT = "direct_eight"; // 直流电流8
String DIRECT_NINE = "direct_nine"; // 直流电流9
String DIRECT_TEN = "direct_ten"; // 直流电流10
String DIRECT_ELEVEN = "direct_eleven"; // 直流电流11
String DIRECT_TWELVE = "direct_twelve"; // 直流电流12
String DC_VOLTAGE_ONE = "dc_voltage_one"; // 直流电压1
String DC_VOLTAGE_TWO = "dc_voltage_two"; // 直流电压2
String DC_VOLTAGE_THREE = "dc_voltage_three"; // 直流电压3
String DC_VOLTAGE_FOUR = "dc_voltage_four"; // 直流电压4
String DC_VOLTAGE_FIVE = "dc_voltage_five"; // 直流电压5
String DC_VOLTAGE_SIX = "dc_voltage_six"; // 直流电压6
String DC_VOLTAGE_SEVEN = "dc_voltage_seven"; // 直流电压7
String DC_VOLTAGE_EIGHT = "dc_voltage_eight"; // 直流电压8
String DC_VOLTAGE_NINE = "dc_voltage_nine"; // 直流电压9
String DC_VOLTAGE_TEN = "dc_voltage_ten"; // 直流电压10
String DC_VOLTAGE_ELEVEN = "dc_voltage_eleven"; // 直流电压11
String DC_VOLTAGE_TWELVE = "dc_voltage_twelve"; // 直流电压12
String SERIES_ONE = "series_one"; // 串流电流1
String SERIES_TWO = "series_two"; // 串流电流2
String SERIES_THREE = "series_three"; // 串流电流3
String SERIES_FOUR = "series_four"; // 串流电流4
String SERIES_FIVE = "series_five"; // 串流电流5
String SERIES_SIX = "series_six"; // 串流电流6
String SERIES_SEVEN = "series_seven"; // 串流电流7
String SERIES_EIGHT = "series_eight"; // 串流电流8
String SERIES_NINE = "series_nine"; // 串流电流9
String SERIES_TEN = "series_ten"; // 串流电流10
String SERIES_ELEVEN = "series_eleven"; // 串流电流11
String SERIES_TWELVE = "series_twelve"; // 串流电流12
String SE_VOLTAGE_ONE = "se_voltage_one"; // 串流电压1
String SE_VOLTAGE_TWO = "se_voltage_two"; // 串流电压2
String SE_VOLTAGE_THREE = "se_voltage_three"; // 串流电压3
String SE_VOLTAGE_FOUR = "se_voltage_four"; // 串流电压4
String SE_VOLTAGE_FIVE = "se_voltage_five"; // 串流电压5
String SE_VOLTAGE_SIX = "se_voltage_six"; // 串流电压6
String SE_VOLTAGE_SEVEN = "se_voltage_seven"; // 串流电压7
String SE_VOLTAGE_EIGHT = "se_voltage_eight"; // 串流电压8
String SE_VOLTAGE_NINE = "se_voltage_nine"; // 串流电压9
String SE_VOLTAGE_TEN = "se_voltage_ten"; // 串流电压10
String SE_VOLTAGE_ELEVEN = "se_voltage_eleven"; // 串流电压11
String SE_VOLTAGE_TWELVE = "se_voltage_twelve"; // 串流电压12
/*==========================================================================================*/
// 设备/厂房参数
/**
* ct
**/
String CT = "ct";
/**
* pt
**/
String PT = "pt";
/**
* 装机容量
**/
String INSTALLED_CAPACITY = "installedCapacity";
/*==========================================================================================*/
/**
* 站点数据配置-有功功率
**/
String P_ATTRIBUTES = "P";
/*==========================================================================================*/
// 光伏电站-电表-物模型监测点标识
/**
* 开关机状态
**/
String PV_JOINT_RELAY = "joint_relay";
/**
* 总有功电度
**/
String PV_GENERATION_CAPACITY = "generation_capacity";
/**
* 日发电量
**/
String PV_GENERATION_DAY = "generate_day";
/**
* 有功功率
**/
String PV_LOAD = "active_power";
/**
* 正向无功
**/
String PV_REACTIVE_POWER = "reactive_power";
/**
* 电压
**/
String PV_VOLTAGE = "voltage";
/**
* 电流
**/
String PV_CURRENT = "current";
/*==========================================================================================*/
// 光伏指标属性
String PHOTOVOLTAIC_OFF = "1.0"; // 开机
String PHOTOVOLTAIC_LOAD_TARGET = "0";
/*==========================================================================================*/
// 水电集团、区域指标关联
/**
* 功率
**/
Integer POWER = 0;
/*==========================================================================================*/
// 水利集团、区域指标关联
/**
* 功率
**/
Integer LOADING = 0;
}

11
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicDeviceVo.java

@ -35,6 +35,10 @@ public class PhotovoltaicDeviceVo {
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double load;
@ApiModelProperty(value = "上次功率: kW")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double lastLoad;
@ApiModelProperty(value = "环比功率")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double loadRatio;
@ -43,11 +47,16 @@ public class PhotovoltaicDeviceVo {
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generate;
@ApiModelProperty(value = "日发电量: kWh")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generateDay;
@ApiModelProperty(value = "环比功率")
@ApiModelProperty(value = "昨日发电量: kWh")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generationYesterday;
@ApiModelProperty(value = "环比发电量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generateDayRatio;

196
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicRealVo.java

@ -51,4 +51,200 @@ public class PhotovoltaicRealVo {
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double lastLoad;
@ApiModelProperty(value = "直流电流1")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double direct_one;
@ApiModelProperty(value = "直流电流2")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double direct_two;
@ApiModelProperty(value = "直流电流3")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double direct_three;
@ApiModelProperty(value = "直流电流4")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double direct_four;
@ApiModelProperty(value = "直流电流5")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double direct_five;
@ApiModelProperty(value = "直流电流6")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double direct_six;
@ApiModelProperty(value = "直流电流7")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double direct_seven;
@ApiModelProperty(value = "直流电流8")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double direct_eight;
@ApiModelProperty(value = "直流电流9")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double direct_nine;
@ApiModelProperty(value = "直流电流10")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double direct_ten;
@ApiModelProperty(value = "直流电流11")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double direct_eleven;
@ApiModelProperty(value = "直流电流12")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double direct_twelve;
@ApiModelProperty(value = "直流电压1")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double dc_voltage_one;
@ApiModelProperty(value = "直流电压2")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double dc_voltage_two;
@ApiModelProperty(value = "直流电压3")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double dc_voltage_three;
@ApiModelProperty(value = "直流电压4")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double dc_voltage_four;
@ApiModelProperty(value = "直流电压5")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double dc_voltage_five;
@ApiModelProperty(value = "直流电压6")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double dc_voltage_six;
@ApiModelProperty(value = "直流电压7")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double dc_voltage_seven;
@ApiModelProperty(value = "直流电压8")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double dc_voltage_eight;
@ApiModelProperty(value = "直流电压9")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double dc_voltage_nine;
@ApiModelProperty(value = "直流电压10")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double dc_voltage_ten;
@ApiModelProperty(value = "直流电压11")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double dc_voltage_eleven;
@ApiModelProperty(value = "直流电压12")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double dc_voltage_twelve;
@ApiModelProperty(value = "直流电流1")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double series_one;
@ApiModelProperty(value = "直流电流2")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double series_two;
@ApiModelProperty(value = "直流电流3")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double series_three;
@ApiModelProperty(value = "直流电流4")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double series_four;
@ApiModelProperty(value = "直流电流5")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double series_five;
@ApiModelProperty(value = "直流电流6")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double series_six;
@ApiModelProperty(value = "直流电流7")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double series_seven;
@ApiModelProperty(value = "直流电流8")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double series_eight;
@ApiModelProperty(value = "直流电流9")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double series_nine;
@ApiModelProperty(value = "直流电流10")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double series_ten;
@ApiModelProperty(value = "直流电流11")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double series_eleven;
@ApiModelProperty(value = "直流电流12")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double series_twelve;
@ApiModelProperty(value = "直流电压1")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double se_voltage_one;
@ApiModelProperty(value = "直流电压2")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double se_voltage_two;
@ApiModelProperty(value = "直流电压3")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double se_voltage_three;
@ApiModelProperty(value = "直流电压4")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double se_voltage_four;
@ApiModelProperty(value = "直流电压5")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double se_voltage_five;
@ApiModelProperty(value = "直流电压6")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double se_voltage_six;
@ApiModelProperty(value = "直流电压7")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double se_voltage_seven;
@ApiModelProperty(value = "直流电压8")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double se_voltage_eight;
@ApiModelProperty(value = "直流电压9")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double se_voltage_nine;
@ApiModelProperty(value = "直流电压10")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double se_voltage_ten;
@ApiModelProperty(value = "直流电压11")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double se_voltage_eleven;
@ApiModelProperty(value = "直流电压12")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double se_voltage_twelve;
}

21
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/PhotovoltaicStationVo.java

@ -50,10 +50,22 @@ public class PhotovoltaicStationVo {
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double load;
@ApiModelProperty(value = "环比功率")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double loadRatio;
@ApiModelProperty(value = "日发电量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generateDay;
@ApiModelProperty(value = "昨日发电量: kWh")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generationYesterday;
@ApiModelProperty(value = "环比发电量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generateDayRatio;
@ApiModelProperty(value = "月发电量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Double generateMon;
@ -81,9 +93,12 @@ public class PhotovoltaicStationVo {
@ApiModelProperty(value = "发电排行")
private List<PhotovoltaicDeviceVo> devices;
@ApiModelProperty(value = "年发电量完成百分比")
private List<PowerYearVo> generateSurvey;
@ApiModelProperty(value = "设备信息")
private List<PhotovoltaicDeviceChartsVo> charts;
@ApiModelProperty(value = "当日机组有功功率")
private List<PhotovoltaicPowerVo> activePowerVoList;
@ApiModelProperty(value = "近30天用电量")
private List<GenerationPowerVo> generationPowerVoList;
}

8
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.fasterxml.jackson.core.type.TypeReference;
import com.hnac.hzims.operational.alert.constants.AbnormalAlarmConstant;
import com.hnac.hzims.operational.alert.entity.AlarmHandleEntity;
import com.hnac.hzims.operational.alert.entity.HistoryAbnormalAlarmEntity;
@ -23,6 +24,7 @@ import com.hnac.hzinfo.datasearch.soe.domian.SoeData;
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.core.utils.JsonUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import net.logstash.logback.encoder.org.apache.commons.lang3.ObjectUtils;
@ -231,12 +233,13 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl<HistoryAbno
}*/
// condition.setEndTime(LocalDateTime.now());
// FIXME 测试使用时间
condition.setBeginTime(LocalDateTime.parse("2023-02-01 00:00:00", format));
condition.setEndTime(LocalDateTime.parse("2023-02-27 00:00:00", format));
condition.setBeginTime(LocalDateTime.parse("2023-03-22 10:06:38", format));
condition.setEndTime(LocalDateTime.parse("2023-03-24 16:06:38", format));
condition.setNeedPage(true);
condition.setPage(param.getCurrent());
condition.setLimit(param.getSize());
condition.setStationIds(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()));
//condition.setStationIds(Collections.singletonList("901900000234"));
condition.setTypes(Arrays.asList(param.getType().split(",")));
Result<HzPage<SoeData>> result = alarmClient.getByStationsAndTime(condition);
if(!result.isSuccess() || ObjectUtil.isEmpty(result.getData()) || CollectionUtil.isEmpty(result.getData().getRecords())){
@ -277,6 +280,7 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl<HistoryAbno
return response;
}
/**
* 获取处理数据ID集合
* @return

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/scheduled/StAlamRecordTask.java

@ -10,9 +10,10 @@ import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.Date;
import static com.hnac.hzims.operational.main.constant.MainConstants.*;
/**

7
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/scheduled/ScheduledCreateTask.java

@ -169,9 +169,10 @@ public class ScheduledCreateTask {
* 获取站点近3年发电量数据
* @return ReturnT<String>
*/
@XxlJob(ELECTRICITY_GENERATION_RECENT_YEAR)
//@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> powerGenerationRecentYear(String param) throws Exception {
//@XxlJob(ELECTRICITY_GENERATION_RECENT_YEAR)
@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> powerGenerationRecentYear() throws Exception {
String param = "";
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}

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

@ -44,12 +44,6 @@ public interface IHomePageService {
List<Dept> getChildArea(List<Dept> departList, Long deptId,List<Dept> list);
float getPowerGeneration(List<EminfoAndEmParamVo> list, String startTime, String endTime,Integer cycleType);
float getEmInfoPower(EminfoAndEmParamVo em, String startTime, String endTime,Integer cycleType);
float getAnalyzeCodeAndSignages(EminfoAndEmParamVo em, String startTime, String endTime, Integer cycleType, String signages);
List<PowerMonthVo> planActualTrend(Long deptId);
List<AreaVo> homeStation(Long deptId);

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

@ -21,10 +21,7 @@ import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Random;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -128,7 +125,7 @@ public class AnalyseDataServiceImpl implements IAnalyseDataService {
if (ObjectUtil.isEmpty(analyseDataTaosVO) || StringUtil.isBlank(analyseDataTaosVO.getVal())) {
return 0f;
}
return Float.parseFloat(analyseDataTaosVO.getVal()) * ride;
return Float.parseFloat(Optional.ofNullable(analyseDataTaosVO.getVal()).orElse("0")) * ride;
}

158
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomePageServiceImpl.java

@ -3,7 +3,6 @@ package com.hnac.hzims.operational.main.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hnac.hzims.EquipmentConstants;
import com.hnac.hzims.equipment.entity.PlanGenerationEntity;
import com.hnac.hzims.equipment.feign.IPlanGenertionClient;
import com.hnac.hzims.equipment.vo.EmInfoExtendVo;
@ -11,23 +10,19 @@ import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo;
import com.hnac.hzims.monitor.utils.DateUtils;
import com.hnac.hzims.operational.fill.entity.*;
import com.hnac.hzims.operational.fill.service.*;
import com.hnac.hzims.operational.main.constant.HomePageConstant;
import com.hnac.hzims.operational.main.service.IAnalyseDataService;
import com.hnac.hzims.operational.main.service.IHomePageService;
import com.hnac.hzims.operational.main.service.IMainSystemMonitoringService;
import com.hnac.hzims.operational.main.service.IMainTaskStatisticService;
import com.hnac.hzims.operational.main.vo.*;
import com.hnac.hzims.operational.main.constant.HomePageConstant;
import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.service.IStationService;
import com.hnac.hzims.ticket.allTicket.fegin.ITicketInfoAllClient;
import com.hnac.hzims.ticket.allTicket.vo.DoublePassRateVO;
import com.hnac.hzims.ticket.allTicket.vo.DoublePassVO;
import com.hnac.hzinfo.datasearch.analyse.IAnalyseDataSearchClient;
import com.hnac.hzinfo.datasearch.analyse.IAnalyseInstanceClient;
import com.hnac.hzinfo.datasearch.analyse.po.AnalyseCodeByAnalyseDataPO;
import com.hnac.hzinfo.datasearch.analyse.po.AnalyzeDataConditionPO;
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyseDataTaosVO;
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeDataConditionVO;
import com.hnac.hzinfo.datasearch.soe.ISoeClient;
import com.hnac.hzinfo.datasearch.soe.domian.SoeData;
import com.hnac.hzinfo.sdk.core.response.Result;
@ -70,7 +65,6 @@ import java.util.stream.Collectors;
@Slf4j
public class HomePageServiceImpl implements IHomePageService {
private final IAnalyseDataService analyseDataService;
private final IPlanGenertionClient planGenertionClient;
private final IMainSystemMonitoringService maintenanceTaskService;
@ -229,7 +223,7 @@ public class HomePageServiceImpl implements IHomePageService {
List<StationEntity> stationList = stationService.getStationType(serveType, types, null);
// 设备信息
List<EminfoAndEmParamVo> devices = maintenanceTaskService.getEmInfoList();
// 开始事件
// 开始时间
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.MONTH, -calendar.get(Calendar.MONTH) + 12);
calendar.add(Calendar.DATE, -calendar.get(Calendar.DATE) + 1);
@ -390,18 +384,26 @@ public class HomePageServiceImpl implements IHomePageService {
double installedCapacity = getInstalledCapacity(equipmentInfoList, station);
powerStationTotalVo.setInstalledCapacity(installedCapacity);
// 当月发电量
String startTime = DateUtil.format(new Date(),"yyyy-MM") + "-01 00:00:00";
String endTime = DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME);
float powerGeneration = this.getPowerGeneration(effEmInfoList, startTime, endTime,EquipmentConstants.CycleTypeEnum.MONTH_CYCLE.getType());
String start = DateUtil.format(new Date(),"yyyy-MM") + "-01 00:00:00";
String end = DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME);
float powerGeneration = this.generateByDevices(effEmInfoList, start, end,5);
powerStationTotalVo.setPowerGeneration((double)powerGeneration);
// 计划发电量
double plannedPowerGeneration = this.getPlannedPowerGeneration(planGenerationEntityList, station);
powerStationTotalVo.setPlannedPowerGeneration(plannedPowerGeneration);
// 当年发电量
float currentYearPowerGeneration = getPlannedYearGeneration(effEmInfoList);
end = DateUtil.format(new Date(),DateUtil.PATTERN_DATE);
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.MINUTE,-calendar.get(Calendar.MINUTE));
calendar.add(Calendar.DAY_OF_MONTH,-calendar.get(Calendar.DAY_OF_MONTH));
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));
start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE);
float currentYearPowerGeneration = this.generateByDevices(effEmInfoList, start+ " 00:00:00", end + " 00:00:00",6);;
powerStationTotalVo.setCurrentYearPowerGeneration(currentYearPowerGeneration);
// 当日发电量
float currentDayPowerGeneration = getPowerGeneration(effEmInfoList, getCurrentTime() + " 00:00:00", getAddDayTime(1) + " 00:00:00",EquipmentConstants.CycleTypeEnum.DAY_CYCLE.getType());
float currentDayPowerGeneration = this.generateByDevices(effEmInfoList, getCurrentTime() + " 00:00:00", getAddDayTime(1) + " 00:00:00",3);
powerStationTotalVo.setCurrentDayPowerGeneration(currentDayPowerGeneration);
// 告警列表
Result<List<SoeData>> S = soeClient.getByLastLimitTime(null, station.getCode(), 1);
@ -413,6 +415,24 @@ public class HomePageServiceImpl implements IHomePageService {
}
/**
* 获取设备发电量
* @param devices
* @param start
* @param end
* @return
*/
private float generateByDevices(List<EminfoAndEmParamVo> devices, String start, String end,int accessRules) {
float generate = 0f;
if(CollectionUtil.isEmpty(devices)){
return generate;
}
for(EminfoAndEmParamVo device : devices ){
generate += analyseDataService.periodTargetFloat(start,end,accessRules,5,device.getEmCode(),device.getRideCount(),HomePageConstant.HYDROPOWER_GENERATE_POWER);
};
return generate;
}
/**
* 获取站点装机容量
*
* @param equipmentInfoList
@ -446,96 +466,6 @@ public class HomePageServiceImpl implements IHomePageService {
/**
* 获取发电量
*
* @param list
* @param startTime
* @param endTime
* @return
*/
@Override
public float getPowerGeneration(List<EminfoAndEmParamVo> list, String startTime, String endTime,Integer cycleType) {
float allPower = 0F;
for (EminfoAndEmParamVo em : list) {
float power = this.getEmInfoPower(em, startTime, endTime,cycleType);
allPower += power;
}
return allPower;
}
/**
* 获取发电量
*
* @param em
* @param startTime
* @param endTime
* @return
*/
@Override
public float getEmInfoPower(EminfoAndEmParamVo em, String startTime, String endTime,Integer cycleType) {
return this.getAnalyzeCodeAndSignages(em,startTime,endTime,cycleType,GENERATE_ELECTRICITY);
}
/**
*
* @param em
* @param startTime
* @param endTime
* @param cycleType
* @param signages
* @return
*/
@Override
public float getAnalyzeCodeAndSignages(EminfoAndEmParamVo em, String startTime, String endTime, Integer cycleType, String signages) {
// FIXME 光伏测试
Random random = new Random();
return random.nextFloat() * 250000;
/*// 发电量
float aFloat = 0F;
AnalyseCodeByAnalyseDataPO po = new AnalyseCodeByAnalyseDataPO();
List<AnalyzeDataConditionPO> signboardConditions = new ArrayList<>();
AnalyzeDataConditionPO analyzeDataConditionPO = new AnalyzeDataConditionPO();
analyzeDataConditionPO.setFull(1);
analyzeDataConditionPO.setSignages(signages);
// 取数规则: 0=(整点值/最早值)、1=最大值、2=最小值、3=平均值、4=(累计值/和值)、5=(变化值/差值) 6=最新值
analyzeDataConditionPO.setAccessRules(EquipmentConstants.AccessRulesEnum.DIFF_CYCLE.getType());
// 周期类型: 0-> s(秒) 1->、m(分)、2->h(小时)3->、d(天)4->、w(周)5->、n(自然月)、6->y(自然年)
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.setDeviceCode(em.getEmCode());
po.setSignboardConditions(signboardConditions);
R<List<AnalyzeDataConditionVO>> analyzeData = analyseDataSearchClient.getAnalyzeDataByAnalyzeCodeAndSignages(po);
if (!analyzeData.isSuccess() || CollectionUtil.isEmpty(analyzeData.getData())) {
return aFloat;
}
List<AnalyzeDataConditionVO> records = analyzeData.getData();
AnalyzeDataConditionVO analyzeDataConditionVO = records.get(0);
if (ObjectUtil.isEmpty(analyzeDataConditionVO)) {
return aFloat;
}
List<AnalyseDataTaosVO> analyseDataTaosVOList = analyzeDataConditionVO.getList();
if (CollectionUtil.isEmpty(analyseDataTaosVOList)) {
return aFloat;
}
AnalyseDataTaosVO analyseDataTaosVO = analyzeDataConditionVO.getList().get(0);
if (ObjectUtil.isEmpty(analyseDataTaosVO) || StringUtil.isBlank(analyseDataTaosVO.getVal())) {
return aFloat;
}
float childFloat = Float.parseFloat(analyseDataTaosVO.getVal());
if (0 != em.getRideCount()) {
//获取发电量的值 且 * rideCount
aFloat = childFloat * em.getRideCount();
} else {
aFloat = childFloat;
}
return aFloat;*/
}
/**
* 年计划发电完成趋势
* @param deptId
* @return
@ -641,27 +571,6 @@ public class HomePageServiceImpl implements IHomePageService {
return planFloat;
}
/**
* 查询站点当年实际发电量
*
* @param effEmInfoList
* @return
*/
private float getPlannedYearGeneration(List<EminfoAndEmParamVo> effEmInfoList) {
Calendar calendar = Calendar.getInstance();
//记得要+1
int month = calendar.get(Calendar.MONTH) + 1;
List<String> monList = this.getMonthList(0, month,true);
float power = 0f;
for (int i = 0; i < monList.size() - 1; i++) {
float monthPower = getPowerGeneration(effEmInfoList, monList.get(i) + " 00:00:00", monList.get(i + 1) + " 00:00:00",EquipmentConstants.CycleTypeEnum.MONTH_CYCLE.getType());
power = power + monthPower;
}
return power;
}
/**
* 关键指标 - 发电站
*
@ -1498,7 +1407,6 @@ public class HomePageServiceImpl implements IHomePageService {
}
/**
* 获取近年月份集合
* @param year

2936
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/PhotovoltaicServiceImpl.java

File diff suppressed because it is too large Load Diff

27
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/SideHustleServiceImpl.java

@ -72,6 +72,8 @@ import java.util.stream.Collectors;
public class SideHustleServiceImpl implements ISideHustleService {
@NotNull
private final IAnalyseDataService analyseDataService;
@NotNull
private final IHomePageService homePageService;
@NotNull
private final IStationService stationService;
@ -488,13 +490,12 @@ public class SideHustleServiceImpl implements ISideHustleService {
return;
}
// 区域站点下设备
List<EminfoAndEmParamVo> valid = deviceList.stream().filter(o->deptList.contains(o.getCreateDept())).collect(Collectors.toList());
if(CollectionUtil.isEmpty(valid)){
List<EminfoAndEmParamVo> devices = deviceList.stream().filter(o->deptList.contains(o.getCreateDept())).collect(Collectors.toList());
if(CollectionUtil.isEmpty(devices)){
return;
}
// 获取当班时间内发电量
SimpleDateFormat sdf = new SimpleDateFormat(DateUtil.PATTERN_DATETIME);
float generatingCapacity = homePageService.getPowerGeneration(valid,sdf.format(startDate),sdf.format(endDate),EquipmentConstants.CycleTypeEnum.DAY_CYCLE.getType());
float generatingCapacity = this.generateByDuty(devices,startDate,endDate);
// 是否为查询上一班组发电量
if(flag){
NextDutyInfoVo upDutyInfoVo = areaDutyVo.getUpDutyInfoVo();
@ -505,6 +506,24 @@ public class SideHustleServiceImpl implements ISideHustleService {
areaDutyVo.setGeneratingCapacity(generatingCapacity);
}
/**
* 根据当班时间查询发电量
* @param devices
* @param startDate
* @param endDate
* @return
*/
private float generateByDuty(List<EminfoAndEmParamVo> devices, Date start, Date end) {
float generate = 0f;
if(CollectionUtil.isEmpty(devices)){
return generate;
}
for(EminfoAndEmParamVo device : devices ){
generate += analyseDataService.periodTargetFloat(DateUtil.format(start,DateUtil.PATTERN_DATETIME),DateUtil.format(end,DateUtil.PATTERN_DATETIME),3,5,device.getEmCode(),device.getRideCount(),HomePageConstant.HYDROPOWER_GENERATE_POWER);
};
return generate;
}
/**
* 当班双票

82
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WaterServiceImpl.java

@ -60,6 +60,8 @@ import java.util.stream.Collectors;
@RequiredArgsConstructor
public class WaterServiceImpl implements IWaterService {
private final IAnalyseDataService analyseDataService;
private final IHomePageService homePageService;
private final IStationService stationService;
@ -571,13 +573,13 @@ public class WaterServiceImpl implements IWaterService {
*/
private float getUsrPowerYear(EminfoAndEmParamVo device) {
Calendar calendar = Calendar.getInstance();
String endTime = sdf.format(calendar.getTime());
String end = sdf.format(calendar.getTime());
calendar.setTime(new Date());
calendar.add(Calendar.MONTH, -calendar.get(Calendar.MONTH));
calendar.add(Calendar.DATE, -calendar.get(Calendar.DATE) + 1);
String startTime = df.format(calendar.getTime());
String start = df.format(calendar.getTime());
// 当年用电量
return homePageService.getAnalyzeCodeAndSignages(device,startTime + " 00:00:00",endTime,EquipmentConstants.CycleTypeEnum.YEAR_CYCLE.getType(),HomePageConstant.ELECTRICITY_CONSUMPTION);
return analyseDataService.periodTargetFloat(start,end,6,5,device.getEmCode(),device.getRideCount(),HomePageConstant.ELECTRICITY_CONSUMPTION);
}
/**
@ -586,10 +588,10 @@ public class WaterServiceImpl implements IWaterService {
* @return
*/
private float getUsrPowerMon(EminfoAndEmParamVo device) {
String startTime = DateUtil.format(new Date(), "yyyy-MM") + "-01 00:00:00";
String endTime = DateUtil.format(new Date(), DateUtil.PATTERN_DATETIME);
String start = DateUtil.format(new Date(), "yyyy-MM") + "-01 00:00:00";
String end = DateUtil.format(new Date(), DateUtil.PATTERN_DATETIME);
// 当月用电量
return homePageService.getAnalyzeCodeAndSignages(device,startTime,endTime,EquipmentConstants.CycleTypeEnum.MONTH_CYCLE.getType(),HomePageConstant.ELECTRICITY_CONSUMPTION);
return analyseDataService.periodTargetFloat(start,end,5,5,device.getEmCode(),device.getRideCount(),HomePageConstant.ELECTRICITY_CONSUMPTION);
}
/**
@ -598,10 +600,9 @@ public class WaterServiceImpl implements IWaterService {
* @return
*/
private float getUsrPowerDay(EminfoAndEmParamVo device) {
Calendar cal = Calendar.getInstance();
String time = df.format(cal.getTime());
String time = DateUtil.format(new Date(),DateUtil.PATTERN_DATE);
// 当日用电量
return homePageService.getAnalyzeCodeAndSignages(device,time + " 00:00:00",time + " 23:59:59",EquipmentConstants.CycleTypeEnum.DAY_CYCLE.getType(),HomePageConstant.ELECTRICITY_CONSUMPTION);
return analyseDataService.periodTargetFloat(time + " 00:00:00",time + " 23:59:59",3,5,device.getEmCode(),device.getRideCount(),HomePageConstant.ELECTRICITY_CONSUMPTION);
}
@ -751,40 +752,51 @@ public class WaterServiceImpl implements IWaterService {
* @return
*/
private List<UsrPowerVo> getUsrPowerVoList(EminfoAndEmParamVo device) {
List<UsrPowerVo> usrPowerVoList = new ArrayList<>();
// 近30天日期集合
List<String> dayList = this.getRecent30Day();
for (int i = 0; i < dayList.size() - 1; i++) {
UsrPowerVo usrPowerVo = new UsrPowerVo();
usrPowerVo.setDate(dayList.get(i));
// 某天用电量
float power = homePageService.getAnalyzeCodeAndSignages(device, dayList.get(i) + " 00:00:00", dayList.get(i + 1) + " 00:00:00",EquipmentConstants.CycleTypeEnum.DAY_CYCLE.getType(),HomePageConstant.ELECTRICITY_CONSUMPTION);
usrPowerVo.setUsrPower(power);
usrPowerVoList.add(usrPowerVo);
}
return usrPowerVoList;
String start = DateUtil.format(new Date(),DateUtil.PATTERN_DATE);
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DAY_OF_MONTH,-29);
String end = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE);
List<AnalyseDataTaosVO> records = analyseDataService.periodTargetData(start,end,EquipmentConstants.CycleTypeEnum.DAY_CYCLE.getType(),5,device.getEmCode(),HomePageConstant.ELECTRICITY_CONSUMPTION);
if(CollectionUtil.isEmpty(records)){
return new ArrayList<>();
}
return records.stream().map(record -> {
UsrPowerVo usr = new UsrPowerVo();
Date time = DateUtil.parse(record.getTs(), "yyyy-MM-dd HH:mm:ss.s");
usr.setDate(DateUtil.format(time,DateUtil.PATTERN_DATE));
usr.setUsrPower(Float.valueOf(Optional.ofNullable(record.getVal()).orElse("0")));
return usr;
}).collect(Collectors.toList());
}
/**
* 近3年发电量
*
* @param device
* @return
*/
private Map<String, Float> getUsrYearMap(EminfoAndEmParamVo device) {
// 返回map
Map<String, Float> usrYearMap = new HashMap<>();
// 获取需要遍历月份
List<String> monList = homePageService.getMonthList(2, 12,true);
for (int i = 0; i < monList.size() - 1; i++) {
if (homePageService.compareDate(monList.get(i))) {
usrYearMap.put(monList.get(i), 0f);
continue;
}
// 设备某月用电量
float power = homePageService.getAnalyzeCodeAndSignages(device, monList.get(i) + " 00:00:00", monList.get(i + 1) + " 00:00:00",EquipmentConstants.CycleTypeEnum.MONTH_CYCLE.getType(),HomePageConstant.ELECTRICITY_CONSUMPTION);
usrYearMap.put(monList.get(i), power);
}
return usrYearMap;
// 开始时间
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.MONTH, -calendar.get(Calendar.MONTH) + 12);
calendar.add(Calendar.DATE, -calendar.get(Calendar.DATE) + 1);
String end = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE) + " 00:00:00";
// 结束日期
calendar.set(Calendar.YEAR, calendar.get(Calendar.YEAR) - 3);
calendar.add(Calendar.MONTH, -calendar.get(Calendar.MONTH));
String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE) + " 00:00:00";
// 查询数据
List<AnalyseDataTaosVO> records = analyseDataService.periodTargetData(start,end,5,5,device.getEmCode(),HomePageConstant.HYDROPOWER_GENERATE_POWER);
if(CollectionUtil.isEmpty(records)){
return new HashMap<>();
}
return records.stream().map(record -> {
PowerMonthVo generate = new PowerMonthVo();
Date time = DateUtil.parse(record.getTs(), "yyyy-MM-dd HH:mm:ss.s");
generate.setStrMonth(DateUtil.format(time, DateUtil.PATTERN_DATE));
generate.setPower(Float.valueOf(Optional.ofNullable(record.getVal()).orElse("0")) * device.getRideCount());
return generate;
}).collect(Collectors.toMap(PowerMonthVo::getStrMonth,PowerMonthVo::getPower));
}

83
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/WebHomeServiceImpl.java

@ -15,6 +15,7 @@ import com.hnac.hzims.operational.main.constant.HomePageConstant;
import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.service.IStationAttributeService;
import com.hnac.hzims.operational.station.service.IStationService;
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyseDataTaosVO;
import com.hnac.hzinfo.datasearch.soe.ISoeClient;
import com.hnac.hzinfo.datasearch.soe.domian.SoeData;
import lombok.RequiredArgsConstructor;
@ -44,6 +45,8 @@ import java.util.stream.Collectors;
@RequiredArgsConstructor
public class WebHomeServiceImpl implements IWebHomeService {
private final IAnalyseDataService analyseDataService;
private final IHomePageService homePageService;
private final IMainSystemMonitoringService maintenanceTaskService;
@ -70,10 +73,6 @@ public class WebHomeServiceImpl implements IWebHomeService {
private final static String load_hydropower_unit_target_key = "hzims:operation:loadhydropowerunit:target:key";
private final static String loadwater_level_key = "hzims:operation:loadwater:level:key";
// 日期格式化yyyy-mm-dd
private final SimpleDateFormat df = new SimpleDateFormat(DateUtil.PATTERN_DATE);
// 日期格式化yyyy-mm-dd
private final SimpleDateFormat sdf = new SimpleDateFormat(DateUtil.PATTERN_DATETIME);
/**
* 加载水电站机组实时数据
@ -275,37 +274,36 @@ public class WebHomeServiceImpl implements IWebHomeService {
* @return
*/
private float getGenerationPower(EminfoAndEmParamVo device,int scope) {
String startTime,endTime;
int cycle;
String start,end;
int accessRules;
Calendar calendar = Calendar.getInstance();
switch (scope){
// 年
case 0:
Calendar calendar = Calendar.getInstance();
endTime = sdf.format(calendar.getTime());
end = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME);
calendar.setTime(new Date());
calendar.add(Calendar.MONTH, -calendar.get(Calendar.MONTH));
calendar.add(Calendar.DATE, -calendar.get(Calendar.DATE) + 1);
startTime = df.format(calendar.getTime()) + " 00:00:00";
cycle = EquipmentConstants.CycleTypeEnum.YEAR_CYCLE.getType();
start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE) + " 00:00:00";
accessRules = EquipmentConstants.CycleTypeEnum.YEAR_CYCLE.getType();
break;
// 月
case 1:
startTime = DateUtil.format(new Date(), "yyyy-MM") + "-01 00:00:00";
endTime = DateUtil.format(new Date(), DateUtil.PATTERN_DATETIME);
cycle = EquipmentConstants.CycleTypeEnum.MONTH_CYCLE.getType();
start = DateUtil.format(new Date(), "yyyy-MM") + "-01 00:00:00";
end = DateUtil.format(new Date(), DateUtil.PATTERN_DATETIME);
accessRules = EquipmentConstants.CycleTypeEnum.MONTH_CYCLE.getType();
break;
// 日
case 2:
Calendar cal = Calendar.getInstance();
String time = df.format(cal.getTime());
startTime = time + " 00:00:00";
endTime = time + " 23:59:59";
cycle = EquipmentConstants.CycleTypeEnum.DAY_CYCLE.getType();
String time = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE);
start = time + " 00:00:00";
end = time + " 23:59:59";
accessRules = EquipmentConstants.CycleTypeEnum.DAY_CYCLE.getType();
break;
default:
throw new IllegalStateException("Unexpected value: " + scope);
}
return homePageService.getAnalyzeCodeAndSignages(device,startTime,endTime,cycle,HomePageConstant.HYDROPOWER_GENERATE_POWER);
return analyseDataService.periodTargetFloat(start,end,accessRules,5,device.getEmCode(),device.getRideCount(),HomePageConstant.HYDROPOWER_GENERATE_POWER);
}
/**
@ -314,40 +312,21 @@ public class WebHomeServiceImpl implements IWebHomeService {
* @return
*/
private List<GenerationPowerVo> getGenerationPowerList(EminfoAndEmParamVo device) {
List<GenerationPowerVo> generationPowerVoList = new ArrayList<>();
// 近30天日期集合
List<String> dayList = this.getRecent30Day();
for (int i = 0; i < dayList.size() - 1; i++) {
GenerationPowerVo generationPowerVo = new GenerationPowerVo();
generationPowerVo.setDate(dayList.get(i));
// 某天发电量
float power = homePageService.getAnalyzeCodeAndSignages(device, dayList.get(i) + " 00:00:00", dayList.get(i + 1) + " 00:00:00",EquipmentConstants.CycleTypeEnum.DAY_CYCLE.getType(),HomePageConstant.HYDROPOWER_GENERATE_POWER);
generationPowerVo.setGenerate(power);
generationPowerVoList.add(generationPowerVo);
}
return generationPowerVoList;
}
/**
* 获取近30天集合
* @return
*/
private List<String> getRecent30Day() {
List<String> list = new ArrayList<>();
// 开始日期
String start = DateUtil.format(new Date(),DateUtil.PATTERN_DATE);
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
calendar.add(Calendar.DATE, + 1);
list.add(df.format(calendar.getTime()));
// 获取日期之间的月
int i = 0;
while (i < 30) {
calendar.add(Calendar.DATE, - 1);
list.add(df.format(calendar.getTime()));
i++;
}
return list.stream().sorted(Comparator.comparing(String::valueOf)).collect(Collectors.toList());
calendar.add(Calendar.DAY_OF_MONTH,-29);
String end = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE);
List<AnalyseDataTaosVO> records = analyseDataService.periodTargetData(start,end,EquipmentConstants.CycleTypeEnum.DAY_CYCLE.getType(),5,device.getEmCode(),HomePageConstant.HYDROPOWER_GENERATE_POWER);
if(CollectionUtil.isEmpty(records)){
return new ArrayList<>();
}
return records.stream().map(record -> {
GenerationPowerVo generate = new GenerationPowerVo();
Date time = DateUtil.parse(record.getTs(), "yyyy-MM-dd HH:mm:ss.s");
generate.setDate(DateUtil.format(time,DateUtil.PATTERN_DATE));
generate.setGenerate(Float.valueOf(Optional.ofNullable(record.getVal()).orElse("0")));
return generate;
}).collect(Collectors.toList());
}
/**

Loading…
Cancel
Save