Browse Source

添加后台的搜索字段

huxz 7 years ago
parent
commit
8322816691

+ 8 - 0
sso-manage-console-web/src/components/accounts/enterprises/EnterpriseHome.vue

@@ -98,6 +98,14 @@
     {
       label: '企业名称',
       value: 'spaceName'
+    },
+    {
+      label: '营业执照号',
+      value: 'businessCode'
+    },
+    {
+      label: 'UU号',
+      value: 'spaceUU'
     }
   ]
 

+ 8 - 0
sso-manage-console-web/src/components/accounts/users/UserHome.vue

@@ -110,6 +110,14 @@
     {
       label: '用户名称',
       value: 'vipName'
+    },
+    {
+      label: '个人UU',
+      value: 'userUU'
+    },
+    {
+      label: '手机号',
+      value: 'mobile'
     }
   ]
 

+ 32 - 29
sso-manage-console/src/main/java/com/uas/sso/sso/backend/service/impl/AppealServiceImpl.java

@@ -111,41 +111,44 @@ public class AppealServiceImpl implements AppealService {
         appeal.setStatus((short) (isPass ? 2 : 3));
         appealDao.save(appeal);
 
+
+        if (!isPass) {
+            return;
+        }
+
         // 审核通过之后,更新用户和企业信息
-        if (isPass) {
-            Map map = JacksonUtils.fromJson(appeal.getSubmitInfo(), Map.class);
-            Assert.notNull(map, "申诉提交信息不能为空");
+        Map map = JacksonUtils.fromJson(appeal.getSubmitInfo(), Map.class);
+        Assert.notNull(map, "申诉提交信息不能为空");
 
-            if (RESET_PASS.equals(appeal.getType()) || VALID_MOBILE.equals(appeal.getType())) {
-                User user = assertUserExist(appeal.getSubmitterUU());
-                user.setMobile(appeal.getMobile());
+        if (RESET_PASS.equals(appeal.getType()) || VALID_MOBILE.equals(appeal.getType())) {
+            User user = assertUserExist(appeal.getSubmitterUU());
+            user.setMobile(appeal.getMobile());
 
-                if (RESET_PASS.equals(appeal.getType())) {
-                    String password = (String) map.get("password");
+            if (RESET_PASS.equals(appeal.getType())) {
+                String password = (String) map.get("password");
 
-                    if (StringUtils.isEmpty(password) || password.length() < 32) {
-                        throw new ValidationFailedException("重置密码不存在或密码未被加密");
-                    }
-                    user.setPassword(password);
-                }
-                userDao.save(user);
-            } else if (CHANGE_ADMIN.equals(appeal.getType())) {
-                Long spaceUU = ((Integer) map.get("spaceUU")).longValue();
-                Assert.notNull(map, "更换管理员申诉企业UU不能为空");
-
-                Userspace space = assertSpaceExist(spaceUU);
-                User user = userDao.findByMobile(appeal.getMobile());
-                if (user == null) {
-                    throw new ValidationFailedException(
-                            String.format("拥有手机号[%s]的用户不存在", appeal.getMobile()));
+                if (StringUtils.isEmpty(password) || password.length() < 32) {
+                    throw new ValidationFailedException("重置密码不存在或密码未被加密");
                 }
-
-                space.setAdmin(user);
-                space.setAdminUU(user.getUserUU());
-                spaceDao.save(space);
-            } else {
-                logger.info("暂无支持申诉类型");
+                user.setPassword(password);
+            }
+            userDao.save(user);
+        } else if (CHANGE_ADMIN.equals(appeal.getType())) {
+            Long spaceUU = ((Integer) map.get("spaceUU")).longValue();
+            Assert.notNull(map, "更换管理员申诉企业UU不能为空");
+
+            Userspace space = assertSpaceExist(spaceUU);
+            User user = userDao.findByMobile(appeal.getMobile());
+            if (user == null) {
+                throw new ValidationFailedException(
+                        String.format("拥有手机号[%s]的用户不存在", appeal.getMobile()));
             }
+
+            space.setAdmin(user);
+            space.setAdminUU(user.getUserUU());
+            spaceDao.save(space);
+        } else {
+            logger.info("暂无支持申诉类型");
         }
     }
 

+ 4 - 1
sso-manage-console/src/main/java/com/uas/sso/sso/backend/service/impl/UserServiceImpl.java

@@ -57,7 +57,10 @@ public class UserServiceImpl implements UserService {
                     predicates.add(predicate);
                 }
 
-                if (!StringUtils.isEmpty(key) && !StringUtils.isEmpty(keyword)) {
+                if ("userUU".equals(key) && !StringUtils.isEmpty(keyword)) {
+                    Predicate predicate = builder.equal(root.get(key), keyword);
+                    predicates.add(predicate);
+                } else if (!StringUtils.isEmpty(key) && !StringUtils.isEmpty(keyword)) {
                     Predicate predicate = builder.like(root.get(key), "%" + keyword + "%");
                     predicates.add(predicate);
                 }

+ 4 - 1
sso-manage-console/src/main/java/com/uas/sso/sso/backend/service/impl/UserSpaceServiceImpl.java

@@ -77,7 +77,10 @@ public class UserSpaceServiceImpl implements UserSpaceService {
                 }
 
                 // 搜索关键字过滤
-                if (!StringUtils.isEmpty(key) && !StringUtils.isEmpty(keyword)) {
+                if ("spaceUU".equals(key) && !StringUtils.isEmpty(keyword)) {
+                    Predicate predicate = builder.equal(root.get(key), keyword);
+                    predicates.add(predicate);
+                } else if (!StringUtils.isEmpty(key) && !StringUtils.isEmpty(keyword)) {
                     Predicate predicate = builder.like(root.get(key), "%" + keyword + "%");
                     predicates.add(predicate);
                 }