From ab58c534308acc2982a617b40b6b027c0c1f6c5d Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Mon, 22 Apr 2024 16:09:26 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=E8=AE=BE=E5=A4=87=E7=BB=B4=E6=8A=A4?= =?UTF-8?q?=E5=BA=93=E3=80=81=E6=97=A5=E5=B8=B8=E7=BB=B4=E6=8A=A4=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E3=80=81=E4=BB=BB=E5=8A=A1=E8=A1=A5=E5=85=85=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hzims-service/operational/src/main/resources/db/2.0.3.sql | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/hzims-service/operational/src/main/resources/db/2.0.3.sql b/hzims-service/operational/src/main/resources/db/2.0.3.sql index c8df871..4290cc0 100644 --- a/hzims-service/operational/src/main/resources/db/2.0.3.sql +++ b/hzims-service/operational/src/main/resources/db/2.0.3.sql @@ -11,4 +11,16 @@ alter table `hzims_oper_maintenance_task` add column `station_name` varchar(100 alter table `hzims_oper_maintenance_task` add column `em_name` varchar(255) comment '设备名称'; -- 日常维护计划、任务添加周期字段 alter table `hzims_oper_maintenance_plan` add column `period` int(11) comment '周期(单位:小时)'; -alter table `hzims_oper_maintenance_task` add column `period` int(11) comment '周期(单位:小时)'; \ No newline at end of file +alter table `hzims_oper_maintenance_task` add column `period` int(11) comment '周期(单位:小时)'; +-- 更新日常维护库设备名称 +update hzims_oper_maintenance_library t1,( + select ml.`id`,ml.`EM_CODE`,GROUP_CONCAT(ei.`NAME`) EM_NAME from hzims_oper_maintenance_library ml,equipment.hzims_em_info ei where ml.`IS_DELETED` = 0 and ei.`IS_DELETED` = 0 and FIND_IN_SET(ei.`NUMBER`,ml.`EM_CODE`) group by ml.`id`,ml.`EM_CODE` +) t2 set t1.`EM_NAME` = t2.`EM_NAME` WHERE t1.`ID` = t2.`ID` and t1.`EM_NAME` is null +-- 更新日常维护计划设备名称 +update hzims_oper_maintenance_plan t1,( + select ml.`id`,ml.`EM_CODE`,GROUP_CONCAT(ei.`NAME`) EM_NAME from hzims_oper_maintenance_plan ml,equipment.hzims_em_info ei where ml.`IS_DELETED` = 0 and ei.`IS_DELETED` = 0 and FIND_IN_SET(ei.`NUMBER`,ml.`EM_CODE`) group by ml.`id`,ml.`EM_CODE` +) t2 set t1.`EM_NAME` = t2.`EM_NAME` WHERE t1.`ID` = t2.`ID` and t1.`EM_NAME` is null +-- 更新日常维护任务设备名称 +update hzims_oper_maintenance_task t1,( + select ml.`id`,ml.`EM_CODE`,GROUP_CONCAT(ei.`NAME`) EM_NAME from hzims_oper_maintenance_task ml,prod_hzims_equipment.hzims_em_info ei where ml.`IS_DELETED` = 0 and ei.`IS_DELETED` = 0 and FIND_IN_SET(ei.`NUMBER`,ml.`EM_CODE`) group by ml.`id`,ml.`EM_CODE` +) t2 set t1.`EM_NAME` = t2.`EM_NAME` WHERE t1.`ID` = t2.`ID` and t1.`EM_NAME` is null \ No newline at end of file From 97be1da833c8af374327f00f9579f0611d32a1ec Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Mon, 22 Apr 2024 16:27:53 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix:=E6=97=A5=E5=B8=B8=E7=BB=B4=E6=8A=A4?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E3=80=81=E4=BB=BB=E5=8A=A1=E8=A1=A5=E5=85=85?= =?UTF-8?q?=E5=91=A8=E6=9C=9F=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hzims-service/operational/src/main/resources/db/2.0.3.sql | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/hzims-service/operational/src/main/resources/db/2.0.3.sql b/hzims-service/operational/src/main/resources/db/2.0.3.sql index 4290cc0..b42a617 100644 --- a/hzims-service/operational/src/main/resources/db/2.0.3.sql +++ b/hzims-service/operational/src/main/resources/db/2.0.3.sql @@ -15,12 +15,20 @@ alter table `hzims_oper_maintenance_task` add column `period` int(11) comment ' -- 更新日常维护库设备名称 update hzims_oper_maintenance_library t1,( select ml.`id`,ml.`EM_CODE`,GROUP_CONCAT(ei.`NAME`) EM_NAME from hzims_oper_maintenance_library ml,equipment.hzims_em_info ei where ml.`IS_DELETED` = 0 and ei.`IS_DELETED` = 0 and FIND_IN_SET(ei.`NUMBER`,ml.`EM_CODE`) group by ml.`id`,ml.`EM_CODE` -) t2 set t1.`EM_NAME` = t2.`EM_NAME` WHERE t1.`ID` = t2.`ID` and t1.`EM_NAME` is null +) t2 set t1.`EM_NAME` = t2.`EM_NAME` WHERE t1.`ID` = t2.`ID` and t1.`EM_NAME` is null; -- 更新日常维护计划设备名称 update hzims_oper_maintenance_plan t1,( select ml.`id`,ml.`EM_CODE`,GROUP_CONCAT(ei.`NAME`) EM_NAME from hzims_oper_maintenance_plan ml,equipment.hzims_em_info ei where ml.`IS_DELETED` = 0 and ei.`IS_DELETED` = 0 and FIND_IN_SET(ei.`NUMBER`,ml.`EM_CODE`) group by ml.`id`,ml.`EM_CODE` -) t2 set t1.`EM_NAME` = t2.`EM_NAME` WHERE t1.`ID` = t2.`ID` and t1.`EM_NAME` is null +) t2 set t1.`EM_NAME` = t2.`EM_NAME` WHERE t1.`ID` = t2.`ID` and t1.`EM_NAME` is null; -- 更新日常维护任务设备名称 update hzims_oper_maintenance_task t1,( select ml.`id`,ml.`EM_CODE`,GROUP_CONCAT(ei.`NAME`) EM_NAME from hzims_oper_maintenance_task ml,prod_hzims_equipment.hzims_em_info ei where ml.`IS_DELETED` = 0 and ei.`IS_DELETED` = 0 and FIND_IN_SET(ei.`NUMBER`,ml.`EM_CODE`) group by ml.`id`,ml.`EM_CODE` -) t2 set t1.`EM_NAME` = t2.`EM_NAME` WHERE t1.`ID` = t2.`ID` and t1.`EM_NAME` is null \ No newline at end of file +) t2 set t1.`EM_NAME` = t2.`EM_NAME` WHERE t1.`ID` = t2.`ID` and t1.`EM_NAME` is null; +-- 更新日常维护计划周期字段值 +update `hzims_oper_maintenance_plan` mp,`hzims_oper_maintenance_library` ml +set mp.`period` = ml.`period` where mp.`REF_LIBRARY_ID` = ml.`ID` +and mp.`IS_DELETED` = 0 and ml.`IS_DELETED` = 0 and mp.`period` is null; +-- 更新日常维护任务周期字段值 +update `hzims_oper_maintenance_task` mt,`hzims_oper_maintenance_library` ml +set mt.`period` = ml.`period` where mt.`REF_LIBRARY_ID` = ml.`ID` +and mt.`IS_DELETED` = 0 and ml.`IS_DELETED` = 0 and mt.`period` is null; \ No newline at end of file From 6d0f315c7ad6de4008d987bd834d6495c8b00b0e Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Mon, 22 Apr 2024 17:19:27 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=E6=97=A5=E5=B8=B8=E7=BB=B4=E6=8A=A4?= =?UTF-8?q?=E6=9C=88=E5=BA=A6=E6=9F=A5=E8=AF=A2=E8=AE=BE=E5=A4=87=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E5=8F=96=E5=80=BC=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../maintenance/service/impl/MaintenanceTaskQueryServiceImpl.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceTaskQueryServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceTaskQueryServiceImpl.java index 2892717..a627cc6 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceTaskQueryServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceTaskQueryServiceImpl.java @@ -125,7 +125,6 @@ public class MaintenanceTaskQueryServiceImpl implements IMaintenanceTaskQuerySer private List fillTaskQuery(List taskList) { R> deptListR = sysClient.getDeptList(); List deptList = deptListR.isSuccess() ? deptListR.getData() : Lists.newArrayList(); - List emList = emInfoClient.list(); IntFunction convert = index -> { OperMaintenanceTaskEntity task = taskList.get(index); MaintenanceTaskQueryVO result = new MaintenanceTaskQueryVO(); @@ -137,9 +136,7 @@ public class MaintenanceTaskQueryServiceImpl implements IMaintenanceTaskQuerySer // 获取维护类型 result.setTypeName(DictCache.getValue(DictConstant.MAINTENANCE_TYPE_CODE,task.getTypeCode())); // 获取维护设备 - result.setEmName(emList.stream().filter( - em -> em.getNumber().equals(task.getEmCode()) - ).findFirst().map(EmInfoEntity::getName).orElse("")); + result.setEmName(task.getEmName()); // 获取执行时间 result.setPlanDisposeTime(DateUtil.formatDateTime(task.getDisposeTime())); result.setDisposeTime(Optional.ofNullable(task.getExecuteTime()).map(DateUtil::formatDateTime).orElse("")); From aebdd0257363ce8b82be1870d3a8602d7498100f Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Mon, 22 Apr 2024 17:48:51 +0800 Subject: [PATCH 4/4] =?UTF-8?q?#=E5=BC=80=E5=85=B3=E6=9C=BA=E5=91=8A?= =?UTF-8?q?=E8=AD=A6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scheduled/service/operation/home/impl/RealTargetServiceImpl.java | 4 ++-- .../hzims/operational/data/service/impl/HzimsDataServiceImpl.java | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java index d6e87bc..db167b0 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java @@ -1384,7 +1384,7 @@ public class RealTargetServiceImpl implements RealTargetService { String end = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME); // 开始日期 calendar.set(Calendar.HOUR_OF_DAY, calendar.get(Calendar.HOUR_OF_DAY) - 24); - String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE) + " 00:00:00"; + String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME); List records = dataService.periodTargetData(start, end, 3, 2, device.getEmCode(), HomePageConstant.PV_LOAD); if (CollectionUtil.isEmpty(records)) { return new ArrayList<>(); @@ -1396,7 +1396,7 @@ public class RealTargetServiceImpl implements RealTargetService { load.setHour(time.getHours()); load.setActivePower(Optional.ofNullable(record.getVal()).orElse("0")); return load; - }).sorted(Comparator.comparing(ActivePowerVo::getStrHour)).sorted(Comparator.comparing(ActivePowerVo::getHour)).collect(Collectors.toList()); + }).sorted(Comparator.comparing(ActivePowerVo::getStrHour)).collect(Collectors.toList()); } /** diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/data/service/impl/HzimsDataServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/data/service/impl/HzimsDataServiceImpl.java index 30f77cf..beede99 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/data/service/impl/HzimsDataServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/data/service/impl/HzimsDataServiceImpl.java @@ -280,9 +280,10 @@ public class HzimsDataServiceImpl implements HzimsDataService { return maps.entrySet().stream().map(entry->{ ActivePowerVo activePower = new ActivePowerVo(); activePower.setHour(entry.getKey()); + activePower.setStrHour(entry.getValue().get(0).getStrHour()); activePower.setActivePower(String.valueOf(entry.getValue().stream().mapToDouble(o->Double.parseDouble(o.getActivePower())).sum())); return activePower; - }).sorted(Comparator.comparing(ActivePowerVo::getHour)).collect(Collectors.toList()); + }).sorted(Comparator.comparing(ActivePowerVo::getStrHour)).collect(Collectors.toList()); } /**