Browse Source

fix:日常维护月度查询设备名称取值逻辑修改

zhongwei
haungxing 7 months ago
parent
commit
6d0f315c7a
  1. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceTaskQueryServiceImpl.java

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) { private List<MaintenanceTaskQueryVO> fillTaskQuery(List<OperMaintenanceTaskEntity> taskList) {
R<List<Dept>> deptListR = sysClient.getDeptList(); R<List<Dept>> deptListR = sysClient.getDeptList();
List<Dept> deptList = deptListR.isSuccess() ? deptListR.getData() : Lists.newArrayList(); List<Dept> deptList = deptListR.isSuccess() ? deptListR.getData() : Lists.newArrayList();
List<EmInfoEntity> emList = emInfoClient.list();
IntFunction<MaintenanceTaskQueryVO> convert = index -> { IntFunction<MaintenanceTaskQueryVO> convert = index -> {
OperMaintenanceTaskEntity task = taskList.get(index); OperMaintenanceTaskEntity task = taskList.get(index);
MaintenanceTaskQueryVO result = new MaintenanceTaskQueryVO(); MaintenanceTaskQueryVO result = new MaintenanceTaskQueryVO();
@ -137,9 +136,7 @@ public class MaintenanceTaskQueryServiceImpl implements IMaintenanceTaskQuerySer
// 获取维护类型 // 获取维护类型
result.setTypeName(DictCache.getValue(DictConstant.MAINTENANCE_TYPE_CODE,task.getTypeCode())); result.setTypeName(DictCache.getValue(DictConstant.MAINTENANCE_TYPE_CODE,task.getTypeCode()));
// 获取维护设备 // 获取维护设备
result.setEmName(emList.stream().filter( result.setEmName(task.getEmName());
em -> em.getNumber().equals(task.getEmCode())
).findFirst().map(EmInfoEntity::getName).orElse(""));
// 获取执行时间 // 获取执行时间
result.setPlanDisposeTime(DateUtil.formatDateTime(task.getDisposeTime())); result.setPlanDisposeTime(DateUtil.formatDateTime(task.getDisposeTime()));
result.setDisposeTime(Optional.ofNullable(task.getExecuteTime()).map(DateUtil::formatDateTime).orElse("")); result.setDisposeTime(Optional.ofNullable(task.getExecuteTime()).map(DateUtil::formatDateTime).orElse(""));

Loading…
Cancel
Save