From 5b16454ab24d2690b799cb597afb41353cbacf22 Mon Sep 17 00:00:00 2001 From: yuejiayang <146344614+YangLei105@users.noreply.github.com> Date: Mon, 18 Nov 2024 16:29:31 +0800 Subject: [PATCH] =?UTF-8?q?11.18=20=E5=88=B6=E9=80=A0=E5=95=86=E7=BB=B4?= =?UTF-8?q?=E6=8A=A4=20Part=20Info=20By=20Customer=20Part=20Info=20By=20Ma?= =?UTF-8?q?nufacturer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ManufacturerInformationServiceImpl.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/com/gaotao/modules/manufacturer/service/impl/ManufacturerInformationServiceImpl.java b/src/main/java/com/gaotao/modules/manufacturer/service/impl/ManufacturerInformationServiceImpl.java index e0cb9c8..b4616ae 100644 --- a/src/main/java/com/gaotao/modules/manufacturer/service/impl/ManufacturerInformationServiceImpl.java +++ b/src/main/java/com/gaotao/modules/manufacturer/service/impl/ManufacturerInformationServiceImpl.java @@ -8,6 +8,8 @@ import com.gaotao.common.utils.PageUtils; import com.gaotao.modules.manufacturer.data.ManufacturerInformationData; import com.gaotao.modules.manufacturer.mapper.ManufacturerInformationMapper; import com.gaotao.modules.manufacturer.service.ManufacturerInformationService; +import com.gaotao.modules.part.entity.ExternalPartManufacturer; +import com.gaotao.modules.part.mapper.ExternalPartManufacturerMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -20,6 +22,9 @@ public class ManufacturerInformationServiceImpl extends ServiceImpl resultList = this.manufacturerInformationMapper.manufacturerInformationSearch(new Page(data.getPage(), data.getLimit()), data); @@ -55,6 +60,12 @@ public class ManufacturerInformationServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("site", data.getSite()).eq("manufacturer_no", data.getManufacturerNo()); + Integer count = externalPartManufacturerMapper.selectCount(queryWrapper); + if (count > 0) { + throw new RuntimeException("This manufacturer has been referenced and cannot be removed!"); + } manufacturerInformationMapper.deleteById(data); } }