diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/mapper/BmAgreementInfoMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/mapper/BmAgreementInfoMapper.java index 5e279869..4b87d931 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/mapper/BmAgreementInfoMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/mapper/BmAgreementInfoMapper.java @@ -109,4 +109,6 @@ public interface BmAgreementInfoMapper * @return */ Long selectProjectUnitAgreementIdByTeamAndProject(@Param("teamId") Long unitId, @Param("projectId") Long projectId); + + int selectSltInfoByagreementId(Long agreementId); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/BmAgreementInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/BmAgreementInfoServiceImpl.java index d6ceb95b..483333a0 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/BmAgreementInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/service/impl/BmAgreementInfoServiceImpl.java @@ -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); } diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmAgreementInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmAgreementInfoMapper.xml index 5b259d8c..84486967 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmAgreementInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmAgreementInfoMapper.xml @@ -212,4 +212,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" bai.unit_id = #{teamId} AND bai.project_id = #{projectId} LIMIT 1 +