汇通调整
This commit is contained in:
parent
e199408ec8
commit
c746ab8a40
|
|
@ -7907,7 +7907,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
||||||
|
|
||||||
// 获取上月的社保福利台账数据
|
// 获取上月的社保福利台账数据
|
||||||
Date lastMonthDate = SalaryDateUtil.localDateToDate(SalaryDateUtil.dateToLocalDate(param.getSalaryMonthDate()).minusMonths(1));
|
Date lastMonthDate = SalaryDateUtil.localDateToDate(SalaryDateUtil.dateToLocalDate(param.getSalaryMonthDate()).minusMonths(1));
|
||||||
List<InsuranceAccountBatchPO> lastInsuranceAccountBatchPOS = getInsuranceAccountBatchMapper().listByBillMonth(SalaryDateUtil.getFormatLocalDate(lastMonthDate), null);
|
List<InsuranceAccountBatchPO> lastInsuranceAccountBatchPOS = getInsuranceAccountBatchMapper().listByBillMonth(SalaryDateUtil.getFormatYearMonth(lastMonthDate), null);
|
||||||
// 没有归档的义务人
|
// 没有归档的义务人
|
||||||
List<Long> lastNotFiledTaxAgentIds = lastInsuranceAccountBatchPOS.stream().filter(po -> po.getBillStatus().equals(BillStatusEnum.NOT_ARCHIVED.getValue())).map(InsuranceAccountBatchPO::getPaymentOrganization).collect(Collectors.toList());
|
List<Long> lastNotFiledTaxAgentIds = lastInsuranceAccountBatchPOS.stream().filter(po -> po.getBillStatus().equals(BillStatusEnum.NOT_ARCHIVED.getValue())).map(InsuranceAccountBatchPO::getPaymentOrganization).collect(Collectors.toList());
|
||||||
|
|
||||||
|
|
@ -7917,16 +7917,25 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
||||||
lastInsuranceAccountDetailPOS = lastInsuranceAccountDetailPOS.stream()
|
lastInsuranceAccountDetailPOS = lastInsuranceAccountDetailPOS.stream()
|
||||||
.filter(f -> f.getPaymentStatus().equals(PaymentStatusEnum.COMMON.getValue()))
|
.filter(f -> f.getPaymentStatus().equals(PaymentStatusEnum.COMMON.getValue()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
if (CollectionUtils.isNotEmpty(notFiledTaxAgentIds)) {
|
|
||||||
|
if (CollectionUtils.isNotEmpty(lastNotFiledTaxAgentIds)) {
|
||||||
// 过滤未归档的
|
// 过滤未归档的
|
||||||
lastInsuranceAccountDetailPOS = lastInsuranceAccountDetailPOS.stream()
|
lastInsuranceAccountDetailPOS = lastInsuranceAccountDetailPOS.stream()
|
||||||
.filter(f -> !notFiledTaxAgentIds.contains(f.getPaymentOrganization()) && !lastNotFiledTaxAgentIds.contains(f.getPaymentOrganization()))
|
.filter(f -> !lastNotFiledTaxAgentIds.contains(f.getPaymentOrganization()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<InsuranceAccountDetailPO> changeDetail = new ArrayList<>();
|
||||||
// 过滤出本月社保、公积金、其他方案发生变化的台账明细
|
// 过滤出本月社保、公积金、其他方案发生变化的台账明细
|
||||||
Map<String, InsuranceAccountDetailPO> lastMonthDetailMap = SalaryEntityUtil.convert2Map(lastInsuranceAccountDetailPOS, po -> po.getPaymentOrganization() + "_split" + po.getEmployeeId());
|
Map<String, InsuranceAccountDetailPO> lastMonthDetailMap = SalaryEntityUtil.convert2Map(lastInsuranceAccountDetailPOS, po -> po.getPaymentOrganization() + "_split" + po.getEmployeeId());
|
||||||
List<InsuranceAccountDetailPO> changeDetail = new ArrayList<>();
|
Set<String> thisMonthKey = SalaryEntityUtil.convert2Map(insuranceAccountDetailPOS, po -> po.getPaymentOrganization() + "_split" + po.getEmployeeId()).keySet();
|
||||||
|
// 获取本月减少的key
|
||||||
|
List<String> lessKey = lastMonthDetailMap.keySet().stream().filter(key -> !thisMonthKey.contains(key)).collect(Collectors.toList());
|
||||||
|
for (String key : lessKey) {
|
||||||
|
InsuranceAccountDetailPO lastMonthPO = lastMonthDetailMap.get(key);
|
||||||
|
changeDetail.add(lastMonthPO);
|
||||||
|
}
|
||||||
|
|
||||||
for (InsuranceAccountDetailPO thisMonthPO : insuranceAccountDetailPOS) {
|
for (InsuranceAccountDetailPO thisMonthPO : insuranceAccountDetailPOS) {
|
||||||
InsuranceAccountDetailPO lastMonthPO = lastMonthDetailMap.get(thisMonthPO.getPaymentOrganization() + "_split" + thisMonthPO.getEmployeeId());
|
InsuranceAccountDetailPO lastMonthPO = lastMonthDetailMap.get(thisMonthPO.getPaymentOrganization() + "_split" + thisMonthPO.getEmployeeId());
|
||||||
if (lastMonthPO == null) {
|
if (lastMonthPO == null) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue