From 8cf7b8ac231cf9d1733fa9da333027f3e99c50fa Mon Sep 17 00:00:00 2001 From: hongchao <3228015117@qq.com> Date: Fri, 7 Nov 2025 16:24:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=8F=E8=AE=AE=E5=88=A0=E9=99=A4=E9=99=90?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../material/basic/mapper/BmAgreementInfoMapper.java | 2 ++ .../basic/service/impl/BmAgreementInfoServiceImpl.java | 5 ++++- .../mapper/material/basic/BmAgreementInfoMapper.xml | 8 ++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) 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 +