Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
f908b042
Commit
f908b042
authored
May 14, 2025
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商险到期提醒优化-忽略不提醒前端客服&离职后删除忽略数据-fxj
parent
364e2614
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
41 deletions
+69
-41
TInsuranceWarnMapper.java
...fu/insurances/mapper/insurances/TInsuranceWarnMapper.java
+2
-0
TInsuranceWarnServiceImpl.java
...ces/service/insurance/impl/TInsuranceWarnServiceImpl.java
+56
-40
TInsuranceWarnMapper.xml
...main/resources/mapper/insurances/TInsuranceWarnMapper.xml
+11
-1
No files found.
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/mapper/insurances/TInsuranceWarnMapper.java
View file @
f908b042
...
@@ -26,4 +26,6 @@ public interface TInsuranceWarnMapper extends BaseMapper<TInsuranceAlert> {
...
@@ -26,4 +26,6 @@ public interface TInsuranceWarnMapper extends BaseMapper<TInsuranceAlert> {
List
<
InsuranceAlertWx
>
getInsuranceAlertToWx
();
List
<
InsuranceAlertWx
>
getInsuranceAlertToWx
();
List
<
TInsuranceAlert
>
selectInsuranceAlertIgnore
();
}
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/insurance/impl/TInsuranceWarnServiceImpl.java
View file @
f908b042
...
@@ -60,6 +60,7 @@ public class TInsuranceWarnServiceImpl extends ServiceImpl<TInsuranceWarnMapper,
...
@@ -60,6 +60,7 @@ public class TInsuranceWarnServiceImpl extends ServiceImpl<TInsuranceWarnMapper,
List
<
TInsuranceAlert
>
list
=
baseMapper
.
selectInsuranceAlert
();
List
<
TInsuranceAlert
>
list
=
baseMapper
.
selectInsuranceAlert
();
//获取所有在用的(未删除未锁定)MVP的用户信息
//获取所有在用的(未删除未锁定)MVP的用户信息
String
userIds
;
String
userIds
;
R
<
Set
<
String
>>
onlineSetTemp
;
if
(
Common
.
isNotKong
(
list
)){
if
(
Common
.
isNotKong
(
list
)){
try
{
try
{
SysConfig
sysConfig
=
sysConfigMapper
.
getSysConfigLimitByKey
(
InsurancesConstants
.
INSURANCE_ALERT_DEFAULT_PERSON
);
SysConfig
sysConfig
=
sysConfigMapper
.
getSysConfigLimitByKey
(
InsurancesConstants
.
INSURANCE_ALERT_DEFAULT_PERSON
);
...
@@ -96,46 +97,8 @@ public class TInsuranceWarnServiceImpl extends ServiceImpl<TInsuranceWarnMapper,
...
@@ -96,46 +97,8 @@ public class TInsuranceWarnServiceImpl extends ServiceImpl<TInsuranceWarnMapper,
log
.
error
(
"商险不购买提醒初始化停用客服异常:"
,
e
);
log
.
error
(
"商险不购买提醒初始化停用客服异常:"
,
e
);
}
}
//处理已经离职数据,分批请求,每次请求1000条数据,返回在职人员信息
//处理已经离职数据,分批请求,每次请求1000条数据,返回在职人员信息
R
<
Set
<
String
>>
onlineSetTemp
=
new
R
<>();
onlineSetTemp
=
new
R
<>();
if
(
list
.
size
()
<=
2000
){
onlineSetTemp
=
getSetR
(
list
,
onlineSetTemp
);
onlineSetTemp
=
archivesDaprUtil
.
getEmpOnlineMap
(
list
.
stream
().
map
(
TInsuranceAlert:
:
getEmpIdcardNo
).
collect
(
Collectors
.
toList
()));
}
else
{
// 提前提取身份证号列表,避免重复 stream 操作
List
<
String
>
idCardNoList
=
list
.
stream
()
.
map
(
TInsuranceAlert:
:
getEmpIdcardNo
)
.
collect
(
Collectors
.
toList
());
int
batchSize
=
2000
;
int
totalSize
=
idCardNoList
.
size
();
// 初始化 onlineSetTemp,防止 NullPointerException
if
(
onlineSetTemp
==
null
)
{
onlineSetTemp
=
new
R
<>();
// 替换为实际类型
}
R
<
Set
<
String
>>
onlineSet
;
Set
<
String
>
temp
=
new
HashSet
<>();
for
(
int
i
=
0
;
i
<
totalSize
;
i
++)
{
if
(
i
%
batchSize
==
0
)
{
// 计算当前批次的结束索引
int
end
=
Math
.
min
(
i
+
batchSize
,
totalSize
);
// 获取当前批次的数据
List
<
String
>
subList
=
idCardNoList
.
subList
(
i
,
end
);
// 调用接口获取在职人员信息
onlineSet
=
archivesDaprUtil
.
getEmpOnlineMap
(
subList
);
// 判空处理
if
(
onlineSet
!=
null
&&
onlineSet
.
getData
()
!=
null
&&
Common
.
isNotNull
(
onlineSet
.
getData
()))
{
temp
.
addAll
(
onlineSet
.
getData
());
}
}
}
if
(
temp
!=
null
){
onlineSetTemp
.
setData
(
temp
);
}
}
//如果不存在离职人员直接走生成逻辑
//如果不存在离职人员直接走生成逻辑
if
(
Common
.
isNotKong
(
onlineSetTemp
.
getData
())){
if
(
Common
.
isNotKong
(
onlineSetTemp
.
getData
())){
// 从 onlineSetTemp 中获取离职人员信息 删除list中已离职的数据
// 从 onlineSetTemp 中获取离职人员信息 删除list中已离职的数据
...
@@ -147,6 +110,59 @@ public class TInsuranceWarnServiceImpl extends ServiceImpl<TInsuranceWarnMapper,
...
@@ -147,6 +110,59 @@ public class TInsuranceWarnServiceImpl extends ServiceImpl<TInsuranceWarnMapper,
this
.
saveOrUpdateBatch
(
list
);
this
.
saveOrUpdateBatch
(
list
);
}
}
}
}
//批量删除已忽略且人员离职的数据
List
<
TInsuranceAlert
>
listIgnore
=
baseMapper
.
selectInsuranceAlertIgnore
();
onlineSetTemp
=
new
R
<>();
onlineSetTemp
=
getSetR
(
listIgnore
,
onlineSetTemp
);
if
(
Common
.
isNotKong
(
onlineSetTemp
.
getData
())){
//批量删除已忽略且人员离职的数据
baseMapper
.
delete
(
Wrappers
.<
TInsuranceAlert
>
query
().
lambda
()
.
in
(
TInsuranceAlert:
:
getEmpIdcardNo
,
onlineSetTemp
.
getData
()));
}
}
private
R
<
Set
<
String
>>
getSetR
(
List
<
TInsuranceAlert
>
list
,
R
<
Set
<
String
>>
onlineSetTemp
)
{
if
(
list
.
size
()
<=
2000
){
onlineSetTemp
=
archivesDaprUtil
.
getEmpOnlineMap
(
list
.
stream
().
map
(
TInsuranceAlert:
:
getEmpIdcardNo
).
collect
(
Collectors
.
toList
()));
}
else
{
// 提前提取身份证号列表,避免重复 stream 操作
List
<
String
>
idCardNoList
=
list
.
stream
()
.
map
(
TInsuranceAlert:
:
getEmpIdcardNo
)
.
collect
(
Collectors
.
toList
());
int
batchSize
=
2000
;
int
totalSize
=
idCardNoList
.
size
();
// 初始化 onlineSetTemp,防止 NullPointerException
if
(
onlineSetTemp
==
null
)
{
onlineSetTemp
=
new
R
<>();
// 替换为实际类型
}
R
<
Set
<
String
>>
onlineSet
;
Set
<
String
>
temp
=
new
HashSet
<>();
for
(
int
i
=
0
;
i
<
totalSize
;
i
++)
{
if
(
i
%
batchSize
==
0
)
{
// 计算当前批次的结束索引
int
end
=
Math
.
min
(
i
+
batchSize
,
totalSize
);
// 获取当前批次的数据
List
<
String
>
subList
=
idCardNoList
.
subList
(
i
,
end
);
// 调用接口获取在职人员信息
onlineSet
=
archivesDaprUtil
.
getEmpOnlineMap
(
subList
);
// 判空处理
if
(
onlineSet
!=
null
&&
onlineSet
.
getData
()
!=
null
&&
Common
.
isNotNull
(
onlineSet
.
getData
()))
{
temp
.
addAll
(
onlineSet
.
getData
());
}
}
}
if
(
temp
!=
null
){
onlineSetTemp
.
setData
(
temp
);
}
}
return
onlineSetTemp
;
}
}
/**
/**
...
...
yifu-insurances/yifu-insurances-biz/src/main/resources/mapper/insurances/TInsuranceWarnMapper.xml
View file @
f908b042
...
@@ -154,6 +154,16 @@
...
@@ -154,6 +154,16 @@
select a.DEPT_NAME,a.DEPT_NO,
select a.DEPT_NAME,a.DEPT_NO,
SUM(case when a.IS_OVERDUE='0' THEN 1 ELSE 0 END) as 'lq',
SUM(case when a.IS_OVERDUE='0' THEN 1 ELSE 0 END) as 'lq',
SUM(CASE WHEN a.IS_OVERDUE='1' THEN 1 ELSE 0 END) as 'gq'
SUM(CASE WHEN a.IS_OVERDUE='1' THEN 1 ELSE 0 END) as 'gq'
from t_insurance_alert a GROUP BY a.DEPT_NO
from t_insurance_alert a where a.EXPIRE_IGNORE_FLAG = '1' and a.DELETE_FLAG='0' GROUP BY a.DEPT_NO
</select>
<select
id=
"selectInsuranceAlertIgnore"
resultMap=
"BaseResultMap"
>
SELECT
a.ID,
a.EMP_NAME,
a.EMP_IDCARD_NO
FROM
t_insurance_alert a
where a.DELETE_FLAG = '0' and a.EXPIRE_IGNORE_FLAG = '0'
</select>
</select>
</mapper>
</mapper>
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