diff --git a/application/src/main/resources/application.yml b/application/src/main/resources/application.yml index 8c251e5..30fd8ff 100644 --- a/application/src/main/resources/application.yml +++ b/application/src/main/resources/application.yml @@ -113,7 +113,7 @@ calculate: am_total: offset: 24 #当数据出现断点时,向后偏移查询多少小时 interval: 15 # 分区间统计,间隔时长(分)1/3/5/10/15/20/30/60 - keys: A29,B2,C2,C6,D2,D4,E3,E4,F4,G2,G4,H2,I2,I4,K2,N2,N4,P4,Q2,R2,R4,S2,S4,F2,T2,T4,U2,U4,J2,J4,L2,A30,P2,Q4,V2,V4,A29_rush,A29_peak,A29_valley,A29_normal,A29_generate,A30_rush,A30_peak,A30_valley,A30_normal,tce_C6,tce_A29,tce_E3,CO2_A29,CO2_C6,CO2_E3,CO2_run,tce_run,tce_E3,A201,A202,A204,tce_J2,gdp,tce,tce_vol,tce_B2,tce_H2,firms,CO2,CO2_vol + keys: A29,B2,C2,C6,D2,D4,E3,E4,F4,G2,G4,H2,I2,I4,K2,N2,N4,P4,Q2,R2,R4,S2,S4,F2,T2,T4,U2,U4,J2,J4,L2,A30,P2,Q4,V2,V4,A29_rush,A29_peak,A29_valley,A29_normal,A29_generate,A30_rush,A30_peak,A30_valley,A30_normal,tce_C6,tce_A29,tce_E3,CO2_A29,CO2_C6,CO2_E3,CO2_run,tce_run,tce_E3,A201,A202,A204,tce_J2,gdp,tce,tce_vol,tce_B2,tce_H2,firms,CO2,CO2_vol,CO2_subtr ddmmyy: #例如:每月1号0时0分 开始统计年/月/日用量 start_hh: 0 #小时/天/月/年 用量统计开始的分钟数(0-59) start_dd: 0 #天/月/年 用量统计开始的小时(0-23) diff --git a/modules/qingyuan/src/main/java/com/thing/qingyuan/basedevice/dto/DeviceDTO.java b/modules/qingyuan/src/main/java/com/thing/qingyuan/basedevice/dto/DeviceDTO.java index 6d08a45..ee632cf 100644 --- a/modules/qingyuan/src/main/java/com/thing/qingyuan/basedevice/dto/DeviceDTO.java +++ b/modules/qingyuan/src/main/java/com/thing/qingyuan/basedevice/dto/DeviceDTO.java @@ -19,7 +19,7 @@ public class DeviceDTO implements Serializable { private static final long serialVersionUID = 1L; @Schema(description = "设备ID") - private Long deviceId; + private String deviceId; @Schema(description = "设备类型: 1.采集器 2.逆变器 3.电表 4.EPM 5.气象仪") private Integer deviceType; @Schema(description = "设备类型2: 与 productKey及deviceType2 关联") @@ -50,4 +50,12 @@ public class DeviceDTO implements Serializable { private String alias; @Schema(description = "网络状态") private String netWorkType="4G"; + /** + * 设备别名 + */ + private Integer devcode; + /** + * 设备别名 + */ + private Integer devaddr; } \ No newline at end of file diff --git a/modules/qingyuan/src/main/java/com/thing/qingyuan/basedevice/entity/DeviceEntity.java b/modules/qingyuan/src/main/java/com/thing/qingyuan/basedevice/entity/DeviceEntity.java index 1410f3e..37c5872 100644 --- a/modules/qingyuan/src/main/java/com/thing/qingyuan/basedevice/entity/DeviceEntity.java +++ b/modules/qingyuan/src/main/java/com/thing/qingyuan/basedevice/entity/DeviceEntity.java @@ -1,6 +1,5 @@ package com.thing.qingyuan.basedevice.entity; -import com.mybatisflex.annotation.Id; import com.mybatisflex.annotation.Table; import lombok.Data; import lombok.EqualsAndHashCode; @@ -24,8 +23,7 @@ public class DeviceEntity implements Serializable { /** * 设备ID */ - @Id - private Long deviceId; + private String deviceId; /** * 设备类型: * 1.采集器 @@ -40,9 +38,9 @@ public class DeviceEntity implements Serializable { */ private Integer deviceType2; /** - * 设备SN + * 设备pn */ - private String deviceSn; + private String devicePn; /** * 设备首次上电日期 */ @@ -79,4 +77,12 @@ public class DeviceEntity implements Serializable { * 设备别名 */ private String alias; + /** + * 设备别名 + */ + private Integer devcode; + /** + * 设备别名 + */ + private Integer devaddr; } \ No newline at end of file diff --git a/modules/qingyuan/src/main/java/com/thing/qingyuan/manageboard/dto/PlantDTO.java b/modules/qingyuan/src/main/java/com/thing/qingyuan/manageboard/dto/PlantDTO.java index 9f6a82e..2210059 100644 --- a/modules/qingyuan/src/main/java/com/thing/qingyuan/manageboard/dto/PlantDTO.java +++ b/modules/qingyuan/src/main/java/com/thing/qingyuan/manageboard/dto/PlantDTO.java @@ -60,20 +60,26 @@ public class PlantDTO implements Serializable { @Schema(description = "电站收益, 每千瓦时发电量收益") private BigDecimal unitProfit; @Schema(description = "当年每千瓦时发电量减排二氧化碳量") - private String reduction; + private String reductionyy; @Schema(description = "当年发电A29") - private String attrKey29; + private String attrKey29yy; @Schema(description = "当年发电量") - private String val29; + private String val29yy; @Schema(description = "发电功率A16") private String attrKey16; @Schema(description = "发电功率") private String val16; @Schema(description = "今日发电量") - private String attrKeyToday29; + private String attrKey29dd; @Schema(description = "今日发电量") - private String valToday29; + private String val29dd; @Schema(description = "今日每千瓦时发电量减排二氧化碳量") - private String todayReduction; + private String reductiondd; + @Schema(description = "逆变器数量") + private Integer inverterNum = 0; + @Schema(description = "检测点运行正常") + private BigDecimal pointNormal = BigDecimal.ZERO; + @Schema(description = "检测点运行总量") + private BigDecimal pointTotal = BigDecimal.ZERO; } \ No newline at end of file diff --git a/modules/qingyuan/src/main/java/com/thing/qingyuan/manageboard/service/impl/PlantServiceImpl.java b/modules/qingyuan/src/main/java/com/thing/qingyuan/manageboard/service/impl/PlantServiceImpl.java index 0dca8a6..4d2bde2 100644 --- a/modules/qingyuan/src/main/java/com/thing/qingyuan/manageboard/service/impl/PlantServiceImpl.java +++ b/modules/qingyuan/src/main/java/com/thing/qingyuan/manageboard/service/impl/PlantServiceImpl.java @@ -214,15 +214,20 @@ public class PlantServiceImpl extends BaseServiceImpl } for (PlantDTO plantDTO : plantDTOS) { Long plantId = plantDTO.getPlantId(); + List deviceDTOS = iotDeviceService.findByPlantId(plantId, 2); + //逆变器数量 + plantDTO.setInverterNum(CollectionUtils.size(deviceDTOS)); + //调用正常的逆变器状态 + plantDTO.setPointNormal(BigDecimal.valueOf(deviceDTOS.stream().filter(s-> Objects.equals(s.getStatus(),0)).count())); //年发电量 TsKvDTO tsKvDTO29 = tsKvService.findLatestByCodeAndAttr(String.valueOf(plantId), "A29yy"); if(!Objects.isNull(tsKvDTO29)){ - plantDTO.setAttrKey29(tsKvDTO29.getAttrKey()); - plantDTO.setVal29(tsKvDTO29.getVal()); + plantDTO.setAttrKey29yy(tsKvDTO29.getAttrKey()); + plantDTO.setVal29yy(tsKvDTO29.getVal()); //年减排量 if(!Objects.isNull(plantDTO.getProfitco2())){ BigDecimal reductionUsage = CalculationUtil.getCarbonUsage(new BigDecimal(tsKvDTO29.getVal()), reductionFactor, coefficient, 2); - plantDTO.setReduction(reductionUsage.toPlainString()); + plantDTO.setReductionyy(reductionUsage.toPlainString()); } } //当前功率 @@ -234,12 +239,12 @@ public class PlantServiceImpl extends BaseServiceImpl //今日发电量 TsKvDTO tsKvDToday29 = tsKvService.findLatestByCodeAndAttr(String.valueOf(plantId), "A29dd"); if(!Objects.isNull(tsKvDToday29)){ - plantDTO.setAttrKeyToday29(tsKvDToday29.getAttrKey()); - plantDTO.setValToday29(tsKvDToday29.getVal()); + plantDTO.setAttrKey29dd(tsKvDToday29.getAttrKey()); + plantDTO.setVal29dd(tsKvDToday29.getVal()); //今日减排量 if(!Objects.isNull(plantDTO.getProfitco2())){ BigDecimal reductionUsage = CalculationUtil.getCarbonUsage(new BigDecimal(tsKvDToday29.getVal()), reductionFactor, coefficient, 2); - plantDTO.setTodayReduction(reductionUsage.toPlainString()); + plantDTO.setReductiondd(reductionUsage.toPlainString()); } } }