Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-csf
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-csf
Commits
2f483404
Commit
2f483404
authored
Apr 27, 2026
by
zhangxingmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
b91dcd3c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
0 deletions
+49
-0
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/PolicyFollowServiceImpl.java
+49
-0
No files found.
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/PolicyFollowServiceImpl.java
View file @
2f483404
...
...
@@ -1349,6 +1349,9 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol
// 2. 更新受保人表
updateInsurantNameFields
(
pageSize
);
// 3. 更新客户表
updateInsurantNameFields
(
pageSize
);
log
.
info
(
"投保人/受保人名字冗余字段更新完成"
);
return
Result
.
success
(
"更新成功"
);
}
...
...
@@ -1446,5 +1449,51 @@ public class PolicyFollowServiceImpl extends ServiceImpl<PolicyFollowMapper, Pol
pageNo
++;
}
}
/**
* 批量处理 customer 的 nameSc 和 nameEnLc
*/
private
void
updateCustomerNameFields
(
int
pageSize
)
{
int
pageNo
=
1
;
while
(
true
)
{
Page
<
Customer
>
page
=
new
Page
<>(
pageNo
,
pageSize
);
Page
<
Customer
>
resultPage
=
customerService
.
page
(
page
);
List
<
Customer
>
records
=
resultPage
.
getRecords
();
if
(
CollUtil
.
isEmpty
(
records
))
{
break
;
}
List
<
Customer
>
toUpdate
=
new
ArrayList
<>();
for
(
Customer
entity
:
records
)
{
boolean
changed
=
false
;
if
(
StringUtils
.
isNotBlank
(
entity
.
getNameCn
()))
{
String
nameSc
=
ChineseTextConverter
.
traditionalToSimplified
(
entity
.
getNameCn
());
if
(!
nameSc
.
equals
(
entity
.
getNameSc
()))
{
entity
.
setNameSc
(
nameSc
);
changed
=
true
;
}
}
if
(
StringUtils
.
isNotBlank
(
entity
.
getNamePyEn
()))
{
String
nameEnLc
=
EnglishTextUtil
.
toLowerCase
(
entity
.
getNamePyEn
());
if
(!
nameEnLc
.
equals
(
entity
.
getNameEnLc
()))
{
entity
.
setNameEnLc
(
nameEnLc
);
changed
=
true
;
}
}
if
(
changed
)
{
entity
.
setUpdateTime
(
new
Date
());
toUpdate
.
add
(
entity
);
}
}
if
(!
toUpdate
.
isEmpty
())
{
customerService
.
updateBatchById
(
toUpdate
);
}
pageNo
++;
}
}
}
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