diff --git a/src/com/engine/salary/biz/SISchemeBiz.java b/src/com/engine/salary/biz/SISchemeBiz.java index f915d7332..c60f93bc2 100644 --- a/src/com/engine/salary/biz/SISchemeBiz.java +++ b/src/com/engine/salary/biz/SISchemeBiz.java @@ -449,6 +449,12 @@ public class SISchemeBiz { public int checkBeforeDeleteSocialscheme(Map params){ return getSIAccountUtilMapper().checkBeforeDeleteSocialscheme((Collection)params.get("ids")).get(0).getNum(); } + public int checkBeforeDeleteAccumulationfund(Map params){ + return getSIAccountUtilMapper().checkBeforeDeleteAccumulationfund((Collection)params.get("ids")).get(0).getNum(); + } + public int checkBeforeDeleteOtherscheme(Map params){ + return getSIAccountUtilMapper().checkBeforeDeleteOtherscheme((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 6fb368f4c..ceeea0d0e 100644 --- a/src/com/engine/salary/cmd/sischeme/SISchemeDeleteCmd.java +++ b/src/com/engine/salary/cmd/sischeme/SISchemeDeleteCmd.java @@ -42,7 +42,15 @@ public class SISchemeDeleteCmd extends AbstractCommonCommand SISchemeBiz siSchemeBiz = new SISchemeBiz(); int num = siSchemeBiz.checkBeforeDeleteSocialscheme(params); if (num > 0){ - throw new SalaryRunTimeException("该社保福利方案已被使用"); + throw new SalaryRunTimeException("该社保方案已被使用"); + } + int accumulationfundNum = siSchemeBiz.checkBeforeDeleteAccumulationfund(params); + if (accumulationfundNum > 0){ + throw new SalaryRunTimeException("该公积金方案已被使用"); + } + int otherschemeNum = siSchemeBiz.checkBeforeDeleteOtherscheme(params); + if (otherschemeNum > 0){ + throw new SalaryRunTimeException("该其他福利方案已被使用"); } siSchemeBiz.deleteSocialscheme(params); diff --git a/src/com/engine/salary/mapper/siaccount/SIAccountUtilMapper.java b/src/com/engine/salary/mapper/siaccount/SIAccountUtilMapper.java index 076b0a94e..4b3787655 100644 --- a/src/com/engine/salary/mapper/siaccount/SIAccountUtilMapper.java +++ b/src/com/engine/salary/mapper/siaccount/SIAccountUtilMapper.java @@ -10,5 +10,22 @@ public interface SIAccountUtilMapper { List checkIfBusinessaccounting(Long id); + /** + * 删除社保前校验是否已经被使用 + * @param id + * @return + */ List checkBeforeDeleteSocialscheme(@Param("ids") Collection id); + /** + * 删除公积金前校验是否已经被使用 + * @param id + * @return + */ + List checkBeforeDeleteAccumulationfund(@Param("ids") Collection id); + /** + * 删除其他福利方案前校验是否已经被使用 + * @param id + * @return + */ + List checkBeforeDeleteOtherscheme(@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 68d485a1f..a79b37ed5 100644 --- a/src/com/engine/salary/mapper/siaccount/SIAccountUtilMapper.xml +++ b/src/com/engine/salary/mapper/siaccount/SIAccountUtilMapper.xml @@ -34,4 +34,29 @@ #{id} + + + \ No newline at end of file