|
@@ -2,7 +2,10 @@ package com.diagbot.facade;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.diagbot.client.UserServiceClient;
|
|
|
import com.diagbot.dto.DeptInfoDTO;
|
|
|
+import com.diagbot.dto.GetDeptInfoDTO;
|
|
|
+import com.diagbot.dto.RespDTO;
|
|
|
import com.diagbot.entity.DeptInfo;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
@@ -16,10 +19,13 @@ import com.diagbot.vo.AddDeptInfoVO;
|
|
|
import com.diagbot.vo.GetDeptInfoDetialsVO;
|
|
|
import com.diagbot.vo.GetDeptInfoVO;
|
|
|
import com.diagbot.vo.UpdateDeptInfoVO;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* @Description:
|
|
@@ -29,6 +35,9 @@ import java.util.List;
|
|
|
@Component
|
|
|
public class DeptInfoFacade extends DeptInfoServiceImpl {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private UserServiceClient userServiceClient;
|
|
|
+
|
|
|
/**
|
|
|
* 添加科室信息
|
|
|
* @param addDeptInfoVO
|
|
@@ -88,8 +97,20 @@ public class DeptInfoFacade extends DeptInfoServiceImpl {
|
|
|
* @param getDeptInfoVO
|
|
|
* @return
|
|
|
*/
|
|
|
- public IPage<DeptInfo> getDeptInfo(GetDeptInfoVO getDeptInfoVO){
|
|
|
- IPage iPage = this.getAllDeptInfo(getDeptInfoVO);
|
|
|
+ public IPage<GetDeptInfoDTO> getDeptInfo(GetDeptInfoVO getDeptInfoVO){
|
|
|
+ IPage<GetDeptInfoDTO> iPage = this.getAllDeptInfo(getDeptInfoVO);
|
|
|
+ List<String> ids = new ArrayList<>();
|
|
|
+ for (GetDeptInfoDTO getDeptInfoDTO:iPage.getRecords()) {
|
|
|
+ ids.add(getDeptInfoDTO.getModifier());
|
|
|
+ }
|
|
|
+ RespDTO<Map<String, String>> respDTO = userServiceClient.getUserInfoByIds(ids);
|
|
|
+ if (respDTO == null || !"0".equals(respDTO.code)) {
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR,
|
|
|
+ "获取用户信息失败");
|
|
|
+ }
|
|
|
+ for (GetDeptInfoDTO getDeptInfoDTO:iPage.getRecords()) {
|
|
|
+ getDeptInfoDTO.setUserName(respDTO.data.get(getDeptInfoDTO.getModifier()));
|
|
|
+ }
|
|
|
return iPage;
|
|
|
}
|
|
|
|