From eb8d326b6ca9f81f814cd053672b6d3678f05e32 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Mon, 27 May 2024 08:49:22 +0800 Subject: [PATCH 1/4] =?UTF-8?q?#=E5=A4=A7=E6=A8=A1=E5=9E=8B=E5=8F=91?= =?UTF-8?q?=E7=94=B5=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzims/bigmodel/interactive/controller/InteractiveController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/controller/InteractiveController.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/controller/InteractiveController.java index 0771fba..c109e57 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/controller/InteractiveController.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/controller/InteractiveController.java @@ -90,6 +90,6 @@ public class InteractiveController { @RequestParam @ApiParam("结束时间")String endTime) { double generate = interactiveService.generation(stationId,startTime,endTime); DecimalFormat format = new DecimalFormat("0.00"); - return R.data(format.format(generate) + "kwh"); + return R.data(format.format(generate) + "kWh"); } } From ce28eac1b62e611a3558e55f16bb5e3bb3a206a0 Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Mon, 27 May 2024 09:15:58 +0800 Subject: [PATCH 2/4] =?UTF-8?q?add:=E7=AB=99=E7=82=B9=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../constants/SearchStationTypeEnum.java | 25 ++++++++++++---------- .../websocket/handler/InteractiveHandler.java | 14 ++++++++++++ .../operational/station/feign/StationClient.java | 2 +- 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/constants/SearchStationTypeEnum.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/constants/SearchStationTypeEnum.java index 51ce3a1..ea935c1 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/constants/SearchStationTypeEnum.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/constants/SearchStationTypeEnum.java @@ -11,17 +11,20 @@ import java.util.Arrays; */ @AllArgsConstructor public enum SearchStationTypeEnum { - TOTAL("站点总数量",null,"运维平台目前接入站点总数为:%s"), - HYDROPOWER_TOTAL("水电站总数量","0","运维平台目前接入水电站总数为:%s"), - WIND_POWER_TOTAL("风电场总数量","1","运维平台目前接入风电场总数为:%s"), - ENERGY_STORAGE_TOTAL("储能站总数量","3","运维平台目前接入储能站总数为:%s"), - PHOTOVOLTAIC_TOTAL("光伏站总数量","5","运维平台目前接入光伏站总数为:%s"), - CHARGE_TOTAL("充电站总数量","7","运维平台目前接入充电站总数为:%s"), - HYDROPOWER_NUM("水电站接入量","0","运维平台目前接入水电站接入量为:%s"), - WIND_POWER_NUM("风电场接入量","1","运维平台目前接入风电场接入量为:%s"), - ENERGY_STORAGE_NUM("储能站接入量","3","运维平台目前接入储能站接入量为:%s"), - PHOTOVOLTAIC_NUM("光伏站接入量","5","运维平台目前接入光伏站接入量为:%s"), - CHARGE_NUM("充电站接入量","7","运维平台目前接入充电站接入量为:%s"), + STATION_TOTAL("电站总数量",null,"智能运维平台接入电站总数为:%s"), + SET_TOTAL("站点总数量",null,"智能运维平台接入站点总数为:%s"), + HYDROPOWER_TOTAL("水电站总数量","0","智能运维平台接入水电站总数为:%s"), + WIND_POWER_TOTAL("风电场总数量","1","智能运维平台接入风电场总数为:%s"), + ENERGY_STORAGE_TOTAL("储能站总数量","3","智能运维平台接入储能站总数为:%s"), + PHOTOVOLTAIC_TOTAL("光伏站总数量","5","智能运维平台接入光伏站总数为:%s"), + CHARGE_TOTAL("充电站总数量","7","智能运维平台接入充电站总数为:%s"), + STATION_NUM("电站接入量",null,"智能运维平台接入电站总数为:%s"), + SET_NUM("站点接入量",null,"智能运维平台接入站点总数为:%s"), + HYDROPOWER_NUM("水电站接入量","0","智能运维平台接入水电站接入量为:%s"), + WIND_POWER_NUM("风电场接入量","1","智能运维平台接入风电场接入量为:%s"), + ENERGY_STORAGE_NUM("储能站接入量","3","智能运维平台接入储能站接入量为:%s"), + PHOTOVOLTAIC_NUM("光伏站接入量","5","智能运维平台接入光伏站接入量为:%s"), + CHARGE_NUM("充电站接入量","7","智能运维平台接入充电站接入量为:%s"), ; @Getter diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/websocket/handler/InteractiveHandler.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/websocket/handler/InteractiveHandler.java index 23b8d2e..c8a5ce8 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/websocket/handler/InteractiveHandler.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/websocket/handler/InteractiveHandler.java @@ -117,6 +117,8 @@ public class InteractiveHandler extends TextWebSocketHandler { case CHOOSE_FAULT: this.handleFaultChoose(messageContext,sessionId); break; + case CHOOSE_YC: + this.handleDataChoose(messageContext,sessionId); default: break; } @@ -209,4 +211,16 @@ public class InteractiveHandler extends TextWebSocketHandler { extra.put("data",data); interactiveService.specialAsk(sessionId,userId,extra); } + + private void handleDataChoose(JSONObject messageContext,String sessionId) { + IInteractiveService interactiveService = SpringUtil.getBean(IInteractiveService.class); + String userId = messageContext.getString("userId"); + String funcCode = messageContext.getString("funcCode"); + FaultSelectionVO selectionVO = messageContext.getObject("selection",FaultSelectionVO.class); + Map extra = new HashMap<>(2); + extra.put("func",funcCode); + extra.put("data",selectionVO); + interactiveService.specialAsk(sessionId,userId,extra); + } + } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/feign/StationClient.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/feign/StationClient.java index fbefca8..b2ca924 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/feign/StationClient.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/feign/StationClient.java @@ -144,7 +144,7 @@ public class StationClient implements IStationClient { @RequestParam(required = false) String endTime, @RequestParam(required = false) String type) { LambdaQueryWrapper wrapper = Wrappers.lambdaQuery() - .eq(StationEntity::getType, type) + .eq(StringUtil.isNotBlank(type) && Func.isNotEmpty(type),StationEntity::getType, type) .le(StringUtil.isNotBlank(endTime) && Func.isNotEmpty(endTime),StationEntity::getCreateTime, endTime) .ge(StringUtil.isNotBlank(startTime) && Func.isNotEmpty(startTime),StationEntity::getCreateTime, startTime); return R.data(stationService.list(wrapper)); From 3f0e049e33e948c6b4cf7b040e6ad24a09b95372 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Mon, 27 May 2024 09:23:50 +0800 Subject: [PATCH 3/4] =?UTF-8?q?#=E5=A4=A7=E6=A8=A1=E5=9E=8B=E5=8F=91?= =?UTF-8?q?=E7=94=B5=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hnac/hzims/operational/fill/service/impl/GenerateServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/GenerateServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/GenerateServiceImpl.java index 88fc4f4..9cf07ec 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/GenerateServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/GenerateServiceImpl.java @@ -258,7 +258,7 @@ public class GenerateServiceImpl extends BaseServiceImpl 0){ entity.setId(null); entity.setFillDate(DateUtil.format(start,DateUtil.PATTERN_DATE)); - entity.setGenerate((random.nextDouble() * 10000) + 50000); + entity.setGenerate((random.nextDouble() * 2800) + 12000); this.save(entity); calendar.add(Calendar.DAY_OF_MONTH,1); start = calendar.getTime(); From afbab4cc47234542f80f6a0e24717f946e377a20 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Mon, 27 May 2024 14:45:51 +0800 Subject: [PATCH 4/4] =?UTF-8?q?#=E5=A1=AB=E6=8A=A5=E5=8F=91=E7=94=B5?= =?UTF-8?q?=E9=87=8F=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hnac/hzims/operational/fill/feign/GenerateClient.java | 5 ++++- .../hzims/operational/fill/service/impl/GenerateServiceImpl.java | 2 +- .../hzims/operational/main/service/impl/HydropowerServiceImpl.java | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/feign/GenerateClient.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/feign/GenerateClient.java index a017445..22030a1 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/feign/GenerateClient.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/feign/GenerateClient.java @@ -6,10 +6,12 @@ import com.hnac.hzims.operational.fill.service.GenerateService; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.tool.utils.CollectionUtil; +import org.springblade.core.tool.utils.DateUtil; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; +import java.util.Date; import java.util.List; @@ -28,9 +30,10 @@ public class GenerateClient implements IGenerateClient { public Double stationGenerateByTime(@RequestParam("stationId") String stationId, @RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime) { + Date start = DateUtil.parse(startTime,DateUtil.PATTERN_DATETIME); List generates = generateService.list(Wrappers.lambdaQuery() .eq(GenerateEntity::getStationCode,stationId) - .ge(GenerateEntity::getFillDate,startTime) + .ge(GenerateEntity::getFillDate,DateUtil.format(start,DateUtil.PATTERN_DATE)) .le(GenerateEntity::getFillDate,endTime) ); if(CollectionUtil.isEmpty(generates)){ diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/GenerateServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/GenerateServiceImpl.java index 9cf07ec..b3141e0 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/GenerateServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/fill/service/impl/GenerateServiceImpl.java @@ -258,7 +258,7 @@ public class GenerateServiceImpl extends BaseServiceImpl 0){ entity.setId(null); entity.setFillDate(DateUtil.format(start,DateUtil.PATTERN_DATE)); - entity.setGenerate((random.nextDouble() * 2800) + 12000); + entity.setGenerate((random.nextDouble() * 1360) + 19000); this.save(entity); calendar.add(Calendar.DAY_OF_MONTH,1); start = calendar.getTime(); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java index cba31a3..98d399a 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java @@ -631,6 +631,8 @@ public class HydropowerServiceImpl implements HydropowerService { // 年发电量 kpi.setGenerateYear(targets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerYear).sum()); // 月发电量 + + kpi.setGenerateMon(targets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerMon).sum()); // 日发电量 kpi.setGenerateDay(targets.stream().mapToDouble(HydropowerUnitTargetVo::getPowerDay).sum());