From 4bb23a7c75d88916ed1f2f693842ed8ff460d9ba Mon Sep 17 00:00:00 2001 From: mashili Date: Fri, 4 Jul 2025 12:37:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A5=89=E8=B4=A4=E7=94=B5=E8=A1=A8=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=8E=A5=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ems/EmsSiteConfigController.java | 5 +- .../common/constant/RedisKeyConstants.java | 5 + .../com/xzzn/ems/domain/EmsAmmeterData.java | 1411 ++++++++++++++++- .../java/com/xzzn/ems/domain/EmsPcsData.java | 4 +- .../ems/domain/vo/AmmeterDataDetailInfo.java | 10 +- .../xzzn/ems/mapper/EmsAmmeterDataMapper.java | 4 +- .../impl/FXXDataProcessServiceImpl.java | 205 ++- .../service/impl/SingleSiteServiceImpl.java | 60 +- .../mapper/ems/EmsAmmeterDataMapper.xml | 513 +++++- 9 files changed, 2093 insertions(+), 124 deletions(-) diff --git a/ems-admin/src/main/java/com/xzzn/web/controller/ems/EmsSiteConfigController.java b/ems-admin/src/main/java/com/xzzn/web/controller/ems/EmsSiteConfigController.java index be2e0e2..0ff205f 100644 --- a/ems-admin/src/main/java/com/xzzn/web/controller/ems/EmsSiteConfigController.java +++ b/ems-admin/src/main/java/com/xzzn/web/controller/ems/EmsSiteConfigController.java @@ -1,6 +1,7 @@ package com.xzzn.web.controller.ems; import com.xzzn.common.core.controller.BaseController; +import com.xzzn.common.core.domain.AjaxResult; import com.xzzn.common.core.page.TableDataInfo; import com.xzzn.ems.domain.EmsDevicesSetting; import com.xzzn.ems.domain.EmsSiteSetting; @@ -56,8 +57,8 @@ public class EmsSiteConfigController extends BaseController{ * 获取设备详细信息 */ @GetMapping("/getDeviceDetailInfo") - public EmsDevicesSetting getDeviceDetailInfo(@RequestParam String deviceId) + public AjaxResult getDeviceDetailInfo(@RequestParam String deviceId) { - return iEmsDeviceSettingService.getDeviceDetailInfo(deviceId); + return success(iEmsDeviceSettingService.getDeviceDetailInfo(deviceId)); } } diff --git a/ems-common/src/main/java/com/xzzn/common/constant/RedisKeyConstants.java b/ems-common/src/main/java/com/xzzn/common/constant/RedisKeyConstants.java index 79cd77f..986830b 100644 --- a/ems-common/src/main/java/com/xzzn/common/constant/RedisKeyConstants.java +++ b/ems-common/src/main/java/com/xzzn/common/constant/RedisKeyConstants.java @@ -31,4 +31,9 @@ public class RedisKeyConstants * battery单体电池数据 redis key */ public static final String BATTERY = "BATTERY_"; + + /** + * 电表数据 redis key + */ + public static final String AMMETER = "AMMETER_"; } diff --git a/ems-system/src/main/java/com/xzzn/ems/domain/EmsAmmeterData.java b/ems-system/src/main/java/com/xzzn/ems/domain/EmsAmmeterData.java index 7509603..b3b6b61 100644 --- a/ems-system/src/main/java/com/xzzn/ems/domain/EmsAmmeterData.java +++ b/ems-system/src/main/java/com/xzzn/ems/domain/EmsAmmeterData.java @@ -12,7 +12,7 @@ import com.xzzn.common.annotation.Excel; * 总数据对象 ems_ammeter_data * * @author xzzn - * @date 2025-06-29 + * @date 2025-07-03 */ public class EmsAmmeterData extends BaseEntity { @@ -22,33 +22,245 @@ public class EmsAmmeterData extends BaseEntity private Long id; /** 数据更新时间 */ - @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "数据更新时间", width = 30, dateFormat = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "数据更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date dataUpdateTime; - /** 类别 */ - @Excel(name = "类别") - private String category; + /** 当前组合有功总电能 */ + @Excel(name = "当前组合有功总电能") + private BigDecimal currentCombActiveTotal; - /** 总 (kWh) */ - @Excel(name = "总 (kWh)") - private BigDecimal totalKwh; + /** 当前组合有功尖电能 */ + @Excel(name = "当前组合有功尖电能") + private BigDecimal currentCombActivePeak; - /** 尖 (kWh) */ - @Excel(name = "尖 (kWh)") - private BigDecimal sharpKwh; + /** 当前组合有功峰电能 */ + @Excel(name = "当前组合有功峰电能") + private BigDecimal currentCombActiveHigh; - /** 峰 (kWh) */ - @Excel(name = "峰 (kWh)") - private BigDecimal peakKwh; + /** 当前组合有功平电能 */ + @Excel(name = "当前组合有功平电能") + private BigDecimal currentCombActiveFlat; - /** 平 (kWh) */ - @Excel(name = "平 (kWh)") - private BigDecimal flatKwh; + /** 当前组合有功谷电能 */ + @Excel(name = "当前组合有功谷电能") + private BigDecimal currentCombActiveValley; - /** 谷 (kWh) */ - @Excel(name = "谷 (kWh)") - private BigDecimal valleyKwh; + /** 当前正向总有功电能 */ + @Excel(name = "当前正向总有功电能") + private BigDecimal currentForwardActiveTotal; + + /** 当前正向有功尖电能 */ + @Excel(name = "当前正向有功尖电能") + private BigDecimal currentForwardActivePeak; + + /** 当前正向有功峰电能 */ + @Excel(name = "当前正向有功峰电能") + private BigDecimal currentForwardActiveHigh; + + /** 当前正向有功平电能 */ + @Excel(name = "当前正向有功平电能") + private BigDecimal currentForwardActiveFlat; + + /** 当前正向有功谷电能 */ + @Excel(name = "当前正向有功谷电能") + private BigDecimal currentForwardActiveValley; + + /** 当前反向总有功电能 */ + @Excel(name = "当前反向总有功电能") + private BigDecimal currentReverseActiveTotal; + + /** 当前反向有功尖电能 */ + @Excel(name = "当前反向有功尖电能") + private BigDecimal currentReverseActivePeak; + + /** 当前反向有功峰电能 */ + @Excel(name = "当前反向有功峰电能") + private BigDecimal currentReverseActiveHigh; + + /** 当前反向有功平电能 */ + @Excel(name = "当前反向有功平电能") + private BigDecimal currentReverseActiveFlat; + + /** 当前反向有功谷电能 */ + @Excel(name = "当前反向有功谷电能") + private BigDecimal currentReverseActiveValley; + + /** 当前组合无功总电能 */ + @Excel(name = "当前组合无功总电能") + private BigDecimal currentCombReactiveTotal; + + /** 当前组合无功尖电能 */ + @Excel(name = "当前组合无功尖电能") + private BigDecimal currentCombReactivePeak; + + /** 当前组合无功峰电能 */ + @Excel(name = "当前组合无功峰电能") + private BigDecimal currentCombReactiveHigh; + + /** 当前组合无功平电能 */ + @Excel(name = "当前组合无功平电能") + private BigDecimal currentCombReactiveFlat; + + /** 当前组合无功谷电能 */ + @Excel(name = "当前组合无功谷电能") + private BigDecimal currentCombReactiveValley; + + /** 当前正向总无功电能 */ + @Excel(name = "当前正向总无功电能") + private BigDecimal currentForwardReactiveTotal; + + /** 当前正向无功尖电能 */ + @Excel(name = "当前正向无功尖电能") + private BigDecimal currentForwardReactivePeak; + + /** 当前正向无功峰电能 */ + @Excel(name = "当前正向无功峰电能") + private BigDecimal currentForwardReactiveHigh; + + /** 当前正向无功平电能 */ + @Excel(name = "当前正向无功平电能") + private BigDecimal currentForwardReactiveFlat; + + /** 当前正向无功谷电能 */ + @Excel(name = "当前正向无功谷电能") + private BigDecimal currentForwardReactiveValley; + + /** 当前反向总无功电能 */ + @Excel(name = "当前反向总无功电能") + private BigDecimal currentReverseReactiveTotal; + + /** 当前反向无功尖电能 */ + @Excel(name = "当前反向无功尖电能") + private BigDecimal currentReverseReactivePeak; + + /** 当前反向无功峰电能 */ + @Excel(name = "当前反向无功峰电能") + private BigDecimal currentReverseReactiveHigh; + + /** 当前反向无功平电能 */ + @Excel(name = "当前反向无功平电能") + private BigDecimal currentReverseReactiveFlat; + + /** 当前反向无功谷电能 */ + @Excel(name = "当前反向无功谷电能") + private BigDecimal currentReverseReactiveValley; + + /** A相电压 */ + @Excel(name = "A相电压") + private BigDecimal phaseAVoltage; + + /** B相电压 */ + @Excel(name = "B相电压") + private BigDecimal phaseBVoltage; + + /** C相电压 */ + @Excel(name = "C相电压") + private BigDecimal phaseCVoltage; + + /** A相电流 */ + @Excel(name = "A相电流") + private BigDecimal phaseACurrent; + + /** B相电流 */ + @Excel(name = "B相电流") + private BigDecimal phaseBCurrent; + + /** C相电流 */ + @Excel(name = "C相电流") + private BigDecimal phaseCCurrent; + + /** 频率 */ + @Excel(name = "频率") + private BigDecimal frequency; + + /** A-B线电压 */ + @Excel(name = "A-B线电压") + private BigDecimal abLineVoltage; + + /** C-B线电压 */ + @Excel(name = "C-B线电压") + private BigDecimal cbLineVoltage; + + /** A-C线电压 */ + @Excel(name = "A-C线电压") + private BigDecimal acLineVoltage; + + /** 正向有功最大需量 */ + @Excel(name = "正向有功最大需量") + private BigDecimal forwardAcMaxDemand; + + /** 反向有功最大需量 */ + @Excel(name = "反向有功最大需量") + private BigDecimal reverseAcMaxDemand; + + /** A相有功功率 */ + @Excel(name = "A相有功功率") + private BigDecimal phaseAActivePower; + + /** B相有功功率 */ + @Excel(name = "B相有功功率") + private BigDecimal phaseBActivePower; + + /** C相有功功率 */ + @Excel(name = "C相有功功率") + private BigDecimal phaseCActivePower; + + /** 总有功功率 */ + @Excel(name = "总有功功率") + private BigDecimal totalActivePower; + + /** A相无功功率 */ + @Excel(name = "A相无功功率") + private BigDecimal phaseAReactivePower; + + /** B相无功功率 */ + @Excel(name = "B相无功功率") + private BigDecimal phaseBReactivePower; + + /** C相无功功率 */ + @Excel(name = "C相无功功率") + private BigDecimal phaseCReactivePower; + + /** 总无功功率 */ + @Excel(name = "总无功功率") + private BigDecimal totalReactivePower; + + /** A相视在功率 */ + @Excel(name = "A相视在功率") + private BigDecimal phaseAApparentPower; + + /** B相视在功率 */ + @Excel(name = "B相视在功率") + private BigDecimal phaseBApparentPower; + + /** C相视在功率 */ + @Excel(name = "C相视在功率") + private BigDecimal phaseCApparentPower; + + /** 总视在功率 */ + @Excel(name = "总视在功率") + private BigDecimal totalApparentPower; + + /** A相功率因数 */ + @Excel(name = "A相功率因数") + private BigDecimal phaseAPowerFactor; + + /** B相功率因数 */ + @Excel(name = "B相功率因数") + private BigDecimal phaseBPowerFactor; + + /** C相功率因数 */ + @Excel(name = "C相功率因数") + private BigDecimal phaseCPowerFactor; + + /** 总功率因数 */ + @Excel(name = "总功率因数") + private BigDecimal totalPowerFactor; + + /** 当日正向有功最大需量 */ + @Excel(name = "当日正向有功最大需量") + private BigDecimal dailyForwardMaxDemand; /** 站点id */ @Excel(name = "站点id") @@ -58,6 +270,142 @@ public class EmsAmmeterData extends BaseEntity @Excel(name = "设备唯一标识符") private String deviceId; + /** 二次-AB 线电压 */ + @Excel(name = "二次-AB 线电压") + private BigDecimal secondaryAbLineVoltage; + + /** 二次-A 相电流 */ + @Excel(name = "二次-A 相电流") + private BigDecimal secondaryAPhaseCurrent; + + /** 二次-A 相电压 */ + @Excel(name = "二次-A 相电压") + private BigDecimal secondaryAPhaseVoltage; + + /** 二次-A 相功率因数 */ + @Excel(name = "二次-A 相功率因数") + private BigDecimal secondaryAPowerFactor; + + /** 二次-A 相视在功率 */ + @Excel(name = "二次-A 相视在功率") + private BigDecimal secondaryAApparentPower; + + /** 二次-A 相无功功率 */ + @Excel(name = "二次-A 相无功功率") + private BigDecimal secondaryAReactivePower; + + /** 二次-A 相有功功率 */ + @Excel(name = "二次-A 相有功功率") + private BigDecimal secondaryAActivePower; + + /** 二次-BC 线电压 */ + @Excel(name = "二次-BC 线电压") + private BigDecimal secondaryBcLineVoltage; + + /** 二次-B 相电流 */ + @Excel(name = "二次-B 相电流") + private BigDecimal secondaryBPhaseCurrent; + + /** 二次-B 相电压 */ + @Excel(name = "二次-B 相电压") + private BigDecimal secondaryBPhaseVoltage; + + /** 二次-B 相功率因数 */ + @Excel(name = "二次-B 相功率因数") + private BigDecimal secondaryBPowerFactor; + + /** 二次-B 相视在功率 */ + @Excel(name = "二次-B 相视在功率") + private BigDecimal secondaryBApparentPower; + + /** 二次-B 相无功功率 */ + @Excel(name = "二次-B 相无功功率") + private BigDecimal secondaryBReactivePower; + + /** 二次-B 相有功功率 */ + @Excel(name = "二次-B 相有功功率") + private BigDecimal secondaryBActivePower; + + /** 二次-CA 线电压 */ + @Excel(name = "二次-CA 线电压") + private BigDecimal secondaryCaLineVoltage; + + /** 二次-C 相电流 */ + @Excel(name = "二次-C 相电流") + private BigDecimal secondaryCPhaseCurrent; + + /** 二次-C 相电压 */ + @Excel(name = "二次-C 相电压") + private BigDecimal secondaryCPhaseVoltage; + + /** 二次-C 相功率因数 */ + @Excel(name = "二次-C 相功率因数") + private BigDecimal secondaryCPowerFactor; + + /** 二次-C 相视在功率 */ + @Excel(name = "二次-C 相视在功率") + private BigDecimal secondaryCApparentPower; + + /** 二次-C 相无功功率 */ + @Excel(name = "二次-C 相无功功率") + private BigDecimal secondaryCReactivePower; + + /** 二次-C 相有功功率 */ + @Excel(name = "二次-C 相有功功率") + private BigDecimal secondaryCActivePower; + + /** 二次-电网频率 */ + @Excel(name = "二次-电网频率") + private BigDecimal secondaryGridFrequency; + + /** 二次-反向无功电能 */ + @Excel(name = "二次-反向无功电能") + private BigDecimal secondaryReverseReactiveEnergy; + + /** 二次-负向有功电能 */ + @Excel(name = "二次-负向有功电能") + private BigDecimal secondaryNegativeActiveEnergy; + + /** 二次-总功率因数 */ + @Excel(name = "二次-总功率因数") + private BigDecimal secondaryTotalPowerFactor; + + /** 二次-总视在功率 */ + @Excel(name = "二次-总视在功率") + private BigDecimal secondaryTotalApparentPower; + + /** 二次-总无功功率 */ + @Excel(name = "二次-总无功功率") + private BigDecimal secondaryTotalReactivePower; + + /** 二次-正向无功电能 */ + @Excel(name = "二次-正向无功电能") + private BigDecimal secondaryPositiveReactiveEnergy; + + /** 二次-正向有功电能 */ + @Excel(name = "二次-正向有功电能") + private BigDecimal secondaryPositiveActiveEnergy; + + /** 二次-总有功功率 */ + @Excel(name = "二次-总有功功率") + private BigDecimal secondaryTotalActivePower; + + /** 反向无功电能 EQ- */ + @Excel(name = "反向无功电能 EQ-") + private BigDecimal reverseReactiveEnergyEqMinus; + + /** 反向有功电能 EP- */ + @Excel(name = "反向有功电能 EP-") + private BigDecimal reverseActiveEnergyEpMinus; + + /** 正向无功电能 EQ+ */ + @Excel(name = "正向无功电能 EQ+") + private BigDecimal positiveReactiveEnergyEqPlus; + + /** 正向有功电能 EP+ */ + @Excel(name = "正向有功电能 EP+") + private BigDecimal positiveActiveEnergyEpPlus; + public void setId(Long id) { this.id = id; @@ -78,64 +426,594 @@ public class EmsAmmeterData extends BaseEntity return dataUpdateTime; } - public void setCategory(String category) + public void setCurrentCombActiveTotal(BigDecimal currentCombActiveTotal) { - this.category = category; + this.currentCombActiveTotal = currentCombActiveTotal; } - public String getCategory() + public BigDecimal getCurrentCombActiveTotal() { - return category; + return currentCombActiveTotal; } - public void setTotalKwh(BigDecimal totalKwh) + public void setCurrentCombActivePeak(BigDecimal currentCombActivePeak) { - this.totalKwh = totalKwh; + this.currentCombActivePeak = currentCombActivePeak; } - public BigDecimal getTotalKwh() + public BigDecimal getCurrentCombActivePeak() { - return totalKwh; + return currentCombActivePeak; } - public void setSharpKwh(BigDecimal sharpKwh) + public void setCurrentCombActiveHigh(BigDecimal currentCombActiveHigh) { - this.sharpKwh = sharpKwh; + this.currentCombActiveHigh = currentCombActiveHigh; } - public BigDecimal getSharpKwh() + public BigDecimal getCurrentCombActiveHigh() { - return sharpKwh; + return currentCombActiveHigh; } - public void setPeakKwh(BigDecimal peakKwh) + public void setCurrentCombActiveFlat(BigDecimal currentCombActiveFlat) { - this.peakKwh = peakKwh; + this.currentCombActiveFlat = currentCombActiveFlat; } - public BigDecimal getPeakKwh() + public BigDecimal getCurrentCombActiveFlat() { - return peakKwh; + return currentCombActiveFlat; } - public void setFlatKwh(BigDecimal flatKwh) + public void setCurrentCombActiveValley(BigDecimal currentCombActiveValley) { - this.flatKwh = flatKwh; + this.currentCombActiveValley = currentCombActiveValley; } - public BigDecimal getFlatKwh() + public BigDecimal getCurrentCombActiveValley() { - return flatKwh; + return currentCombActiveValley; } - public void setValleyKwh(BigDecimal valleyKwh) + public void setCurrentForwardActiveTotal(BigDecimal currentForwardActiveTotal) { - this.valleyKwh = valleyKwh; + this.currentForwardActiveTotal = currentForwardActiveTotal; } - public BigDecimal getValleyKwh() + public BigDecimal getCurrentForwardActiveTotal() { - return valleyKwh; + return currentForwardActiveTotal; + } + + public void setCurrentForwardActivePeak(BigDecimal currentForwardActivePeak) + { + this.currentForwardActivePeak = currentForwardActivePeak; + } + + public BigDecimal getCurrentForwardActivePeak() + { + return currentForwardActivePeak; + } + + public void setCurrentForwardActiveHigh(BigDecimal currentForwardActiveHigh) + { + this.currentForwardActiveHigh = currentForwardActiveHigh; + } + + public BigDecimal getCurrentForwardActiveHigh() + { + return currentForwardActiveHigh; + } + + public void setCurrentForwardActiveFlat(BigDecimal currentForwardActiveFlat) + { + this.currentForwardActiveFlat = currentForwardActiveFlat; + } + + public BigDecimal getCurrentForwardActiveFlat() + { + return currentForwardActiveFlat; + } + + public void setCurrentForwardActiveValley(BigDecimal currentForwardActiveValley) + { + this.currentForwardActiveValley = currentForwardActiveValley; + } + + public BigDecimal getCurrentForwardActiveValley() + { + return currentForwardActiveValley; + } + + public void setCurrentReverseActiveTotal(BigDecimal currentReverseActiveTotal) + { + this.currentReverseActiveTotal = currentReverseActiveTotal; + } + + public BigDecimal getCurrentReverseActiveTotal() + { + return currentReverseActiveTotal; + } + + public void setCurrentReverseActivePeak(BigDecimal currentReverseActivePeak) + { + this.currentReverseActivePeak = currentReverseActivePeak; + } + + public BigDecimal getCurrentReverseActivePeak() + { + return currentReverseActivePeak; + } + + public void setCurrentReverseActiveHigh(BigDecimal currentReverseActiveHigh) + { + this.currentReverseActiveHigh = currentReverseActiveHigh; + } + + public BigDecimal getCurrentReverseActiveHigh() + { + return currentReverseActiveHigh; + } + + public void setCurrentReverseActiveFlat(BigDecimal currentReverseActiveFlat) + { + this.currentReverseActiveFlat = currentReverseActiveFlat; + } + + public BigDecimal getCurrentReverseActiveFlat() + { + return currentReverseActiveFlat; + } + + public void setCurrentReverseActiveValley(BigDecimal currentReverseActiveValley) + { + this.currentReverseActiveValley = currentReverseActiveValley; + } + + public BigDecimal getCurrentReverseActiveValley() + { + return currentReverseActiveValley; + } + + public void setCurrentCombReactiveTotal(BigDecimal currentCombReactiveTotal) + { + this.currentCombReactiveTotal = currentCombReactiveTotal; + } + + public BigDecimal getCurrentCombReactiveTotal() + { + return currentCombReactiveTotal; + } + + public void setCurrentCombReactivePeak(BigDecimal currentCombReactivePeak) + { + this.currentCombReactivePeak = currentCombReactivePeak; + } + + public BigDecimal getCurrentCombReactivePeak() + { + return currentCombReactivePeak; + } + + public void setCurrentCombReactiveHigh(BigDecimal currentCombReactiveHigh) + { + this.currentCombReactiveHigh = currentCombReactiveHigh; + } + + public BigDecimal getCurrentCombReactiveHigh() + { + return currentCombReactiveHigh; + } + + public void setCurrentCombReactiveFlat(BigDecimal currentCombReactiveFlat) + { + this.currentCombReactiveFlat = currentCombReactiveFlat; + } + + public BigDecimal getCurrentCombReactiveFlat() + { + return currentCombReactiveFlat; + } + + public void setCurrentCombReactiveValley(BigDecimal currentCombReactiveValley) + { + this.currentCombReactiveValley = currentCombReactiveValley; + } + + public BigDecimal getCurrentCombReactiveValley() + { + return currentCombReactiveValley; + } + + public void setCurrentForwardReactiveTotal(BigDecimal currentForwardReactiveTotal) + { + this.currentForwardReactiveTotal = currentForwardReactiveTotal; + } + + public BigDecimal getCurrentForwardReactiveTotal() + { + return currentForwardReactiveTotal; + } + + public void setCurrentForwardReactivePeak(BigDecimal currentForwardReactivePeak) + { + this.currentForwardReactivePeak = currentForwardReactivePeak; + } + + public BigDecimal getCurrentForwardReactivePeak() + { + return currentForwardReactivePeak; + } + + public void setCurrentForwardReactiveHigh(BigDecimal currentForwardReactiveHigh) + { + this.currentForwardReactiveHigh = currentForwardReactiveHigh; + } + + public BigDecimal getCurrentForwardReactiveHigh() + { + return currentForwardReactiveHigh; + } + + public void setCurrentForwardReactiveFlat(BigDecimal currentForwardReactiveFlat) + { + this.currentForwardReactiveFlat = currentForwardReactiveFlat; + } + + public BigDecimal getCurrentForwardReactiveFlat() + { + return currentForwardReactiveFlat; + } + + public void setCurrentForwardReactiveValley(BigDecimal currentForwardReactiveValley) + { + this.currentForwardReactiveValley = currentForwardReactiveValley; + } + + public BigDecimal getCurrentForwardReactiveValley() + { + return currentForwardReactiveValley; + } + + public void setCurrentReverseReactiveTotal(BigDecimal currentReverseReactiveTotal) + { + this.currentReverseReactiveTotal = currentReverseReactiveTotal; + } + + public BigDecimal getCurrentReverseReactiveTotal() + { + return currentReverseReactiveTotal; + } + + public void setCurrentReverseReactivePeak(BigDecimal currentReverseReactivePeak) + { + this.currentReverseReactivePeak = currentReverseReactivePeak; + } + + public BigDecimal getCurrentReverseReactivePeak() + { + return currentReverseReactivePeak; + } + + public void setCurrentReverseReactiveHigh(BigDecimal currentReverseReactiveHigh) + { + this.currentReverseReactiveHigh = currentReverseReactiveHigh; + } + + public BigDecimal getCurrentReverseReactiveHigh() + { + return currentReverseReactiveHigh; + } + + public void setCurrentReverseReactiveFlat(BigDecimal currentReverseReactiveFlat) + { + this.currentReverseReactiveFlat = currentReverseReactiveFlat; + } + + public BigDecimal getCurrentReverseReactiveFlat() + { + return currentReverseReactiveFlat; + } + + public void setCurrentReverseReactiveValley(BigDecimal currentReverseReactiveValley) + { + this.currentReverseReactiveValley = currentReverseReactiveValley; + } + + public BigDecimal getCurrentReverseReactiveValley() + { + return currentReverseReactiveValley; + } + + public void setPhaseAVoltage(BigDecimal phaseAVoltage) + { + this.phaseAVoltage = phaseAVoltage; + } + + public BigDecimal getPhaseAVoltage() + { + return phaseAVoltage; + } + + public void setPhaseBVoltage(BigDecimal phaseBVoltage) + { + this.phaseBVoltage = phaseBVoltage; + } + + public BigDecimal getPhaseBVoltage() + { + return phaseBVoltage; + } + + public void setPhaseCVoltage(BigDecimal phaseCVoltage) + { + this.phaseCVoltage = phaseCVoltage; + } + + public BigDecimal getPhaseCVoltage() + { + return phaseCVoltage; + } + + public void setPhaseACurrent(BigDecimal phaseACurrent) + { + this.phaseACurrent = phaseACurrent; + } + + public BigDecimal getPhaseACurrent() + { + return phaseACurrent; + } + + public void setPhaseBCurrent(BigDecimal phaseBCurrent) + { + this.phaseBCurrent = phaseBCurrent; + } + + public BigDecimal getPhaseBCurrent() + { + return phaseBCurrent; + } + + public void setPhaseCCurrent(BigDecimal phaseCCurrent) + { + this.phaseCCurrent = phaseCCurrent; + } + + public BigDecimal getPhaseCCurrent() + { + return phaseCCurrent; + } + + public void setFrequency(BigDecimal frequency) + { + this.frequency = frequency; + } + + public BigDecimal getFrequency() + { + return frequency; + } + + public void setAbLineVoltage(BigDecimal abLineVoltage) + { + this.abLineVoltage = abLineVoltage; + } + + public BigDecimal getAbLineVoltage() + { + return abLineVoltage; + } + + public void setCbLineVoltage(BigDecimal cbLineVoltage) + { + this.cbLineVoltage = cbLineVoltage; + } + + public BigDecimal getCbLineVoltage() + { + return cbLineVoltage; + } + + public void setAcLineVoltage(BigDecimal acLineVoltage) + { + this.acLineVoltage = acLineVoltage; + } + + public BigDecimal getAcLineVoltage() + { + return acLineVoltage; + } + + public void setForwardAcMaxDemand(BigDecimal forwardAcMaxDemand) + { + this.forwardAcMaxDemand = forwardAcMaxDemand; + } + + public BigDecimal getForwardAcMaxDemand() + { + return forwardAcMaxDemand; + } + + public void setReverseAcMaxDemand(BigDecimal reverseAcMaxDemand) + { + this.reverseAcMaxDemand = reverseAcMaxDemand; + } + + public BigDecimal getReverseAcMaxDemand() + { + return reverseAcMaxDemand; + } + + public void setPhaseAActivePower(BigDecimal phaseAActivePower) + { + this.phaseAActivePower = phaseAActivePower; + } + + public BigDecimal getPhaseAActivePower() + { + return phaseAActivePower; + } + + public void setPhaseBActivePower(BigDecimal phaseBActivePower) + { + this.phaseBActivePower = phaseBActivePower; + } + + public BigDecimal getPhaseBActivePower() + { + return phaseBActivePower; + } + + public void setPhaseCActivePower(BigDecimal phaseCActivePower) + { + this.phaseCActivePower = phaseCActivePower; + } + + public BigDecimal getPhaseCActivePower() + { + return phaseCActivePower; + } + + public void setTotalActivePower(BigDecimal totalActivePower) + { + this.totalActivePower = totalActivePower; + } + + public BigDecimal getTotalActivePower() + { + return totalActivePower; + } + + public void setPhaseAReactivePower(BigDecimal phaseAReactivePower) + { + this.phaseAReactivePower = phaseAReactivePower; + } + + public BigDecimal getPhaseAReactivePower() + { + return phaseAReactivePower; + } + + public void setPhaseBReactivePower(BigDecimal phaseBReactivePower) + { + this.phaseBReactivePower = phaseBReactivePower; + } + + public BigDecimal getPhaseBReactivePower() + { + return phaseBReactivePower; + } + + public void setPhaseCReactivePower(BigDecimal phaseCReactivePower) + { + this.phaseCReactivePower = phaseCReactivePower; + } + + public BigDecimal getPhaseCReactivePower() + { + return phaseCReactivePower; + } + + public void setTotalReactivePower(BigDecimal totalReactivePower) + { + this.totalReactivePower = totalReactivePower; + } + + public BigDecimal getTotalReactivePower() + { + return totalReactivePower; + } + + public void setPhaseAApparentPower(BigDecimal phaseAApparentPower) + { + this.phaseAApparentPower = phaseAApparentPower; + } + + public BigDecimal getPhaseAApparentPower() + { + return phaseAApparentPower; + } + + public void setPhaseBApparentPower(BigDecimal phaseBApparentPower) + { + this.phaseBApparentPower = phaseBApparentPower; + } + + public BigDecimal getPhaseBApparentPower() + { + return phaseBApparentPower; + } + + public void setPhaseCApparentPower(BigDecimal phaseCApparentPower) + { + this.phaseCApparentPower = phaseCApparentPower; + } + + public BigDecimal getPhaseCApparentPower() + { + return phaseCApparentPower; + } + + public void setTotalApparentPower(BigDecimal totalApparentPower) + { + this.totalApparentPower = totalApparentPower; + } + + public BigDecimal getTotalApparentPower() + { + return totalApparentPower; + } + + public void setPhaseAPowerFactor(BigDecimal phaseAPowerFactor) + { + this.phaseAPowerFactor = phaseAPowerFactor; + } + + public BigDecimal getPhaseAPowerFactor() + { + return phaseAPowerFactor; + } + + public void setPhaseBPowerFactor(BigDecimal phaseBPowerFactor) + { + this.phaseBPowerFactor = phaseBPowerFactor; + } + + public BigDecimal getPhaseBPowerFactor() + { + return phaseBPowerFactor; + } + + public void setPhaseCPowerFactor(BigDecimal phaseCPowerFactor) + { + this.phaseCPowerFactor = phaseCPowerFactor; + } + + public BigDecimal getPhaseCPowerFactor() + { + return phaseCPowerFactor; + } + + public void setTotalPowerFactor(BigDecimal totalPowerFactor) + { + this.totalPowerFactor = totalPowerFactor; + } + + public BigDecimal getTotalPowerFactor() + { + return totalPowerFactor; + } + + public void setDailyForwardMaxDemand(BigDecimal dailyForwardMaxDemand) + { + this.dailyForwardMaxDemand = dailyForwardMaxDemand; + } + + public BigDecimal getDailyForwardMaxDemand() + { + return dailyForwardMaxDemand; } public void setSiteId(String siteId) @@ -158,24 +1036,451 @@ public class EmsAmmeterData extends BaseEntity return deviceId; } + public void setSecondaryAbLineVoltage(BigDecimal secondaryAbLineVoltage) + { + this.secondaryAbLineVoltage = secondaryAbLineVoltage; + } + + public BigDecimal getSecondaryAbLineVoltage() + { + return secondaryAbLineVoltage; + } + + public void setSecondaryAPhaseCurrent(BigDecimal secondaryAPhaseCurrent) + { + this.secondaryAPhaseCurrent = secondaryAPhaseCurrent; + } + + public BigDecimal getSecondaryAPhaseCurrent() + { + return secondaryAPhaseCurrent; + } + + public void setSecondaryAPhaseVoltage(BigDecimal secondaryAPhaseVoltage) + { + this.secondaryAPhaseVoltage = secondaryAPhaseVoltage; + } + + public BigDecimal getSecondaryAPhaseVoltage() + { + return secondaryAPhaseVoltage; + } + + public void setSecondaryAPowerFactor(BigDecimal secondaryAPowerFactor) + { + this.secondaryAPowerFactor = secondaryAPowerFactor; + } + + public BigDecimal getSecondaryAPowerFactor() + { + return secondaryAPowerFactor; + } + + public void setSecondaryAApparentPower(BigDecimal secondaryAApparentPower) + { + this.secondaryAApparentPower = secondaryAApparentPower; + } + + public BigDecimal getSecondaryAApparentPower() + { + return secondaryAApparentPower; + } + + public void setSecondaryAReactivePower(BigDecimal secondaryAReactivePower) + { + this.secondaryAReactivePower = secondaryAReactivePower; + } + + public BigDecimal getSecondaryAReactivePower() + { + return secondaryAReactivePower; + } + + public void setSecondaryAActivePower(BigDecimal secondaryAActivePower) + { + this.secondaryAActivePower = secondaryAActivePower; + } + + public BigDecimal getSecondaryAActivePower() + { + return secondaryAActivePower; + } + + public void setSecondaryBcLineVoltage(BigDecimal secondaryBcLineVoltage) + { + this.secondaryBcLineVoltage = secondaryBcLineVoltage; + } + + public BigDecimal getSecondaryBcLineVoltage() + { + return secondaryBcLineVoltage; + } + + public void setSecondaryBPhaseCurrent(BigDecimal secondaryBPhaseCurrent) + { + this.secondaryBPhaseCurrent = secondaryBPhaseCurrent; + } + + public BigDecimal getSecondaryBPhaseCurrent() + { + return secondaryBPhaseCurrent; + } + + public void setSecondaryBPhaseVoltage(BigDecimal secondaryBPhaseVoltage) + { + this.secondaryBPhaseVoltage = secondaryBPhaseVoltage; + } + + public BigDecimal getSecondaryBPhaseVoltage() + { + return secondaryBPhaseVoltage; + } + + public void setSecondaryBPowerFactor(BigDecimal secondaryBPowerFactor) + { + this.secondaryBPowerFactor = secondaryBPowerFactor; + } + + public BigDecimal getSecondaryBPowerFactor() + { + return secondaryBPowerFactor; + } + + public void setSecondaryBApparentPower(BigDecimal secondaryBApparentPower) + { + this.secondaryBApparentPower = secondaryBApparentPower; + } + + public BigDecimal getSecondaryBApparentPower() + { + return secondaryBApparentPower; + } + + public void setSecondaryBReactivePower(BigDecimal secondaryBReactivePower) + { + this.secondaryBReactivePower = secondaryBReactivePower; + } + + public BigDecimal getSecondaryBReactivePower() + { + return secondaryBReactivePower; + } + + public void setSecondaryBActivePower(BigDecimal secondaryBActivePower) + { + this.secondaryBActivePower = secondaryBActivePower; + } + + public BigDecimal getSecondaryBActivePower() + { + return secondaryBActivePower; + } + + public void setSecondaryCaLineVoltage(BigDecimal secondaryCaLineVoltage) + { + this.secondaryCaLineVoltage = secondaryCaLineVoltage; + } + + public BigDecimal getSecondaryCaLineVoltage() + { + return secondaryCaLineVoltage; + } + + public void setSecondaryCPhaseCurrent(BigDecimal secondaryCPhaseCurrent) + { + this.secondaryCPhaseCurrent = secondaryCPhaseCurrent; + } + + public BigDecimal getSecondaryCPhaseCurrent() + { + return secondaryCPhaseCurrent; + } + + public void setSecondaryCPhaseVoltage(BigDecimal secondaryCPhaseVoltage) + { + this.secondaryCPhaseVoltage = secondaryCPhaseVoltage; + } + + public BigDecimal getSecondaryCPhaseVoltage() + { + return secondaryCPhaseVoltage; + } + + public void setSecondaryCPowerFactor(BigDecimal secondaryCPowerFactor) + { + this.secondaryCPowerFactor = secondaryCPowerFactor; + } + + public BigDecimal getSecondaryCPowerFactor() + { + return secondaryCPowerFactor; + } + + public void setSecondaryCApparentPower(BigDecimal secondaryCApparentPower) + { + this.secondaryCApparentPower = secondaryCApparentPower; + } + + public BigDecimal getSecondaryCApparentPower() + { + return secondaryCApparentPower; + } + + public void setSecondaryCReactivePower(BigDecimal secondaryCReactivePower) + { + this.secondaryCReactivePower = secondaryCReactivePower; + } + + public BigDecimal getSecondaryCReactivePower() + { + return secondaryCReactivePower; + } + + public void setSecondaryCActivePower(BigDecimal secondaryCActivePower) + { + this.secondaryCActivePower = secondaryCActivePower; + } + + public BigDecimal getSecondaryCActivePower() + { + return secondaryCActivePower; + } + + public void setSecondaryGridFrequency(BigDecimal secondaryGridFrequency) + { + this.secondaryGridFrequency = secondaryGridFrequency; + } + + public BigDecimal getSecondaryGridFrequency() + { + return secondaryGridFrequency; + } + + public void setSecondaryReverseReactiveEnergy(BigDecimal secondaryReverseReactiveEnergy) + { + this.secondaryReverseReactiveEnergy = secondaryReverseReactiveEnergy; + } + + public BigDecimal getSecondaryReverseReactiveEnergy() + { + return secondaryReverseReactiveEnergy; + } + + public void setSecondaryNegativeActiveEnergy(BigDecimal secondaryNegativeActiveEnergy) + { + this.secondaryNegativeActiveEnergy = secondaryNegativeActiveEnergy; + } + + public BigDecimal getSecondaryNegativeActiveEnergy() + { + return secondaryNegativeActiveEnergy; + } + + public void setSecondaryTotalPowerFactor(BigDecimal secondaryTotalPowerFactor) + { + this.secondaryTotalPowerFactor = secondaryTotalPowerFactor; + } + + public BigDecimal getSecondaryTotalPowerFactor() + { + return secondaryTotalPowerFactor; + } + + public void setSecondaryTotalApparentPower(BigDecimal secondaryTotalApparentPower) + { + this.secondaryTotalApparentPower = secondaryTotalApparentPower; + } + + public BigDecimal getSecondaryTotalApparentPower() + { + return secondaryTotalApparentPower; + } + + public void setSecondaryTotalReactivePower(BigDecimal secondaryTotalReactivePower) + { + this.secondaryTotalReactivePower = secondaryTotalReactivePower; + } + + public BigDecimal getSecondaryTotalReactivePower() + { + return secondaryTotalReactivePower; + } + + public void setSecondaryPositiveReactiveEnergy(BigDecimal secondaryPositiveReactiveEnergy) + { + this.secondaryPositiveReactiveEnergy = secondaryPositiveReactiveEnergy; + } + + public BigDecimal getSecondaryPositiveReactiveEnergy() + { + return secondaryPositiveReactiveEnergy; + } + + public void setSecondaryPositiveActiveEnergy(BigDecimal secondaryPositiveActiveEnergy) + { + this.secondaryPositiveActiveEnergy = secondaryPositiveActiveEnergy; + } + + public BigDecimal getSecondaryPositiveActiveEnergy() + { + return secondaryPositiveActiveEnergy; + } + + public void setSecondaryTotalActivePower(BigDecimal secondaryTotalActivePower) + { + this.secondaryTotalActivePower = secondaryTotalActivePower; + } + + public BigDecimal getSecondaryTotalActivePower() + { + return secondaryTotalActivePower; + } + + public void setReverseReactiveEnergyEqMinus(BigDecimal reverseReactiveEnergyEqMinus) + { + this.reverseReactiveEnergyEqMinus = reverseReactiveEnergyEqMinus; + } + + public BigDecimal getReverseReactiveEnergyEqMinus() + { + return reverseReactiveEnergyEqMinus; + } + + public void setReverseActiveEnergyEpMinus(BigDecimal reverseActiveEnergyEpMinus) + { + this.reverseActiveEnergyEpMinus = reverseActiveEnergyEpMinus; + } + + public BigDecimal getReverseActiveEnergyEpMinus() + { + return reverseActiveEnergyEpMinus; + } + + public void setPositiveReactiveEnergyEqPlus(BigDecimal positiveReactiveEnergyEqPlus) + { + this.positiveReactiveEnergyEqPlus = positiveReactiveEnergyEqPlus; + } + + public BigDecimal getPositiveReactiveEnergyEqPlus() + { + return positiveReactiveEnergyEqPlus; + } + + public void setPositiveActiveEnergyEpPlus(BigDecimal positiveActiveEnergyEpPlus) + { + this.positiveActiveEnergyEpPlus = positiveActiveEnergyEpPlus; + } + + public BigDecimal getPositiveActiveEnergyEpPlus() + { + return positiveActiveEnergyEpPlus; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("id", getId()) .append("dataUpdateTime", getDataUpdateTime()) - .append("category", getCategory()) - .append("totalKwh", getTotalKwh()) - .append("sharpKwh", getSharpKwh()) - .append("peakKwh", getPeakKwh()) - .append("flatKwh", getFlatKwh()) - .append("valleyKwh", getValleyKwh()) + .append("currentCombActiveTotal", getCurrentCombActiveTotal()) + .append("currentCombActivePeak", getCurrentCombActivePeak()) + .append("currentCombActiveHigh", getCurrentCombActiveHigh()) + .append("currentCombActiveFlat", getCurrentCombActiveFlat()) + .append("currentCombActiveValley", getCurrentCombActiveValley()) + .append("currentForwardActiveTotal", getCurrentForwardActiveTotal()) + .append("currentForwardActivePeak", getCurrentForwardActivePeak()) + .append("currentForwardActiveHigh", getCurrentForwardActiveHigh()) + .append("currentForwardActiveFlat", getCurrentForwardActiveFlat()) + .append("currentForwardActiveValley", getCurrentForwardActiveValley()) + .append("currentReverseActiveTotal", getCurrentReverseActiveTotal()) + .append("currentReverseActivePeak", getCurrentReverseActivePeak()) + .append("currentReverseActiveHigh", getCurrentReverseActiveHigh()) + .append("currentReverseActiveFlat", getCurrentReverseActiveFlat()) + .append("currentReverseActiveValley", getCurrentReverseActiveValley()) + .append("currentCombReactiveTotal", getCurrentCombReactiveTotal()) + .append("currentCombReactivePeak", getCurrentCombReactivePeak()) + .append("currentCombReactiveHigh", getCurrentCombReactiveHigh()) + .append("currentCombReactiveFlat", getCurrentCombReactiveFlat()) + .append("currentCombReactiveValley", getCurrentCombReactiveValley()) + .append("currentForwardReactiveTotal", getCurrentForwardReactiveTotal()) + .append("currentForwardReactivePeak", getCurrentForwardReactivePeak()) + .append("currentForwardReactiveHigh", getCurrentForwardReactiveHigh()) + .append("currentForwardReactiveFlat", getCurrentForwardReactiveFlat()) + .append("currentForwardReactiveValley", getCurrentForwardReactiveValley()) + .append("currentReverseReactiveTotal", getCurrentReverseReactiveTotal()) + .append("currentReverseReactivePeak", getCurrentReverseReactivePeak()) + .append("currentReverseReactiveHigh", getCurrentReverseReactiveHigh()) + .append("currentReverseReactiveFlat", getCurrentReverseReactiveFlat()) + .append("currentReverseReactiveValley", getCurrentReverseReactiveValley()) + .append("phaseAVoltage", getPhaseAVoltage()) + .append("phaseBVoltage", getPhaseBVoltage()) + .append("phaseCVoltage", getPhaseCVoltage()) + .append("phaseACurrent", getPhaseACurrent()) + .append("phaseBCurrent", getPhaseBCurrent()) + .append("phaseCCurrent", getPhaseCCurrent()) + .append("frequency", getFrequency()) + .append("abLineVoltage", getAbLineVoltage()) + .append("cbLineVoltage", getCbLineVoltage()) + .append("acLineVoltage", getAcLineVoltage()) + .append("forwardAcMaxDemand", getForwardAcMaxDemand()) + .append("reverseAcMaxDemand", getReverseAcMaxDemand()) + .append("phaseAActivePower", getPhaseAActivePower()) + .append("phaseBActivePower", getPhaseBActivePower()) + .append("phaseCActivePower", getPhaseCActivePower()) + .append("totalActivePower", getTotalActivePower()) + .append("phaseAReactivePower", getPhaseAReactivePower()) + .append("phaseBReactivePower", getPhaseBReactivePower()) + .append("phaseCReactivePower", getPhaseCReactivePower()) + .append("totalReactivePower", getTotalReactivePower()) + .append("phaseAApparentPower", getPhaseAApparentPower()) + .append("phaseBApparentPower", getPhaseBApparentPower()) + .append("phaseCApparentPower", getPhaseCApparentPower()) + .append("totalApparentPower", getTotalApparentPower()) + .append("phaseAPowerFactor", getPhaseAPowerFactor()) + .append("phaseBPowerFactor", getPhaseBPowerFactor()) + .append("phaseCPowerFactor", getPhaseCPowerFactor()) + .append("totalPowerFactor", getTotalPowerFactor()) + .append("dailyForwardMaxDemand", getDailyForwardMaxDemand()) + .append("siteId", getSiteId()) + .append("deviceId", getDeviceId()) .append("createBy", getCreateBy()) .append("createTime", getCreateTime()) .append("updateBy", getUpdateBy()) .append("updateTime", getUpdateTime()) .append("remark", getRemark()) - .append("siteId", getSiteId()) - .append("deviceId", getDeviceId()) + .append("secondaryAbLineVoltage", getSecondaryAbLineVoltage()) + .append("secondaryAPhaseCurrent", getSecondaryAPhaseCurrent()) + .append("secondaryAPhaseVoltage", getSecondaryAPhaseVoltage()) + .append("secondaryAPowerFactor", getSecondaryAPowerFactor()) + .append("secondaryAApparentPower", getSecondaryAApparentPower()) + .append("secondaryAReactivePower", getSecondaryAReactivePower()) + .append("secondaryAActivePower", getSecondaryAActivePower()) + .append("secondaryBcLineVoltage", getSecondaryBcLineVoltage()) + .append("secondaryBPhaseCurrent", getSecondaryBPhaseCurrent()) + .append("secondaryBPhaseVoltage", getSecondaryBPhaseVoltage()) + .append("secondaryBPowerFactor", getSecondaryBPowerFactor()) + .append("secondaryBApparentPower", getSecondaryBApparentPower()) + .append("secondaryBReactivePower", getSecondaryBReactivePower()) + .append("secondaryBActivePower", getSecondaryBActivePower()) + .append("secondaryCaLineVoltage", getSecondaryCaLineVoltage()) + .append("secondaryCPhaseCurrent", getSecondaryCPhaseCurrent()) + .append("secondaryCPhaseVoltage", getSecondaryCPhaseVoltage()) + .append("secondaryCPowerFactor", getSecondaryCPowerFactor()) + .append("secondaryCApparentPower", getSecondaryCApparentPower()) + .append("secondaryCReactivePower", getSecondaryCReactivePower()) + .append("secondaryCActivePower", getSecondaryCActivePower()) + .append("secondaryGridFrequency", getSecondaryGridFrequency()) + .append("secondaryReverseReactiveEnergy", getSecondaryReverseReactiveEnergy()) + .append("secondaryNegativeActiveEnergy", getSecondaryNegativeActiveEnergy()) + .append("secondaryTotalPowerFactor", getSecondaryTotalPowerFactor()) + .append("secondaryTotalApparentPower", getSecondaryTotalApparentPower()) + .append("secondaryTotalReactivePower", getSecondaryTotalReactivePower()) + .append("secondaryPositiveReactiveEnergy", getSecondaryPositiveReactiveEnergy()) + .append("secondaryPositiveActiveEnergy", getSecondaryPositiveActiveEnergy()) + .append("secondaryTotalActivePower", getSecondaryTotalActivePower()) + .append("reverseReactiveEnergyEqMinus", getReverseReactiveEnergyEqMinus()) + .append("reverseActiveEnergyEpMinus", getReverseActiveEnergyEpMinus()) + .append("positiveReactiveEnergyEqPlus", getPositiveReactiveEnergyEqPlus()) + .append("positiveActiveEnergyEpPlus", getPositiveActiveEnergyEpPlus()) .toString(); } } diff --git a/ems-system/src/main/java/com/xzzn/ems/domain/EmsPcsData.java b/ems-system/src/main/java/com/xzzn/ems/domain/EmsPcsData.java index 079294f..bebfb80 100644 --- a/ems-system/src/main/java/com/xzzn/ems/domain/EmsPcsData.java +++ b/ems-system/src/main/java/com/xzzn/ems/domain/EmsPcsData.java @@ -22,8 +22,8 @@ public class EmsPcsData extends BaseEntity private Long id; /** 数据更新时间 */ - @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "数据更新时间", width = 30, dateFormat = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "数据更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date dataUpdateTime; /** 工作状态 */ diff --git a/ems-system/src/main/java/com/xzzn/ems/domain/vo/AmmeterDataDetailInfo.java b/ems-system/src/main/java/com/xzzn/ems/domain/vo/AmmeterDataDetailInfo.java index 797ef63..7ef28fa 100644 --- a/ems-system/src/main/java/com/xzzn/ems/domain/vo/AmmeterDataDetailInfo.java +++ b/ems-system/src/main/java/com/xzzn/ems/domain/vo/AmmeterDataDetailInfo.java @@ -12,19 +12,19 @@ public class AmmeterDataDetailInfo private String category; /** 总 (kWh) */ - private BigDecimal totalKwh; + private BigDecimal totalKwh = BigDecimal.ZERO; /** 尖 (kWh) */ - private BigDecimal sharpKwh; + private BigDecimal sharpKwh = BigDecimal.ZERO; /** 峰 (kWh) */ - private BigDecimal peakKwh; + private BigDecimal peakKwh = BigDecimal.ZERO; /** 平 (kWh) */ - private BigDecimal flatKwh; + private BigDecimal flatKwh = BigDecimal.ZERO; /** 谷 (kWh) */ - private BigDecimal valleyKwh; + private BigDecimal valleyKwh = BigDecimal.ZERO; /** 总表设备Id */ private String deviceId; diff --git a/ems-system/src/main/java/com/xzzn/ems/mapper/EmsAmmeterDataMapper.java b/ems-system/src/main/java/com/xzzn/ems/mapper/EmsAmmeterDataMapper.java index b96b482..d308762 100644 --- a/ems-system/src/main/java/com/xzzn/ems/mapper/EmsAmmeterDataMapper.java +++ b/ems-system/src/main/java/com/xzzn/ems/mapper/EmsAmmeterDataMapper.java @@ -9,7 +9,7 @@ import org.apache.ibatis.annotations.Param; * 总数据Mapper接口 * * @author xzzn - * @date 2025-06-27 + * @date 2025-07-03 */ public interface EmsAmmeterDataMapper { @@ -66,5 +66,5 @@ public interface EmsAmmeterDataMapper * @param siteId * @return */ - public List getAmmeterDetailInfo(@Param("siteId")String siteId,@Param("deviceId") String deviceId); + public List getAmmeterDetailInfo(@Param("siteId")String siteId, @Param("deviceId") String deviceId); } diff --git a/ems-system/src/main/java/com/xzzn/ems/service/impl/FXXDataProcessServiceImpl.java b/ems-system/src/main/java/com/xzzn/ems/service/impl/FXXDataProcessServiceImpl.java index 2fe446f..4ffb995 100644 --- a/ems-system/src/main/java/com/xzzn/ems/service/impl/FXXDataProcessServiceImpl.java +++ b/ems-system/src/main/java/com/xzzn/ems/service/impl/FXXDataProcessServiceImpl.java @@ -17,7 +17,6 @@ import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.math.BigDecimal; import java.util.*; @Service @@ -43,7 +42,10 @@ public class FXXDataProcessServiceImpl implements IFXXDataProcessService { private RedisCache redisCache; @Autowired - private EmsDevicesSettingMapper emsDevicesSettingMapper;; + private EmsDevicesSettingMapper emsDevicesSettingMapper; + + @Autowired + private EmsAmmeterDataMapper emsAmmeterDataMapper;; @Override public void handleFxData(String message) { @@ -61,15 +63,20 @@ public class FXXDataProcessServiceImpl implements IFXXDataProcessService { } else if (deviceId.contains("BMSC")) { log.info("BMSC data:"+ jsonData); - batteryCluserDataProcess(deviceId, jsonData); + batteryClusterDataProcess(deviceId, jsonData); batteryDataProcess(deviceId, jsonData); } else if (deviceId.contains("PCS")) { pcsDataProcess(deviceId, jsonData); pcsBranchDataProcess(deviceId, jsonData); + } else if (deviceId.contains("LOAD")) { + loadDataProcess(deviceId, jsonData); + } else if (deviceId.contains("METE")) { + meteDataProcess(deviceId, jsonData); } } } + private void batteryStackDataProcess(String deviceId, String dataJson) { //电池堆 @@ -151,7 +158,7 @@ public class FXXDataProcessServiceImpl implements IFXXDataProcessService { } - private void batteryCluserDataProcess(String deviceId, String dataJson) { + private void batteryClusterDataProcess(String deviceId, String dataJson) { Map obj = JSON.parseObject(dataJson, new TypeReference>() { }); @@ -161,7 +168,7 @@ public class FXXDataProcessServiceImpl implements IFXXDataProcessService { String stackDeviceId = ""; if (up != null && up.size() >0) { stackDeviceId = up.get(0).getParentId(); - if (stackDeviceId != null || stackDeviceId.isEmpty()) { + if (stackDeviceId == null || stackDeviceId.isEmpty()) { stackDeviceId = "1"; } } @@ -239,7 +246,7 @@ public class FXXDataProcessServiceImpl implements IFXXDataProcessService { String stackDeviceId = ""; if (up != null && up.size() >0) { stackDeviceId = up.get(0).getParentId(); - if (stackDeviceId != null || stackDeviceId.isEmpty()) { + if (stackDeviceId == null || stackDeviceId.isEmpty()) { stackDeviceId = "1"; } } @@ -346,7 +353,6 @@ public class FXXDataProcessServiceImpl implements IFXXDataProcessService { } - private void pcsBranchDataProcess(String deviceId, String dataJson) { Map> records = processDataPrefix(JSON.parseObject(dataJson, new TypeReference>() {})); @@ -394,7 +400,192 @@ public class FXXDataProcessServiceImpl implements IFXXDataProcessService { } + private void loadDataProcess(String deviceId, String dataJson) { + //总表 + Map obj = JSON.parseObject(dataJson, new TypeReference>() { + }); + + EmsAmmeterData dataLoad = new EmsAmmeterData(); + // 更新时间 + dataLoad.setDataUpdateTime(new Date()); + + // 电能设置-组合有功 + dataLoad.setCurrentCombActiveTotal(StringUtils.getBigDecimal(obj.get("DQZHYGZDN"))); + dataLoad.setCurrentCombActivePeak(StringUtils.getBigDecimal(obj.get("DQZHYGJDN"))); + dataLoad.setCurrentCombActiveHigh(StringUtils.getBigDecimal(obj.get("DQZHYGFDN"))); + dataLoad.setCurrentCombActiveFlat(StringUtils.getBigDecimal(obj.get("DQZHYGPDN"))); + dataLoad.setCurrentCombActiveValley(StringUtils.getBigDecimal(obj.get("DQZHYGGDN"))); + // 电能设置-正向有功 + dataLoad.setCurrentForwardActiveTotal(StringUtils.getBigDecimal(obj.get("DQZXYGZDN"))); + dataLoad.setCurrentForwardActivePeak(StringUtils.getBigDecimal(obj.get("DQZXYGJDN"))); + dataLoad.setCurrentForwardActiveHigh(StringUtils.getBigDecimal(obj.get("DQZXYGFDN"))); + dataLoad.setCurrentForwardActiveFlat(StringUtils.getBigDecimal(obj.get("DQZXYGPDN"))); + dataLoad.setCurrentForwardActiveValley(StringUtils.getBigDecimal(obj.get("DQZXYGGDN"))); + // 电能设置-反向有功 + dataLoad.setCurrentReverseActiveTotal(StringUtils.getBigDecimal(obj.get("DQFXYGZDN"))); + dataLoad.setCurrentReverseActivePeak(StringUtils.getBigDecimal(obj.get("DQFXYGJDN"))); + dataLoad.setCurrentReverseActiveHigh(StringUtils.getBigDecimal(obj.get("DQFXYGFDN"))); + dataLoad.setCurrentReverseActiveFlat(StringUtils.getBigDecimal(obj.get("DQFXYGPDN"))); + dataLoad.setCurrentReverseActiveValley(StringUtils.getBigDecimal(obj.get("DQFXYGGDN"))); + // 电能设置-组合无功 + dataLoad.setCurrentCombReactiveTotal(StringUtils.getBigDecimal(obj.get("DQZHWGZDN"))); + dataLoad.setCurrentCombReactivePeak(StringUtils.getBigDecimal(obj.get("DQZHWGJDN"))); + dataLoad.setCurrentCombReactiveHigh(StringUtils.getBigDecimal(obj.get("DQZHWGFDN"))); + dataLoad.setCurrentCombReactiveFlat(StringUtils.getBigDecimal(obj.get("DQZHWGPDN"))); + dataLoad.setCurrentCombReactiveValley(StringUtils.getBigDecimal(obj.get("DQZHWGGDN"))); + // 电能设置-正向无功 + dataLoad.setCurrentForwardReactiveTotal(StringUtils.getBigDecimal(obj.get("DQZXWGZDN"))); + dataLoad.setCurrentForwardReactivePeak(StringUtils.getBigDecimal(obj.get("DQZXWGJDN"))); + dataLoad.setCurrentForwardReactiveHigh(StringUtils.getBigDecimal(obj.get("DQZXWGFDN"))); + dataLoad.setCurrentForwardReactiveFlat(StringUtils.getBigDecimal(obj.get("DQZXWGPDN"))); + dataLoad.setCurrentForwardReactiveValley(StringUtils.getBigDecimal(obj.get("DQZXWGGDN"))); + // 电能设置-反向无功 + dataLoad.setCurrentReverseReactiveTotal(StringUtils.getBigDecimal(obj.get("DQFXWGZDN"))); + dataLoad.setCurrentReverseReactivePeak(StringUtils.getBigDecimal(obj.get("DQFXWGJDN"))); + dataLoad.setCurrentReverseReactiveHigh(StringUtils.getBigDecimal(obj.get("DQFXWGFDN"))); + dataLoad.setCurrentReverseReactiveFlat(StringUtils.getBigDecimal(obj.get("DQFXWGPDN"))); + dataLoad.setCurrentReverseReactiveValley(StringUtils.getBigDecimal(obj.get("DQFXWGGDN"))); + + // 电压+电流 + dataLoad.setPhaseAVoltage(StringUtils.getBigDecimal(obj.get("AXDY"))); + dataLoad.setPhaseBVoltage(StringUtils.getBigDecimal(obj.get("BXDY"))); + dataLoad.setPhaseCVoltage(StringUtils.getBigDecimal(obj.get("CXDY"))); + dataLoad.setPhaseACurrent(StringUtils.getBigDecimal(obj.get("AXDL"))); + dataLoad.setPhaseBCurrent(StringUtils.getBigDecimal(obj.get("BXDL"))); + dataLoad.setPhaseCCurrent(StringUtils.getBigDecimal(obj.get("CXDL"))); + + dataLoad.setAbLineVoltage(StringUtils.getBigDecimal(obj.get("ABXDY"))); + dataLoad.setCbLineVoltage(StringUtils.getBigDecimal(obj.get("CBXDY"))); + dataLoad.setAcLineVoltage(StringUtils.getBigDecimal(obj.get("ACXDY"))); + + // 频率 + dataLoad.setFrequency(StringUtils.getBigDecimal(obj.get("PL"))); + + // 功率 有功+总+无功+无总+视在 + dataLoad.setPhaseAActivePower(StringUtils.getBigDecimal(obj.get("AXYGGL"))); + dataLoad.setPhaseBActivePower(StringUtils.getBigDecimal(obj.get("BXYGGL"))); + dataLoad.setPhaseCActivePower(StringUtils.getBigDecimal(obj.get("CXYGGL"))); + dataLoad.setTotalActivePower(StringUtils.getBigDecimal(obj.get("ZYGGL"))); + dataLoad.setPhaseAReactivePower(StringUtils.getBigDecimal(obj.get("AXWGGL"))); + dataLoad.setPhaseBReactivePower(StringUtils.getBigDecimal(obj.get("BXWGGL"))); + dataLoad.setPhaseCReactivePower(StringUtils.getBigDecimal(obj.get("CXWGGL"))); + dataLoad.setTotalReactivePower(StringUtils.getBigDecimal(obj.get("ZWGGL"))); + dataLoad.setPhaseAApparentPower(StringUtils.getBigDecimal(obj.get("AXSZGL"))); + dataLoad.setPhaseBApparentPower(StringUtils.getBigDecimal(obj.get("BXSZGL"))); + dataLoad.setPhaseCApparentPower(StringUtils.getBigDecimal(obj.get("CXSZGL"))); + dataLoad.setTotalApparentPower(StringUtils.getBigDecimal(obj.get("ZSZGL"))); + + // 功率因数 + dataLoad.setPhaseAPowerFactor(StringUtils.getBigDecimal(obj.get("AXGLYS"))); + dataLoad.setPhaseBPowerFactor(StringUtils.getBigDecimal(obj.get("BXGLYS"))); + dataLoad.setPhaseCPowerFactor(StringUtils.getBigDecimal(obj.get("CXGLYS"))); + dataLoad.setTotalPowerFactor(StringUtils.getBigDecimal(obj.get("ZGLYS"))); + + // 需量 + dataLoad.setForwardAcMaxDemand(StringUtils.getBigDecimal(obj.get("ZXYGZDXL"))); + dataLoad.setReverseAcMaxDemand(StringUtils.getBigDecimal(obj.get("FXYGZDXL"))); + dataLoad.setDailyForwardMaxDemand(StringUtils.getBigDecimal(obj.get("DRZXYGZDXL"))); + + dataLoad.setCreateBy("system"); + dataLoad.setCreateTime(DateUtils.getNowDate()); + dataLoad.setUpdateBy("system"); + dataLoad.setUpdateTime(DateUtils.getNowDate()); + dataLoad.setSiteId(SITE_ID); + dataLoad.setDeviceId(deviceId); + + emsAmmeterDataMapper.insertEmsAmmeterData(dataLoad); + + redisCache.setCacheObject(RedisKeyConstants.AMMETER + SITE_ID + "_" +deviceId, dataLoad); + } + + private void meteDataProcess(String deviceId, String dataJson) { + + //总表 + Map obj = JSON.parseObject(dataJson, new TypeReference>() { + }); + + EmsAmmeterData dataLoad = new EmsAmmeterData(); + // 更新时间 + dataLoad.setDataUpdateTime(new Date()); + + // 电压+电流 + dataLoad.setPhaseAVoltage(StringUtils.getBigDecimal(obj.get("AXDY"))); + dataLoad.setPhaseBVoltage(StringUtils.getBigDecimal(obj.get("BXDY"))); + dataLoad.setPhaseCVoltage(StringUtils.getBigDecimal(obj.get("CXDY"))); + dataLoad.setPhaseACurrent(StringUtils.getBigDecimal(obj.get("AXDL"))); + dataLoad.setPhaseBCurrent(StringUtils.getBigDecimal(obj.get("BXDL"))); + dataLoad.setPhaseCCurrent(StringUtils.getBigDecimal(obj.get("CXDL"))); + + dataLoad.setAbLineVoltage(StringUtils.getBigDecimal(obj.get("ABXDY"))); + dataLoad.setCbLineVoltage(StringUtils.getBigDecimal(obj.get("BCXDY"))); + dataLoad.setAcLineVoltage(StringUtils.getBigDecimal(obj.get("CAXDY"))); + + // 频率 + dataLoad.setFrequency(StringUtils.getBigDecimal(obj.get("DWPL"))); + + // 功率 + dataLoad.setPhaseAActivePower(StringUtils.getBigDecimal(obj.get("AXYGGL"))); + dataLoad.setPhaseBActivePower(StringUtils.getBigDecimal(obj.get("BXYGGL"))); + dataLoad.setPhaseCActivePower(StringUtils.getBigDecimal(obj.get("CXYGGL"))); + dataLoad.setTotalActivePower(StringUtils.getBigDecimal(obj.get("ZYGGL"))); + dataLoad.setPhaseAReactivePower(StringUtils.getBigDecimal(obj.get("AXWGGL"))); + dataLoad.setPhaseBReactivePower(StringUtils.getBigDecimal(obj.get("BXWGGL"))); + dataLoad.setPhaseCReactivePower(StringUtils.getBigDecimal(obj.get("CXWGGL"))); + dataLoad.setTotalReactivePower(StringUtils.getBigDecimal(obj.get("ZWGGL"))); + + dataLoad.setTotalApparentPower(StringUtils.getBigDecimal(obj.get("ZSZGL"))); + dataLoad.setTotalPowerFactor(StringUtils.getBigDecimal(obj.get("ZGLYS"))); + + // 二次相关数据 + dataLoad.setSecondaryAbLineVoltage(StringUtils.getBigDecimal(obj.get("ECABXDY"))); + dataLoad.setSecondaryAPhaseCurrent(StringUtils.getBigDecimal(obj.get("ECAXDL"))); + dataLoad.setSecondaryAPhaseVoltage(StringUtils.getBigDecimal(obj.get("ECAXDY"))); + dataLoad.setSecondaryAPowerFactor(StringUtils.getBigDecimal(obj.get("ECAXGLYS"))); + dataLoad.setSecondaryAApparentPower(StringUtils.getBigDecimal(obj.get("ECAXSZGL"))); + dataLoad.setSecondaryAReactivePower(StringUtils.getBigDecimal(obj.get("ECAXWGGL"))); + dataLoad.setSecondaryAActivePower(StringUtils.getBigDecimal(obj.get("ECAXYGGL"))); + dataLoad.setSecondaryBcLineVoltage(StringUtils.getBigDecimal(obj.get("ECBCXDY"))); + dataLoad.setSecondaryBPhaseCurrent(StringUtils.getBigDecimal(obj.get("ECBXDL"))); + dataLoad.setSecondaryBPhaseVoltage(StringUtils.getBigDecimal(obj.get("ECBXDY"))); + dataLoad.setSecondaryBPowerFactor(StringUtils.getBigDecimal(obj.get("ECBXGLYS"))); + dataLoad.setSecondaryBApparentPower(StringUtils.getBigDecimal(obj.get("ECBXSZGL"))); + dataLoad.setSecondaryBReactivePower(StringUtils.getBigDecimal(obj.get("ECBXWGGL"))); + dataLoad.setSecondaryBActivePower(StringUtils.getBigDecimal(obj.get("ECBXYGGL"))); + dataLoad.setSecondaryCaLineVoltage(StringUtils.getBigDecimal(obj.get("ECCAXDY"))); + dataLoad.setSecondaryCPhaseCurrent(StringUtils.getBigDecimal(obj.get("ECCXDL"))); + dataLoad.setSecondaryCPhaseVoltage(StringUtils.getBigDecimal(obj.get("ECCXDY"))); + dataLoad.setSecondaryCPowerFactor(StringUtils.getBigDecimal(obj.get("ECCXGLYS"))); + dataLoad.setSecondaryCApparentPower(StringUtils.getBigDecimal(obj.get("ECCXSZGL"))); + dataLoad.setSecondaryCReactivePower(StringUtils.getBigDecimal(obj.get("ECCXWGGL"))); + dataLoad.setSecondaryCActivePower(StringUtils.getBigDecimal(obj.get("ECCXYGGL"))); + dataLoad.setSecondaryGridFrequency(StringUtils.getBigDecimal(obj.get("ECDWPL"))); + dataLoad.setSecondaryReverseReactiveEnergy(StringUtils.getBigDecimal(obj.get("ECFXWGDN"))); + dataLoad.setSecondaryNegativeActiveEnergy(StringUtils.getBigDecimal(obj.get("ECFXYGDN"))); + dataLoad.setSecondaryTotalPowerFactor(StringUtils.getBigDecimal(obj.get("ECZGLYS"))); + dataLoad.setSecondaryTotalApparentPower(StringUtils.getBigDecimal(obj.get("ECZSZFL"))); + dataLoad.setSecondaryTotalReactivePower(StringUtils.getBigDecimal(obj.get("ECZWGGL"))); + dataLoad.setSecondaryPositiveReactiveEnergy(StringUtils.getBigDecimal(obj.get("ECZXWGDN"))); + dataLoad.setSecondaryPositiveActiveEnergy(StringUtils.getBigDecimal(obj.get("ECZXYGDN"))); + dataLoad.setSecondaryTotalActivePower(StringUtils.getBigDecimal(obj.get("ECZYGGL"))); + + // 需量 + dataLoad.setReverseReactiveEnergyEqMinus(StringUtils.getBigDecimal(obj.get("FXWGDN"))); + dataLoad.setReverseActiveEnergyEpMinus(StringUtils.getBigDecimal(obj.get("FXYGDN"))); + dataLoad.setPositiveReactiveEnergyEqPlus(StringUtils.getBigDecimal(obj.get("ZXWGDN"))); + dataLoad.setPositiveActiveEnergyEpPlus(StringUtils.getBigDecimal(obj.get("ZXYGDN"))); + + dataLoad.setCreateBy("system"); + dataLoad.setCreateTime(DateUtils.getNowDate()); + dataLoad.setUpdateBy("system"); + dataLoad.setUpdateTime(DateUtils.getNowDate()); + dataLoad.setSiteId(SITE_ID); + dataLoad.setDeviceId(deviceId); + + emsAmmeterDataMapper.insertEmsAmmeterData(dataLoad); + + redisCache.setCacheObject(RedisKeyConstants.AMMETER + SITE_ID + "_" +deviceId, dataLoad); + } // 数据分组处理 private static Map> processData(Map rawData) { Map> records = new HashMap<>(); diff --git a/ems-system/src/main/java/com/xzzn/ems/service/impl/SingleSiteServiceImpl.java b/ems-system/src/main/java/com/xzzn/ems/service/impl/SingleSiteServiceImpl.java index 4a27b11..2637a16 100644 --- a/ems-system/src/main/java/com/xzzn/ems/service/impl/SingleSiteServiceImpl.java +++ b/ems-system/src/main/java/com/xzzn/ems/service/impl/SingleSiteServiceImpl.java @@ -2,6 +2,7 @@ package com.xzzn.ems.service.impl; import com.xzzn.common.constant.RedisKeyConstants; import com.xzzn.common.core.redis.RedisCache; +import com.xzzn.common.enums.AmmeterCategoryStatus; import com.xzzn.common.enums.DeviceCategory; import com.xzzn.common.utils.StringUtils; import com.xzzn.ems.domain.*; @@ -334,25 +335,56 @@ public class SingleSiteServiceImpl implements ISingleSiteService { List ammeterDataVos = new ArrayList<>(); if (!StringUtils.isEmpty(siteId)) { - // 先获取所有电表设备 - List devicesList = emsDevicesSettingMapper.getAllBatteryDeviceBySiteId(siteId); - if (!CollectionUtils.isEmpty(devicesList)) { - for (EmsDevicesSetting devicesSetting : devicesList) { - AmmeterDataVo ammeterDataVo = new AmmeterDataVo(); - ammeterDataVo.setDeviceName(devicesSetting.getDeviceName()); - ammeterDataVo.setEmsCommunicationStatus(devicesSetting.getCommunicationStatus()); - String deviceId = devicesSetting.getDeviceId(); - // 获取类别数据 - List ammeterDataDetailInfos = emsAmmeterDataMapper.getAmmeterDetailInfo(siteId,deviceId); + // 先获取总表设备 + List> ammeterIdList = emsDevicesSettingMapper.getDeviceInfosBySiteIdAndCategory(siteId, DeviceCategory.AMMETER.getCode()); + for (Map ammeterDevice : ammeterIdList) { + AmmeterDataVo ammeterDataVo = new AmmeterDataVo(); + ammeterDataVo.setDeviceName(ammeterDevice.get("deviceName").toString()); + ammeterDataVo.setEmsCommunicationStatus(ammeterDevice.get("communicationStatus").toString()); + // 从redis取总表详细数据 + String ammeterId = ammeterDevice.get("id").toString(); + EmsAmmeterData ammeterData = redisCache.getCacheObject(RedisKeyConstants.AMMETER + siteId + "_" +ammeterId); + if (ammeterData != null) { + ammeterDataVo.setDataUpdateTime(ammeterData.getDataUpdateTime()); + // 处理类别数据 + List ammeterDataDetailInfos = new ArrayList<>(); + dealAmmeterCategoryDataInfo(ammeterData,ammeterDataDetailInfos); ammeterDataVo.setAmmeterDataDetailInfos(ammeterDataDetailInfos); - // 数据更新时间 - ammeterDataVo.setDataUpdateTime(ammeterDataDetailInfos.get(0).getUpdateTime()); - - ammeterDataVos.add(ammeterDataVo); } + + ammeterDataVos.add(ammeterDataVo); } } return ammeterDataVos; } + private void dealAmmeterCategoryDataInfo(EmsAmmeterData ammeterData, List ammeterDataDetailInfos) { + // 累计放电量 + AmmeterDataDetailInfo ammeterDataDetailInfo1 = new AmmeterDataDetailInfo(); + ammeterDataDetailInfo1.setCategory(AmmeterCategoryStatus.TOTAL_CHARGE.getInfo()); + ammeterDataDetailInfo1.setTotalKwh(ammeterData.getCurrentCombActiveTotal()); + ammeterDataDetailInfo1.setSharpKwh(ammeterData.getCurrentCombActivePeak()); + ammeterDataDetailInfo1.setPeakKwh(ammeterData.getCurrentCombActiveHigh()); + ammeterDataDetailInfo1.setFlatKwh(ammeterData.getCurrentCombActiveFlat()); + ammeterDataDetailInfo1.setValleyKwh(ammeterData.getCurrentCombActiveValley()); + ammeterDataDetailInfos.add(ammeterDataDetailInfo1); + // 累计放电量 + AmmeterDataDetailInfo ammeterDataDetailInfo2 = new AmmeterDataDetailInfo(); + ammeterDataDetailInfo2.setCategory(AmmeterCategoryStatus.TOTAL_DISCHARGE.getInfo()); + ammeterDataDetailInfo2.setTotalKwh(ammeterData.getCurrentCombReactiveTotal()); + ammeterDataDetailInfo2.setSharpKwh(ammeterData.getCurrentCombReactivePeak()); + ammeterDataDetailInfo2.setPeakKwh(ammeterData.getCurrentCombReactiveHigh()); + ammeterDataDetailInfo2.setFlatKwh(ammeterData.getCurrentCombReactiveFlat()); + ammeterDataDetailInfo2.setValleyKwh(ammeterData.getCurrentCombReactiveValley()); + ammeterDataDetailInfos.add(ammeterDataDetailInfo2); + // 日放电量 + AmmeterDataDetailInfo ammeterDataDetailInfo3 = new AmmeterDataDetailInfo(); + ammeterDataDetailInfo3.setCategory(AmmeterCategoryStatus.DAILY_CHARGE.getInfo()); + ammeterDataDetailInfos.add(ammeterDataDetailInfo3); + // 日充电量 + AmmeterDataDetailInfo ammeterDataDetailInfo4 = new AmmeterDataDetailInfo(); + ammeterDataDetailInfo4.setCategory(AmmeterCategoryStatus.DAILY_DISCHARGE.getInfo()); + ammeterDataDetailInfos.add(ammeterDataDetailInfo4); + } + } diff --git a/ems-system/src/main/resources/mapper/ems/EmsAmmeterDataMapper.xml b/ems-system/src/main/resources/mapper/ems/EmsAmmeterDataMapper.xml index 81f17fc..01c652e 100644 --- a/ems-system/src/main/resources/mapper/ems/EmsAmmeterDataMapper.xml +++ b/ems-system/src/main/resources/mapper/ems/EmsAmmeterDataMapper.xml @@ -7,37 +7,211 @@ - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - select id, data_update_time, category, total_kwh, sharp_kwh, peak_kwh, flat_kwh, valley_kwh, create_by, create_time, update_by, update_time, remark, site_id, device_id from ems_ammeter_data + select id, data_update_time, current_comb_active_total, current_comb_active_peak, current_comb_active_high, current_comb_active_flat, current_comb_active_valley, current_forward_active_total, current_forward_active_peak, current_forward_active_high, current_forward_active_flat, current_forward_active_valley, current_reverse_active_total, current_reverse_active_peak, current_reverse_active_high, current_reverse_active_flat, current_reverse_active_valley, current_comb_reactive_total, current_comb_reactive_peak, current_comb_reactive_high, current_comb_reactive_flat, current_comb_reactive_valley, current_forward_reactive_total, current_forward_reactive_peak, current_forward_reactive_high, current_forward_reactive_flat, current_forward_reactive_valley, current_reverse_reactive_total, current_reverse_reactive_peak, current_reverse_reactive_high, current_reverse_reactive_flat, current_reverse_reactive_valley, phase_a_voltage, phase_b_voltage, phase_c_voltage, phase_a_current, phase_b_current, phase_c_current, frequency, ab_line_voltage, cb_line_voltage, ac_line_voltage, forward_ac_max_demand, reverse_ac_max_demand, phase_a_active_power, phase_b_active_power, phase_c_active_power, total_active_power, phase_a_reactive_power, phase_b_reactive_power, phase_c_reactive_power, total_reactive_power, phase_a_apparent_power, phase_b_apparent_power, phase_c_apparent_power, total_apparent_power, phase_a_power_factor, phase_b_power_factor, phase_c_power_factor, total_power_factor, daily_forward_max_demand, site_id, device_id, create_by, create_time, update_by, update_time, remark, secondary_ab_line_voltage, secondary_a_phase_current, secondary_a_phase_voltage, secondary_a_power_factor, secondary_a_apparent_power, secondary_a_reactive_power, secondary_a_active_power, secondary_bc_line_voltage, secondary_b_phase_current, secondary_b_phase_voltage, secondary_b_power_factor, secondary_b_apparent_power, secondary_b_reactive_power, secondary_b_active_power, secondary_ca_line_voltage, secondary_c_phase_current, secondary_c_phase_voltage, secondary_c_power_factor, secondary_c_apparent_power, secondary_c_reactive_power, secondary_c_active_power, secondary_grid_frequency, secondary_reverse_reactive_energy, secondary_negative_active_energy, secondary_total_power_factor, secondary_total_apparent_power, secondary_total_reactive_power, secondary_positive_reactive_energy, secondary_positive_active_energy, secondary_total_active_power, reverse_reactive_energy_eq_minus, reverse_active_energy_ep_minus, positive_reactive_energy_eq_plus, positive_active_energy_ep_plus from ems_ammeter_data @@ -50,35 +224,209 @@ insert into ems_ammeter_data data_update_time, - category, - total_kwh, - sharp_kwh, - peak_kwh, - flat_kwh, - valley_kwh, + current_comb_active_total, + current_comb_active_peak, + current_comb_active_high, + current_comb_active_flat, + current_comb_active_valley, + current_forward_active_total, + current_forward_active_peak, + current_forward_active_high, + current_forward_active_flat, + current_forward_active_valley, + current_reverse_active_total, + current_reverse_active_peak, + current_reverse_active_high, + current_reverse_active_flat, + current_reverse_active_valley, + current_comb_reactive_total, + current_comb_reactive_peak, + current_comb_reactive_high, + current_comb_reactive_flat, + current_comb_reactive_valley, + current_forward_reactive_total, + current_forward_reactive_peak, + current_forward_reactive_high, + current_forward_reactive_flat, + current_forward_reactive_valley, + current_reverse_reactive_total, + current_reverse_reactive_peak, + current_reverse_reactive_high, + current_reverse_reactive_flat, + current_reverse_reactive_valley, + phase_a_voltage, + phase_b_voltage, + phase_c_voltage, + phase_a_current, + phase_b_current, + phase_c_current, + frequency, + ab_line_voltage, + cb_line_voltage, + ac_line_voltage, + forward_ac_max_demand, + reverse_ac_max_demand, + phase_a_active_power, + phase_b_active_power, + phase_c_active_power, + total_active_power, + phase_a_reactive_power, + phase_b_reactive_power, + phase_c_reactive_power, + total_reactive_power, + phase_a_apparent_power, + phase_b_apparent_power, + phase_c_apparent_power, + total_apparent_power, + phase_a_power_factor, + phase_b_power_factor, + phase_c_power_factor, + total_power_factor, + daily_forward_max_demand, + site_id, + device_id, create_by, create_time, update_by, update_time, remark, - site_id, - device_id, + secondary_ab_line_voltage, + secondary_a_phase_current, + secondary_a_phase_voltage, + secondary_a_power_factor, + secondary_a_apparent_power, + secondary_a_reactive_power, + secondary_a_active_power, + secondary_bc_line_voltage, + secondary_b_phase_current, + secondary_b_phase_voltage, + secondary_b_power_factor, + secondary_b_apparent_power, + secondary_b_reactive_power, + secondary_b_active_power, + secondary_ca_line_voltage, + secondary_c_phase_current, + secondary_c_phase_voltage, + secondary_c_power_factor, + secondary_c_apparent_power, + secondary_c_reactive_power, + secondary_c_active_power, + secondary_grid_frequency, + secondary_reverse_reactive_energy, + secondary_negative_active_energy, + secondary_total_power_factor, + secondary_total_apparent_power, + secondary_total_reactive_power, + secondary_positive_reactive_energy, + secondary_positive_active_energy, + secondary_total_active_power, + reverse_reactive_energy_eq_minus, + reverse_active_energy_ep_minus, + positive_reactive_energy_eq_plus, + positive_active_energy_ep_plus, #{dataUpdateTime}, - #{category}, - #{totalKwh}, - #{sharpKwh}, - #{peakKwh}, - #{flatKwh}, - #{valleyKwh}, + #{currentCombActiveTotal}, + #{currentCombActivePeak}, + #{currentCombActiveHigh}, + #{currentCombActiveFlat}, + #{currentCombActiveValley}, + #{currentForwardActiveTotal}, + #{currentForwardActivePeak}, + #{currentForwardActiveHigh}, + #{currentForwardActiveFlat}, + #{currentForwardActiveValley}, + #{currentReverseActiveTotal}, + #{currentReverseActivePeak}, + #{currentReverseActiveHigh}, + #{currentReverseActiveFlat}, + #{currentReverseActiveValley}, + #{currentCombReactiveTotal}, + #{currentCombReactivePeak}, + #{currentCombReactiveHigh}, + #{currentCombReactiveFlat}, + #{currentCombReactiveValley}, + #{currentForwardReactiveTotal}, + #{currentForwardReactivePeak}, + #{currentForwardReactiveHigh}, + #{currentForwardReactiveFlat}, + #{currentForwardReactiveValley}, + #{currentReverseReactiveTotal}, + #{currentReverseReactivePeak}, + #{currentReverseReactiveHigh}, + #{currentReverseReactiveFlat}, + #{currentReverseReactiveValley}, + #{phaseAVoltage}, + #{phaseBVoltage}, + #{phaseCVoltage}, + #{phaseACurrent}, + #{phaseBCurrent}, + #{phaseCCurrent}, + #{frequency}, + #{abLineVoltage}, + #{cbLineVoltage}, + #{acLineVoltage}, + #{forwardAcMaxDemand}, + #{reverseAcMaxDemand}, + #{phaseAActivePower}, + #{phaseBActivePower}, + #{phaseCActivePower}, + #{totalActivePower}, + #{phaseAReactivePower}, + #{phaseBReactivePower}, + #{phaseCReactivePower}, + #{totalReactivePower}, + #{phaseAApparentPower}, + #{phaseBApparentPower}, + #{phaseCApparentPower}, + #{totalApparentPower}, + #{phaseAPowerFactor}, + #{phaseBPowerFactor}, + #{phaseCPowerFactor}, + #{totalPowerFactor}, + #{dailyForwardMaxDemand}, + #{siteId}, + #{deviceId}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{remark}, - #{siteId}, - #{deviceId}, + #{secondaryAbLineVoltage}, + #{secondaryAPhaseCurrent}, + #{secondaryAPhaseVoltage}, + #{secondaryAPowerFactor}, + #{secondaryAApparentPower}, + #{secondaryAReactivePower}, + #{secondaryAActivePower}, + #{secondaryBcLineVoltage}, + #{secondaryBPhaseCurrent}, + #{secondaryBPhaseVoltage}, + #{secondaryBPowerFactor}, + #{secondaryBApparentPower}, + #{secondaryBReactivePower}, + #{secondaryBActivePower}, + #{secondaryCaLineVoltage}, + #{secondaryCPhaseCurrent}, + #{secondaryCPhaseVoltage}, + #{secondaryCPowerFactor}, + #{secondaryCApparentPower}, + #{secondaryCReactivePower}, + #{secondaryCActivePower}, + #{secondaryGridFrequency}, + #{secondaryReverseReactiveEnergy}, + #{secondaryNegativeActiveEnergy}, + #{secondaryTotalPowerFactor}, + #{secondaryTotalApparentPower}, + #{secondaryTotalReactivePower}, + #{secondaryPositiveReactiveEnergy}, + #{secondaryPositiveActiveEnergy}, + #{secondaryTotalActivePower}, + #{reverseReactiveEnergyEqMinus}, + #{reverseActiveEnergyEpMinus}, + #{positiveReactiveEnergyEqPlus}, + #{positiveActiveEnergyEpPlus}, @@ -86,19 +434,106 @@ update ems_ammeter_data data_update_time = #{dataUpdateTime}, - category = #{category}, - total_kwh = #{totalKwh}, - sharp_kwh = #{sharpKwh}, - peak_kwh = #{peakKwh}, - flat_kwh = #{flatKwh}, - valley_kwh = #{valleyKwh}, + current_comb_active_total = #{currentCombActiveTotal}, + current_comb_active_peak = #{currentCombActivePeak}, + current_comb_active_high = #{currentCombActiveHigh}, + current_comb_active_flat = #{currentCombActiveFlat}, + current_comb_active_valley = #{currentCombActiveValley}, + current_forward_active_total = #{currentForwardActiveTotal}, + current_forward_active_peak = #{currentForwardActivePeak}, + current_forward_active_high = #{currentForwardActiveHigh}, + current_forward_active_flat = #{currentForwardActiveFlat}, + current_forward_active_valley = #{currentForwardActiveValley}, + current_reverse_active_total = #{currentReverseActiveTotal}, + current_reverse_active_peak = #{currentReverseActivePeak}, + current_reverse_active_high = #{currentReverseActiveHigh}, + current_reverse_active_flat = #{currentReverseActiveFlat}, + current_reverse_active_valley = #{currentReverseActiveValley}, + current_comb_reactive_total = #{currentCombReactiveTotal}, + current_comb_reactive_peak = #{currentCombReactivePeak}, + current_comb_reactive_high = #{currentCombReactiveHigh}, + current_comb_reactive_flat = #{currentCombReactiveFlat}, + current_comb_reactive_valley = #{currentCombReactiveValley}, + current_forward_reactive_total = #{currentForwardReactiveTotal}, + current_forward_reactive_peak = #{currentForwardReactivePeak}, + current_forward_reactive_high = #{currentForwardReactiveHigh}, + current_forward_reactive_flat = #{currentForwardReactiveFlat}, + current_forward_reactive_valley = #{currentForwardReactiveValley}, + current_reverse_reactive_total = #{currentReverseReactiveTotal}, + current_reverse_reactive_peak = #{currentReverseReactivePeak}, + current_reverse_reactive_high = #{currentReverseReactiveHigh}, + current_reverse_reactive_flat = #{currentReverseReactiveFlat}, + current_reverse_reactive_valley = #{currentReverseReactiveValley}, + phase_a_voltage = #{phaseAVoltage}, + phase_b_voltage = #{phaseBVoltage}, + phase_c_voltage = #{phaseCVoltage}, + phase_a_current = #{phaseACurrent}, + phase_b_current = #{phaseBCurrent}, + phase_c_current = #{phaseCCurrent}, + frequency = #{frequency}, + ab_line_voltage = #{abLineVoltage}, + cb_line_voltage = #{cbLineVoltage}, + ac_line_voltage = #{acLineVoltage}, + forward_ac_max_demand = #{forwardAcMaxDemand}, + reverse_ac_max_demand = #{reverseAcMaxDemand}, + phase_a_active_power = #{phaseAActivePower}, + phase_b_active_power = #{phaseBActivePower}, + phase_c_active_power = #{phaseCActivePower}, + total_active_power = #{totalActivePower}, + phase_a_reactive_power = #{phaseAReactivePower}, + phase_b_reactive_power = #{phaseBReactivePower}, + phase_c_reactive_power = #{phaseCReactivePower}, + total_reactive_power = #{totalReactivePower}, + phase_a_apparent_power = #{phaseAApparentPower}, + phase_b_apparent_power = #{phaseBApparentPower}, + phase_c_apparent_power = #{phaseCApparentPower}, + total_apparent_power = #{totalApparentPower}, + phase_a_power_factor = #{phaseAPowerFactor}, + phase_b_power_factor = #{phaseBPowerFactor}, + phase_c_power_factor = #{phaseCPowerFactor}, + total_power_factor = #{totalPowerFactor}, + daily_forward_max_demand = #{dailyForwardMaxDemand}, + site_id = #{siteId}, + device_id = #{deviceId}, create_by = #{createBy}, create_time = #{createTime}, update_by = #{updateBy}, update_time = #{updateTime}, remark = #{remark}, - site_id = #{siteId}, - device_id = #{deviceId}, + secondary_ab_line_voltage = #{secondaryAbLineVoltage}, + secondary_a_phase_current = #{secondaryAPhaseCurrent}, + secondary_a_phase_voltage = #{secondaryAPhaseVoltage}, + secondary_a_power_factor = #{secondaryAPowerFactor}, + secondary_a_apparent_power = #{secondaryAApparentPower}, + secondary_a_reactive_power = #{secondaryAReactivePower}, + secondary_a_active_power = #{secondaryAActivePower}, + secondary_bc_line_voltage = #{secondaryBcLineVoltage}, + secondary_b_phase_current = #{secondaryBPhaseCurrent}, + secondary_b_phase_voltage = #{secondaryBPhaseVoltage}, + secondary_b_power_factor = #{secondaryBPowerFactor}, + secondary_b_apparent_power = #{secondaryBApparentPower}, + secondary_b_reactive_power = #{secondaryBReactivePower}, + secondary_b_active_power = #{secondaryBActivePower}, + secondary_ca_line_voltage = #{secondaryCaLineVoltage}, + secondary_c_phase_current = #{secondaryCPhaseCurrent}, + secondary_c_phase_voltage = #{secondaryCPhaseVoltage}, + secondary_c_power_factor = #{secondaryCPowerFactor}, + secondary_c_apparent_power = #{secondaryCApparentPower}, + secondary_c_reactive_power = #{secondaryCReactivePower}, + secondary_c_active_power = #{secondaryCActivePower}, + secondary_grid_frequency = #{secondaryGridFrequency}, + secondary_reverse_reactive_energy = #{secondaryReverseReactiveEnergy}, + secondary_negative_active_energy = #{secondaryNegativeActiveEnergy}, + secondary_total_power_factor = #{secondaryTotalPowerFactor}, + secondary_total_apparent_power = #{secondaryTotalApparentPower}, + secondary_total_reactive_power = #{secondaryTotalReactivePower}, + secondary_positive_reactive_energy = #{secondaryPositiveReactiveEnergy}, + secondary_positive_active_energy = #{secondaryPositiveActiveEnergy}, + secondary_total_active_power = #{secondaryTotalActivePower}, + reverse_reactive_energy_eq_minus = #{reverseReactiveEnergyEqMinus}, + reverse_active_energy_ep_minus = #{reverseActiveEnergyEpMinus}, + positive_reactive_energy_eq_plus = #{positiveReactiveEnergyEqPlus}, + positive_active_energy_ep_plus = #{positiveActiveEnergyEpPlus}, where id = #{id}