Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-cloud-core
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
xingmin
yd-cloud-core
Commits
80a2ac11
Commit
80a2ac11
authored
Feb 02, 2026
by
zhangxingmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
a1183e83
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
12 deletions
+20
-12
yd-common/src/main/java/com/yd/common/enums/CommonEnum.java
+1
-0
yd-common/src/main/java/com/yd/common/utils/ChineseTextConverter.java
+2
-1
yd-common/src/main/java/com/yd/common/utils/CustomLocalDateTimeDeserializer.java
+15
-9
yd-common/src/main/java/com/yd/common/utils/RandomStringGenerator.java
+2
-2
No files found.
yd-common/src/main/java/com/yd/common/enums/CommonEnum.java
View file @
80a2ac11
...
...
@@ -75,6 +75,7 @@ public enum CommonEnum {
UID_TYPE_PREMIUM_RECONCILIATION
(
"premium_reconciliation"
,
"保费对账记录表"
),
UID_TYPE_PREMIUM_REMITTANCE
(
"premium_remittance"
,
"保费对账-汇款记录表"
),
UID_TYPE_PREMIUM_REMITTANCE_FILE
(
"premium_remittance_file"
,
"保费对账-汇款记录附件表"
),
UID_TYPE_REL_OBJECT_CERTIFICATE
(
"rel_object_certificate"
,
"对象证件关系表"
),
//作用域枚举
SCOPE_SYS
(
"1"
,
"系统级(全局)"
),
...
...
yd-common/src/main/java/com/yd/common/utils/ChineseTextConverter.java
View file @
80a2ac11
...
...
@@ -54,6 +54,6 @@ public class ChineseTextConverter {
}
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
traditionalToSimplified
(
"大學或以上
"
));
System
.
out
.
println
(
simplifiedToTraditional
(
"联络电话
"
));
}
}
\ No newline at end of file
yd-common/src/main/java/com/yd/common/utils/CustomLocalDateTimeDeserializer.java
View file @
80a2ac11
...
...
@@ -7,24 +7,31 @@ import com.fasterxml.jackson.databind.JsonDeserializer;
import
java.io.IOException
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.time.format.DateTimeParseException
;
public
class
CustomLocalDateTimeDeserializer
extends
JsonDeserializer
<
LocalDateTime
>
{
private
static
final
DateTimeFormatter
DATE_FORMATTER
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
);
private
static
final
DateTimeFormatter
DATE_TIME_FORMATTER
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
);
@Override
public
LocalDateTime
deserialize
(
JsonParser
p
,
DeserializationContext
ctxt
)
throws
IOException
{
String
text
=
p
.
getText
();
if
(
text
==
null
||
text
.
isEmpty
())
{
return
null
;
}
// 如果字符串长度只有10(即"yyyy-MM-dd"),则拼接" 00:00:00"
if
(
text
.
length
()
==
10
)
{
text
=
text
+
" 00:00:00"
;
try
{
// 先尝试解析完整的时间格式
return
LocalDateTime
.
parse
(
text
,
DATE_TIME_FORMATTER
);
}
catch
(
DateTimeParseException
e1
)
{
try
{
// 如果失败,尝试解析日期格式并添加时间
return
LocalDateTime
.
parse
(
text
+
" 00:00:00"
,
DATE_TIME_FORMATTER
);
}
catch
(
DateTimeParseException
e2
)
{
// 如果都失败,抛出异常
throw
new
IOException
(
"Failed to parse LocalDateTime from: "
+
text
,
e2
);
}
}
return
LocalDateTime
.
parse
(
text
,
DATE_TIME_FORMATTER
);
}
}
\ No newline at end of file
yd-common/src/main/java/com/yd/common/utils/RandomStringGenerator.java
View file @
80a2ac11
...
...
@@ -60,8 +60,8 @@ public class RandomStringGenerator {
// String random32 = generate(32, false);
// System.out.println("32位: " + random32);
for
(
int
i
=
0
;
i
<
6
;
i
++)
{
System
.
out
.
println
(
generateBizId16
(
"c
lient_us
er"
));
for
(
int
i
=
0
;
i
<
9
;
i
++)
{
System
.
out
.
println
(
generateBizId16
(
"c
ffp_post
er"
));
}
}
...
...
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