Browse Source

产品线名称空值校验

master
luogw 7 days ago
parent
commit
c6ccfd6670
  1. 3
      src/main/java/com/project/information/domain/service/impl/SaveProductLineDomainServiceImpl.java

3
src/main/java/com/project/information/domain/service/impl/SaveProductLineDomainServiceImpl.java

@ -22,6 +22,9 @@ public class SaveProductLineDomainServiceImpl implements SaveProductLineDomainSe
@Override @Override
public Result<ProductLineDTO> save(ProductLineDTO dto) throws Exception { public Result<ProductLineDTO> save(ProductLineDTO dto) throws Exception {
// 校验 // 校验
if (StrUtil.isBlank(dto.getName())) {
throw new BusinessErrorException("产品线/子产品线名称不能为空");
}
if (StrUtil.isBlank(dto.getBusiness()) && ObjectUtil.isEmpty(dto.getBusinessId())) { if (StrUtil.isBlank(dto.getBusiness()) && ObjectUtil.isEmpty(dto.getBusinessId())) {
throw new BusinessErrorException("所属 BG 不能为空"); throw new BusinessErrorException("所属 BG 不能为空");
} }

Loading…
Cancel
Save