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
03b738f0
Commit
03b738f0
authored
Mar 09, 2026
by
zhangxingmin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into prod
parents
da0e4741
5af1ef9b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
85 additions
and
15 deletions
+85
-15
yd-auth-core/src/main/java/com/yd/auth/core/config/SecurityConfig.java
+3
-0
yd-common/src/main/java/com/yd/common/enums/CommonEnum.java
+2
-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
+76
-12
yd-common/src/main/java/com/yd/common/utils/RandomStringGenerator.java
+2
-2
No files found.
yd-auth-core/src/main/java/com/yd/auth/core/config/SecurityConfig.java
View file @
03b738f0
...
@@ -68,6 +68,9 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
...
@@ -68,6 +68,9 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
"/swagger-ui/**"
,
"/swagger-ui/**"
,
"/v3/api-docs/**"
,
"/v3/api-docs/**"
,
"/sysUser/body/detail"
,
"/sysUser/body/detail"
,
"/ossFile/list"
,
"/sysDict/type/item/list/**"
,
"/clientUser/clientUserBizIdList"
,
"/scrm/test"
,
"/scrm/test"
,
"/doc.html"
,
"/doc.html"
,
"/webjars/**"
,
"/webjars/**"
,
...
...
yd-common/src/main/java/com/yd/common/enums/CommonEnum.java
View file @
03b738f0
...
@@ -75,6 +75,8 @@ public enum CommonEnum {
...
@@ -75,6 +75,8 @@ public enum CommonEnum {
UID_TYPE_PREMIUM_RECONCILIATION
(
"premium_reconciliation"
,
"保费对账记录表"
),
UID_TYPE_PREMIUM_RECONCILIATION
(
"premium_reconciliation"
,
"保费对账记录表"
),
UID_TYPE_PREMIUM_REMITTANCE
(
"premium_remittance"
,
"保费对账-汇款记录表"
),
UID_TYPE_PREMIUM_REMITTANCE
(
"premium_remittance"
,
"保费对账-汇款记录表"
),
UID_TYPE_PREMIUM_REMITTANCE_FILE
(
"premium_remittance_file"
,
"保费对账-汇款记录附件表"
),
UID_TYPE_PREMIUM_REMITTANCE_FILE
(
"premium_remittance_file"
,
"保费对账-汇款记录附件表"
),
UID_TYPE_REL_OBJECT_CERTIFICATE
(
"rel_object_certificate"
,
"对象证件关系表"
),
UID_TYPE_CALM_TASK
(
"calm_task"
,
"保单冷静期定时任务表"
),
//作用域枚举
//作用域枚举
SCOPE_SYS
(
"1"
,
"系统级(全局)"
),
SCOPE_SYS
(
"1"
,
"系统级(全局)"
),
...
...
yd-common/src/main/java/com/yd/common/utils/ChineseTextConverter.java
View file @
03b738f0
...
@@ -54,6 +54,6 @@ public class ChineseTextConverter {
...
@@ -54,6 +54,6 @@ public class ChineseTextConverter {
}
}
public
static
void
main
(
String
[]
args
)
{
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 @
03b738f0
...
@@ -7,24 +7,89 @@ import com.fasterxml.jackson.databind.JsonDeserializer;
...
@@ -7,24 +7,89 @@ import com.fasterxml.jackson.databind.JsonDeserializer;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.time.format.DateTimeFormatter
;
import
java.time.format.DateTimeFormatterBuilder
;
import
java.time.temporal.ChronoField
;
public
class
CustomLocalDateTimeDeserializer
extends
JsonDeserializer
<
LocalDateTime
>
{
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"
);
private
static
final
DateTimeFormatter
[]
FORMATTERS
=
{
// ISO 格式: yyyy-MM-dd'T'HH:mm:ss
DateTimeFormatter
.
ISO_LOCAL_DATE_TIME
,
// 标准格式: yyyy-MM-dd HH:mm:ss
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
),
// 只有日期: yyyy-MM-dd
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
),
// 其他可能的格式
DateTimeFormatter
.
ofPattern
(
"yyyy/MM/dd HH:mm:ss"
),
DateTimeFormatter
.
ofPattern
(
"yyyy/MM/dd"
),
DateTimeFormatter
.
ofPattern
(
"yyyy.MM.dd HH:mm:ss"
),
DateTimeFormatter
.
ofPattern
(
"yyyy.MM.dd"
)
};
@Override
@Override
public
LocalDateTime
deserialize
(
JsonParser
p
,
DeserializationContext
ctxt
)
throws
IOException
{
public
LocalDateTime
deserialize
(
JsonParser
p
,
DeserializationContext
ctxt
)
throws
IOException
{
String
text
=
p
.
getText
();
String
text
=
p
.
getText
();
if
(
text
==
null
||
text
.
isEmpty
())
{
if
(
text
==
null
||
text
.
trim
().
isEmpty
())
{
return
null
;
return
null
;
}
}
// 如果字符串长度只有10(即"yyyy-MM-dd"),则拼接" 00:00:00"
text
=
text
.
trim
();
if
(
text
.
length
()
==
10
)
{
text
=
text
+
" 00:00:00"
;
// 尝试用所有格式解析
for
(
DateTimeFormatter
formatter
:
FORMATTERS
)
{
try
{
// 如果是日期格式,转换为 LocalDateTime
if
(
formatter
.
toString
().
contains
(
"yyyy-MM-dd"
)
&&
!
formatter
.
toString
().
contains
(
"HH:mm:ss"
))
{
// 这是纯日期格式,需要转换为 LocalDateTime
return
LocalDateTime
.
parse
(
text
+
"T00:00:00"
,
DateTimeFormatter
.
ISO_LOCAL_DATE_TIME
);
}
return
LocalDateTime
.
parse
(
text
,
formatter
);
}
catch
(
Exception
e
)
{
// 继续尝试下一个格式
continue
;
}
}
// 如果所有格式都失败,尝试更灵活的解析
return
parseFlexible
(
text
);
}
private
LocalDateTime
parseFlexible
(
String
text
)
throws
IOException
{
try
{
// 尝试处理带T的日期时间
if
(
text
.
contains
(
"T"
))
{
// 移除可能的多余空格
text
=
text
.
replace
(
" "
,
""
);
// 确保T后面有时间部分
if
(
text
.
indexOf
(
'T'
)
+
1
<
text
.
length
())
{
String
timePart
=
text
.
substring
(
text
.
indexOf
(
'T'
)
+
1
);
if
(
timePart
.
isEmpty
())
{
text
=
text
+
"00:00:00"
;
}
else
if
(
timePart
.
split
(
":"
).
length
==
2
)
{
text
=
text
+
":00"
;
}
return
LocalDateTime
.
parse
(
text
,
DateTimeFormatter
.
ISO_LOCAL_DATE_TIME
);
}
}
// 尝试处理只有日期的格式
if
(
text
.
length
()
==
10
&&
text
.
charAt
(
4
)
==
'-'
&&
text
.
charAt
(
7
)
==
'-'
)
{
return
LocalDateTime
.
parse
(
text
+
"T00:00:00"
,
DateTimeFormatter
.
ISO_LOCAL_DATE_TIME
);
}
// 尝试处理包含空格的日期时间
if
(
text
.
length
()
>=
10
&&
text
.
charAt
(
4
)
==
'-'
&&
text
.
charAt
(
7
)
==
'-'
)
{
if
(
text
.
length
()
>
10
&&
text
.
charAt
(
10
)
==
' '
)
{
// 格式: yyyy-MM-dd HH:mm:ss
return
LocalDateTime
.
parse
(
text
,
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
));
}
}
throw
new
IOException
(
"无法解析日期时间: "
+
text
);
}
catch
(
Exception
e
)
{
throw
new
IOException
(
"无法解析日期时间: "
+
text
,
e
);
}
}
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 @
03b738f0
...
@@ -60,8 +60,8 @@ public class RandomStringGenerator {
...
@@ -60,8 +60,8 @@ public class RandomStringGenerator {
// String random32 = generate(32, false);
// String random32 = generate(32, false);
// System.out.println("32位: " + random32);
// System.out.println("32位: " + random32);
for
(
int
i
=
0
;
i
<
6
;
i
++)
{
for
(
int
i
=
0
;
i
<
9
;
i
++)
{
System
.
out
.
println
(
generateBizId16
(
"
client_user
"
));
System
.
out
.
println
(
generateBizId16
(
"
user_sign
"
));
}
}
}
}
...
...
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