删除社保福利方案测试
This commit is contained in:
parent
35fc07bb9a
commit
089cb2aa11
|
|
@ -455,6 +455,9 @@ public class SISchemeBiz {
|
|||
public int checkBeforeDeleteOtherscheme(Map<String, Object> params){
|
||||
return getSIAccountUtilMapper().checkBeforeDeleteOtherscheme((Collection<Long>)params.get("ids")).get(0).getNum();
|
||||
}
|
||||
public int checkBeforeDeleteBill(Map<String, Object> params){
|
||||
return getSIAccountUtilMapper().checkBeforeDeleteBill((Collection<Long>)params.get("ids")).get(0).getNum();
|
||||
}
|
||||
|
||||
public void deleteSocialscheme(Map<String, Object> params){
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
|
|
|
|||
|
|
@ -52,6 +52,10 @@ public class SISchemeDeleteCmd extends AbstractCommonCommand<Map<String, Object>
|
|||
if (otherschemeNum > 0){
|
||||
throw new SalaryRunTimeException("该其他福利方案已被使用");
|
||||
}
|
||||
int billNum = siSchemeBiz.checkBeforeDeleteBill(params);
|
||||
if (billNum > 0){
|
||||
throw new SalaryRunTimeException("该其他福利方案已被核算");
|
||||
}
|
||||
siSchemeBiz.deleteSocialscheme(params);
|
||||
|
||||
return apidatas;
|
||||
|
|
|
|||
|
|
@ -28,4 +28,10 @@ public interface SIAccountUtilMapper {
|
|||
* @return
|
||||
*/
|
||||
List<SIAccountUtilDTO> checkBeforeDeleteOtherscheme(@Param("ids") Collection<Long> id);
|
||||
/**
|
||||
* 删除其他福利方案前校验是否已经被使用
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<SIAccountUtilDTO> checkBeforeDeleteBill(@Param("ids") Collection<Long> id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="checkBeforeDeleteBill" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
COUNT(0) num
|
||||
FROM
|
||||
hrsa_bill_detail
|
||||
WHERE
|
||||
delete_type = 0
|
||||
AND (social_scheme_id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
OR fund_scheme_id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
OR other_scheme_id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>)
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue