协议删除限制
This commit is contained in:
parent
c90560fbaa
commit
8cf7b8ac23
|
|
@ -109,4 +109,6 @@ public interface BmAgreementInfoMapper
|
|||
* @return
|
||||
*/
|
||||
Long selectProjectUnitAgreementIdByTeamAndProject(@Param("teamId") Long unitId, @Param("projectId") Long projectId);
|
||||
|
||||
int selectSltInfoByagreementId(Long agreementId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -252,8 +252,11 @@ public class BmAgreementInfoServiceImpl implements IBmAgreementInfoService
|
|||
{
|
||||
//查询该协议是否存在领料任务,有的话不能删除
|
||||
int res = bmAgreementInfoMapper.selectByagreementId(agreementId);
|
||||
int res2 = bmAgreementInfoMapper.selectSltInfoByagreementId(agreementId);
|
||||
if (res > 0) {
|
||||
throw new ServiceException("该协议存在领料任务,不能删除");
|
||||
throw new ServiceException("该协议存在领退料记录,不能删除");
|
||||
} else if(res2 > 0){
|
||||
throw new ServiceException("该协议存在领退料记录,不能删除");
|
||||
} else {
|
||||
return bmAgreementInfoMapper.deleteBmAgreementInfoByAgreementId(agreementId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -212,4 +212,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
bai.unit_id = #{teamId} AND bai.project_id = #{projectId}
|
||||
LIMIT 1
|
||||
</select>
|
||||
<select id="selectSltInfoByagreementId" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
slt_agreement_info
|
||||
WHERE
|
||||
agreement_id = #{agreementId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue