记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董敬伟
liquidnet-bus-v1
Commits
7fe9b9d3
Commit
7fe9b9d3
authored
Jan 18, 2022
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
生成取货码
parent
357923cb
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
577 additions
and
535 deletions
+577
-535
IDGenerator.java
...ain/java/com/liquidnet/commons/lang/util/IDGenerator.java
+19
-9
StringUtil.java
...main/java/com/liquidnet/commons/lang/util/StringUtil.java
+558
-526
No files found.
liquidnet-bus-common/liquidnet-common-base/src/main/java/com/liquidnet/commons/lang/util/IDGenerator.java
View file @
7fe9b9d3
...
...
@@ -69,11 +69,27 @@ public class IDGenerator {
}
public
static
String
storeRefundCode
(
String
orderMasterCode
)
{
return
orderMasterCode
.
concat
(
"R"
).
concat
(
RandomUtil
.
getRandomInt
(
0
,
50
)
+
""
);
return
orderMasterCode
.
concat
(
"R"
).
concat
(
RandomUtil
.
getRandomInt
(
0
,
99
)
+
""
);
}
public
static
String
getWriteOffCode
()
{
return
""
;
LocalDateTime
now
=
LocalDateTime
.
now
();
String
year
=
(
now
.
getYear
()+
""
).
substring
(
2
);
String
day
=
now
.
getDayOfYear
()+
""
;
String
hour
=
now
.
getHour
()+
""
;
String
sec
=
now
.
getSecond
()+
""
;
String
random
=
RandomUtil
.
getRandomInt
(
0
,
100
)+
""
;
if
(
day
.
length
()==
1
){
day
=
"0"
+
day
;
}
if
(
hour
.
length
()==
1
){
hour
=
"0"
+
hour
;
}
if
(
sec
.
length
()==
1
){
sec
=
"0"
+
sec
;
}
String
code
=
year
+
day
+
hour
+
sec
+
random
;
return
StringUtil
.
switchPosition
(
StringUtil
.
switchPosition
(
code
,
1
,
4
),
3
,
6
);
}
/**
...
...
@@ -123,12 +139,6 @@ public class IDGenerator {
}
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
""
+
IDGenerator
.
payCode
());
System
.
out
.
println
(
""
+
IDGenerator
.
refundCode
());
System
.
out
.
println
(
"nextTimeId==="
+
IDGenerator
.
nextTimeId
());
System
.
out
.
println
(
"nextMilliId==="
+
IDGenerator
.
nextMilliId
());
System
.
out
.
println
(
"nextMilliId2==="
+
IDGenerator
.
nextMilliId2
());
System
.
out
.
println
(
"nextSnowId==="
+
IDGenerator
.
nextSnowId
());
System
.
out
.
println
(
"get32UUID==="
+
IDGenerator
.
get32UUID
());
System
.
out
.
println
(
getWriteOffCode
());
}
}
liquidnet-bus-common/liquidnet-common-base/src/main/java/com/liquidnet/commons/lang/util/StringUtil.java
View file @
7fe9b9d3
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