|
|
|
@ -7,7 +7,6 @@ import com.xujie.common.utils.R; |
|
|
|
import com.xujie.modules.baseInformation.entity.SrmSupplierAddress; |
|
|
|
import com.xujie.modules.baseInformation.mapper.SrmSupplierAddressMapper; |
|
|
|
import com.xujie.modules.baseInformation.service.SrmSupplierAddressService; |
|
|
|
import jakarta.mail.Address; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
@ -26,6 +25,13 @@ public class SrmSupplierAddressServiceImpl implements SrmSupplierAddressService |
|
|
|
|
|
|
|
@Override |
|
|
|
public R addSupplierAddress(SrmSupplierAddress supplierAddress) { |
|
|
|
if (supplierAddress.getSupplierId() == null || supplierAddress.getSupplierId().trim().isEmpty()) { |
|
|
|
return R.error("供应商ID不能为空"); |
|
|
|
} |
|
|
|
if (supplierAddress.getAddressId() == null || supplierAddress.getAddressId().trim().isEmpty()) { |
|
|
|
return R.error("地址ID不能为空"); |
|
|
|
} |
|
|
|
|
|
|
|
// 检查供应商地址是否已存在 |
|
|
|
SrmSupplierAddress existing = srmSupplierAddressMapper.selectSupplierAddressByAddress(supplierAddress.getSupplierId(), supplierAddress.getAddressId(), supplierAddress.getSite()); |
|
|
|
if (existing != null) { |
|
|
|
@ -42,6 +48,13 @@ public class SrmSupplierAddressServiceImpl implements SrmSupplierAddressService |
|
|
|
|
|
|
|
@Override |
|
|
|
public R updateSupplierAddress(SrmSupplierAddress supplierAddress) { |
|
|
|
if (supplierAddress.getSupplierId() == null || supplierAddress.getSupplierId().trim().isEmpty()) { |
|
|
|
return R.error("供应商ID不能为空"); |
|
|
|
} |
|
|
|
if (supplierAddress.getAddressId() == null || supplierAddress.getAddressId().trim().isEmpty()) { |
|
|
|
return R.error("地址ID不能为空"); |
|
|
|
} |
|
|
|
|
|
|
|
// 检查供应商地址是否存在 |
|
|
|
SrmSupplierAddress existing = srmSupplierAddressMapper.selectSupplierAddressByAddress(supplierAddress.getSupplierId(), supplierAddress.getAddressId(), supplierAddress.getSite()); |
|
|
|
if (existing == null) { |
|
|
|
|