Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
8timerv2
8timerapiv200
Commits
e888c79e
Commit
e888c79e
authored
4 years ago
by
tangzhaoqian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
手机号 正则优化
parent
c6424672
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
3 deletions
+34
-3
src/main/java/cn/timer/api/config/exception/Regular.java
+2
-1
src/main/java/cn/timer/api/controller/zzgl/ZzglController.java
+30
-0
src/main/java/cn/timer/api/utils/router/RouterUtils.java
+2
-2
No files found.
src/main/java/cn/timer/api/config/exception/Regular.java
View file @
e888c79e
...
...
@@ -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}$"
;
/**
* 账号是否合法
*/
...
...
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/controller/zzgl/ZzglController.java
View file @
e888c79e
package
cn
.
timer
.
api
.
controller
.
zzgl
;
import
java.util.ArrayList
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
...
...
@@ -28,6 +29,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.convert.Convert
;
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.TreeUtil
;
import
cn.hutool.core.util.StrUtil
;
...
...
@@ -129,13 +131,41 @@ public class ZzglController {
tree
.
setName
(
treeNode
.
getName
());
// 扩展属性 ...
tree
.
putExtra
(
"leader"
,
treeNode
.
getLeader
());
tree
.
putExtra
(
"type"
,
treeNode
.
getType
());
// tree.putExtra("other", new Object());
});
// System.out.println(treeNodes);
// System.out.println(treeNodes.size());
// System.out.println(deep2(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;
// }
/**
* 获取部门
*
...
...
This diff is collapsed.
Click to expand it.
src/main/java/cn/timer/api/utils/router/RouterUtils.java
View file @
e888c79e
...
...
@@ -156,7 +156,7 @@ public class RouterUtils {
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
();
user:
for
(
int
i
=
0
;
i
<
listUser
.
size
();
i
++)
{
...
...
@@ -174,7 +174,7 @@ public class RouterUtils {
}
}
}
//
}
}
NextNode
(
router
.
getChildren
(),
obj
,
isFirse
,
isAuditNext
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment