diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpTaskServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpTaskServiceImpl.java index caf4b49..03411c0 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpTaskServiceImpl.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpTaskServiceImpl.java @@ -20,7 +20,6 @@ import com.hnac.hzims.operational.defect.feign.IOperPhenomenonClient; import com.hnac.hzims.operational.defect.vo.OperPhenomenonVO; import com.hnac.hzims.util.HttpClientUtils; import com.hnac.hzims.util.pojo.HttpResponse; -import lombok.AllArgsConstructor; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.mp.base.BaseServiceImpl; @@ -32,6 +31,8 @@ import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.core.tool.utils.StringUtil; import org.springblade.system.feign.ISysClient; +import org.springblade.system.user.entity.User; +import org.springblade.system.user.feign.IUserClient; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @@ -39,6 +40,7 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Optional; import java.util.stream.Collectors; /** @@ -51,6 +53,8 @@ import java.util.stream.Collectors; public class FdpTaskServiceImpl extends BaseServiceImpl implements IFdpTaskService { private final IOperPhenomenonClient operPhenomenonClient; private final ISysClient sysClient; + + private final IUserClient userClient; private IDiagnoseProxy diagnoseProxy; @Value("${url.submitResult}") @@ -75,7 +79,20 @@ public class FdpTaskServiceImpl extends BaseServiceImpl detail(Long id) { FdpTaskEntity detail = super.getById(id); - return R.data(FdpTaskWrapper.build().entityVO(detail)); + FdpTaskVO data = FdpTaskWrapper.build().entityVO(detail); + if (StringUtil.isEmpty(data.getCreateUserName())){ + R userR = userClient.userInfoById(detail.getCreateUser().longValue()); + if (userR.isSuccess()&&Func.isNotEmpty(userR.getData())){ + data.setCreateUserName(Optional.ofNullable(userR.getData()).map(User::getName).orElse(null)); + } + } + if (StringUtil.isEmpty(data.getUpdateUser())){ + R userR = userClient.userInfoById(detail.getUpdateUser().longValue()); + if (userR.isSuccess()&&Func.isNotEmpty(userR.getData())){ + data.setUpdateUserName(Optional.ofNullable(userR.getData()).map(User::getName).orElse(null)); + } + } + return R.data(data); } @Override diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/wrapper/FdpTaskWrapper.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/wrapper/FdpTaskWrapper.java index 0590858..8e3e22e 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/wrapper/FdpTaskWrapper.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/wrapper/FdpTaskWrapper.java @@ -26,6 +26,7 @@ public class FdpTaskWrapper extends BaseEntityWrapper @Override public FdpTaskVO entityVO(FdpTaskEntity entity) { FdpTaskVO vo = BeanUtil.copy(entity, FdpTaskVO.class); + User createUser = UserCache.getUser(entity.getCreateUser()); User updateUser = UserCache.getUser(entity.getUpdateUser()); vo.setCreateUserName(Optional.ofNullable(createUser).map(User::getName).orElse(null));