Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
钱涛 2022-07-28 17:20:41 +08:00
commit 03f7efa2c9
4 changed files with 57 additions and 1 deletions

View File

@ -449,6 +449,12 @@ public class SISchemeBiz {
public int checkBeforeDeleteSocialscheme(Map<String, Object> params){
return getSIAccountUtilMapper().checkBeforeDeleteSocialscheme((Collection<Long>)params.get("ids")).get(0).getNum();
}
public int checkBeforeDeleteAccumulationfund(Map<String, Object> params){
return getSIAccountUtilMapper().checkBeforeDeleteAccumulationfund((Collection<Long>)params.get("ids")).get(0).getNum();
}
public int checkBeforeDeleteOtherscheme(Map<String, Object> params){
return getSIAccountUtilMapper().checkBeforeDeleteOtherscheme((Collection<Long>)params.get("ids")).get(0).getNum();
}
public void deleteSocialscheme(Map<String, Object> params){
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();

View File

@ -42,7 +42,15 @@ public class SISchemeDeleteCmd extends AbstractCommonCommand<Map<String, Object>
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);

View File

@ -10,5 +10,22 @@ public interface SIAccountUtilMapper {
List<SIAccountUtilDTO> checkIfBusinessaccounting(Long id);
/**
* 删除社保前校验是否已经被使用
* @param id
* @return
*/
List<SIAccountUtilDTO> checkBeforeDeleteSocialscheme(@Param("ids") Collection<Long> id);
/**
* 删除公积金前校验是否已经被使用
* @param id
* @return
*/
List<SIAccountUtilDTO> checkBeforeDeleteAccumulationfund(@Param("ids") Collection<Long> id);
/**
* 删除其他福利方案前校验是否已经被使用
* @param id
* @return
*/
List<SIAccountUtilDTO> checkBeforeDeleteOtherscheme(@Param("ids") Collection<Long> id);
}

View File

@ -34,4 +34,29 @@
#{id}
</foreach>
</select>
<select id="checkBeforeDeleteAccumulationfund" resultMap="BaseResultMap">
SELECT
COUNT(0) num
FROM
hrsa_bill_detail
WHERE
delete_type = 0
AND fund_scheme_id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</select>
<select id="checkBeforeDeleteOtherscheme" resultMap="BaseResultMap">
SELECT
COUNT(0) num
FROM
hrsa_bill_detail
WHERE
delete_type = 0
AND other_scheme_id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</select>
</mapper>