福利档案列表

This commit is contained in:
MustangDeng 2022-06-15 10:23:39 +08:00
parent 8d6a3c41d7
commit d5228ff1bf
3 changed files with 70 additions and 14 deletions

View File

@ -45,6 +45,7 @@ import com.engine.salary.util.SalaryFormItemUtil;
import com.engine.salary.util.db.MapperProxyFactory;
import com.engine.salary.util.page.PageInfo;
import com.engine.salary.util.page.SalaryPageUtil;
import com.google.common.collect.Lists;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
@ -428,6 +429,55 @@ public class SIArchivesBiz {
}
}
public List<InsuranceArchivesSocialSchemePO> getSocialByEmployeeIds(List<Long> employeeIds) {
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
SocialSchemeMapper socialSchemeMapper = sqlSession.getMapper(SocialSchemeMapper.class);
List<List<Long>> partition = Lists.partition(employeeIds, 1000);
List<InsuranceArchivesSocialSchemePO> allList = new ArrayList<>();
for (List<Long> longs : partition) {
List<InsuranceArchivesSocialSchemePO> socialList = socialSchemeMapper.getSocialByEmployeeId(longs);
allList.addAll(socialList);
}
return allList;
} finally {
sqlSession.close();
}
}
public List<InsuranceArchivesFundSchemePO> getFundByEmployeeIds(List<Long> employeeIds) {
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
FundSchemeMapper fundSchemeMapper = sqlSession.getMapper(FundSchemeMapper.class);
List<List<Long>> partition = Lists.partition(employeeIds, 1000);
List<InsuranceArchivesFundSchemePO> allList = new ArrayList<>();
for (List<Long> longs : partition) {
List<InsuranceArchivesFundSchemePO> fundList = fundSchemeMapper.getFundByEmployeeId(longs);
allList.addAll(fundList);
}
return allList;
} finally {
sqlSession.close();
}
}
public List<InsuranceArchivesOtherSchemePO> getOtherByEmployeeIds(List<Long> employeeIds) {
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
OtherSchemeMapper otherSchemeMapper = sqlSession.getMapper(OtherSchemeMapper.class);
List<List<Long>> partition = Lists.partition(employeeIds, 1000);
List<InsuranceArchivesOtherSchemePO> allList = new ArrayList<>();
for (List<Long> longs : partition) {
List<InsuranceArchivesOtherSchemePO> otherList = otherSchemeMapper.getOtherByEmployeeId(longs);
allList.addAll(otherList);
}
return allList;
} finally {
sqlSession.close();
}
}
/**
* 新增
@ -846,12 +896,12 @@ public class SIArchivesBiz {
InsuranceSchemeMapper insuranceSchemeMapper = sqlSession.getMapper(InsuranceSchemeMapper.class);
List<Long> employeeIds = insuranceArchivesEmployeePOS.stream().map(InsuranceArchivesEmployeePO::getEmployeeId).collect(Collectors.toList());
Map<Long, InsuranceArchivesSocialSchemePO> socialSchemePOMap = InsuranceArchivesSocialSchemePOEncrypt.decryptList(socialSchemeMapper.getSocialByEmployeeId(employeeIds))
Map<Long, InsuranceArchivesSocialSchemePO> socialSchemePOMap = InsuranceArchivesSocialSchemePOEncrypt.decryptList(this.getSocialByEmployeeIds(employeeIds))
.stream().collect(Collectors.toMap(InsuranceArchivesSocialSchemePO::getEmployeeId, Function.identity()));
Map<Long, InsuranceArchivesFundSchemePO> fundSchemePOMap = InsuranceArchivesFundSchemePOEncrypt.decryptList(fundSchemeMapper.getFundByEmployeeId(employeeIds))
.stream().collect(Collectors.toMap(InsuranceArchivesFundSchemePO::getEmployeeId, Function.identity()));
List<InsuranceArchivesOtherSchemePO> otherByEmployeeList = otherSchemeMapper.getOtherByEmployeeId(employeeIds);
List<InsuranceArchivesOtherSchemePO> otherByEmployeeList = this.getOtherByEmployeeIds(employeeIds);
InsuranceArchivesOtherSchemePOEncrypt.decryptList(otherByEmployeeList);
Map<Long, InsuranceArchivesOtherSchemePO> otherSchemePOMap = otherByEmployeeList
.stream().collect(Collectors.toMap(InsuranceArchivesOtherSchemePO::getEmployeeId, Function.identity()));
@ -1080,15 +1130,15 @@ public class SIArchivesBiz {
Map<Long, InsuranceArchivesSocialSchemePO> socialMap = new HashMap<>();
Map<Long, InsuranceArchivesFundSchemePO> funMap = new HashMap<>();
Map<Long, InsuranceArchivesOtherSchemePO> otherMap = new HashMap<>();
List<InsuranceArchivesSocialSchemePO> socialPOS = InsuranceArchivesSocialSchemePOEncrypt.decryptList(MapperProxyFactory.getProxy(SocialSchemeMapper.class).getSocialByEmployeeId(ids));
List<InsuranceArchivesSocialSchemePO> socialPOS = InsuranceArchivesSocialSchemePOEncrypt.decryptList(this.getSocialByEmployeeIds(ids));
if (CollectionUtils.isNotEmpty(socialPOS)) {
socialMap = socialPOS.stream().collect(Collectors.toMap(InsuranceArchivesSocialSchemePO::getEmployeeId, Function.identity()));
}
List<InsuranceArchivesFundSchemePO> fundPOS = InsuranceArchivesFundSchemePOEncrypt.decryptList(MapperProxyFactory.getProxy(FundSchemeMapper.class).getFundByEmployeeId(ids));
List<InsuranceArchivesFundSchemePO> fundPOS = InsuranceArchivesFundSchemePOEncrypt.decryptList(this.getFundByEmployeeIds(ids));
if (CollectionUtils.isNotEmpty(fundPOS)) {
funMap = fundPOS.stream().collect(Collectors.toMap(InsuranceArchivesFundSchemePO::getEmployeeId, Function.identity()));
}
List<InsuranceArchivesOtherSchemePO> otherPOS = MapperProxyFactory.getProxy(OtherSchemeMapper.class).getOtherByEmployeeId(ids);
List<InsuranceArchivesOtherSchemePO> otherPOS = this.getOtherByEmployeeIds(ids);
InsuranceArchivesOtherSchemePOEncrypt.decryptList(otherPOS);
if (CollectionUtils.isNotEmpty(otherPOS)) {
otherMap = otherPOS.stream().collect(Collectors.toMap(InsuranceArchivesOtherSchemePO::getEmployeeId, Function.identity()));

View File

@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.biz.SIArchivesBiz;
import com.engine.salary.encrypt.siarchives.InsuranceArchivesFundSchemePOEncrypt;
import com.engine.salary.encrypt.siarchives.InsuranceArchivesOtherSchemePOEncrypt;
import com.engine.salary.encrypt.siarchives.InsuranceArchivesSocialSchemePOEncrypt;
@ -45,6 +46,8 @@ import java.util.stream.Collectors;
**/
public class SIImportServiceImpl extends Service implements SIImportService {
private SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
public SIArchivesService getSIArchivesService(User user) {
return ServiceUtil.getService(SIArchivesServiceImpl.class,user);
}
@ -168,19 +171,19 @@ public class SIImportServiceImpl extends Service implements SIImportService {
}
List<Long> employeeIds = insuranceArchivesEmployeePOS.stream().map(InsuranceArchivesEmployeePO::getEmployeeId).collect(Collectors.toList());
Map<Long, InsuranceArchivesSocialSchemePO> socialSchemePOMap = new HashMap<>();
List<InsuranceArchivesSocialSchemePO> socialSchemePOList = MapperProxyFactory.getProxy(SocialSchemeMapper.class).getSocialByEmployeeId(employeeIds);
List<InsuranceArchivesSocialSchemePO> socialSchemePOList = siArchivesBiz.getSocialByEmployeeIds(employeeIds);
InsuranceArchivesSocialSchemePOEncrypt.decryptList(socialSchemePOList);
if (CollectionUtils.isNotEmpty(socialSchemePOList)) {
socialSchemePOMap = socialSchemePOList.stream().collect(Collectors.toMap(InsuranceArchivesSocialSchemePO::getEmployeeId, Function.identity()));
}
List<InsuranceArchivesFundSchemePO> fundSchemePOList = MapperProxyFactory.getProxy(FundSchemeMapper.class).getFundByEmployeeId(employeeIds);
List<InsuranceArchivesFundSchemePO> fundSchemePOList = siArchivesBiz.getFundByEmployeeIds(employeeIds);
InsuranceArchivesFundSchemePOEncrypt.encryptList(fundSchemePOList);
Map<Long, InsuranceArchivesFundSchemePO> fundSchemePOMap = new HashMap<>();
if (CollectionUtils.isNotEmpty(fundSchemePOList)) {
fundSchemePOMap = fundSchemePOList.stream().collect(Collectors.toMap(InsuranceArchivesFundSchemePO::getEmployeeId, Function.identity()));
}
Map<Long, InsuranceArchivesOtherSchemePO> otherSchemePOMap = new HashMap<>();
List<InsuranceArchivesOtherSchemePO> otherSchemePOList = MapperProxyFactory.getProxy(OtherSchemeMapper.class).getOtherByEmployeeId(employeeIds);
List<InsuranceArchivesOtherSchemePO> otherSchemePOList = siArchivesBiz.getOtherByEmployeeIds(employeeIds);
InsuranceArchivesOtherSchemePOEncrypt.decryptList(otherSchemePOList);
if (CollectionUtils.isNotEmpty(otherSchemePOList)) {
otherSchemePOMap = otherSchemePOList.stream().collect(Collectors.toMap(InsuranceArchivesOtherSchemePO::getEmployeeId, Function.identity()));

View File

@ -6,6 +6,7 @@ import com.cloudstore.eccom.pc.table.WeaTableColumn;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.biz.EmployBiz;
import com.engine.salary.biz.SIArchivesBiz;
import com.engine.salary.biz.SISchemeBiz;
import com.engine.salary.cmd.sischeme.*;
import com.engine.salary.encrypt.AESEncryptUtil;
@ -105,6 +106,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
private EmployBiz employeeBiz = new EmployBiz();
private SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
@Override
public Map<String, Object> getForm(Map<String, Object> params) {
return commandExecutor.execute(new SISchemeGetFormCmd(params, user));
@ -208,9 +211,9 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
end = employeeIds.size();
}
List<Long> ids = employeeIds.subList(i, end);
socialList.addAll(InsuranceArchivesSocialSchemePOEncrypt.decryptList(getSocialSchemeMapper().getSocialByEmployeeId(ids)));
fundList.addAll(InsuranceArchivesFundSchemePOEncrypt.decryptList(getFundSchemeMapper().getFundByEmployeeId(ids)));
otherList.addAll(InsuranceArchivesOtherSchemePOEncrypt.decryptList(getOtherSchemeMapper().getOtherByEmployeeId(ids)));
socialList.addAll(InsuranceArchivesSocialSchemePOEncrypt.decryptList(siArchivesBiz.getSocialByEmployeeIds(ids)));
fundList.addAll(InsuranceArchivesFundSchemePOEncrypt.decryptList(siArchivesBiz.getFundByEmployeeIds(ids)));
otherList.addAll(InsuranceArchivesOtherSchemePOEncrypt.decryptList(siArchivesBiz.getOtherByEmployeeIds(ids)));
}
Map<Long, InsuranceArchivesSocialSchemePO> socialSchemePOMap =
@ -417,7 +420,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
Set<String> fundSet = new HashSet<>();
Set<String> otherSet = new HashSet<>();
insuranceArchivesEmployeePOS.forEach(item -> {
List<InsuranceArchivesSocialSchemePO> socialByEmployeeId = getSocialSchemeMapper().getSocialByEmployeeId(new ArrayList<Long>() {{
List<InsuranceArchivesSocialSchemePO> socialByEmployeeId = siArchivesBiz.getSocialByEmployeeIds(new ArrayList<Long>() {{
add(item.getEmployeeId());
}});
InsuranceArchivesSocialSchemePOEncrypt.decryptList(socialByEmployeeId);
@ -427,7 +430,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
}
InsuranceArchivesFundSchemePO fundItem = null;
List<InsuranceArchivesFundSchemePO> fundByEmployeeId = getFundSchemeMapper().getFundByEmployeeId(new ArrayList<Long>() {{
List<InsuranceArchivesFundSchemePO> fundByEmployeeId = siArchivesBiz.getFundByEmployeeIds(new ArrayList<Long>() {{
add(item.getEmployeeId());
}});
InsuranceArchivesFundSchemePOEncrypt.decryptList(fundByEmployeeId);
@ -437,7 +440,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
}
InsuranceArchivesOtherSchemePO otherItem = null;
List<InsuranceArchivesOtherSchemePO> otherByEmployeeId = getOtherSchemeMapper().getOtherByEmployeeId(new ArrayList<Long>() {{
List<InsuranceArchivesOtherSchemePO> otherByEmployeeId = siArchivesBiz.getOtherByEmployeeIds(new ArrayList<Long>() {{
add(item.getEmployeeId());
}});
InsuranceArchivesOtherSchemePOEncrypt.decryptList(otherByEmployeeId);