From 79ef1941b2fcb6ca469214cf8f625410e8997a5e Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Thu, 20 Jul 2023 15:14:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=B8=AA=E7=A8=8E=E6=89=A3?= =?UTF-8?q?=E7=BC=B4=E4=B9=89=E5=8A=A1=E4=BA=BA=E6=97=B6=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E7=A4=BE=E4=BF=9D=E7=A6=8F=E5=88=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/TaxAgentServiceImpl.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java index 42da849f9..d3cbc3999 100644 --- a/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java @@ -12,6 +12,9 @@ import com.engine.salary.entity.datacollection.po.OtherDeductionPO; import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; import com.engine.salary.entity.salarysob.po.SalarySobPO; +import com.engine.salary.entity.siaccount.param.InsuranceAccountBatchParam; +import com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO; +import com.engine.salary.entity.siarchives.po.InsuranceArchivesBaseInfoPO; import com.engine.salary.entity.taxagent.bo.TaxAgentBO; import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO; import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeTaxAgentDTO; @@ -31,6 +34,8 @@ import com.engine.salary.mapper.datacollection.AddUpDeductionMapper; import com.engine.salary.mapper.datacollection.AddUpSituationMapper; import com.engine.salary.mapper.datacollection.OtherDeductionMapper; import com.engine.salary.mapper.salarysob.SalarySobMapper; +import com.engine.salary.mapper.siaccount.InsuranceAccountBatchMapper; +import com.engine.salary.mapper.siarchives.InsuranceBaseInfoMapper; import com.engine.salary.mapper.taxagent.TaxAgentMapper; import com.engine.salary.service.*; import com.engine.salary.util.SalaryEntityUtil; @@ -117,6 +122,14 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } + private InsuranceBaseInfoMapper getInsuranceBaseInfoMapper() { + return MapperProxyFactory.getProxy(InsuranceBaseInfoMapper.class); + } + + private InsuranceAccountBatchMapper getInsuranceAccountBatchMapper() { + return MapperProxyFactory.getProxy(InsuranceAccountBatchMapper.class); + } + // private PaymentAgencyMapper paymentAgencyMapper; @@ -469,6 +482,16 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { if (CollectionUtils.isNotEmpty(salaryArchiveList)) { throw new SalaryRunTimeException("存在薪资档案引用"); } + // 被社保福利档案引用 + List socialByPaymentOrganization = getInsuranceBaseInfoMapper().getSocialByPaymentOrganization(id); + if(CollectionUtils.isNotEmpty(socialByPaymentOrganization)){ + throw new SalaryRunTimeException("存在社保福利档案引用"); + } + // 被社保福利台账引用 + List insuranceArchiveList = getInsuranceAccountBatchMapper().list(InsuranceAccountBatchParam.builder().taxAgents(Collections.singletonList(id)).build()); + if(CollectionUtils.isNotEmpty(insuranceArchiveList)){ + throw new SalaryRunTimeException("存在社保福利台账引用"); + } //被社保福利档案引用 // List socialSchemePOList = new LambdaQueryChainWrapper<>(siArchivesSocialMapper) // .eq(InsuranceArchivesSocialSchemePO::getTenantKey)