Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
ty 7 months ago
parent
commit
24239be908
  1. 4
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java
  2. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/data/service/impl/HzimsDataServiceImpl.java
  3. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceTaskQueryServiceImpl.java
  4. 20
      hzims-service/operational/src/main/resources/db/2.0.3.sql

4
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<AnalyseDataTaosVO> 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());
}
/**

3
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());
}
/**

5
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<MaintenanceTaskQueryVO> fillTaskQuery(List<OperMaintenanceTaskEntity> taskList) {
R<List<Dept>> deptListR = sysClient.getDeptList();
List<Dept> deptList = deptListR.isSuccess() ? deptListR.getData() : Lists.newArrayList();
List<EmInfoEntity> emList = emInfoClient.list();
IntFunction<MaintenanceTaskQueryVO> 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(""));

20
hzims-service/operational/src/main/resources/db/2.0.3.sql

@ -12,3 +12,23 @@ alter table `hzims_oper_maintenance_task` add column `em_name` varchar(255) comm
-- 日常维护计划、任务添加周期字段
alter table `hzims_oper_maintenance_plan` add column `period` int(11) comment '周期(单位:小时)';
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;
-- 更新日常维护计划周期字段值
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;
Loading…
Cancel
Save