|
@@ -2,6 +2,8 @@ package com.diagbot.facade;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.diagbot.client.UserServiceClient;
|
|
|
+import com.diagbot.dto.RespDTO;
|
|
|
import com.diagbot.dto.UserRoleInfoFindDTO;
|
|
|
import com.diagbot.entity.User;
|
|
|
import com.diagbot.entity.UserHospital;
|
|
@@ -45,6 +47,8 @@ public class UserRoleFacade extends UserRoleServiceImpl {
|
|
|
UserRoleService userRoleService;
|
|
|
@Autowired
|
|
|
HospitalInfoFacade hospitalInfoFacade;
|
|
|
+ @Autowired
|
|
|
+ UserServiceClient userServiceClient;
|
|
|
|
|
|
public boolean addUserRoles(UserRoleInfoVO userRoleInfoVO) {
|
|
|
boolean res = false;
|
|
@@ -87,13 +91,14 @@ public class UserRoleFacade extends UserRoleServiceImpl {
|
|
|
hospitalInfoData = hospitalInfoFacade.getHospitalInfoData(hospitalId);
|
|
|
}
|
|
|
if (ListUtil.isNotEmpty(modifierid)) {
|
|
|
- userInfoByIds = userFacade.getUserInfoByIds(modifierid);
|
|
|
- if (userInfoByIds == null) {
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "获取所有用户信息失败");
|
|
|
+ RespDTO<Map<String, String>> userNamesDTO = userServiceClient.getUserInfoByIds(modifierid);
|
|
|
+ if (userNamesDTO == null || !CommonErrorCode.OK.getCode().equals(userNamesDTO.code)) {
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
+ "获取所有用户信息失败");
|
|
|
}
|
|
|
+ userInfoByIds = userNamesDTO.data;
|
|
|
}
|
|
|
- for (
|
|
|
- UserRoleInfoFindDTO userData : dataAll) {
|
|
|
+ for (UserRoleInfoFindDTO userData : dataAll) {
|
|
|
userData.setHospitalName(hospitalInfoData.get(userData.getHospitalId()));
|
|
|
userData.setModifier(userInfoByIds.get(userData.getModifier()));
|
|
|
}
|