Commit 179b1917 authored by fangxinjiang's avatar fangxinjiang

Merge branch 'MVP1.7.10' into MVP1.7.11

parents 98a18d6b f908b042
......@@ -26,4 +26,6 @@ public interface TInsuranceWarnMapper extends BaseMapper<TInsuranceAlert> {
List<InsuranceAlertWx> getInsuranceAlertToWx();
List<TInsuranceAlert> selectInsuranceAlertIgnore();
}
......@@ -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,7 +97,32 @@ public class TInsuranceWarnServiceImpl extends ServiceImpl<TInsuranceWarnMapper,
log.error("商险不购买提醒初始化停用客服异常:",e);
}
//处理已经离职数据,分批请求,每次请求1000条数据,返回在职人员信息
R<Set<String>> onlineSetTemp = new R<>();
onlineSetTemp = new R<>();
onlineSetTemp = getSetR(list, onlineSetTemp);
//如果不存在离职人员直接走生成逻辑
if (Common.isNotKong(onlineSetTemp.getData())){
// 从 onlineSetTemp 中获取离职人员信息 删除list中已离职的数据
removeLeaver(list, onlineSetTemp);
}
//不为空生成数据
if (Common.isNotKong(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 {
......@@ -136,17 +162,7 @@ public class TInsuranceWarnServiceImpl extends ServiceImpl<TInsuranceWarnMapper,
onlineSetTemp.setData(temp);
}
}
//如果不存在离职人员直接走生成逻辑
if (Common.isNotKong(onlineSetTemp.getData())){
// 从 onlineSetTemp 中获取离职人员信息 删除list中已离职的数据
removeLeaver(list, onlineSetTemp);
}
//不为空生成数据
if (Common.isNotKong(list)){
this.saveOrUpdateBatch(list);
}
}
return onlineSetTemp;
}
/**
......
......@@ -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>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment