|
@@ -8,11 +8,12 @@ import com.github.microservice.auth.client.type.LoginType;
|
|
|
import com.github.microservice.components.data.base.util.PageEntityUtil;
|
|
import com.github.microservice.components.data.base.util.PageEntityUtil;
|
|
|
import com.github.microservice.net.ResultContent;
|
|
import com.github.microservice.net.ResultContent;
|
|
|
import com.github.microservice.net.ResultMessage;
|
|
import com.github.microservice.net.ResultMessage;
|
|
|
|
|
+import com.github.microservice.utils.DesenUtil;
|
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
|
import com.zhongshu.card.client.model.base.AuthTypeParam;
|
|
import com.zhongshu.card.client.model.base.AuthTypeParam;
|
|
|
import com.zhongshu.card.client.model.base.UserIdModel;
|
|
import com.zhongshu.card.client.model.base.UserIdModel;
|
|
|
import com.zhongshu.card.client.model.org.*;
|
|
import com.zhongshu.card.client.model.org.*;
|
|
|
-import com.zhongshu.card.client.model.org.role.RoleModel;
|
|
|
|
|
|
|
+import com.zhongshu.card.client.model.org.role.RoleSimpleModel;
|
|
|
import com.zhongshu.card.client.model.orgModel.OrgBindUserAllParam;
|
|
import com.zhongshu.card.client.model.orgModel.OrgBindUserAllParam;
|
|
|
import com.zhongshu.card.client.model.school.DictInfoSimpleModel;
|
|
import com.zhongshu.card.client.model.school.DictInfoSimpleModel;
|
|
|
import com.zhongshu.card.client.service.org.UserAccountService;
|
|
import com.zhongshu.card.client.service.org.UserAccountService;
|
|
@@ -164,7 +165,7 @@ public class UserAccountServiceImpl extends SuperService implements UserAccountS
|
|
|
userCountDao.save(userAccount);
|
|
userCountDao.save(userAccount);
|
|
|
} else {
|
|
} else {
|
|
|
// 编辑
|
|
// 编辑
|
|
|
- BeanUtils.copyPropertiesWithoutNull(param, userAccount);
|
|
|
|
|
|
|
+ BeanUtils.copyPropertiesWithoutNull(param, userAccount);
|
|
|
String realName = param.getRealName();
|
|
String realName = param.getRealName();
|
|
|
if (StringUtils.isEmpty(realName)) {
|
|
if (StringUtils.isEmpty(realName)) {
|
|
|
realName = param.getName();
|
|
realName = param.getName();
|
|
@@ -462,6 +463,12 @@ public class UserAccountServiceImpl extends SuperService implements UserAccountS
|
|
|
return ResultContent.buildSuccess(PageEntityUtil.concurrent2PageModel(page, this::toOrgUserModel));
|
|
return ResultContent.buildSuccess(PageEntityUtil.concurrent2PageModel(page, this::toOrgUserModel));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public ResultContent<Page<OrganizationUserModel>> projectUserOpenPage(OrganizationUserSearch param, Pageable pageable) {
|
|
|
|
|
+ Page<OrganizationUser> page = organizationUserDao.page(pageable, param);
|
|
|
|
|
+ return ResultContent.buildSuccess(PageEntityUtil.concurrent2PageModel(page, this::toOrgUserDesenModel));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 查询机构用户列表
|
|
* 查询机构用户列表
|
|
|
*
|
|
*
|
|
@@ -685,6 +692,17 @@ public class UserAccountServiceImpl extends SuperService implements UserAccountS
|
|
|
return model;
|
|
return model;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public UserCountSimpleModel toSimpleDesenModel(UserAccount entity) {
|
|
|
|
|
+ UserCountSimpleModel model = null;
|
|
|
|
|
+ if (ObjectUtils.isNotEmpty(entity)) {
|
|
|
|
|
+ model = new UserCountSimpleModel();
|
|
|
|
|
+ BeanUtils.copyProperties(entity, model);
|
|
|
|
|
+ model.setLoginName("***");
|
|
|
|
|
+ model.setPhone(DesenUtil.turnPhoneDesen(model.getPhone()));
|
|
|
|
|
+ }
|
|
|
|
|
+ return model;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 用户在机构的数据模型(用户信息、职位、部门、角色等)
|
|
* 用户在机构的数据模型(用户信息、职位、部门、角色等)
|
|
|
*
|
|
*
|
|
@@ -710,7 +728,49 @@ public class UserAccountServiceImpl extends SuperService implements UserAccountS
|
|
|
|
|
|
|
|
// 角色信息
|
|
// 角色信息
|
|
|
if (ObjectUtils.isNotEmpty(entity.getRoles())) {
|
|
if (ObjectUtils.isNotEmpty(entity.getRoles())) {
|
|
|
- List<RoleModel> roleModels = entity.getRoles().stream().map(roleServiceImpl::toModel).collect(Collectors.toList());
|
|
|
|
|
|
|
+ List<RoleSimpleModel> roleModels = entity.getRoles().stream().map(roleServiceImpl::toSimpleModel).collect(Collectors.toList());
|
|
|
|
|
+ model.setRoles(roleModels);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 部门信息
|
|
|
|
|
+ if (ObjectUtils.isNotEmpty(entity.getDepartment())) {
|
|
|
|
|
+ DepartmentModel departmentModel = departmentService.toModel(entity.getDepartment());
|
|
|
|
|
+ model.setDepartment(departmentModel);
|
|
|
|
|
+ List<DepartmentModel> departmentModels = departmentService.getParents(entity.getDepartment().getId());
|
|
|
|
|
+ model.setDepartments(departmentModels);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return model;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 脱敏模型
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param entity
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ public OrganizationUserModel toOrgUserDesenModel(OrganizationUser entity) {
|
|
|
|
|
+ OrganizationUserModel model = new OrganizationUserModel();
|
|
|
|
|
+ if (ObjectUtils.isNotEmpty(entity)) {
|
|
|
|
|
+ BeanUtils.copyProperties(entity, model);
|
|
|
|
|
+ model.setPhone(DesenUtil.turnPhoneDesen(model.getPhone()));
|
|
|
|
|
+ model.setCardNumber(DesenUtil.turnIDCardDesen(model.getCardNumber()));
|
|
|
|
|
+
|
|
|
|
|
+ // 机构信息
|
|
|
|
|
+ OrganizationMiniModel miniModel = organizationManagerService.toMiniModel(entity.getOrganization());
|
|
|
|
|
+ model.setOrganization(miniModel);
|
|
|
|
|
+
|
|
|
|
|
+ // 用户信息
|
|
|
|
|
+ UserCountSimpleModel userCountModel = toSimpleDesenModel(entity.getUser());
|
|
|
|
|
+ model.setUser(userCountModel);
|
|
|
|
|
+
|
|
|
|
|
+ // 职务 职位
|
|
|
|
|
+ DictInfoSimpleModel position = dictInfoService.toSimpleModel(entity.getPosition());
|
|
|
|
|
+ model.setPosition(position);
|
|
|
|
|
+
|
|
|
|
|
+ // 角色信息
|
|
|
|
|
+ if (ObjectUtils.isNotEmpty(entity.getRoles())) {
|
|
|
|
|
+ List<RoleSimpleModel> roleModels = entity.getRoles().stream().map(roleServiceImpl::toSimpleModel).collect(Collectors.toList());
|
|
|
model.setRoles(roleModels);
|
|
model.setRoles(roleModels);
|
|
|
}
|
|
}
|
|
|
|
|
|