Commit 3a0d2593 authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/MVP1.7.11' into MVP1.7.11

parents 680f4f66 08be9794
......@@ -107,4 +107,11 @@ public class ProjectSetInfoVo implements Serializable {
@Schema(description = "是否BPO", name = "bpoFlag")
@ExcelIgnore
private String bpoFlag;
/**
* MVP1.7.11 增加: 服务项目
*/
@Schema(description = "服务项目", name = "serverItem")
@ExcelIgnore
private String serverItem;
}
......@@ -492,7 +492,8 @@
a.STOP_FLAG,
a.INVOICE_TITLE_SALARY,
a.INVOICE_TITLE_INSURANCE,
a.BPO_FLAG
a.BPO_FLAG,
a.SERVER_ITEM
FROM t_settle_domain a
where a.DELETE_FLAG = '0'
<if test="codes != null and codes.size() > 0">
......
......@@ -26,4 +26,6 @@ public interface TInsuranceWarnMapper extends BaseMapper<TInsuranceAlert> {
List<InsuranceAlertWx> getInsuranceAlertToWx();
List<TInsuranceAlert> selectInsuranceAlertIgnore();
}
......@@ -52,6 +52,7 @@ import com.yifu.cloud.plus.v1.yifu.social.vo.TIncomeDetailReturnVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
......@@ -2837,6 +2838,21 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param);
continue;
}else {
// MVP1.7.11:校验户是否在服务项里
// 获取项目的服务项
if (Common.isEmpty(projectSetInfoVo.getServerItem())){
param.setErrorMessage("项目未维护服务项目,请联系管理员");
listResult.add(param);
continue;
}
String[] serverItemArr = projectSetInfoVo.getServerItem().split("、");
// 服务项校验
if (!ArrayUtils.contains(serverItemArr, "商险")) {
param.setErrorMessage("该项目未勾选 商险 服务项,请至EKP系统-项目查询与变更处勾选后,再次尝试");
listResult.add(param);
continue;
}
//对应的项目编码已停止合作
if (CommonConstants.ONE_STRING.equals(projectSetInfoVo.getStopFlag()) ||
CommonConstants.TWO_STRING.equals(projectSetInfoVo.getStopFlag())){
......@@ -3172,6 +3188,20 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param);
continue;
}else {
// MVP1.7.11:校验户是否在服务项里
// 获取项目的服务项
if (Common.isEmpty(projectSetInfoVo.getServerItem())){
param.setErrorMessage("项目未维护服务项目,请联系管理员");
listResult.add(param);
continue;
}
String[] serverItemArr = projectSetInfoVo.getServerItem().split("、");
// 服务项校验
if (!ArrayUtils.contains(serverItemArr, "商险")) {
param.setErrorMessage("该项目未勾选 商险 服务项,请至EKP系统-项目查询与变更处勾选后,再次尝试");
listResult.add(param);
continue;
}
//对应的项目编码已停止合作
if (CommonConstants.ONE_STRING.equals(projectSetInfoVo.getStopFlag()) ||
CommonConstants.TWO_STRING.equals(projectSetInfoVo.getStopFlag())){
......@@ -3606,6 +3636,21 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param);
continue;
}else {
// MVP1.7.11:校验户是否在服务项里
// 获取项目的服务项
if (Common.isEmpty(projectSetInfoVo.getServerItem())){
param.setErrorMessage("项目未维护服务项目,请联系管理员");
listResult.add(param);
continue;
}
String[] serverItemArr = projectSetInfoVo.getServerItem().split("、");
// 服务项校验
if (!ArrayUtils.contains(serverItemArr, "商险")) {
param.setErrorMessage("该项目未勾选 商险 服务项,请至EKP系统-项目查询与变更处勾选后,再次尝试");
listResult.add(param);
continue;
}
//对应的替换员工项目编码已停止合作
if (CommonConstants.ONE_STRING.equals(projectSetInfoVo.getStopFlag()) ||
CommonConstants.TWO_STRING.equals(projectSetInfoVo.getStopFlag())){
......
......@@ -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;
}
/**
......
......@@ -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>
......@@ -72,6 +72,7 @@ import com.yifu.cloud.plus.v1.yifu.social.util.ServiceUtil;
import com.yifu.cloud.plus.v1.yifu.social.vo.*;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang.ArrayUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.shardingsphere.transaction.annotation.ShardingTransactionType;
......@@ -512,8 +513,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (Common.isNotNull(empVoMap)) {
empVo = empVoMap.get(excel.getEmpIdcard());
}
if (Common.isNotNull(socialFund)
&& Common.isNotNull(socialFund.getSocialId())
if (Common.isNotNull(socialFund)
&& Common.isNotNull(socialFund.getSocialId())
&& (CommonConstants.FOUR_STRING.equals(socialFund.getSocialStatus())
|| CommonConstants.TWELVE_STRING.equals(socialFund.getSocialStatus()))){
// 部分失败
......@@ -2337,6 +2338,40 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_PROJECT_NOT_FOUND)));
return true;
}
// MVP1.7.11:校验户是否在服务项里
// 获取项目的服务项
if (Common.isEmpty(setInfoVo.getServerItem())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), "项目未维护服务项目,请联系管理员"));
return true;
}
String[] serverItemArr = setInfoVo.getServerItem().split("、");
// 服务项校验
if(Common.isNotNull(excel.getSocialHousehold()) && Common.isNotNull(excel.getProvidentHousehold())){
if (!ArrayUtils.contains(serverItemArr, "社保") && !ArrayUtils.contains(serverItemArr, "公积金")) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), "该项目未勾选 社保和公积金 服务项,请至EKP系统-项目查询与变更处勾选后,再次尝试"));
return true;
}
if (!ArrayUtils.contains(serverItemArr, "社保")) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), "该项目未勾选 社保 服务项,请至EKP系统-项目查询与变更处勾选后,再次尝试"));
return true;
}
if (!ArrayUtils.contains(serverItemArr, "公积金")) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), "该项目未勾选 公积金 服务项,请至EKP系统-项目查询与变更处勾选后,再次尝试"));
return true;
}
} else if(Common.isNotNull(excel.getSocialHousehold())) {
if (!ArrayUtils.contains(serverItemArr, "社保")) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), "该项目未勾选 社保 服务项,请至EKP系统-项目查询与变更处勾选后,再次尝试"));
return true;
}
} else {
if (!ArrayUtils.contains(serverItemArr, "公积金")) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), "该项目未勾选 公积金 服务项,请至EKP系统-项目查询与变更处勾选后,再次尝试"));
return true;
}
}
//对应的项目编码已停止合作
if (CommonConstants.ONE_STRING.equals(setInfoVo.getStopFlag()) || CommonConstants.TWO_STRING.equals(setInfoVo.getStopFlag())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SETTLEDOMAIN_STOP)));
......
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