|
|
|
@ -302,6 +302,12 @@ public class SrmSupplierServiceImpl extends ServiceImpl<SrmSupplierMapper, SrmSu |
|
|
|
throw new RuntimeException("供应商不存在,ID:" + id); |
|
|
|
} |
|
|
|
|
|
|
|
// 已创建订单的供应商不允许删除 |
|
|
|
int orderCount = srmSupplierMapper.countSupplierOrders(supplier.getSite(), supplier.getSupplierNo()); |
|
|
|
if (orderCount > 0) { |
|
|
|
throw new RuntimeException("该供应商已创建订单(" + orderCount + " 单),不允许删除"); |
|
|
|
} |
|
|
|
|
|
|
|
// 执行删除操作 |
|
|
|
int result = srmSupplierMapper.deleteSrmSupplierById(id); |
|
|
|
if (result == 0) { |
|
|
|
|