薪酬系统-福利台账,抽取bill_batch表中统计数据刷新方法

This commit is contained in:
sy 2022-11-24 09:31:44 +08:00
parent aa7a3ced01
commit 0f50520aa9
2 changed files with 44 additions and 0 deletions

View File

@ -238,5 +238,10 @@ public interface SIAccountService {
*/
Map<String, Object> importExcelInsuranceDetail(ExcelInsuranceImportParam excelInsuranceImportParam);
/**
* 刷新_bill_batch表中的统计信息
*/
void refreshBillBatch(Long paymentOrganization, String billMonth);
}

View File

@ -2125,5 +2125,44 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
return excelInsuranceDetailPO;
}
/**
* 刷新_bill_batch表中的统计信息
*/
@Override
public void refreshBillBatch(Long paymentOrganization, String billMonth) {
ExecutorService taskExecutor = Executors.newCachedThreadPool();
taskExecutor.execute(() -> {
if (paymentOrganization != null && billMonth != null) {
InsuranceAccountDetailParam refreshParam =new InsuranceAccountDetailParam();
refreshParam.setBillMonth(billMonth);
refreshParam.setPaymentOrganization(paymentOrganization.toString());
PageInfo<InsuranceAccountViewListDTO> pageInfos = overView(refreshParam);
TaxAgentPO taxAgentPo = getTaxAgentMapper().getById(paymentOrganization);
if (taxAgentPo != null) {
List<InsuranceAccountViewListDTO> viewListDTOList = pageInfos.getList();
viewListDTOList.stream().filter(f -> f.getPayOrg().equals(taxAgentPo.getName())).collect(Collectors.toList());
InsuranceAccountBatchPO batchPO = getInsuranceAccountBatchMapper().getByBillMonth(billMonth, paymentOrganization);
batchPO = SiAccountEncrypt.decryptInsuranceAccountBatch(batchPO);
//更新
if (viewListDTOList.size() > 0 && batchPO != null) {
InsuranceAccountViewListDTO viewListDTO = viewListDTOList.get(0);
batchPO.setSocialNum(viewListDTO.getSocialNum());
batchPO.setFundNum(viewListDTO.getFundNum());
batchPO.setOtherNum(viewListDTO.getOtherNum());
batchPO.setSocialPay(viewListDTO.getSocialPaySum().replace(",", ""));
batchPO.setFundPay(viewListDTO.getFundPaySum().replace(",", ""));
batchPO.setOtherPay(viewListDTO.getOtherPaySum().replace(",", ""));
batchPO.setUpdateTime(new Date());
batchPO = SiAccountEncrypt.encryptInsuranceAccountBatch(batchPO);
getInsuranceAccountBatchMapper().updateById(batchPO);
}
}
}
});
}
}