记得上下班打卡 | 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
d07274e4
Commit
d07274e4
authored
Jan 21, 2026
by
wangyifan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支付文案特殊符号替换
parent
f3ebbe9e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
PaySubjectUtils.java
...va/com/liquidnet/service/order/utils/PaySubjectUtils.java
+6
-2
No files found.
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/utils/PaySubjectUtils.java
View file @
d07274e4
...
@@ -42,11 +42,15 @@ public class PaySubjectUtils {
...
@@ -42,11 +42,15 @@ public class PaySubjectUtils {
// 替换所有不符合的字符为 -
// 替换所有不符合的字符为 -
String
cleaned
=
pattern
.
matcher
(
subject
).
replaceAll
(
"-"
);
String
cleaned
=
pattern
.
matcher
(
subject
).
replaceAll
(
"-"
);
// 4. 显式移除易混淆的“竖线类”字符(即使它们是汉字或全角符号)
cleaned
=
cleaned
.
replace
(
"丨"
,
"-"
)
// U+4E28: CJK 汉字(部首),支付宝可能拦截
.
replace
(
"|"
,
"-"
);
// U+FF5C: 全角竖线,支付宝明确不友好
// 处理多个连续的 - 替换为单个 -
// 处理多个连续的 - 替换为单个 -
cleaned
=
cleaned
.
replaceAll
(
"-+"
,
"-"
);
cleaned
=
cleaned
.
replaceAll
(
"-+"
,
"-"
);
// 去除首尾的 -(保留空格)
// 去除首尾的 -(保留空格)
cleaned
=
cleaned
.
replaceAll
(
"^-
|-
$"
,
""
);
cleaned
=
cleaned
.
replaceAll
(
"^-
+|-+
$"
,
""
);
return
"正在现场-"
+
cleaned
;
return
"正在现场-"
+
cleaned
;
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
...
@@ -116,7 +120,7 @@ public class PaySubjectUtils {
...
@@ -116,7 +120,7 @@ public class PaySubjectUtils {
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
String
text
=
"「发呆的下午」| 北京的第一次“发呆冲击” 鸟撞x虎啸春x大叫控"
;
String
text
=
"「发呆的下午」| 北京的第一次“发呆冲击” 鸟撞x虎啸春x大叫控"
;
String
text2
=
"
大波浪乐队 2021全新专辑《新逻辑 不止一面》全国巡演郑州
"
;
String
text2
=
"
Don't \"mid way\" 「独 步」【了】丨 ·广州站
"
;
String
text3
=
"Matt吕彦良2025-Fresh-ME-新鲜之旅巡演-Refresh-with-Matt-Lv-长沙站Matt吕彦良2025-Fresh-ME-新鲜之旅巡演-Refr鲜之旅鲜之旅鲜之旅鲜之旅鲜之旅鲜之旅鲜之旅鲜之旅鲜之旅鲜之旅鲜之旅鲜之旅"
;
String
text3
=
"Matt吕彦良2025-Fresh-ME-新鲜之旅巡演-Refresh-with-Matt-Lv-长沙站Matt吕彦良2025-Fresh-ME-新鲜之旅巡演-Refr鲜之旅鲜之旅鲜之旅鲜之旅鲜之旅鲜之旅鲜之旅鲜之旅鲜之旅鲜之旅鲜之旅鲜之旅"
;
System
.
out
.
println
(
cleanSubject
(
text
));
System
.
out
.
println
(
cleanSubject
(
text
));
System
.
out
.
println
(
cleanSubject
(
text2
));
System
.
out
.
println
(
cleanSubject
(
text2
));
...
...
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