Commit c97cbc67 by tangzhaoqian Committed by chenzg

手机号 正则优化

parent a4d08b72
...@@ -13,7 +13,8 @@ public class Regular { ...@@ -13,7 +13,8 @@ public class Regular {
/** /**
* 手机号码 * 手机号码
*/ */
public static final String PHONE = "^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(17[013678])|(18[0,5-9]))\\d{8}$"; // public static final String PHONE = "^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(17[013678])|(18[0,5-9]))\\d{8}$";
public static final String PHONE = "^[1]{10}$";
/** /**
* 账号是否合法 * 账号是否合法
*/ */
......
package cn.timer.api.controller.zzgl; package cn.timer.api.controller.zzgl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -28,6 +29,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; ...@@ -28,6 +29,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import cn.hutool.core.lang.tree.Tree; import cn.hutool.core.lang.tree.Tree;
import cn.hutool.core.lang.tree.TreeNode;
import cn.hutool.core.lang.tree.TreeNodeConfig; import cn.hutool.core.lang.tree.TreeNodeConfig;
import cn.hutool.core.lang.tree.TreeUtil; import cn.hutool.core.lang.tree.TreeUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
...@@ -129,13 +131,41 @@ public class ZzglController { ...@@ -129,13 +131,41 @@ public class ZzglController {
tree.setName(treeNode.getName()); tree.setName(treeNode.getName());
// 扩展属性 ... // 扩展属性 ...
tree.putExtra("leader", treeNode.getLeader()); tree.putExtra("leader", treeNode.getLeader());
tree.putExtra("type", treeNode.getType());
// tree.putExtra("other", new Object()); // tree.putExtra("other", new Object());
}); });
// System.out.println(treeNodes);
// System.out.println(treeNodes.size());
// System.out.println(deep2(treeNodes));
return ResultUtil.data(treeNodes); return ResultUtil.data(treeNodes);
} }
// 非递归,利用树的层次遍历
// public static int deep2(List<Tree<String>> treeNodes) {
// if(treeNodes == null)
// return 0;
// int depth = 0;
// for (Tree<String> tree : treeNodes) {
// if (tree.getChildren() == null) {
// depth = tree.size()-1 > depth ? tree.size()-1 : depth;
// if (Convert.toInt(tree.get("type")) == 1) {
// depth = depth > 1 ? depth - 1 : depth;
// }
// System.out.println("depth = "+ depth);
// }else {
// int temp = deep2(tree.getChildren());
// depth = temp > depth ? temp : depth;
// System.out.println("temp = "+ temp);
// }
// }
//
// return depth;
// }
/** /**
* 获取部门 * 获取部门
* *
......
...@@ -156,7 +156,7 @@ public class RouterUtils { ...@@ -156,7 +156,7 @@ public class RouterUtils {
router.setExecute(EXECUTING); router.setExecute(EXECUTING);
if (r != null && RELATION_TYPE_USERS.equals(r.getType())) { // if (r != null && RELATION_TYPE_USERS.equals(r.getType())) {
List<User> listUser = router.getRelation().get(0).getUsers(); List<User> listUser = router.getRelation().get(0).getUsers();
user: user:
for (int i = 0; i < listUser.size(); i++) { for (int i = 0; i < listUser.size(); i++) {
...@@ -174,7 +174,7 @@ public class RouterUtils { ...@@ -174,7 +174,7 @@ public class RouterUtils {
} }
} }
} // }
} }
NextNode(router.getChildren(), obj , isFirse, isAuditNext); NextNode(router.getChildren(), obj , isFirse, isAuditNext);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment