|
|
|
|
@ -86,6 +86,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|
|
|
|
private InsuranceSchemeMapper getInsuranceSchemeMapper() {
|
|
|
|
|
return MapperProxyFactory.getProxy(InsuranceSchemeMapper.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private TaxAgentMapper getTaxAgentMapper() {
|
|
|
|
|
return MapperProxyFactory.getProxy(TaxAgentMapper.class);
|
|
|
|
|
}
|
|
|
|
|
@ -153,7 +154,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|
|
|
|
@Override
|
|
|
|
|
public Map<Long, String> getSchemeIdNameMap() {
|
|
|
|
|
Map<Long, String> result = new HashMap<>();
|
|
|
|
|
List<InsuranceSchemePO> insuranceSchemePOS = MapperProxyFactory.getProxy(InsuranceSchemeMapper.class).listAll();
|
|
|
|
|
List<InsuranceSchemePO> insuranceSchemePOS = getInsuranceSchemeMapper().listAll();
|
|
|
|
|
if (CollectionUtils.isNotEmpty(insuranceSchemePOS)) {
|
|
|
|
|
result = insuranceSchemePOS.stream().collect(Collectors.toMap(InsuranceSchemePO::getId, InsuranceSchemePO::getSchemeName));
|
|
|
|
|
}
|
|
|
|
|
@ -163,26 +164,33 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|
|
|
|
@Override
|
|
|
|
|
public PageInfo<InsuranceSchemeListDTO> list(InsuranceSchemeParam queryParam) {
|
|
|
|
|
SalaryAssert.notNull(queryParam.getWelfareTypeEnum(), SalaryI18nUtil.getI18nLabel(84026, "参数错误"));
|
|
|
|
|
|
|
|
|
|
SalaryPageUtil.start(queryParam.getCurrent(), queryParam.getPageSize());
|
|
|
|
|
List<InsuranceSchemePO> insuranceSchemePOS = MapperProxyFactory.getProxy(InsuranceSchemeMapper.class).listByWelfareType(queryParam.getWelfareTypeEnum().getValue());
|
|
|
|
|
PageInfo<InsuranceSchemePO> pageInfo = new PageInfo<>(insuranceSchemePOS, InsuranceSchemePO.class);
|
|
|
|
|
List<InsuranceSchemeListDTO> collect = insuranceSchemePOS.stream().map(item ->
|
|
|
|
|
InsuranceSchemeListDTO.builder()
|
|
|
|
|
.id(item.getId())
|
|
|
|
|
.paymentType(SalaryI18nUtil.getI18nLabel(buildPaymentTypeEnum(item.getPaymentType()).getLabelId(),
|
|
|
|
|
buildPaymentTypeEnum(item.getPaymentType()).getDefaultLabel()))
|
|
|
|
|
.schemeName(item.getSchemeName())
|
|
|
|
|
.paymentArea(item.getPaymentArea())
|
|
|
|
|
.paymentScope(buildPaymentScope(item.getId()))
|
|
|
|
|
.remarks(item.getRemarks())
|
|
|
|
|
.build()
|
|
|
|
|
).collect(Collectors.toList());
|
|
|
|
|
Long currentEmployeeId = (long) user.getUID();
|
|
|
|
|
List<InsuranceSchemePO> insuranceSchemePOS;
|
|
|
|
|
Boolean needAuth = getTaxAgentService().isNeedAuth(currentEmployeeId);
|
|
|
|
|
if (needAuth) {
|
|
|
|
|
insuranceSchemePOS = getInsuranceSchemeMapper().listByWelfareType(queryParam.getWelfareTypeEnum().getValue());
|
|
|
|
|
//分权
|
|
|
|
|
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService().listAllTaxAgents(currentEmployeeId);
|
|
|
|
|
List<Long> authTaxAgentIds = SalaryEntityUtil.properties(taxAgentPOS, TaxAgentPO::getId, Collectors.toList());
|
|
|
|
|
insuranceSchemePOS = insuranceSchemePOS.stream().filter(po -> {
|
|
|
|
|
String taxAgentIdsStr = po.getTaxAgentIds();
|
|
|
|
|
List<Long> taxAgentIds = new ArrayList<>();
|
|
|
|
|
if (StringUtils.isNotBlank(taxAgentIdsStr)) {
|
|
|
|
|
taxAgentIds = Arrays.stream(taxAgentIdsStr.split(",")).map(Long::valueOf).collect(Collectors.toList());
|
|
|
|
|
}
|
|
|
|
|
return StringUtils.isBlank(po.getSharedType()) || SharedTypeEnum.PUBLIC.getValue().equals(po.getSharedType()) || (SharedTypeEnum.PRIVATE.getValue().equals(po.getSharedType()) && SalaryEntityUtil.judgeIntersection(authTaxAgentIds, taxAgentIds));
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
} else {
|
|
|
|
|
insuranceSchemePOS = getInsuranceSchemeMapper().listByWelfareType(queryParam.getWelfareTypeEnum().getValue());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PageInfo<InsuranceSchemeListDTO> dtoPage = new PageInfo<>(InsuranceSchemeListDTO.class);
|
|
|
|
|
dtoPage.setPageNum(queryParam.getCurrent());
|
|
|
|
|
dtoPage.setPageSize(queryParam.getPageSize());
|
|
|
|
|
dtoPage.setTotal(pageInfo.getTotal());
|
|
|
|
|
dtoPage.setTotal(insuranceSchemePOS.size());
|
|
|
|
|
//分页
|
|
|
|
|
insuranceSchemePOS = SalaryPageUtil.subList(queryParam.getCurrent(), queryParam.getPageSize(), insuranceSchemePOS);
|
|
|
|
|
List<InsuranceSchemeListDTO> collect = insuranceSchemePOS.stream().map(item -> InsuranceSchemeListDTO.builder().id(item.getId()).paymentType(SalaryI18nUtil.getI18nLabel(buildPaymentTypeEnum(item.getPaymentType()).getLabelId(), buildPaymentTypeEnum(item.getPaymentType()).getDefaultLabel())).schemeName(item.getSchemeName()).paymentArea(item.getPaymentArea()).paymentScope(buildPaymentScope(item.getId())).remarks(item.getRemarks()).build()).collect(Collectors.toList());
|
|
|
|
|
dtoPage.setList(collect);
|
|
|
|
|
return dtoPage;
|
|
|
|
|
}
|
|
|
|
|
@ -226,15 +234,9 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|
|
|
|
otherList.addAll(InsuranceArchivesOtherSchemePOEncrypt.decryptList(siArchivesBiz.getOtherByEmployeeIds(ids)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Map<Long, InsuranceArchivesSocialSchemePO> socialSchemePOMap =
|
|
|
|
|
socialList
|
|
|
|
|
.stream().collect(Collectors.toMap(InsuranceArchivesSocialSchemePO::getEmployeeId, Function.identity()));
|
|
|
|
|
Map<Long, InsuranceArchivesFundSchemePO> fundSchemePOMap =
|
|
|
|
|
fundList
|
|
|
|
|
.stream().collect(Collectors.toMap(InsuranceArchivesFundSchemePO::getEmployeeId, Function.identity()));
|
|
|
|
|
Map<Long, InsuranceArchivesOtherSchemePO> otherSchemePOMap =
|
|
|
|
|
otherList
|
|
|
|
|
.stream().collect(Collectors.toMap(InsuranceArchivesOtherSchemePO::getEmployeeId, Function.identity()));
|
|
|
|
|
Map<Long, InsuranceArchivesSocialSchemePO> socialSchemePOMap = socialList.stream().collect(Collectors.toMap(InsuranceArchivesSocialSchemePO::getEmployeeId, Function.identity()));
|
|
|
|
|
Map<Long, InsuranceArchivesFundSchemePO> fundSchemePOMap = fundList.stream().collect(Collectors.toMap(InsuranceArchivesFundSchemePO::getEmployeeId, Function.identity()));
|
|
|
|
|
Map<Long, InsuranceArchivesOtherSchemePO> otherSchemePOMap = otherList.stream().collect(Collectors.toMap(InsuranceArchivesOtherSchemePO::getEmployeeId, Function.identity()));
|
|
|
|
|
insuranceArchivesEmployeePOS.forEach(item -> {
|
|
|
|
|
InsuranceArchivesSocialSchemePO socialItem = socialSchemePOMap.get(item.getEmployeeId());
|
|
|
|
|
InsuranceArchivesFundSchemePO fundItem = fundSchemePOMap.get(item.getEmployeeId());
|
|
|
|
|
@ -254,7 +256,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|
|
|
|
});
|
|
|
|
|
if (socialJson != null) {
|
|
|
|
|
map.putAll(socialJson);
|
|
|
|
|
// SalaryEntityUtil.thousandthConvert(socialJson, map);
|
|
|
|
|
// SalaryEntityUtil.thousandthConvert(socialJson, map);
|
|
|
|
|
}
|
|
|
|
|
map.put("socialAccount", socialItem.getSocialAccount());
|
|
|
|
|
map.put("socialStartTime", socialItem.getSocialStartTime());
|
|
|
|
|
@ -267,7 +269,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|
|
|
|
});
|
|
|
|
|
if (fundJson != null) {
|
|
|
|
|
map.putAll(fundJson);
|
|
|
|
|
// SalaryEntityUtil.thousandthConvert(fundJson, map);
|
|
|
|
|
// SalaryEntityUtil.thousandthConvert(fundJson, map);
|
|
|
|
|
}
|
|
|
|
|
map.put("supplementFundAccount", fundItem.getSupplementFundAccount());
|
|
|
|
|
map.put("fundStartTime", fundItem.getFundStartTime());
|
|
|
|
|
@ -368,8 +370,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|
|
|
|
* @return result
|
|
|
|
|
*/
|
|
|
|
|
public String buildPaymentScope(Long id) {
|
|
|
|
|
List<String> collect = queryInsuranceSchemeDetailList(id).stream().map(InsuranceSchemeDetailPO::getInsuranceId).distinct().collect(Collectors.toList())
|
|
|
|
|
.stream().map(this::queryInsuranceName).collect(Collectors.toList());
|
|
|
|
|
List<String> collect = queryInsuranceSchemeDetailList(id).stream().map(InsuranceSchemeDetailPO::getInsuranceId).distinct().collect(Collectors.toList()).stream().map(this::queryInsuranceName).collect(Collectors.toList());
|
|
|
|
|
return StringUtils.join(collect, "、");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -389,8 +390,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|
|
|
|
if (schemeId == null) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
InsuranceSchemePO insuranceSchemePO =
|
|
|
|
|
getInsuranceSchemeMapper().getById(schemeId);
|
|
|
|
|
InsuranceSchemePO insuranceSchemePO = getInsuranceSchemeMapper().getById(schemeId);
|
|
|
|
|
if (insuranceSchemePO == null) {
|
|
|
|
|
return "";
|
|
|
|
|
} else {
|
|
|
|
|
@ -487,13 +487,9 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|
|
|
|
});
|
|
|
|
|
Map<String, String> socialMap = new HashMap<>();
|
|
|
|
|
Map<Long, ICategoryPO> socialCollect = new HashMap<>();
|
|
|
|
|
Map<Long, ICategoryPO> customSocial =
|
|
|
|
|
getICategoryMapper().listByWelfareType(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), null)
|
|
|
|
|
.stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity()));
|
|
|
|
|
Map<Long, ICategoryPO> customSocial = getICategoryMapper().listByWelfareType(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity()));
|
|
|
|
|
|
|
|
|
|
Map<Long, ICategoryPO> sysSocial =
|
|
|
|
|
getICategoryMapper().listByWelfareType(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), DataTypeEnum.SYSTEM.getValue())
|
|
|
|
|
.stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity()));
|
|
|
|
|
Map<Long, ICategoryPO> sysSocial = getICategoryMapper().listByWelfareType(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity()));
|
|
|
|
|
socialCollect.putAll(customSocial);
|
|
|
|
|
socialCollect.putAll(sysSocial);
|
|
|
|
|
socialSet.forEach(item -> {
|
|
|
|
|
@ -503,12 +499,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|
|
|
|
});
|
|
|
|
|
Map<String, String> fundMap = new HashMap<>();
|
|
|
|
|
Map<Long, ICategoryPO> fundCollect = new HashMap<>();
|
|
|
|
|
Map<Long, ICategoryPO> customFund =
|
|
|
|
|
getICategoryMapper().listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), null)
|
|
|
|
|
.stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity()));
|
|
|
|
|
Map<Long, ICategoryPO> sysFund =
|
|
|
|
|
getICategoryMapper().listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), DataTypeEnum.SYSTEM.getValue())
|
|
|
|
|
.stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity()));
|
|
|
|
|
Map<Long, ICategoryPO> customFund = getICategoryMapper().listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity()));
|
|
|
|
|
Map<Long, ICategoryPO> sysFund = getICategoryMapper().listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity()));
|
|
|
|
|
fundCollect.putAll(customFund);
|
|
|
|
|
fundCollect.putAll(sysFund);
|
|
|
|
|
fundSet.forEach(item -> {
|
|
|
|
|
@ -518,12 +510,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|
|
|
|
});
|
|
|
|
|
Map<String, String> otherMap = new HashMap<>();
|
|
|
|
|
Map<Long, ICategoryPO> otherCollect = new HashMap<>();
|
|
|
|
|
Map<Long, ICategoryPO> customOther =
|
|
|
|
|
getICategoryMapper().listByWelfareType(WelfareTypeEnum.OTHER.getValue(), null)
|
|
|
|
|
.stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity()));
|
|
|
|
|
Map<Long, ICategoryPO> sysOther =
|
|
|
|
|
getICategoryMapper().listByWelfareType(WelfareTypeEnum.OTHER.getValue(), DataTypeEnum.SYSTEM.getValue())
|
|
|
|
|
.stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity()));
|
|
|
|
|
Map<Long, ICategoryPO> customOther = getICategoryMapper().listByWelfareType(WelfareTypeEnum.OTHER.getValue(), null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity()));
|
|
|
|
|
Map<Long, ICategoryPO> sysOther = getICategoryMapper().listByWelfareType(WelfareTypeEnum.OTHER.getValue(), DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity()));
|
|
|
|
|
otherCollect.putAll(customOther);
|
|
|
|
|
otherCollect.putAll(sysOther);
|
|
|
|
|
otherSet.forEach(item -> {
|
|
|
|
|
@ -631,9 +619,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|
|
|
|
singleAccount.add(cellData);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
isError = singleAccountCheck(singleAccount, welfareMap, insuranceArchivesAccountPOS, employeeByIds, excelComments, errorCount + 1, schemeNameIdMap,
|
|
|
|
|
paymentNameIdMap,
|
|
|
|
|
creator, i + 2, openDevolution, taxAgentManageRangeEmployeeTree);
|
|
|
|
|
isError = singleAccountCheck(singleAccount, welfareMap, insuranceArchivesAccountPOS, employeeByIds, excelComments, errorCount + 1, schemeNameIdMap, paymentNameIdMap, creator, i + 2, openDevolution, taxAgentManageRangeEmployeeTree);
|
|
|
|
|
if (isError) {
|
|
|
|
|
errorCount += 1;
|
|
|
|
|
// 添加错误数据
|
|
|
|
|
@ -689,12 +675,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|
|
|
|
return userState;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean singleAccountCheck(List<Map<String, Object>> singleAccount, Map<Long, String> welfareMap, List<InsuranceArchivesAccountPO> insuranceArchivesAccountPOS,
|
|
|
|
|
List<DataCollectionEmployee> employeeByIds,
|
|
|
|
|
List<Map<String, String>> excelComments, int i, Map<String, Long> schemeNameIdMap, Map<String, Long> paymentNameIdMap, Long creator, int index,
|
|
|
|
|
Boolean openDevolution,
|
|
|
|
|
List<TaxAgentManageRangeEmployeeDTO> taxAgentManageRangeEmployeeTree
|
|
|
|
|
) {
|
|
|
|
|
public boolean singleAccountCheck(List<Map<String, Object>> singleAccount, Map<Long, String> welfareMap, List<InsuranceArchivesAccountPO> insuranceArchivesAccountPOS, List<DataCollectionEmployee> employeeByIds, List<Map<String, String>> excelComments, int i, Map<String, Long> schemeNameIdMap, Map<String, Long> paymentNameIdMap, Long creator, int index, Boolean openDevolution, List<TaxAgentManageRangeEmployeeDTO> taxAgentManageRangeEmployeeTree) {
|
|
|
|
|
boolean isError = false;
|
|
|
|
|
String userName = (String) singleAccount.get(0).get(SalaryI18nUtil.getI18nLabel(85429, "姓名"));
|
|
|
|
|
String deparmentName = (String) singleAccount.get(1).get(SalaryI18nUtil.getI18nLabel(86185, "部门"));
|
|
|
|
|
@ -707,11 +688,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|
|
|
|
excelComments.add(errorMessageMap);
|
|
|
|
|
isError = true;
|
|
|
|
|
}
|
|
|
|
|
List<DataCollectionEmployee> employees = employeeByIds.stream().filter(e -> (StringUtils.isBlank(userName) || Objects.equals(e.getUsername(), userName))
|
|
|
|
|
&& (StringUtils.isBlank(deparmentName) || Objects.equals(e.getDepartmentName(), deparmentName))
|
|
|
|
|
&& (StringUtils.isBlank(telephone) || Objects.equals(e.getMobile(), telephone))
|
|
|
|
|
&& (StringUtils.isBlank(userStatus) || Objects.equals(userStateExchange(e.getStatus()), userStatus)))
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
List<DataCollectionEmployee> employees = employeeByIds.stream().filter(e -> (StringUtils.isBlank(userName) || Objects.equals(e.getUsername(), userName)) && (StringUtils.isBlank(deparmentName) || Objects.equals(e.getDepartmentName(), deparmentName)) && (StringUtils.isBlank(telephone) || Objects.equals(e.getMobile(), telephone)) && (StringUtils.isBlank(userStatus) || Objects.equals(userStateExchange(e.getStatus()), userStatus))).collect(Collectors.toList());
|
|
|
|
|
if (CollectionUtils.isEmpty(employees)) {
|
|
|
|
|
Map<String, String> errorMessageMap = Maps.newHashMap();
|
|
|
|
|
errorMessageMap.put("message", rowIndex + "员工信息不存在");
|
|
|
|
|
@ -748,9 +725,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|
|
|
|
Map<String, Object> fundEndTimeMap = findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91484, "公积金最后缴纳月"));
|
|
|
|
|
Map<String, Object> otherStartTimeMap = findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91490, "其他福利起始缴纳月"));
|
|
|
|
|
Map<String, Object> otherEndTimeMap = findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91494, "其他福利最后缴纳月"));
|
|
|
|
|
if (StringUtils.isBlank((String) socialMap.get(SalaryI18nUtil.getI18nLabel(91323, "社保方案名称"))) && StringUtils.isBlank(
|
|
|
|
|
(String) fundMap.get(SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称")))
|
|
|
|
|
&& StringUtils.isBlank((String) otherMap.get(SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称")))) {
|
|
|
|
|
if (StringUtils.isBlank((String) socialMap.get(SalaryI18nUtil.getI18nLabel(91323, "社保方案名称"))) && StringUtils.isBlank((String) fundMap.get(SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称"))) && StringUtils.isBlank((String) otherMap.get(SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称")))) {
|
|
|
|
|
Map<String, String> errorMessageMap = Maps.newHashMap();
|
|
|
|
|
errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100312, "社保,公积金,其他福利方案名称不可同时为空"));
|
|
|
|
|
excelComments.add(errorMessageMap);
|
|
|
|
|
@ -764,7 +739,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|
|
|
|
errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100579, "个税扣缴义务人不允许为空"));
|
|
|
|
|
excelComments.add(errorMessageMap);
|
|
|
|
|
isError = true;
|
|
|
|
|
}else if (!paymentNameIdMap.containsKey(paymentOrg)) {
|
|
|
|
|
} else if (!paymentNameIdMap.containsKey(paymentOrg)) {
|
|
|
|
|
Map<String, String> errorMessageMap = Maps.newHashMap();
|
|
|
|
|
errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100312, "社保缴纳组织应和个税扣缴义务人名称一致,社保缴纳组织不存在或不在权限范围内"));
|
|
|
|
|
excelComments.add(errorMessageMap);
|
|
|
|
|
@ -775,7 +750,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|
|
|
|
Long paymentOrgId = paymentNameIdMap.get(paymentOrg);
|
|
|
|
|
TaxAgentManageRangeEmployeeDTO taxAgentManageRangeEmployeeDTO = taxAgentManageRangeEmployeeTree.stream().filter(tax -> tax.getTaxAgentId().equals(paymentOrgId)).findFirst().get();
|
|
|
|
|
Optional<Long> o = taxAgentManageRangeEmployeeDTO.getEmployeeList().stream().map(TaxAgentManageRangeEmployeeDTO.TaxAgentEmployee::getEmployeeId).filter(e -> e.equals(employeeId)).findFirst();
|
|
|
|
|
if(!o.isPresent()){
|
|
|
|
|
if (!o.isPresent()) {
|
|
|
|
|
Map<String, String> errorMessageMap = Maps.newHashMap();
|
|
|
|
|
errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100312, "该条数据不在个税扣缴义务人人员范围内,不可导入"));
|
|
|
|
|
excelComments.add(errorMessageMap);
|
|
|
|
|
@ -849,18 +824,15 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|
|
|
|
excelComments.add(errorMessageMap);
|
|
|
|
|
isError = true;
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank((String) socialMap.get(SalaryI18nUtil.getI18nLabel(91323, "社保方案名称")))
|
|
|
|
|
&& schemeNameIdMap.get((String) socialMap.get(SalaryI18nUtil.getI18nLabel(91323, "社保方案名称"))) == null) {
|
|
|
|
|
if (StringUtils.isNotBlank((String) socialMap.get(SalaryI18nUtil.getI18nLabel(91323, "社保方案名称"))) && schemeNameIdMap.get((String) socialMap.get(SalaryI18nUtil.getI18nLabel(91323, "社保方案名称"))) == null) {
|
|
|
|
|
Map<String, String> errorMessageMap = Maps.newHashMap();
|
|
|
|
|
errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100322,
|
|
|
|
|
"社保方案不存在"));
|
|
|
|
|
errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100322, "社保方案不存在"));
|
|
|
|
|
excelComments.add(errorMessageMap);
|
|
|
|
|
isError = true;
|
|
|
|
|
} else {
|
|
|
|
|
insuranceArchivesSocialSchemePO = buildSocialPO(employeeId, welfareMap, singleAccount, schemeNameIdMap, paymentNameIdMap, creator);
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank((String) fundMap.get(SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称")))
|
|
|
|
|
&& schemeNameIdMap.get((String) fundMap.get(SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称"))) == null) {
|
|
|
|
|
if (StringUtils.isNotBlank((String) fundMap.get(SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称"))) && schemeNameIdMap.get((String) fundMap.get(SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称"))) == null) {
|
|
|
|
|
Map<String, String> errorMessageMap = Maps.newHashMap();
|
|
|
|
|
errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100323, "公积金方案不存在"));
|
|
|
|
|
excelComments.add(errorMessageMap);
|
|
|
|
|
@ -868,8 +840,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|
|
|
|
} else {
|
|
|
|
|
insuranceArchivesFundSchemePO = buildFundPO(employeeId, welfareMap, singleAccount, schemeNameIdMap, paymentNameIdMap, creator);
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank((String) fundMap.get(SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称")))
|
|
|
|
|
&& schemeNameIdMap.get((String) fundMap.get(SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称"))) == null) {
|
|
|
|
|
if (StringUtils.isNotBlank((String) fundMap.get(SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称"))) && schemeNameIdMap.get((String) fundMap.get(SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称"))) == null) {
|
|
|
|
|
Map<String, String> errorMessageMap = Maps.newHashMap();
|
|
|
|
|
errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100324, "其他福利方案不存在"));
|
|
|
|
|
excelComments.add(errorMessageMap);
|
|
|
|
|
@ -879,11 +850,11 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|
|
|
|
}
|
|
|
|
|
/**************校验申报基数**************/
|
|
|
|
|
for (Map.Entry<Long, String> entry : welfareMap.entrySet()) {
|
|
|
|
|
String keyName = entry.getValue()+SalaryI18nUtil.getI18nLabel(100293, "申报基数");
|
|
|
|
|
String numberVlue = findElement(singleAccount, keyName).get(keyName) == null ?"": findElement(singleAccount, keyName).get(keyName).toString();
|
|
|
|
|
if (!"".equals(numberVlue) && !NumberUtils.isParsable(numberVlue)){
|
|
|
|
|
String keyName = entry.getValue() + SalaryI18nUtil.getI18nLabel(100293, "申报基数");
|
|
|
|
|
String numberVlue = findElement(singleAccount, keyName).get(keyName) == null ? "" : findElement(singleAccount, keyName).get(keyName).toString();
|
|
|
|
|
if (!"".equals(numberVlue) && !NumberUtils.isParsable(numberVlue)) {
|
|
|
|
|
Map<String, String> errorMessageMap = Maps.newHashMap();
|
|
|
|
|
errorMessageMap.put("message", rowIndex+keyName + SalaryI18nUtil.getI18nLabel(100581, "请输入数字"));
|
|
|
|
|
errorMessageMap.put("message", rowIndex + keyName + SalaryI18nUtil.getI18nLabel(100581, "请输入数字"));
|
|
|
|
|
excelComments.add(errorMessageMap);
|
|
|
|
|
isError = true;
|
|
|
|
|
}
|
|
|
|
|
@ -909,27 +880,21 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public InsuranceArchivesSocialSchemePO buildSocialPO(Long employeeId, Map<Long, String> welfareMap, List<Map<String, Object>> singleAccount, Map<String, Long> schemeNameIdMap,
|
|
|
|
|
Map<String, Long> paymentNameIdMap, Long creator) {
|
|
|
|
|
public InsuranceArchivesSocialSchemePO buildSocialPO(Long employeeId, Map<Long, String> welfareMap, List<Map<String, Object>> singleAccount, Map<String, Long> schemeNameIdMap, Map<String, Long> paymentNameIdMap, Long creator) {
|
|
|
|
|
|
|
|
|
|
if (employeeId == null) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
InsuranceArchivesSocialSchemePO insuranceArchivesSocialSchemePO = new InsuranceArchivesSocialSchemePO();
|
|
|
|
|
insuranceArchivesSocialSchemePO.setId(IdGenerator.generate());
|
|
|
|
|
insuranceArchivesSocialSchemePO.setSocialAccount((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91324, "社保账号")).get(
|
|
|
|
|
SalaryI18nUtil.getI18nLabel(91324, "社保账号")));
|
|
|
|
|
insuranceArchivesSocialSchemePO.setSocialSchemeId(schemeNameIdMap.get(
|
|
|
|
|
(String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91323, "社保方案名称")).get(
|
|
|
|
|
SalaryI18nUtil.getI18nLabel(91323, "社保方案名称"))));
|
|
|
|
|
String socialStartDate = (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91319, "社保起始缴纳月")).get(
|
|
|
|
|
SalaryI18nUtil.getI18nLabel(91319, "社保起始缴纳月"));
|
|
|
|
|
insuranceArchivesSocialSchemePO.setSocialAccount((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91324, "社保账号")).get(SalaryI18nUtil.getI18nLabel(91324, "社保账号")));
|
|
|
|
|
insuranceArchivesSocialSchemePO.setSocialSchemeId(schemeNameIdMap.get((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91323, "社保方案名称")).get(SalaryI18nUtil.getI18nLabel(91323, "社保方案名称"))));
|
|
|
|
|
String socialStartDate = (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91319, "社保起始缴纳月")).get(SalaryI18nUtil.getI18nLabel(91319, "社保起始缴纳月"));
|
|
|
|
|
if (StringUtils.isNotBlank(socialStartDate) && socialStartDate.length() > 7) {
|
|
|
|
|
socialStartDate = socialStartDate.substring(0, 7);
|
|
|
|
|
}
|
|
|
|
|
insuranceArchivesSocialSchemePO.setSocialStartTime(socialStartDate);
|
|
|
|
|
String socialEndDate = (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91320, "社保最后缴纳月")).get(
|
|
|
|
|
SalaryI18nUtil.getI18nLabel(91320, "社保最后缴纳月"));
|
|
|
|
|
String socialEndDate = (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91320, "社保最后缴纳月")).get(SalaryI18nUtil.getI18nLabel(91320, "社保最后缴纳月"));
|
|
|
|
|
if (StringUtils.isNotBlank(socialEndDate) && socialEndDate.length() > 7) {
|
|
|
|
|
socialEndDate = socialEndDate.substring(0, 7);
|
|
|
|
|
}
|
|
|
|
|
@ -937,9 +902,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|
|
|
|
insuranceArchivesSocialSchemePO.setTenantKey("");
|
|
|
|
|
insuranceArchivesSocialSchemePO.setWelfareType(WelfareTypeEnum.SOCIAL_SECURITY.getValue());
|
|
|
|
|
insuranceArchivesSocialSchemePO.setUpdateTime(new Date());
|
|
|
|
|
insuranceArchivesSocialSchemePO.setPaymentOrganization(paymentNameIdMap.get(
|
|
|
|
|
(String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91325, "个税扣缴义务人")).get(
|
|
|
|
|
SalaryI18nUtil.getI18nLabel(91325, "个税扣缴义务人"))));
|
|
|
|
|
insuranceArchivesSocialSchemePO.setPaymentOrganization(paymentNameIdMap.get((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91325, "个税扣缴义务人")).get(SalaryI18nUtil.getI18nLabel(91325, "个税扣缴义务人"))));
|
|
|
|
|
insuranceArchivesSocialSchemePO.setNonPayment(NonPaymentEnum.YES.getValue());
|
|
|
|
|
insuranceArchivesSocialSchemePO.setCreator(creator);
|
|
|
|
|
insuranceArchivesSocialSchemePO.setCreateTime(new Date());
|
|
|
|
|
@ -947,8 +910,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|
|
|
|
insuranceArchivesSocialSchemePO.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue());
|
|
|
|
|
insuranceArchivesSocialSchemePO.setEmployeeId(employeeId);
|
|
|
|
|
insuranceArchivesSocialSchemePO.setUnderTake(UndertakerEnum.SCOPE_PERSON.getValue());
|
|
|
|
|
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOS =
|
|
|
|
|
getInsuranceSchemeDetailMapper().queryListBySchemeId(insuranceArchivesSocialSchemePO.getSocialSchemeId());
|
|
|
|
|
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(insuranceArchivesSocialSchemePO.getSocialSchemeId());
|
|
|
|
|
InsuranceSchemeDetailPOEncrypt.decryptList(insuranceSchemeDetailPOS);
|
|
|
|
|
if (CollectionUtils.isNotEmpty(insuranceSchemeDetailPOS)) {
|
|
|
|
|
List<Long> insuranceIds = insuranceSchemeDetailPOS.stream().map(InsuranceSchemeDetailPO::getInsuranceId).collect(Collectors.toList());
|
|
|
|
|
@ -958,9 +920,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if (findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")) != null) {
|
|
|
|
|
socialPaymentBase.put(String.valueOf(insuranceId),
|
|
|
|
|
(String) findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")).get(
|
|
|
|
|
welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")));
|
|
|
|
|
socialPaymentBase.put(String.valueOf(insuranceId), (String) findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")).get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
insuranceArchivesSocialSchemePO.setSocialPaymentBaseString(JSON.toJSONString(socialPaymentBase));
|
|
|
|
|
@ -969,8 +929,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public InsuranceArchivesFundSchemePO buildFundPO(Long employeeId, Map<Long, String> welfareMap, List<Map<String, Object>> singleAccount, Map<String, Long> schemeNameIdMap,
|
|
|
|
|
Map<String, Long> paymentNameIdMap, Long creator) {
|
|
|
|
|
public InsuranceArchivesFundSchemePO buildFundPO(Long employeeId, Map<Long, String> welfareMap, List<Map<String, Object>> singleAccount, Map<String, Long> schemeNameIdMap, Map<String, Long> paymentNameIdMap, Long creator) {
|
|
|
|
|
|
|
|
|
|
if (employeeId == null) {
|
|
|
|
|
return null;
|
|
|
|
|
@ -981,30 +940,22 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|
|
|
|
insuranceArchivesFundSchemePO.setTenantKey("");
|
|
|
|
|
insuranceArchivesFundSchemePO.setCreateTime(new Date());
|
|
|
|
|
insuranceArchivesFundSchemePO.setUpdateTime(new Date());
|
|
|
|
|
insuranceArchivesFundSchemePO.setFundSchemeId(schemeNameIdMap.get(
|
|
|
|
|
(String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称")).get(
|
|
|
|
|
SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称"))));
|
|
|
|
|
insuranceArchivesFundSchemePO.setFundAccount((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91486, "公积金账号")).get(
|
|
|
|
|
SalaryI18nUtil.getI18nLabel(91486, "公积金账号")));
|
|
|
|
|
insuranceArchivesFundSchemePO.setSupplementFundAccount((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91487, "补充公积金账号")).get(
|
|
|
|
|
SalaryI18nUtil.getI18nLabel(91487, "补充公积金账号")));
|
|
|
|
|
String fundStartDate = (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91483, "公积金起始缴纳月")).get(
|
|
|
|
|
SalaryI18nUtil.getI18nLabel(91483, "公积金起始缴纳月"));
|
|
|
|
|
insuranceArchivesFundSchemePO.setFundSchemeId(schemeNameIdMap.get((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称")).get(SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称"))));
|
|
|
|
|
insuranceArchivesFundSchemePO.setFundAccount((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91486, "公积金账号")).get(SalaryI18nUtil.getI18nLabel(91486, "公积金账号")));
|
|
|
|
|
insuranceArchivesFundSchemePO.setSupplementFundAccount((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91487, "补充公积金账号")).get(SalaryI18nUtil.getI18nLabel(91487, "补充公积金账号")));
|
|
|
|
|
String fundStartDate = (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91483, "公积金起始缴纳月")).get(SalaryI18nUtil.getI18nLabel(91483, "公积金起始缴纳月"));
|
|
|
|
|
if (StringUtils.isNotBlank(fundStartDate) && fundStartDate.length() > 7) {
|
|
|
|
|
fundStartDate = fundStartDate.substring(0, 7);
|
|
|
|
|
}
|
|
|
|
|
insuranceArchivesFundSchemePO.setFundStartTime(fundStartDate);
|
|
|
|
|
|
|
|
|
|
String fundEndDate = (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91484, "公积金最后缴纳月")).get(
|
|
|
|
|
SalaryI18nUtil.getI18nLabel(91484, "公积金最后缴纳月"));
|
|
|
|
|
String fundEndDate = (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91484, "公积金最后缴纳月")).get(SalaryI18nUtil.getI18nLabel(91484, "公积金最后缴纳月"));
|
|
|
|
|
if (StringUtils.isNotBlank(fundEndDate) && fundEndDate.length() > 7) {
|
|
|
|
|
fundEndDate = fundEndDate.substring(0, 7);
|
|
|
|
|
}
|
|
|
|
|
insuranceArchivesFundSchemePO.setFundEndTime(fundEndDate);
|
|
|
|
|
insuranceArchivesFundSchemePO.setWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue());
|
|
|
|
|
insuranceArchivesFundSchemePO.setPaymentOrganization(paymentNameIdMap.get(
|
|
|
|
|
(String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91488, "个税扣缴义务人")).get(
|
|
|
|
|
SalaryI18nUtil.getI18nLabel(91488, "个税扣缴义务人"))));
|
|
|
|
|
insuranceArchivesFundSchemePO.setPaymentOrganization(paymentNameIdMap.get((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91488, "个税扣缴义务人")).get(SalaryI18nUtil.getI18nLabel(91488, "个税扣缴义务人"))));
|
|
|
|
|
insuranceArchivesFundSchemePO.setNonPayment(NonPaymentEnum.YES.getValue());
|
|
|
|
|
insuranceArchivesFundSchemePO.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue());
|
|
|
|
|
insuranceArchivesFundSchemePO.setUnderTake(UndertakerEnum.SCOPE_PERSON.getValue());
|
|
|
|
|
@ -1020,9 +971,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if (findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")) != null) {
|
|
|
|
|
socialPaymentBase.put(String.valueOf(insuranceId),
|
|
|
|
|
(String) findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")).get(
|
|
|
|
|
welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")));
|
|
|
|
|
socialPaymentBase.put(String.valueOf(insuranceId), (String) findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")).get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
insuranceArchivesFundSchemePO.setFundPaymentBaseString(JSON.toJSONString(socialPaymentBase));
|
|
|
|
|
@ -1031,8 +980,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public InsuranceArchivesOtherSchemePO buildOtherPO(Long employeeId, Map<Long, String> welfareMap, List<Map<String, Object>> singleAccount, Map<String, Long> schemeNameIdMap,
|
|
|
|
|
Map<String, Long> paymentNameIdMap, Long creator) {
|
|
|
|
|
public InsuranceArchivesOtherSchemePO buildOtherPO(Long employeeId, Map<Long, String> welfareMap, List<Map<String, Object>> singleAccount, Map<String, Long> schemeNameIdMap, Map<String, Long> paymentNameIdMap, Long creator) {
|
|
|
|
|
|
|
|
|
|
if (employeeId == null) {
|
|
|
|
|
return null;
|
|
|
|
|
@ -1043,24 +991,18 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|
|
|
|
insuranceArchivesOtherSchemePO.setTenantKey("");
|
|
|
|
|
insuranceArchivesOtherSchemePO.setCreateTime(new Date());
|
|
|
|
|
insuranceArchivesOtherSchemePO.setUpdateTime(new Date());
|
|
|
|
|
insuranceArchivesOtherSchemePO.setOtherSchemeId(
|
|
|
|
|
schemeNameIdMap.get((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称")).get(
|
|
|
|
|
SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称"))));
|
|
|
|
|
String otherStartDate = (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91490, "其他福利起始缴纳月")).get(
|
|
|
|
|
SalaryI18nUtil.getI18nLabel(91490, "其他福利起始缴纳月"));
|
|
|
|
|
insuranceArchivesOtherSchemePO.setOtherSchemeId(schemeNameIdMap.get((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称")).get(SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称"))));
|
|
|
|
|
String otherStartDate = (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91490, "其他福利起始缴纳月")).get(SalaryI18nUtil.getI18nLabel(91490, "其他福利起始缴纳月"));
|
|
|
|
|
if (StringUtils.isNotBlank(otherStartDate) && otherStartDate.length() > 7) {
|
|
|
|
|
otherStartDate = otherStartDate.substring(0, 7);
|
|
|
|
|
}
|
|
|
|
|
insuranceArchivesOtherSchemePO.setOtherStartTime(otherStartDate);
|
|
|
|
|
String otherEndDate = (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91494, "其他福利最后缴纳月")).get(
|
|
|
|
|
SalaryI18nUtil.getI18nLabel(91494, "其他福利最后缴纳月"));
|
|
|
|
|
String otherEndDate = (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91494, "其他福利最后缴纳月")).get(SalaryI18nUtil.getI18nLabel(91494, "其他福利最后缴纳月"));
|
|
|
|
|
if (StringUtils.isNotBlank(otherEndDate) && otherEndDate.length() > 7) {
|
|
|
|
|
otherEndDate = otherEndDate.substring(0, 7);
|
|
|
|
|
}
|
|
|
|
|
insuranceArchivesOtherSchemePO.setOtherEndTime(otherEndDate);
|
|
|
|
|
insuranceArchivesOtherSchemePO.setPaymentOrganization(paymentNameIdMap.get(
|
|
|
|
|
(String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91497, "个税扣缴义务人")).get(
|
|
|
|
|
SalaryI18nUtil.getI18nLabel(91497, "个税扣缴义务人"))));
|
|
|
|
|
insuranceArchivesOtherSchemePO.setPaymentOrganization(paymentNameIdMap.get((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91497, "个税扣缴义务人")).get(SalaryI18nUtil.getI18nLabel(91497, "个税扣缴义务人"))));
|
|
|
|
|
insuranceArchivesOtherSchemePO.setWelfareType(WelfareTypeEnum.OTHER.getValue());
|
|
|
|
|
insuranceArchivesOtherSchemePO.setNonPayment(NonPaymentEnum.YES.getValue());
|
|
|
|
|
insuranceArchivesOtherSchemePO.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue());
|
|
|
|
|
@ -1076,9 +1018,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if (findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")) != null) {
|
|
|
|
|
socialPaymentBase.put(String.valueOf(insuranceId),
|
|
|
|
|
(String) findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")).get(
|
|
|
|
|
welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")));
|
|
|
|
|
socialPaymentBase.put(String.valueOf(insuranceId), (String) findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")).get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
insuranceArchivesOtherSchemePO.setOtherPaymentBaseString(JSON.toJSONString(socialPaymentBase));
|
|
|
|
|
@ -1088,12 +1028,9 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|
|
|
|
|
|
|
|
|
public void handleImportData(List<InsuranceArchivesAccountPO> insuranceArchivesAccountPOS) {
|
|
|
|
|
//导入社保档案
|
|
|
|
|
List<InsuranceArchivesSocialSchemePO> socialSchemePOS = insuranceArchivesAccountPOS.stream().filter(Objects::nonNull).map(InsuranceArchivesAccountPO::getSocial)
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
List<InsuranceArchivesSocialSchemePO> socialSchemePOS = insuranceArchivesAccountPOS.stream().filter(Objects::nonNull).map(InsuranceArchivesAccountPO::getSocial).collect(Collectors.toList());
|
|
|
|
|
if (CollectionUtils.isNotEmpty(socialSchemePOS)) {
|
|
|
|
|
socialSchemePOS = socialSchemePOS.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(
|
|
|
|
|
() -> new TreeSet<>(Comparator.comparing(InsuranceArchivesSocialSchemePO::getEmployeeId))
|
|
|
|
|
), ArrayList::new));
|
|
|
|
|
socialSchemePOS = socialSchemePOS.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceArchivesSocialSchemePO::getEmployeeId))), ArrayList::new));
|
|
|
|
|
List<Long> socialEmployeeIds = socialSchemePOS.stream().map(InsuranceArchivesSocialSchemePO::getEmployeeId).collect(Collectors.toList());
|
|
|
|
|
List<List<Long>> socialEmployeeIdPartition = Lists.partition(socialEmployeeIds, 100);
|
|
|
|
|
socialEmployeeIdPartition.forEach(getSocialSchemeMapper()::batchDeleteByEmployeeIds);
|
|
|
|
|
@ -1102,12 +1039,9 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|
|
|
|
partition.forEach(getSocialSchemeMapper()::batchSave);
|
|
|
|
|
}
|
|
|
|
|
//导入公积金档案
|
|
|
|
|
List<InsuranceArchivesFundSchemePO> fundSchemePOS = insuranceArchivesAccountPOS.stream().filter(Objects::nonNull).map(InsuranceArchivesAccountPO::getFund)
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
List<InsuranceArchivesFundSchemePO> fundSchemePOS = insuranceArchivesAccountPOS.stream().filter(Objects::nonNull).map(InsuranceArchivesAccountPO::getFund).collect(Collectors.toList());
|
|
|
|
|
if (CollectionUtils.isNotEmpty(fundSchemePOS)) {
|
|
|
|
|
fundSchemePOS = fundSchemePOS.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(
|
|
|
|
|
() -> new TreeSet<>(Comparator.comparing(InsuranceArchivesFundSchemePO::getEmployeeId))
|
|
|
|
|
), ArrayList::new));
|
|
|
|
|
fundSchemePOS = fundSchemePOS.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceArchivesFundSchemePO::getEmployeeId))), ArrayList::new));
|
|
|
|
|
List<Long> fundEmployeeIds = fundSchemePOS.stream().map(InsuranceArchivesFundSchemePO::getEmployeeId).collect(Collectors.toList());
|
|
|
|
|
List<List<Long>> fundEmployeeIdsPartition = Lists.partition(fundEmployeeIds, 100);
|
|
|
|
|
fundEmployeeIdsPartition.forEach(getFundSchemeMapper()::batchDeleteByEmployeeIds);
|
|
|
|
|
@ -1116,12 +1050,9 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
|
|
|
|
|
partition.forEach(getFundSchemeMapper()::batchSave);
|
|
|
|
|
}
|
|
|
|
|
//导入其他福利档案
|
|
|
|
|
List<InsuranceArchivesOtherSchemePO> otherSchemePOS = insuranceArchivesAccountPOS.stream().filter(Objects::nonNull).map(InsuranceArchivesAccountPO::getOther)
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
List<InsuranceArchivesOtherSchemePO> otherSchemePOS = insuranceArchivesAccountPOS.stream().filter(Objects::nonNull).map(InsuranceArchivesAccountPO::getOther).collect(Collectors.toList());
|
|
|
|
|
if (CollectionUtils.isNotEmpty(otherSchemePOS)) {
|
|
|
|
|
otherSchemePOS = otherSchemePOS.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(
|
|
|
|
|
() -> new TreeSet<>(Comparator.comparing(InsuranceArchivesOtherSchemePO::getEmployeeId))
|
|
|
|
|
), ArrayList::new));
|
|
|
|
|
otherSchemePOS = otherSchemePOS.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceArchivesOtherSchemePO::getEmployeeId))), ArrayList::new));
|
|
|
|
|
List<Long> otherEmployeeIds = otherSchemePOS.stream().map(InsuranceArchivesOtherSchemePO::getEmployeeId).collect(Collectors.toList());
|
|
|
|
|
List<List<Long>> otherEmployeeIdsPartition = Lists.partition(otherEmployeeIds, 100);
|
|
|
|
|
otherEmployeeIdsPartition.forEach(getOtherSchemeMapper()::batchDeleteByEmployeeIds);
|
|
|
|
|
|