|
|
@@ -66,9 +66,6 @@ public class UserServiceImpl implements UserService {
|
|
|
@Autowired
|
|
|
private EnterpriseDao enterpriseDao;
|
|
|
|
|
|
- @Autowired
|
|
|
- private CommonDao commonDao;
|
|
|
-
|
|
|
@Autowired
|
|
|
private UserCacheEnterpriseDao userCacheEnterpriseDao;
|
|
|
|
|
|
@@ -78,51 +75,6 @@ public class UserServiceImpl implements UserService {
|
|
|
@Autowired
|
|
|
private MessageConf messageConf;
|
|
|
|
|
|
-
|
|
|
- @Override
|
|
|
- public Page<User> findUsersPageByEnUUAndKeyword(final PageInfo pageInfo , Long enUU , String keyword) {
|
|
|
- List<Long> usersId = new ArrayList<>();
|
|
|
- if (keyword.contains("@")) { // 按邮箱查找
|
|
|
- usersId = userDao.findUserByUserEmailAndEnUU(keyword, enUU);
|
|
|
- } else if (keyword.matches(TEL_REGEXP)) { // 按手机号查找
|
|
|
- usersId = userDao.findUserByUserTelAndEnUU(keyword, enUU);
|
|
|
- } else if (keyword.matches(UU_REGEXP)) { // 按UU号查找
|
|
|
- usersId = userDao.findUserByEnUUAndUserUU(enUU, Long.parseLong(keyword));
|
|
|
- } else if (!keyword.contains("@") && (keyword.matches(CHINESE_REGEXP) || keyword.matches(ENGLISH_REGEXP))) {// 按名字查找
|
|
|
- usersId = userDao.findUserByUserNameAndEnUU(keyword, enUU);
|
|
|
- } else{
|
|
|
- usersId = userDao.findUserByUserNameAndEnUU(keyword, enUU);
|
|
|
- }
|
|
|
- final List<Long> users = usersId;
|
|
|
- if (users.size()>0) {
|
|
|
- Page<User> pUser = userDao.findAll(new Specification<User>() {
|
|
|
- public Predicate toPredicate(Root<User> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
|
|
|
- Predicate predicateId = root.get("userUU").in(users);
|
|
|
- query.where(predicateId);
|
|
|
- return null;
|
|
|
- }
|
|
|
- }, pageInfo);
|
|
|
- for (User user : pUser) {
|
|
|
- Set<Role> roles = user.getRoles();
|
|
|
- Long enuu = SystemSession.getUser().getEnterprise().getUu();
|
|
|
- if (!CollectionUtils.isEmpty(roles)) {
|
|
|
- Iterator<Role> iterator = roles.iterator();
|
|
|
- while (iterator.hasNext()) {
|
|
|
- Role role = iterator.next();
|
|
|
- if (!role.getEnUU().equals(enuu)) {
|
|
|
- iterator.remove();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return pUser;
|
|
|
- }else{
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
@Override
|
|
|
public User findUserByUserUU(Long uu) {
|
|
|
List<User> users = userDao.findUserByUserUU(uu);
|
|
|
@@ -184,18 +136,6 @@ public class UserServiceImpl implements UserService {
|
|
|
return users;
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public User findUserByEnUUAndUserUU(Long enUU, Long userUU) {
|
|
|
- List<User> users = userDao.findByEnUUAndUserUU(enUU, userUU);
|
|
|
- return CollectionUtils.isEmpty(users) ? null : users.get(0);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public List<User> findUsersByEnUU(Long enUU) {
|
|
|
- List<User> users = userDao.findByEnUU(enUU);
|
|
|
- return users;
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
public Page<User> findUsersPageByEnUU(final PageInfo pageInfo , Long enUU) {
|
|
|
final List<Long> usersId = userDao.findIdByEnUU(enUU);
|
|
|
@@ -729,11 +669,6 @@ public class UserServiceImpl implements UserService {
|
|
|
map.put("status","sucess");
|
|
|
map.put("msg",re.getDesc());
|
|
|
return map;
|
|
|
- } else {
|
|
|
- ModelMap map = new ModelMap();
|
|
|
- map.put("status","fail");
|
|
|
- map.put("msg","没有该导出权限,请联系管理员");
|
|
|
- return map;
|
|
|
}
|
|
|
}
|
|
|
}else {
|
|
|
@@ -742,6 +677,9 @@ public class UserServiceImpl implements UserService {
|
|
|
map.put("msg","没有该导出权限,请联系管理员");
|
|
|
return map;
|
|
|
}
|
|
|
- return null;
|
|
|
+ ModelMap map = new ModelMap();
|
|
|
+ map.put("status","fail");
|
|
|
+ map.put("msg","没有该导出权限,请联系管理员");
|
|
|
+ return map;
|
|
|
}
|
|
|
}
|