From 7cad02cb35820c2387cde7cabfba04f341b685d5 Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Wed, 24 May 2023 08:07:10 +0800 Subject: [PATCH 1/2] =?UTF-8?q?#=20APP=E9=A6=96=E9=A1=B5=E2=80=98=E7=81=B5?= =?UTF-8?q?=E6=B4=BB=E6=8E=92=E7=89=88=E2=80=99=E6=98=BE=E7=A4=BAbug?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=20#=20=E7=A6=BB=E7=BA=BF=E5=B7=A1=E6=A3=80sq?= =?UTF-8?q?l=E6=89=A7=E8=A1=8C=E5=A4=B1=E8=B4=A5bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hnac/hzinfo/inspect/offline/util/TableJsonUtils.java | 3 +++ .../java/com/hnac/hzims/operational/defect/util/TableJsonUtils.java | 4 ++++ .../hzims/operational/main/service/impl/HydropowerServiceImpl.java | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/util/TableJsonUtils.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/util/TableJsonUtils.java index 3baeb8f..218b5de 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/util/TableJsonUtils.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/util/TableJsonUtils.java @@ -136,6 +136,9 @@ public class TableJsonUtils { needField = needField.substring(0, characterIndex); } } + if(needField.contains("DEFAULT B")) { + needField = needField.replace("DEFAULT B","DEFAULT "); + } return needField; } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/util/TableJsonUtils.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/util/TableJsonUtils.java index 34f3857..49f143f 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/util/TableJsonUtils.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/util/TableJsonUtils.java @@ -89,6 +89,7 @@ public class TableJsonUtils { } } sb.append(" OFFLINE_FLAG VARCHAR(2) DEFAULT '0')"); + // 拼接完整的建表语句 createTableSql = createTableSql.substring(0, firstParenthesesIndex+1) + sb.toString(); // 转成成大写 @@ -130,6 +131,9 @@ public class TableJsonUtils { needField = needField.substring(0, characterIndex); } } + if(needField.contains("DEFAULT B")) { + needField = needField.replace("DEFAULT B","DEFAULT "); + } return needField; } 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 b7535a6..7d99632 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 @@ -1651,7 +1651,7 @@ public class HydropowerServiceImpl implements HydropowerService { return; } item.setNextShift(nextDuty.getClassName()); - item.setNextTeam(Optional.ofNullable(nextDuty.getGroupName()).orElse("灵活排版")); + item.setNextTeam(Optional.ofNullable(nextDuty.getGroupName()).orElse("灵活排班")); // 下一班组负责人 String managerName = this.getManagerName(nextDuty.getManagerId()); item.setNextTeamLeader(managerName); From 829245010a58679a6ff4b6fbf1bc18eacf5b6681 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Wed, 24 May 2023 10:09:17 +0800 Subject: [PATCH 2/2] =?UTF-8?q?#=E5=8F=91=E7=94=B5=E8=B4=9F=E8=8D=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/service/impl/AnalyseDataServiceImpl.java | 2 ++ .../main/service/impl/HydropowerServiceImpl.java | 21 ++++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AnalyseDataServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AnalyseDataServiceImpl.java index f2d0f8d..476cdde 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AnalyseDataServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AnalyseDataServiceImpl.java @@ -73,10 +73,12 @@ public class AnalyseDataServiceImpl implements IAnalyseDataService { analyzeDataConditionPO.setEndTime(LocalDateTime.parse(DateUtil.format(new Date(), endTime), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME))); signboardConditions.add(analyzeDataConditionPO); po.setSignboardConditions(signboardConditions); + log.error("period_target_data_request {}",po); R> result = analyseDataSearchClient.getAnalyzeDataByAnalyzeCodeAndSignages(po); if (!result.isSuccess() || CollectionUtil.isEmpty(result.getData())) { return new ArrayList<>(); } + log.error("period_target_data_resp {}",result); return result.getData().get(0).getList(); } 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 7d99632..7f5ee0c 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 @@ -749,7 +749,12 @@ public class HydropowerServiceImpl implements HydropowerService { if(CollectionUtil.isEmpty(realList)){ return 0.0; } - return realList.stream().filter(o->deptId.equals(o.getDeptId())).mapToDouble(HydropowerUnitRealVo::getActivePower).sum(); + return realList.stream().filter(o->deptId.equals(o.getDeptId())).mapToDouble(o->{ + if("MW".equalsIgnoreCase(o.getPowerUnit())){ + return o.getActivePower() * 1000; + } + return o.getActivePower(); + }).sum(); } /** @@ -1006,7 +1011,12 @@ public class HydropowerServiceImpl implements HydropowerService { // 容量 kpi.setInstalledCapacity(reals.stream().mapToDouble(HydropowerUnitRealVo::getInstalledCapacity).sum()); // 负荷 - kpi.setLoad(reals.stream().mapToDouble(HydropowerUnitRealVo::getActivePower).sum()); + kpi.setLoad(reals.stream().mapToDouble(o->{ + if("MW".equalsIgnoreCase(o.getPowerUnit())){ + return o.getActivePower() * 1000; + } + return o.getActivePower(); + }).sum()); // 容量利用率 if (Math.abs(kpi.getInstalledCapacity()) <= 0) { kpi.setCapacityRate(0.0); @@ -1105,7 +1115,12 @@ public class HydropowerServiceImpl implements HydropowerService { // 实时数据: 容量利用率、电站利用率 if(CollectionUtil.isNotEmpty(reals)){ // 实时功率 - double use = reals.stream().filter(real->entry.getValue().stream().map(StationEntity::getRefDept).collect(Collectors.toList()).contains(real.getDeptId())).mapToDouble(HydropowerUnitRealVo::getActivePower).sum(); + double use = reals.stream().filter(real->entry.getValue().stream().map(StationEntity::getRefDept).collect(Collectors.toList()).contains(real.getDeptId())).mapToDouble(o->{ + if("MW".equalsIgnoreCase(o.getPowerUnit())){ + return o.getActivePower() * 1000; + } + return o.getActivePower(); + }).sum(); if(CollectionUtil.isNotEmpty(plans)){ // 装机容量 double capacity = reals.stream().filter(real-> entry.getValue().stream().map(StationEntity::getRefDept).collect(Collectors.toList()).contains(real.getDeptId())).mapToDouble(HydropowerUnitRealVo::getInstalledCapacity).sum();