Browse Source

修正智能诊断统计任务展示

zhongwei
tyty 1 year ago
parent
commit
d13f93d3f7
  1. 21
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpTaskServiceImpl.java
  2. 1
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/wrapper/FdpTaskWrapper.java

21
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.operational.defect.vo.OperPhenomenonVO;
import com.hnac.hzims.util.HttpClientUtils; import com.hnac.hzims.util.HttpClientUtils;
import com.hnac.hzims.util.pojo.HttpResponse; import com.hnac.hzims.util.pojo.HttpResponse;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl; 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.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil; import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.feign.ISysClient; 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.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -39,6 +40,7 @@ import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -51,6 +53,8 @@ import java.util.stream.Collectors;
public class FdpTaskServiceImpl extends BaseServiceImpl<FdpTaskMapper, FdpTaskEntity> implements IFdpTaskService { public class FdpTaskServiceImpl extends BaseServiceImpl<FdpTaskMapper, FdpTaskEntity> implements IFdpTaskService {
private final IOperPhenomenonClient operPhenomenonClient; private final IOperPhenomenonClient operPhenomenonClient;
private final ISysClient sysClient; private final ISysClient sysClient;
private final IUserClient userClient;
private IDiagnoseProxy diagnoseProxy; private IDiagnoseProxy diagnoseProxy;
@Value("${url.submitResult}") @Value("${url.submitResult}")
@ -75,7 +79,20 @@ public class FdpTaskServiceImpl extends BaseServiceImpl<FdpTaskMapper, FdpTaskEn
@Override @Override
public R<FdpTaskVO> detail(Long id) { public R<FdpTaskVO> detail(Long id) {
FdpTaskEntity detail = super.getById(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<User> 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<User> 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 @Override

1
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/wrapper/FdpTaskWrapper.java

@ -26,6 +26,7 @@ public class FdpTaskWrapper extends BaseEntityWrapper<FdpTaskEntity, FdpTaskVO>
@Override @Override
public FdpTaskVO entityVO(FdpTaskEntity entity) { public FdpTaskVO entityVO(FdpTaskEntity entity) {
FdpTaskVO vo = BeanUtil.copy(entity, FdpTaskVO.class); FdpTaskVO vo = BeanUtil.copy(entity, FdpTaskVO.class);
User createUser = UserCache.getUser(entity.getCreateUser()); User createUser = UserCache.getUser(entity.getCreateUser());
User updateUser = UserCache.getUser(entity.getUpdateUser()); User updateUser = UserCache.getUser(entity.getUpdateUser());
vo.setCreateUserName(Optional.ofNullable(createUser).map(User::getName).orElse(null)); vo.setCreateUserName(Optional.ofNullable(createUser).map(User::getName).orElse(null));

Loading…
Cancel
Save