From 8846346ddaf7d5f9c9729eb8e92c0bbd2f952cbf Mon Sep 17 00:00:00 2001 From: MustangDeng <670124965@qq.com> Date: Tue, 14 Jun 2022 16:05:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=B0=E8=B4=A6=E6=A0=B8=E7=AE=97=E5=9B=9E?= =?UTF-8?q?=E6=BB=9A=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIAccountBiz.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/com/engine/salary/biz/SIAccountBiz.java b/src/com/engine/salary/biz/SIAccountBiz.java index 29881f5c2..19939dc12 100644 --- a/src/com/engine/salary/biz/SIAccountBiz.java +++ b/src/com/engine/salary/biz/SIAccountBiz.java @@ -142,7 +142,19 @@ public class SIAccountBiz extends Service { // insuranceSchemeContext.setNewValues(build); // siAccountLoggerTemplate.write(insuranceSchemeContext); } - account(param, employeeId, SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY, currentUserName); + try { + account(param, employeeId, SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY, currentUserName); + } catch(Exception e) { + // 回滚 + List list = Lists.newArrayList(MapperProxyFactory.getProxy(InsuranceAccountBatchMapper.class).getByBillMonth(param.getBillMonth(), param.getPaymentOrganization())); + list = SiAccountEncrypt.decryptInsuranceAccountBatchList(list); + if (CollectionUtils.isNotEmpty(list)) { + list.stream().forEach(f -> { + MapperProxyFactory.getProxy(InsuranceAccountBatchMapper.class).deleteById(f.getId()); + }); + } + throw new SalaryRunTimeException(e.getMessage()); + } } @@ -157,7 +169,7 @@ public class SIAccountBiz extends Service { }); } } - SalaryAssert.notEmpty(employeeIds, "no account data"); + SalaryAssert.notEmpty(employeeIds, "没有需要核算的人员"); AccountParam selectParam = new AccountParam(); selectParam.setBillMonth(param.getBillMonth()); selectParam.setPaymentOrganization(param.getPaymentOrganization());