|
@@ -14,6 +14,7 @@ import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.sql.Timestamp;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
import java.util.Optional;
|
|
|
|
|
@@ -24,6 +25,10 @@ import java.util.Optional;
|
|
|
|
|
|
@Component
|
|
|
public class UserRepo implements IUserRepo {
|
|
|
+ @Autowired
|
|
|
+ private EvaluationAgencyDao agencyDao;
|
|
|
+ @Autowired
|
|
|
+ private TestTypeDao testTypeDao;
|
|
|
|
|
|
@Autowired
|
|
|
private UserDao userDao;
|
|
@@ -38,6 +43,9 @@ public class UserRepo implements IUserRepo {
|
|
|
private UserToRoleDao userToRoleDao;
|
|
|
|
|
|
@Autowired
|
|
|
+ private UserTaskCountDao userTaskCountDao;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
private RoleToPermissionDao roleToPermissionDao;
|
|
|
|
|
|
@Autowired
|
|
@@ -71,18 +79,40 @@ public class UserRepo implements IUserRepo {
|
|
|
Optional<UserPO> userPOOptional = userDao.findById(userId);
|
|
|
if (!userPOOptional.isPresent()) {
|
|
|
throw new UserNotExistException("用户不存在");
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
User user = getUserAndRoleAndPermissionByUserPO(userPOOptional.get());
|
|
|
+
|
|
|
return user;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ public User getByUserIDJustAgencyInfo(Long userId) throws UserNotExistException, RoleNotFoundException {
|
|
|
+ Optional<UserPO> userPOOptional = userDao.findById(userId);
|
|
|
+ if (!userPOOptional.isPresent()) {
|
|
|
+ throw new UserNotExistException("用户不存在");
|
|
|
+ } else {
|
|
|
+ User user = getUserAndRoleAndPermissionByUserPO(userPOOptional.get());
|
|
|
+ return this.getEvaluationInfo(user);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public User getByIDJustInfo(Long userId) throws UserNotExistException, RoleNotFoundException {
|
|
|
+ Optional<UserPO> userPOOptional = userDao.findById(userId);
|
|
|
+ if (!userPOOptional.isPresent()){
|
|
|
+ throw new UserNotExistException("用户不存在");
|
|
|
+ } else {
|
|
|
+ return Converter.convert(User.class, userPOOptional.get());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
public User getByMobileNum(String mobileNum) throws UserNotExistException, RoleNotFoundException {
|
|
|
UserPO userPO = userDao.findByMobile(mobileNum);
|
|
|
if (userPO == null) {
|
|
|
throw new UserNotExistException("用户不存在");
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
User user = getUserAndRoleAndPermissionByUserPO(userPO);
|
|
|
return user;
|
|
|
}
|
|
@@ -98,11 +128,12 @@ public class UserRepo implements IUserRepo {
|
|
|
|
|
|
/**
|
|
|
* 获取机构认证的申请
|
|
|
+ *
|
|
|
* @return
|
|
|
* @throws RoleNotFoundException
|
|
|
*/
|
|
|
@Override
|
|
|
- public List<User> getApplyEvaluationAgencyByIsAuthenticated(){
|
|
|
+ public List<User> getApplyEvaluationAgencyByIsAuthenticated() {
|
|
|
List<UserPO> userPOList = new ArrayList<>();
|
|
|
evaluationAgencyDao.findByIsAuthentication(AuthenticationStatus.isNotAuthenticated).forEach(evaluationAgencyPO -> {
|
|
|
userPOList.add(userDao.findById(evaluationAgencyPO.getUserId()).get());
|
|
@@ -119,6 +150,23 @@ public class UserRepo implements IUserRepo {
|
|
|
return userListByIds;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public ArrayList<UserPO> getAllUserInfo() throws RoleNotFoundException {
|
|
|
+ Iterable<UserPO> allUserPO = userDao.findAll();
|
|
|
+ ArrayList<UserPO> userPOArrayList = Lists.newArrayList(allUserPO);
|
|
|
+ return userPOArrayList;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public UserTaskCount getUserTaskCountByUserId(Long userId) {
|
|
|
+ Optional<UserTaskCountPO> userTaskCountPO = userTaskCountDao.findByUserId(userId);
|
|
|
+ if (!userTaskCountPO.isPresent()) {
|
|
|
+ return null;
|
|
|
+ } else {
|
|
|
+ return Converter.convert(UserTaskCount.class, userTaskCountPO.get());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
//add
|
|
|
// @Override
|
|
@@ -159,6 +207,7 @@ public class UserRepo implements IUserRepo {
|
|
|
|
|
|
/**
|
|
|
* 注册用户时默认为普通用户,分配角色后存入数据库
|
|
|
+ *
|
|
|
* @param user
|
|
|
* @return
|
|
|
*/
|
|
@@ -171,7 +220,7 @@ public class UserRepo implements IUserRepo {
|
|
|
// 存储从数据库中取出的User的Role数据
|
|
|
List<Role> roleListResult = new ArrayList<>();
|
|
|
|
|
|
- for(Role role : roleList){
|
|
|
+ for (Role role : roleList) {
|
|
|
RolePO rolePO = roleDao.findByName(role.getName());
|
|
|
Role roleConvert = Converter.convert(Role.class, rolePO);
|
|
|
|
|
@@ -190,6 +239,7 @@ public class UserRepo implements IUserRepo {
|
|
|
|
|
|
/**
|
|
|
* 保存用户相关的所有信息(包括测评机构信息、角色信息、权限信息)
|
|
|
+ *
|
|
|
* @param user
|
|
|
* @return
|
|
|
* @throws RoleNotFoundException
|
|
@@ -202,7 +252,8 @@ public class UserRepo implements IUserRepo {
|
|
|
|
|
|
|
|
|
/**
|
|
|
- *保存用户信息(包括测评机构信息、角色信息、权限信息)
|
|
|
+ * 保存用户信息(包括测评机构信息、角色信息、权限信息)
|
|
|
+ *
|
|
|
* @param user
|
|
|
* @return
|
|
|
* @throws RoleNotFoundException
|
|
@@ -210,15 +261,15 @@ public class UserRepo implements IUserRepo {
|
|
|
private User saveRoleAndPermissionAndEvaluationAgencyByUser(User user) throws RoleNotFoundException {
|
|
|
UserPO userPO = userDao.save(Converter.convert(UserPO.class, user));
|
|
|
List<Role> roleList = user.getRoleList();
|
|
|
- if (roleList==null || roleList.size()==0){
|
|
|
+ if (roleList == null || roleList.size() == 0) {
|
|
|
UserToRolePO u2r = new UserToRolePO();
|
|
|
u2r.setUserId(userPO.getId());
|
|
|
u2r.setRoleId(1L);
|
|
|
userToRoleDao.save(u2r);
|
|
|
}
|
|
|
List<UserToRolePO> userToRolePOList = userToRoleDao.findByUserId(userPO.getId());
|
|
|
- if(roleList != null){
|
|
|
- for(Role role : roleList){
|
|
|
+ if (roleList != null) {
|
|
|
+ for (Role role : roleList) {
|
|
|
if (userToRolePOList.stream().noneMatch(userToRolePO -> userToRolePO.getRoleId().equals(role.getId()))) {
|
|
|
UserToRolePO userToRolePO = new UserToRolePO();
|
|
|
userToRolePO.setRoleId(role.getId());
|
|
@@ -230,19 +281,24 @@ public class UserRepo implements IUserRepo {
|
|
|
|
|
|
/*机构认证保存机构信息*/
|
|
|
EvaluationAgency evaluationAgency = user.getEvaluationAgency();
|
|
|
- if(evaluationAgency != null){
|
|
|
+ if (evaluationAgency != null) {
|
|
|
EvaluationAgencyPO evaluationAgencyPO = Converter.convert(EvaluationAgencyPO.class, evaluationAgency);
|
|
|
evaluationAgencyPO.setUserId(userPO.getId());
|
|
|
+ System.out.println(evaluationAgencyPO + "xxxxxxxxxxxxxxxxxxxxxxxx");
|
|
|
evaluationAgencyPO = evaluationAgencyDao.save(evaluationAgencyPO);
|
|
|
List<EvaluationAgencyResource> resources = evaluationAgency.getEvaluationAgencyResourceList();
|
|
|
List<EvaluationAgencyAbility> abilities = evaluationAgency.getEvaluationAgencyAbilityList();
|
|
|
- for (EvaluationAgencyResource resource : resources) {
|
|
|
- resource.setEvaluationAgencyId(evaluationAgencyPO.getId());
|
|
|
- resourceRepo.saveEvaluationAgencyResource(resource);
|
|
|
+ if (resources != null) {
|
|
|
+ for (EvaluationAgencyResource resource : resources) {
|
|
|
+ resource.setEvaluationAgencyId(evaluationAgencyPO.getId());
|
|
|
+ resourceRepo.saveEvaluationAgencyResource(resource);
|
|
|
+ }
|
|
|
}
|
|
|
- for (EvaluationAgencyAbility ability : abilities) {
|
|
|
- ability.setEvaluationAgencyId(evaluationAgencyPO.getId());
|
|
|
- resourceRepo.saveEvaluationAgencyAbility(ability);
|
|
|
+ if (abilities != null) {
|
|
|
+ for (EvaluationAgencyAbility ability : abilities) {
|
|
|
+ ability.setEvaluationAgencyId(evaluationAgencyPO.getId());
|
|
|
+ resourceRepo.saveEvaluationAgencyAbility(ability);
|
|
|
+ }
|
|
|
}
|
|
|
// // save测评机构资源
|
|
|
// EvaluationAgencyResource evaluationAgencyResource = evaluationAgency.getEvaluationAgencyResource();
|
|
@@ -254,34 +310,49 @@ public class UserRepo implements IUserRepo {
|
|
|
}
|
|
|
|
|
|
/*实名认证保存个人信息*/
|
|
|
- if(user.getPersonalAuthentication() != null){
|
|
|
- personalAuthenticationDao.save(Converter.convert(PersonalAuthenticationPO.class, user.getPersonalAuthentication()));
|
|
|
+ if (user.getPersonalAuthentication() != null) {
|
|
|
+ PersonalAuthenticationPO authenticationPO = Converter.convert(PersonalAuthenticationPO.class, user.getPersonalAuthentication());
|
|
|
+ personalAuthenticationDao.save(authenticationPO);
|
|
|
}
|
|
|
|
|
|
/*企业认证保存企业信息*/
|
|
|
- if(user.getEnterpriseAuthentication() != null){
|
|
|
- enterpriseAuthenticationDao.save(Converter.convert(EnterpriseAuthenticationPO.class, user.getEnterpriseAuthentication()));
|
|
|
- }
|
|
|
+// if (user.getEnterpriseAuthentication() != null) {
|
|
|
+//// if (user.getEnterpriseAuthentication().getType().contains("研发机构")) {
|
|
|
+//// System.out.println("认证消息为===========" + user.getPersonalAuthentication());
|
|
|
+//// EnterpriseAuthenticationPO authenticationPO = Converter.convert(EnterpriseAuthenticationPO.class, user.getEnterpriseAuthentication());
|
|
|
+//// System.out.println("认证消息为PO===========" + authenticationPO);
|
|
|
+//// enterpriseAuthenticationDao.save(authenticationPO);
|
|
|
+//// }
|
|
|
+//// else if (user.getEnterpriseAuthentication().getIsDaOrEa().equals("评测机构")) {
|
|
|
+// EvaluationAgencyPO evaluationAgencyPO = new EvaluationAgencyPO();
|
|
|
+// evaluationAgencyPO.setUserId(user.getId());
|
|
|
+// evaluationAgencyPO.setAddress(user.getEnterpriseAuthentication().getAddress());
|
|
|
+// evaluationAgencyPO.setEvaluationAgencyName(user.getEnterpriseAuthentication().getEnterpriseName());
|
|
|
+// evaluationAgencyPO.setUpdateTime(new Timestamp(System.currentTimeMillis()));
|
|
|
+// agencyDao.save(evaluationAgencyPO);
|
|
|
+//// }
|
|
|
+// }
|
|
|
|
|
|
return getByID(userPO.getId());
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 通过角色获取角色和权限信息
|
|
|
+ *
|
|
|
* @param roleResult
|
|
|
* @return
|
|
|
*/
|
|
|
private Role getPermissionByRole(Role roleResult) {
|
|
|
List<Permission> permissionResultList = new ArrayList<>();
|
|
|
List<RoleToPermissionPO> roleToPermissionPOList = roleToPermissionDao.findAllByRoleId(roleResult.getId());
|
|
|
- for(RoleToPermissionPO roleToPermissionPO : roleToPermissionPOList){
|
|
|
+ for (RoleToPermissionPO roleToPermissionPO : roleToPermissionPOList) {
|
|
|
Long permissionId = roleToPermissionPO.getPermissionId();
|
|
|
Optional<PermissionPO> permissionPOOptional = permissionDao.findById(permissionId);
|
|
|
- if(!permissionPOOptional.isPresent()){
|
|
|
+ if (!permissionPOOptional.isPresent()) {
|
|
|
throw new PermissionNotFoundException();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
PermissionPO permissionPO = permissionPOOptional.get();
|
|
|
- permissionResultList.add(Converter.convert(Permission.class,permissionPO));
|
|
|
+ permissionResultList.add(Converter.convert(Permission.class, permissionPO));
|
|
|
}
|
|
|
}
|
|
|
roleResult.setPermissionList(permissionResultList);
|
|
@@ -290,13 +361,14 @@ public class UserRepo implements IUserRepo {
|
|
|
|
|
|
/**
|
|
|
* 通过UsePOList获取用户-角色-权限信息
|
|
|
+ *
|
|
|
* @param userPOList
|
|
|
* @return
|
|
|
* @throws RoleNotFoundException
|
|
|
*/
|
|
|
private List<User> getUserAndRoleAndPermissionListByUserPOList(List<UserPO> userPOList) throws RoleNotFoundException {
|
|
|
List<User> userList = new ArrayList<>();
|
|
|
- for(UserPO userPO : userPOList){
|
|
|
+ for (UserPO userPO : userPOList) {
|
|
|
User userAndRole = getUserAndRoleAndPermissionByUserPO(userPO);
|
|
|
userList.add(userAndRole);
|
|
|
}
|
|
@@ -305,6 +377,7 @@ public class UserRepo implements IUserRepo {
|
|
|
|
|
|
/**
|
|
|
* 通过用户信息获取用户-角色-权限信息
|
|
|
+ *
|
|
|
* @param userPO
|
|
|
* @return
|
|
|
* @throws RoleNotFoundException
|
|
@@ -315,66 +388,58 @@ public class UserRepo implements IUserRepo {
|
|
|
List<Role> roleResultList = new ArrayList<>();
|
|
|
for (UserToRolePO userToRolePO : userToRolePOList) {
|
|
|
Optional<RolePO> rolePOOptional = roleDao.findById(userToRolePO.getRoleId());
|
|
|
- if(rolePOOptional.isPresent()){
|
|
|
+ if (rolePOOptional.isPresent()) {
|
|
|
RolePO rolePO = rolePOOptional.get();
|
|
|
// 权限
|
|
|
Role roleResult = getPermissionByRole(Converter.convert(Role.class, rolePO));
|
|
|
roleResultList.add(roleResult);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
throw new RoleNotFoundException();
|
|
|
}
|
|
|
}
|
|
|
userResult.setRoleList(roleResultList);
|
|
|
|
|
|
- /*获取测评机构信息*/
|
|
|
- EvaluationAgencyPO evaluationAgencyPO = evaluationAgencyDao.findByUserIdAndIsDeleted(userPO.getId(), DeletedStatus.isNotDeleted);
|
|
|
- if(evaluationAgencyPO != null){
|
|
|
- EvaluationAgency evaluationAgencyResult = Converter.convert(EvaluationAgency.class, evaluationAgencyPO);
|
|
|
-
|
|
|
- /*获取测评机构能力*/
|
|
|
- List<EvaluationAgencyAbilityPO> evaluationAgencyAbilityPOList = agencyAbilityDao.findByEvaluationAgencyIdAndIsDeleted(evaluationAgencyResult.getId(), DeletedStatus.isNotDeleted);
|
|
|
- List<EvaluationAgencyAbility> evaluationAgencyAbilityList = new ArrayList<>();
|
|
|
- if(evaluationAgencyAbilityPOList.size() != 0){
|
|
|
- for(EvaluationAgencyAbilityPO evaluationAgencyAbilityPO : evaluationAgencyAbilityPOList){
|
|
|
- EvaluationAgencyAbility evaluationAgencyAbility = Converter.convert(EvaluationAgencyAbility.class, evaluationAgencyAbilityPO);
|
|
|
- evaluationAgencyAbilityList.add(evaluationAgencyAbility);
|
|
|
- }
|
|
|
- }
|
|
|
- evaluationAgencyResult.setEvaluationAgencyAbilityList(evaluationAgencyAbilityList);
|
|
|
-
|
|
|
- /*获取测评机构资源*/
|
|
|
- List<EvaluationAgencyResourcePO> evaluationAgencyResourcePOList = agencyResourceDao.findByEvaluationAgencyIdAndIsDeleted(evaluationAgencyResult.getId(), DeletedStatus.isNotDeleted);
|
|
|
- List<EvaluationAgencyResource> evaluationAgencyResourceList = new ArrayList<>();
|
|
|
- if(evaluationAgencyResourcePOList.size() != 0){
|
|
|
- for(EvaluationAgencyResourcePO evaluationAgencyResourcePO : evaluationAgencyResourcePOList){
|
|
|
- EvaluationAgencyResource evaluationAgencyResource = Converter.convert(EvaluationAgencyResource.class, evaluationAgencyResourcePO);
|
|
|
- evaluationAgencyResourceList.add(evaluationAgencyResource);
|
|
|
- }
|
|
|
- }
|
|
|
- evaluationAgencyResult.setEvaluationAgencyResourceList(evaluationAgencyResourceList);
|
|
|
- userResult.setEvaluationAgency(evaluationAgencyResult);
|
|
|
- }
|
|
|
+ /*获取机构认证的信息*/
|
|
|
+ userResult = getEvaluationInfo(userResult);
|
|
|
|
|
|
/*获取个人认证的信息*/
|
|
|
PersonalAuthenticationPO personalAuthenticationPO = personalAuthenticationDao.findByUserIdAndIsDeleted(userPO.getId(), DeletedStatus.isNotDeleted);
|
|
|
- if(personalAuthenticationPO != null){
|
|
|
+ if (personalAuthenticationPO != null) {
|
|
|
userResult.setPersonalAuthentication(Converter.convert(PersonalAuthentication.class, personalAuthenticationPO));
|
|
|
}
|
|
|
|
|
|
/*获取企业认证的信息*/
|
|
|
EnterpriseAuthenticationPO enterpriseAuthenticationPO = enterpriseAuthenticationDao.findByUserIdAndIsDeleted(userPO.getId(), DeletedStatus.isNotDeleted);
|
|
|
- if(enterpriseAuthenticationPO != null){
|
|
|
+ if (enterpriseAuthenticationPO != null) {
|
|
|
userResult.setEnterpriseAuthentication(Converter.convert(EnterpriseAuthentication.class, enterpriseAuthenticationPO));
|
|
|
}
|
|
|
+ //获取用户能力
|
|
|
+ String abilityName="";
|
|
|
+ List<String> codeList=new ArrayList<>();
|
|
|
+ List<String> abailities = new ArrayList<>();
|
|
|
+ if(userPO.getPersonalCompetence()!=null&&!userPO.getPersonalCompetence().trim().equals("")){
|
|
|
+ codeList= Arrays.asList(userPO.getPersonalCompetence().split(","));
|
|
|
+ }
|
|
|
+
|
|
|
+ if(abailities!=null&&!codeList.isEmpty()){
|
|
|
+
|
|
|
+ for (int i = 0; i < abailities.size(); i++) {
|
|
|
+ abilityName = testTypeDao.findByCode(codeList.get(i)).get().getName();
|
|
|
+ abailities.add(abilityName);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ userResult.setPersonAbilities(abailities);
|
|
|
|
|
|
/*获取区域管理员信息*/
|
|
|
List<RegionalManagerToRegionalPO> regionalManagerToRegionalPOList = regionalManagerToRegionalDao.findByUserIdAndIsDeleted(userPO.getId(), DeletedStatus.isNotDeleted);
|
|
|
- if(regionalManagerToRegionalPOList.size() > 0){
|
|
|
+ if (regionalManagerToRegionalPOList.size() > 0) {
|
|
|
List<RegionalManagerToRegional> regionalList = new ArrayList<>();
|
|
|
RegionalManager regionalManager = new RegionalManager();
|
|
|
regionalManager.setUserId(userPO.getId());
|
|
|
- for(RegionalManagerToRegionalPO regionalManagerToRegionalPO : regionalManagerToRegionalPOList){
|
|
|
- if(regionalManagerToRegionalPO != null){
|
|
|
+ for (RegionalManagerToRegionalPO regionalManagerToRegionalPO : regionalManagerToRegionalPOList) {
|
|
|
+ if (regionalManagerToRegionalPO != null) {
|
|
|
regionalManager.setId(regionalManagerToRegionalPO.getId());
|
|
|
/*获取区域管理员管理的区域信息*/
|
|
|
RegionalManagerToRegional regionalResult = Converter.convert(RegionalManagerToRegional.class, regionalManagerToRegionalPO);
|
|
@@ -388,28 +453,68 @@ public class UserRepo implements IUserRepo {
|
|
|
|
|
|
//获取系统管理员信息
|
|
|
SystemAdministratorToUserPO systemAdministratorToUserPO = systemAdministratorToUserDao.findByUserIdAndIsDeleted(userPO.getId(), DeletedStatus.isNotDeleted);
|
|
|
- if(systemAdministratorToUserPO != null){
|
|
|
+ if (systemAdministratorToUserPO != null) {
|
|
|
userResult.setSystemAdministratorToUser(Converter.convert(SystemAdministratorToUser.class, systemAdministratorToUserPO));
|
|
|
}
|
|
|
|
|
|
return userResult;
|
|
|
}
|
|
|
|
|
|
- public Role getRole(String roleName){
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ private User getEvaluationInfo(User userResult) {
|
|
|
+ /*获取测评机构信息*/
|
|
|
+ EvaluationAgencyPO evaluationAgencyPO = evaluationAgencyDao.findByUserIdAndIsDeleted(userResult.getId(), DeletedStatus.isNotDeleted);
|
|
|
+ if (evaluationAgencyPO != null) {
|
|
|
+ EvaluationAgency evaluationAgencyResult = Converter.convert(EvaluationAgency.class, evaluationAgencyPO);
|
|
|
+
|
|
|
+ /*获取测评机构能力*/
|
|
|
+ List<EvaluationAgencyAbilityPO> evaluationAgencyAbilityPOList = agencyAbilityDao.findByEvaluationAgencyIdAndIsDeleted(evaluationAgencyResult.getId(), DeletedStatus.isNotDeleted);
|
|
|
+ List<EvaluationAgencyAbility> evaluationAgencyAbilityList = new ArrayList<>();
|
|
|
+ if (evaluationAgencyAbilityPOList.size() != 0) {
|
|
|
+ for (EvaluationAgencyAbilityPO evaluationAgencyAbilityPO : evaluationAgencyAbilityPOList) {
|
|
|
+ EvaluationAgencyAbility evaluationAgencyAbility = Converter.convert(EvaluationAgencyAbility.class, evaluationAgencyAbilityPO);
|
|
|
+ evaluationAgencyAbilityList.add(evaluationAgencyAbility);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ evaluationAgencyResult.setEvaluationAgencyAbilityList(evaluationAgencyAbilityList);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /*获取测评机构资源*/
|
|
|
+ List<EvaluationAgencyResourcePO> evaluationAgencyResourcePOList = agencyResourceDao.findByEvaluationAgencyIdAndIsDeleted(evaluationAgencyResult.getId(), DeletedStatus.isNotDeleted);
|
|
|
+ List<EvaluationAgencyResource> evaluationAgencyResourceList = new ArrayList<>();
|
|
|
+ if (evaluationAgencyResourcePOList.size() != 0) {
|
|
|
+ for (EvaluationAgencyResourcePO evaluationAgencyResourcePO : evaluationAgencyResourcePOList) {
|
|
|
+ EvaluationAgencyResource evaluationAgencyResource = Converter.convert(EvaluationAgencyResource.class, evaluationAgencyResourcePO);
|
|
|
+ evaluationAgencyResourceList.add(evaluationAgencyResource);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ evaluationAgencyResult.setEvaluationAgencyResourceList(evaluationAgencyResourceList);
|
|
|
+ userResult.setEvaluationAgency(evaluationAgencyResult);
|
|
|
+ }
|
|
|
+ return userResult;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Role getRole(String roleName) {
|
|
|
Role role = new Role();
|
|
|
BeanUtils.copyProperties(roleDao.findByName(roleName), role);
|
|
|
return role;
|
|
|
}
|
|
|
|
|
|
- public long getAllUserNum(){
|
|
|
+ public long getAllUserNum() {
|
|
|
return userDao.count();
|
|
|
}
|
|
|
|
|
|
- public long getAllAgencyNum(){
|
|
|
+ public long getAllAgencyNum() {
|
|
|
return evaluationAgencyDao.count();
|
|
|
}
|
|
|
|
|
|
- public long getAllResourceNum(){
|
|
|
+ public long getAllResourceNum() {
|
|
|
return agencyResourceDao.count();
|
|
|
}
|
|
|
}
|