diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/history/service/impl/HistoryDeviceServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/history/service/impl/HistoryDeviceServiceImpl.java index 85b96b4..5c51965 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/history/service/impl/HistoryDeviceServiceImpl.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/history/service/impl/HistoryDeviceServiceImpl.java @@ -122,7 +122,11 @@ public class HistoryDeviceServiceImpl implements IHistoryDeviceService { if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){ return new ArrayList<>(); } - return result.getData(); + return result.getData().stream().peek(fac->{ + fac.setName(Arrays.stream(fac.getName().split("\\.")) + .reduce((first, second) -> second) + .orElse(fac.getName())); + }).collect(Collectors.toList()); } /** diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/impl/HazardWorkServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/impl/HazardWorkServiceImpl.java index 94eee8c..4510d3b 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/impl/HazardWorkServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/impl/HazardWorkServiceImpl.java @@ -1,6 +1,7 @@ package com.hnac.hzims.safeproduct.risk.service.impl; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -104,14 +105,14 @@ public class HazardWorkServiceImpl extends ServiceImpl header = userClient.userInfoById(headId); - if (header.isSuccess()) { + if (header.isSuccess() && ObjectUtils.isNotEmpty(header.getData())) { hazardWorkVO.setHeadName(header.getData().getRealName()); } } Long manageId = record.getManage(); if (manageId != null) { R manager = userClient.userInfoById(manageId); - if (manager.isSuccess()) { + if (manager.isSuccess() && ObjectUtils.isNotEmpty(manager.getData())) { hazardWorkVO.setManagerName(manager.getData().getRealName()); } }