From 4a1ac3f8e560fb7dedbe216f57a78945655b26c7 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Wed, 28 Aug 2024 14:53:21 +0800 Subject: [PATCH] =?UTF-8?q?#=E7=94=B5=E9=87=8F=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hnac/hzims/equipment/entity/ThreeGenerationEntity.java | 3 +++ .../com/hnac/hzims/operational/main/constant/HomePageConstant.java | 1 + .../service/operation/home/impl/ObtainGenerationServiceImpl.java | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/entity/ThreeGenerationEntity.java b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/entity/ThreeGenerationEntity.java index 276d3f7..5498e9d 100644 --- a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/entity/ThreeGenerationEntity.java +++ b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/entity/ThreeGenerationEntity.java @@ -40,4 +40,7 @@ public class ThreeGenerationEntity extends TenantEntity { @ApiModelProperty(value = "发电量") private BigDecimal generate; + + @ApiModelProperty(value = "无功电量") + private BigDecimal reactiveGenerate; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/HomePageConstant.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/HomePageConstant.java index 4337c56..accbd76 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/HomePageConstant.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/HomePageConstant.java @@ -173,6 +173,7 @@ public interface HomePageConstant { // 水电站实时属性名称 String HYDROPOWER_GENERATE_POWER = "generation_capacity"; // 发电量 + String HYDROPOWER_REACTIVE_GENERATE = "reactive_generate"; // 无功电量 String HYDROPOWER_ACTIVE_POWER = "active_power"; // 有功功率 String HYDROPOWER_REACTIVE_POWER = "reactive_power"; // 有功功率 String HYDROPOWER_POWERFACTOR = "index_jz_cos"; // 功率因数 diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ObtainGenerationServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ObtainGenerationServiceImpl.java index e791794..ff44095 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ObtainGenerationServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ObtainGenerationServiceImpl.java @@ -363,6 +363,7 @@ public class ObtainGenerationServiceImpl implements ObtainGenerationService { if(CollectionUtil.isEmpty(records)){ return; } + List reactives = dataService.periodTargetData(start,end,5,5,device.getEmCode(),HomePageConstant.HYDROPOWER_REACTIVE_GENERATE); // 保存设备发电量 threeGenerateService.saveBatch(records.stream().map(record -> { ThreeGenerationEntity generate = new ThreeGenerationEntity(); @@ -387,6 +388,11 @@ public class ObtainGenerationServiceImpl implements ObtainGenerationService { }else{ generate.setGenerate(BigDecimal.valueOf(Double.parseDouble(record.getVal()) * device.getRideCount())); } + // 无功电量 + if(CollectionUtil.isEmpty(reactives)){ + generate.setReactiveGenerate(BigDecimal.ZERO); + } + return generate; }).collect(Collectors.toList())); });