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
179b1917
Commit
179b1917
authored
May 14, 2025
by
fangxinjiang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'MVP1.7.10' into MVP1.7.11
parents
98a18d6b
f908b042
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 @
179b1917
...
...
@@ -26,4 +26,6 @@ public interface TInsuranceWarnMapper extends BaseMapper<TInsuranceAlert> {
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 @
179b1917
...
...
@@ -60,6 +60,7 @@ public class TInsuranceWarnServiceImpl extends ServiceImpl<TInsuranceWarnMapper,
List
<
TInsuranceAlert
>
list
=
baseMapper
.
selectInsuranceAlert
();
//获取所有在用的(未删除未锁定)MVP的用户信息
String
userIds
;
R
<
Set
<
String
>>
onlineSetTemp
;
if
(
Common
.
isNotKong
(
list
)){
try
{
SysConfig
sysConfig
=
sysConfigMapper
.
getSysConfigLimitByKey
(
InsurancesConstants
.
INSURANCE_ALERT_DEFAULT_PERSON
);
...
...
@@ -96,46 +97,8 @@ public class TInsuranceWarnServiceImpl extends ServiceImpl<TInsuranceWarnMapper,
log
.
error
(
"商险不购买提醒初始化停用客服异常:"
,
e
);
}
//处理已经离职数据,分批请求,每次请求1000条数据,返回在职人员信息
R
<
Set
<
String
>>
onlineSetTemp
=
new
R
<>();
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
);
}
}
onlineSetTemp
=
new
R
<>();
onlineSetTemp
=
getSetR
(
list
,
onlineSetTemp
);
//如果不存在离职人员直接走生成逻辑
if
(
Common
.
isNotKong
(
onlineSetTemp
.
getData
())){
// 从 onlineSetTemp 中获取离职人员信息 删除list中已离职的数据
...
...
@@ -147,6 +110,59 @@ public class TInsuranceWarnServiceImpl extends ServiceImpl<TInsuranceWarnMapper,
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 @
179b1917
...
...
@@ -154,6 +154,16 @@
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='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>
</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