From 089cb2aa11c655fcd61e18e1e6b61dc4ae5d9391 Mon Sep 17 00:00:00 2001 From: liuliang <401809302@qq.com> Date: Thu, 28 Jul 2022 17:56:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E7=A4=BE=E4=BF=9D=E7=A6=8F?= =?UTF-8?q?=E5=88=A9=E6=96=B9=E6=A1=88=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SISchemeBiz.java | 3 +++ .../cmd/sischeme/SISchemeDeleteCmd.java | 4 +++ .../mapper/siaccount/SIAccountUtilMapper.java | 6 +++++ .../mapper/siaccount/SIAccountUtilMapper.xml | 27 ++++++++++++++++--- 4 files changed, 37 insertions(+), 3 deletions(-) diff --git a/src/com/engine/salary/biz/SISchemeBiz.java b/src/com/engine/salary/biz/SISchemeBiz.java index c60f93bc2..5b6ab3796 100644 --- a/src/com/engine/salary/biz/SISchemeBiz.java +++ b/src/com/engine/salary/biz/SISchemeBiz.java @@ -455,6 +455,9 @@ public class SISchemeBiz { public int checkBeforeDeleteOtherscheme(Map params){ return getSIAccountUtilMapper().checkBeforeDeleteOtherscheme((Collection)params.get("ids")).get(0).getNum(); } + public int checkBeforeDeleteBill(Map params){ + return getSIAccountUtilMapper().checkBeforeDeleteBill((Collection)params.get("ids")).get(0).getNum(); + } public void deleteSocialscheme(Map params){ SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); diff --git a/src/com/engine/salary/cmd/sischeme/SISchemeDeleteCmd.java b/src/com/engine/salary/cmd/sischeme/SISchemeDeleteCmd.java index ceeea0d0e..3be5aa265 100644 --- a/src/com/engine/salary/cmd/sischeme/SISchemeDeleteCmd.java +++ b/src/com/engine/salary/cmd/sischeme/SISchemeDeleteCmd.java @@ -52,6 +52,10 @@ public class SISchemeDeleteCmd extends AbstractCommonCommand if (otherschemeNum > 0){ throw new SalaryRunTimeException("该其他福利方案已被使用"); } + int billNum = siSchemeBiz.checkBeforeDeleteBill(params); + if (billNum > 0){ + throw new SalaryRunTimeException("该其他福利方案已被核算"); + } siSchemeBiz.deleteSocialscheme(params); return apidatas; diff --git a/src/com/engine/salary/mapper/siaccount/SIAccountUtilMapper.java b/src/com/engine/salary/mapper/siaccount/SIAccountUtilMapper.java index 4b3787655..f906dda74 100644 --- a/src/com/engine/salary/mapper/siaccount/SIAccountUtilMapper.java +++ b/src/com/engine/salary/mapper/siaccount/SIAccountUtilMapper.java @@ -28,4 +28,10 @@ public interface SIAccountUtilMapper { * @return */ List checkBeforeDeleteOtherscheme(@Param("ids") Collection id); + /** + * 删除其他福利方案前校验是否已经被使用 + * @param id + * @return + */ + List checkBeforeDeleteBill(@Param("ids") Collection id); } diff --git a/src/com/engine/salary/mapper/siaccount/SIAccountUtilMapper.xml b/src/com/engine/salary/mapper/siaccount/SIAccountUtilMapper.xml index a79b37ed5..0fba343a3 100644 --- a/src/com/engine/salary/mapper/siaccount/SIAccountUtilMapper.xml +++ b/src/com/engine/salary/mapper/siaccount/SIAccountUtilMapper.xml @@ -26,7 +26,7 @@ SELECT COUNT(0) num FROM - hrsa_bill_detail + hrsa_social_archives WHERE delete_type = 0 AND social_scheme_id IN @@ -39,7 +39,7 @@ SELECT COUNT(0) num FROM - hrsa_bill_detail + hrsa_fund_archives WHERE delete_type = 0 AND fund_scheme_id IN @@ -51,7 +51,7 @@ SELECT COUNT(0) num FROM - hrsa_bill_detail + hrsa_other_archives WHERE delete_type = 0 AND other_scheme_id IN @@ -59,4 +59,25 @@ #{id} + + \ No newline at end of file